凉纪 1 vuosi sitten
vanhempi
commit
fb3b941878

+ 0 - 1
src/components/layouts/index.vue

@@ -65,7 +65,6 @@ export default {
         !this.include.includes(to.name) && this.include.push(to.name);
         console.log(this.include,'缓存列表')
       }
-      //includes函数的用法,判断数组中是否包含某个值,返回布尔值
      /**
      * 如果要form(离开)的页面是keepAlive缓存的,
      * 再根据deep来判断是前进还是后退

+ 15 - 8
src/views/menu/securityCheckRegister/add.vue

@@ -126,7 +126,7 @@
       <div class="flex-box">
         <van-button type="default"  plain @click="accredit" v-show="showGrantBtn">授权</van-button>
         <van-button type="info"  plain hairline @click="saveData">保存</van-button>
-        <van-button type="info" :disabled="Boolean(!isSubmit)" @click="submitData">提交</van-button>
+        <van-button type="info"  @click="submitData">提交</van-button>
       </div>
     </div>
 
@@ -438,17 +438,23 @@ export default {
         });
       })
     },
-
+//:disabled="Boolean(!isSubmit)"
     //提交数据
     submitData() {
       //验证必填项
       let pointData = this.checkList.flatMap(v => v.pointList);
-      let allNfcList = pointData.flatMap(v=>v.nfcList);
-      let result = allNfcList.some(v=>v.status != 1);
-      //some函数的用法
-      if(result){
-        this.$toast('请先扫描NFC标签');
-        return;
+      let allNfcList = [];
+      pointData.forEach(v=>{
+        if(v.nfcList && v.nfcList.length > 0){
+          allNfcList.push(...v.nfcList)
+        }
+      })
+      if(allNfcList.length > 0){
+        let result = allNfcList.some(v=>v.status != 1);
+        if(result){
+          this.$toast('请先扫描NFC标签');
+          return;
+        }
       }
       let arr = pointData.filter(v => {
         if (v.status === 1) {
@@ -457,6 +463,7 @@ export default {
       })
       if (arr.length) return this.$toast(`${arr[0].itemName}:该信息不完整请填写`);
       this.taskInfo.isSubmit = 1;
+      console.log(this.taskInfo,'taskInfo')
       registerSubmit(this.taskInfo).then(res => {
         this.$toast('提交成功')
         this.$router.replace({

+ 1 - 0
src/views/menu/securityCheckRegister/addCheck.vue

@@ -123,6 +123,7 @@ export default {
           v.isAdd = 1;
           v.checked = false;
           v.pointId = v.id;
+          if(!v.nfcList) v.nfcList = [];
         });
         this.total = res.total;
         if(this.dataList.length < res.total) {