Browse Source

type:refactor

commit:修改请求url
master
孙家正 2 years ago
parent
commit
f3ad69ddd9
  1. 2
      pages/stock/already.vue
  2. 12
      pages/stock/list.vue
  3. 6
      pages/stock/mana.vue
  4. 2
      pages/stock/record.vue

2
pages/stock/already.vue

@ -117,7 +117,7 @@ export default {
}, },
async search(){ async search(){
if(this.total==0 || this.list.length<this.total){ if(this.total==0 || this.list.length<this.total){
var res=await request("/api/OutInManageApi/queryCollectingList",{ var res=await request("/api/Inventory/queryCollectingList",{
method:"post", method:"post",
body: this.searchVal body: this.searchVal
}) })

12
pages/stock/list.vue

@ -234,22 +234,22 @@ export default{
fields:{ fields:{
inOutType:{label:"库类型",type:"select",columns:[],value:[]}, inOutType:{label:"库类型",type:"select",columns:[],value:[]},
inOutBatchNo:{label:"库批次号",btnText:"生成",btnFun:()=>this.formData.inOutBatchNo=`KC${new Date().format('yyyyMMdd')}${new Date().getTime()}`}, inOutBatchNo:{label:"库批次号",btnText:"生成",btnFun:()=>this.formData.inOutBatchNo=`KC${new Date().format('yyyyMMdd')}${new Date().getTime()}`},
inOutVoucher:{label:"库凭证",type:"upImg",value:"",num:3}, pic:{label:"库凭证",type:"upImg",value:"",num:3},
number:{label:"库数量",placeholder:"请输入采购数量"}, number:{label:"库数量",placeholder:"请输入采购数量"},
}, },
formData:{ formData:{
inOutType:"", inOutType:"",
goodsId:"", goodsId:"",
inOutBatchNo:"", inOutBatchNo:"",
inOutVoucher:[], pic:[],
number:"", number:"",
substanceType:"", substanceType:"",
}, },
rules:{ rules:{
inOutType:{required:true}, inOutType:{required:true},
inOutBatchNo:{required:true}, inOutBatchNo:{required:true},
inOutVoucher:{required:true,validator(rule,val,call){ pic:{required:true,validator(rule,val,call){
if(!this.fields.inOutVoucher.value)call(new Error("请上传库凭证!")); if(!this.fields.pic.value)call(new Error("请上传库凭证!"));
else call() else call()
}}, }},
number:{required:true,type:"number"}, number:{required:true,type:"number"},
@ -291,14 +291,14 @@ export default{
submit(){ submit(){
this.$refs.form.validate().then(async valid=>{ this.$refs.form.validate().then(async valid=>{
if(valid){ if(valid){
var res=await request("/api/OutInManageApi/outInList",{ var res=await request("/api/Inventory/inventoryOperate",{
method:"post", method:"post",
body:{ body:{
...this.formData, ...this.formData,
...this.detail, ...this.detail,
equivalentAmount: this.detail.equivalentInventory, equivalentAmount: this.detail.equivalentInventory,
supplier: this.detail.supplierName, supplier: this.detail.supplierName,
inOutVoucher:this.fields.inOutVoucher.value, pic:this.fields.pic.value,
type: ({in:2, out:1})[this.mode], type: ({in:2, out:1})[this.mode],
} }
}) })

6
pages/stock/mana.vue

@ -133,14 +133,14 @@
<view class="info"> <view class="info">
<text>{{v.agriculturalGoods}}</text> <text>{{v.agriculturalGoods}}</text>
<text :data-unit="v.specDescribe">{{v.substanceName}}</text> <text :data-unit="v.specDescribe">{{v.substanceName}}</text>
<text>补货量{{v.replenishment||0}}kg</text> <text v-if="v.replenishment">补货量{{v.replenishment}}{{v.unit}}</text>
</view> </view>
<view class="company"> <view class="company">
<text style="--c:#FBA83C;margin-right:14rpx;">{{v.detailType}}</text> <text style="--c:#FBA83C;margin-right:14rpx;">{{v.detailType}}</text>
<text style="--c:#999;" class="over">{{v.supplierName}}</text> <text style="--c:#999;" class="over">{{v.supplierName}}</text>
</view> </view>
<view class="num"> <view class="num">
<text>库存量{{v.equivalentInventory||0}}kg</text> <text>库存量{{v.equivalentInventory||0}}{{v.unit}}</text>
<view class="btns"> <view class="btns">
<button class="cu-btn" @click="toList('out',v)">出库</button> <button class="cu-btn" @click="toList('out',v)">出库</button>
<button class="cu-btn" @click="toList('in',v)">入库</button> <button class="cu-btn" @click="toList('in',v)">入库</button>
@ -187,7 +187,7 @@ export default {
body: this.searchVal body: this.searchVal
}) })
if(res.statu){ if(res.statu){
this.list=this.list.concat(res.data.nz) this.list=this.list.concat(res.data.realRecords)
this.total=res.data.total this.total=res.data.total
this.searchVal.pageNo++ this.searchVal.pageNo++
if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"}) if(this.list.length==this.total)uni.showToast({title:"加载完成!",icon:"none"})

2
pages/stock/record.vue

@ -98,7 +98,7 @@ export default {
methods:{ methods:{
async search(){ async search(){
if(this.total==0 || this.list.length<this.total){ if(this.total==0 || this.list.length<this.total){
var res=await request("/api/OutInManageApi/queryOutInRecord",{ var res=await request("/api/Inventory/queryOutInRecord",{
method:"post", method:"post",
body: this.searchVal body: this.searchVal
}) })

Loading…
Cancel
Save