From f8d0290bb8b7f9d287c6e76de18e9ce5de97a8b9 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Mon, 13 Feb 2023 16:15:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=98=BE=E7=A4=BA=20=E4=BF=9D=E5=AD=98=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/stock/list.vue | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/pages/stock/list.vue b/pages/stock/list.vue index 3325409..4cf6ef5 100644 --- a/pages/stock/list.vue +++ b/pages/stock/list.vue @@ -185,23 +185,9 @@ 规格 {{detail.specDescribe}} - - 库存:2袋(200kg) + 库存:{{detail.equivalentInventory}}{{detail.packgeUnit}}({{detail.equivalentInventory*detail.unitNum}}{{detail.unit}}) - this.formData.inOutBatchNo=`KC${new Date().format('yyyyMMdd')}${new Date().getTime()}`}, + inOutBatchNo:{label:"库批次号",btnText:"生成",btnFun:()=>this.formData.inOutBatchNo=`${({in:'RK',out:'CK'})[this.mode]}${new Date().format('yyyyMMdd')}${new Date().getTime()}`}, pic:{label:"库凭证",type:"upImg",value:"",num:3}, number:{label:"库数量",placeholder:"请输入采购数量"}, }, @@ -248,11 +234,15 @@ export default{ rules:{ inOutType:{required:true}, inOutBatchNo:{required:true}, - pic:{required:true,validator(rule,val,call){ - if(!this.fields.pic.value)call(new Error("请上传库凭证!")); + // pic:{required:true,validator(rule,val,call){ + // if(!this.fields.pic.value)call(new Error("请上传库凭证!")); + // else call() + // }}, + number:{required:true,validator(rule,val,call){ + if(!val)call(new Error(`请输入${({in:'入',out:'出'})[this.mode]}库数量!`)); + else if(this.mode=='out' && val>this.detail.equivalentInventory)call(new Error(`${({in:'入',out:'出'})[this.mode]}库数量不能大于库存数量!`)); else call() - }}, - number:{required:true,type:"number"}, + },type:"number"}, }, mode:"", eventChannel:null, @@ -295,7 +285,7 @@ export default{ method:"post", body:{ ...this.formData, - ...this.detail, + inventoryId: this.detail.inventoryId, equivalentAmount: this.detail.equivalentInventory, supplier: this.detail.supplierName, pic:this.fields.pic.value, @@ -304,6 +294,7 @@ export default{ }) if(res.statu){ uni.navigateBack() + this.eventChannel.emit("update") }else{ uni.showModal({ title:"提示",