ソースを参照

修复履职登记

gaoxiong 1 年間 前
コミット
f1971f4a6d
1 ファイル変更23 行追加6 行削除
  1. 23 6
      src/views/menu/resumption/detail.vue

+ 23 - 6
src/views/menu/resumption/detail.vue

@@ -540,8 +540,13 @@ export default {
       this.validateArea(areaId)
     },
     validateArea(areaId) {
-      let total = 0
-      let yes = 0
+      //检查项数量
+      let total = 0;
+      //完成检查项数量
+      let yes = 0;
+      //完成NFC扫描的数量
+      let nfc_num = 0;
+      let nfc_no = 0;
       this.checks.forEach(item => {
         let pointList = item.points
         pointList.forEach(point => {
@@ -551,12 +556,24 @@ export default {
               yes++
             }
           }
-        })
-      })
+        });
+        this.nfcs.forEach(nfc => {
+          if(areaId === nfc.areaId){
+              nfc_num++;
+              if(nfc.status === 0){
+                nfc_no++;
+              }
+          }
+        });
+      });
+
+      // 0:未开始,2:进行中,1已完成
       let areaStatus = '0'
-      if (total === yes && this.areaNoList.length === 0) {
+      if (total === yes &&  nfc_no === 0) {
+        //检查项完成检查,nfc完成扫描,或者没有nfc扫描
         areaStatus = '1'
-      } else if (yes === 0 && this.areaNoList.length === this.NFCnums) {
+      } else if (yes === 0 && nfc_no === nfc_num  ) {
+        //检查项完成检查项为0,nfc也没动
         areaStatus = '0'
       } else {
         areaStatus = '2'