Browse Source

张丁 许可证号至少要有一项

zhangding 3 năm trước cách đây
mục cha
commit
44d9e3a30a
1 tập tin đã thay đổi với 15 bổ sung12 xóa
  1. 15 12
      ui/src/views/invoice/bookingworkticket/index.vue

+ 15 - 12
ui/src/views/invoice/bookingworkticket/index.vue

@@ -599,7 +599,7 @@ export default {
         estimateWorktime: [
           { required: true, message: "预计作业时间不能为空", trigger: "change" }
         ],
-        gczyxkzh: [
+        gczyxkzh1: [
           { validator: validatePass2, trigger: 'blur'  }
         ],
       }
@@ -1090,16 +1090,18 @@ export default {
       //提交票号
        submitassociation(){
        this.guanlianVisible=false
+       let arr=[]
+       arr.push(this.licenseForm.whgzxkzh)
+        arr.push(this.licenseForm.dhzyxkzh)
+         arr.push(this.licenseForm.xzkjxkzh)
+          arr.push(this.licenseForm.mbzyxkzh)
+           arr.push(this.licenseForm.gczyxkzh)
       const putData={}
-      if(this.licenseForm.whgzxkzh!=null
-      ||this.licenseForm.whgzxkzh!=''
-      ||this.licenseForm.dhzyxkzh!=null
-      ||this.licenseForm.dhzyxkzh!=''
-      ||this.licenseForm.xzkjxkzh!=null
-      ||this.licenseForm.xzkjxkzh!=''
-      ||this.licenseForm.mbzyxkzh!=null
-      ||this.licenseForm.mbzyxkzh!=''
-      ||this.licenseForm.gczyxkzh!=null||this.licenseForm.gczyxkzh!=''){
+      let num=0
+       arr.forEach(item => {if(item===null||item===''){
+          num=num+1
+       }})
+       if(num<5){
       putData.id=this.associationParams.id
       putData.whgzxkzh=this.licenseForm.whgzxkzh
       putData.hpjb=this.licenseForm.hpjb
@@ -1108,10 +1110,11 @@ export default {
       putData.mbzyxkzh=this.licenseForm.mbzyxkzh
       putData.gczyxkzh=this.licenseForm.gczyxkzh
       putData.gczyjb=this.licenseForm.gczyjb
-      }else{
+    
+       }else{
         return  this.msgError("请至少关联一张许可证号");
       }
-  
+
        updateWorkcontent(putData).then(response => {
           //    console.log(response.row)