瀏覽代碼

Merge branch 'V0.0.6' of http://10.87.21.221:8000/jzyd_yyds/soc_app into V0.0.6

 Conflicts:
	src/views/menu/resumption/detail.vue
zhulu 1 年之前
父節點
當前提交
1a81062ace
共有 2 個文件被更改,包括 54 次插入37 次删除
  1. 10 2
      src/views/menu/resumption/detail.vue
  2. 44 35
      src/views/menu/securityCheckRegister/add.vue

+ 10 - 2
src/views/menu/resumption/detail.vue

@@ -358,10 +358,10 @@
     },
     methods: {
       showButtoFun(vel) {
-        if (val === 1) {
+        if (vel === 1) {
           this.showButton = false
         }
-        if (val === 2) {
+        if (vel === 2) {
           this.showButton = true
         }
       },
@@ -408,6 +408,9 @@
           nfcCode = nfcStr.content
         }
         this.checkNfcFilter(nfcCode)
+
+        //保存一次数据
+        this.resumptionDataSave();
       },
       checkNfcFilter(nfcCode) {
         let areaId = null
@@ -567,6 +570,9 @@
         this.resumptionData.noPointNums = total - num
         this.validateAreaAll()
         this.openCollapseItems()
+
+        //保存一次数据
+        this.resumptionDataSave();
       },
       changeSwitch() {
         let num = 0
@@ -682,6 +688,8 @@
       changeNfcImg(imgItem) {
         this.updateNFC(1, imgItem.nfcCode, imgItem)
         this.validateArea(this.areaId);
+
+        this.resumptionDataSave();
       },
       updateNFC(type, nfcCode, imgItem) {
         //type 1 表示新增加扫描的数据,2 表示新增未扫描的数量,0 未做任何操作

+ 44 - 35
src/views/menu/securityCheckRegister/add.vue

@@ -176,7 +176,7 @@ import NfcPopup from '@/components/nfcPopup/more'
 import AddCheck from './addCheck'
 import { registerDetail, registerSubmit } from './api'
 import { imgUrl} from '@/utils'
-import { ImagePreview } from 'vant'
+import {Dialog, ImagePreview} from 'vant'
 import { mapGetters } from 'vuex'
 import dayjs from 'dayjs'
 export default {
@@ -379,6 +379,8 @@ export default {
       });
       if(!checkOk){
         this.$toast.fail( "扫描结果不在本次检查范围内!");
+      }else{
+        this.saveData();
       }
     },
 
@@ -509,37 +511,47 @@ export default {
 //
     //提交数据
     submitData() {
-      //验证必填项
-      let pointData = this.checkList.flatMap(v => v.pointList);
-      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) {
-          return !v.remark || !v.rectificationDeadline
-        }
-      })
-      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.toPagesFcn();
-      }).catch(error=>{
-        if( error === '任务已完成'){
-          this.toPagesFcn();
-        }
+      Dialog.confirm({
+        title: '提示',
+        message: '是否提交当前检查任务?提交后不能修改,如要修改请使用保存按钮!',
       })
+        .then(() => {
+          //验证必填项
+          let pointData = this.checkList.flatMap(v => v.pointList);
+          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) {
+              return !v.remark || !v.rectificationDeadline
+            }
+          })
+          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.toPagesFcn();
+          }).catch(error=>{
+            if( error === '任务已完成'){
+              this.toPagesFcn();
+            }
+          });
+        })
+        .catch(() => {
+          // on cancel
+        });
+
     },
     //页面跳转逻辑
     toPagesFcn(){
@@ -571,7 +583,6 @@ export default {
     //点击NFC图标
     clickNFC(arr) {
       this.NFCList = arr;
-      console.log(this.NFCList,'NFCList')
       this.$refs.NfcPopup.show(arr);
     },
     //清空数据
@@ -587,7 +598,6 @@ export default {
     },
     //切换开关时添加操作时间
     switchChange(item) {
-      console.log(item, '666')
       if (item.status == '0') {
         item.remark = null;
         item.rectificationDeadline = null;
@@ -596,7 +606,6 @@ export default {
     },
     //添加图片时的回调
     changeNfcImg(imgItem) {
-      console.log(imgItem, this.NFCList, 'imgItem')
       this.NFCList.forEach(v => {
         if (v.nfcCode === imgItem.nfcCode) {
           v.img = imgItem.url;
@@ -606,7 +615,7 @@ export default {
           this.nfcImage.push(v);
         }
       })
-      console.log(this.NFCList, this.nfcImage, 'nfcObj')
+      this.saveData();
     },
   }
 }