From bf1634e2d83236543bf199503d45bb0af22ce0a5 Mon Sep 17 00:00:00 2001 From: dingtalk_umvbsp Date: Thu, 16 Feb 2023 18:33:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=A1=A8=E5=8D=95=E9=AA=8C=E8=AF=81=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/stock/list.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pages/stock/list.vue b/pages/stock/list.vue index 51174d7..20537dd 100644 --- a/pages/stock/list.vue +++ b/pages/stock/list.vue @@ -184,8 +184,14 @@ export default{ substanceType:"", }, rules:{ - inOutType:{required:true}, - inOutBatchNo:{required:true}, + inOutType:{required:true,validator:(rule,val,call)=>{ + if(!val)call(new Error(`${({in:'入',out:'出'})[this.mode]}库类型必填!`)); + else call() + }}, + inOutBatchNo:{required:true,validator:(rule,val,call)=>{ + if(!val)call(new Error(`${({in:'入',out:'出'})[this.mode]}库批次号必填!`)); + 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]}库数量不能大于库存数量!`));