|
@@ -164,22 +164,20 @@ export default {
|
|
|
handler(val){
|
|
handler(val){
|
|
|
console.log(val,'val')
|
|
console.log(val,'val')
|
|
|
if(!val)return
|
|
if(!val)return
|
|
|
-
|
|
|
|
|
- val.forEach((valItem) => {
|
|
|
|
|
|
|
+ let str = JSON.parse(JSON.stringify(val));
|
|
|
|
|
+ str.forEach((valItem) => {
|
|
|
// 查找是否有与 valItem.itemId 相同的项
|
|
// 查找是否有与 valItem.itemId 相同的项
|
|
|
const existingItem = this.checkList.find((checkItem) => checkItem.itemId === valItem.itemId);
|
|
const existingItem = this.checkList.find((checkItem) => checkItem.itemId === valItem.itemId);
|
|
|
-
|
|
|
|
|
if (existingItem) {
|
|
if (existingItem) {
|
|
|
// // 如果存在相同 itemId 的项,查找 pointList 是否有与 valItem.pointId 相同的项
|
|
// // 如果存在相同 itemId 的项,查找 pointList 是否有与 valItem.pointId 相同的项
|
|
|
const existingPoint = existingItem.pointList.find((pointItem) => pointItem.pointId === valItem.id);
|
|
const existingPoint = existingItem.pointList.find((pointItem) => pointItem.pointId === valItem.id);
|
|
|
if (!existingPoint) {
|
|
if (!existingPoint) {
|
|
|
console.log(existingItem,'point添加成功')
|
|
console.log(existingItem,'point添加成功')
|
|
|
this.$nextTick(()=>{
|
|
this.$nextTick(()=>{
|
|
|
- existingItem.pointList.push({
|
|
|
|
|
- ...valItem,
|
|
|
|
|
- pointId: valItem.id,
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ existingItem.pointList.push(valItem);
|
|
|
})
|
|
})
|
|
|
|
|
+ }else {
|
|
|
|
|
+ this.$toast('该检查项已添加');
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
console.log(valItem,'item添加成功')
|
|
console.log(valItem,'item添加成功')
|
|
@@ -193,7 +191,6 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- deep:true
|
|
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
computed:{
|
|
computed:{
|
|
@@ -261,7 +258,9 @@ export default {
|
|
|
this.taskInfo.isSubmit = 0;
|
|
this.taskInfo.isSubmit = 0;
|
|
|
registerSubmit(this.taskInfo).then(res=>{
|
|
registerSubmit(this.taskInfo).then(res=>{
|
|
|
this.$toast('保存成功');
|
|
this.$toast('保存成功');
|
|
|
- this.$router.go(-1);
|
|
|
|
|
|
|
+ this.$router.replace ({
|
|
|
|
|
+ path:'/securityCheckRegister',
|
|
|
|
|
+ });
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -284,7 +283,9 @@ export default {
|
|
|
this.taskInfo.isSubmit = 1;
|
|
this.taskInfo.isSubmit = 1;
|
|
|
registerSubmit(this.taskInfo).then(res=>{
|
|
registerSubmit(this.taskInfo).then(res=>{
|
|
|
this.$toast('提交成功');
|
|
this.$toast('提交成功');
|
|
|
- this.$router.go(-1);
|
|
|
|
|
|
|
+ this.$router.replace ({
|
|
|
|
|
+ path:'/securityCheckRegister',
|
|
|
|
|
+ });
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -325,7 +326,7 @@ export default {
|
|
|
//切换开关时添加操作时间
|
|
//切换开关时添加操作时间
|
|
|
switchChange(item){
|
|
switchChange(item){
|
|
|
console.log(item,'666')
|
|
console.log(item,'666')
|
|
|
- item.resTime = formatDate(new Date());
|
|
|
|
|
|
|
+ //item.resTime = formatDate(new Date());
|
|
|
},
|
|
},
|
|
|
//添加图片时的回调
|
|
//添加图片时的回调
|
|
|
changeNfcImg(imgItem){
|
|
changeNfcImg(imgItem){
|