Browse Source

出入库 修改表单验证提示

master
邓宏 2 years ago
parent
commit
bf1634e2d8
  1. 10
      pages/stock/list.vue

10
pages/stock/list.vue

@ -184,8 +184,14 @@ export default{
substanceType:"", substanceType:"",
}, },
rules:{ rules:{
inOutType:{required:true}, inOutType:{required:true,validator:(rule,val,call)=>{
inOutBatchNo:{required:true}, 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){ number:{required:true,validator(rule,val,call){
if(!val)call(new Error(`请输入${({in:'入',out:'出'})[this.mode]}库数量!`)); 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 if(this.mode=='out' && val>this.detail.equivalentInventory)call(new Error(`${({in:'入',out:'出'})[this.mode]}库数量不能大于库存数量!`));

Loading…
Cancel
Save