|
@@ -176,7 +176,7 @@ import NfcPopup from '@/components/nfcPopup/more'
|
|
|
import AddCheck from './addCheck'
|
|
import AddCheck from './addCheck'
|
|
|
import { registerDetail, registerSubmit } from './api'
|
|
import { registerDetail, registerSubmit } from './api'
|
|
|
import { imgUrl} from '@/utils'
|
|
import { imgUrl} from '@/utils'
|
|
|
-import { ImagePreview } from 'vant'
|
|
|
|
|
|
|
+import {Dialog, ImagePreview} from 'vant'
|
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
export default {
|
|
export default {
|
|
@@ -379,6 +379,8 @@ export default {
|
|
|
});
|
|
});
|
|
|
if(!checkOk){
|
|
if(!checkOk){
|
|
|
this.$toast.fail( "扫描结果不在本次检查范围内!");
|
|
this.$toast.fail( "扫描结果不在本次检查范围内!");
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.saveData();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -509,37 +511,47 @@ export default {
|
|
|
//
|
|
//
|
|
|
//提交数据
|
|
//提交数据
|
|
|
submitData() {
|
|
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(){
|
|
toPagesFcn(){
|
|
@@ -571,7 +583,6 @@ export default {
|
|
|
//点击NFC图标
|
|
//点击NFC图标
|
|
|
clickNFC(arr) {
|
|
clickNFC(arr) {
|
|
|
this.NFCList = arr;
|
|
this.NFCList = arr;
|
|
|
- console.log(this.NFCList,'NFCList')
|
|
|
|
|
this.$refs.NfcPopup.show(arr);
|
|
this.$refs.NfcPopup.show(arr);
|
|
|
},
|
|
},
|
|
|
//清空数据
|
|
//清空数据
|
|
@@ -587,7 +598,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
//切换开关时添加操作时间
|
|
//切换开关时添加操作时间
|
|
|
switchChange(item) {
|
|
switchChange(item) {
|
|
|
- console.log(item, '666')
|
|
|
|
|
if (item.status == '0') {
|
|
if (item.status == '0') {
|
|
|
item.remark = null;
|
|
item.remark = null;
|
|
|
item.rectificationDeadline = null;
|
|
item.rectificationDeadline = null;
|
|
@@ -596,7 +606,6 @@ export default {
|
|
|
},
|
|
},
|
|
|
//添加图片时的回调
|
|
//添加图片时的回调
|
|
|
changeNfcImg(imgItem) {
|
|
changeNfcImg(imgItem) {
|
|
|
- console.log(imgItem, this.NFCList, 'imgItem')
|
|
|
|
|
this.NFCList.forEach(v => {
|
|
this.NFCList.forEach(v => {
|
|
|
if (v.nfcCode === imgItem.nfcCode) {
|
|
if (v.nfcCode === imgItem.nfcCode) {
|
|
|
v.img = imgItem.url;
|
|
v.img = imgItem.url;
|
|
@@ -606,7 +615,7 @@ export default {
|
|
|
this.nfcImage.push(v);
|
|
this.nfcImage.push(v);
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- console.log(this.NFCList, this.nfcImage, 'nfcObj')
|
|
|
|
|
|
|
+ this.saveData();
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|