|
|
@@ -35,26 +35,35 @@ export const clewMixins = {
|
|
|
this.requiredFlag = false;
|
|
|
this.requiredMessage = '请选择' + optionList[val].customerClueName;
|
|
|
return;
|
|
|
- } else if (optionList[val].isMust == '0' && optionList[val].searchValue) {
|
|
|
+ } else if (optionList[val].isMust == '0') {
|
|
|
+ // 本级题
|
|
|
+ // 必填校验
|
|
|
+ this.isRequiredFlag(optionList[val]);
|
|
|
// 子级题校验
|
|
|
let customerClueOptionList = optionList[val].customerClueOptionList;
|
|
|
- for (let i = 0; i < customerClueOptionList.length; i++) {
|
|
|
- // 选中的题目Y:选中,N:未选中
|
|
|
- if (customerClueOptionList[i].value == 'Y') {
|
|
|
- if (customerClueOptionList[i].customerClueItemList) {
|
|
|
- // 必填校验
|
|
|
- this.isRequiredFlag(customerClueOptionList[i].customerClueItemList);
|
|
|
- // 赋值选中题
|
|
|
- let customerClueItemList =
|
|
|
- params.customerClueItemList[val].customerClueOptionList[i].customerClueItemList;
|
|
|
- customerClueItemList.push(
|
|
|
- ...this.deepClone(customerClueOptionList[i].customerClueItemList, 0)
|
|
|
- );
|
|
|
- if (customerClueOptionList[i].customerClueItemList.length) {
|
|
|
- this.filterOption(customerClueOptionList[i].customerClueItemList, params);
|
|
|
+ if (customerClueOptionList.length) {
|
|
|
+ for (let i = 0; i < customerClueOptionList.length; i++) {
|
|
|
+ // 选中的题目Y:选中,N:未选中
|
|
|
+ if (customerClueOptionList[i].value == 'Y') {
|
|
|
+ if (customerClueOptionList[i].customerClueItemList) {
|
|
|
+ // 必填校验
|
|
|
+ this.isRequiredFlag(customerClueOptionList[i].customerClueItemList);
|
|
|
+ // 赋值选中题
|
|
|
+ let customerClueItemList =
|
|
|
+ params.customerClueItemList[val].customerClueOptionList[i].customerClueItemList;
|
|
|
+ customerClueItemList.push(
|
|
|
+ ...this.deepClone(customerClueOptionList[i].customerClueItemList, 0)
|
|
|
+ );
|
|
|
+ if (customerClueOptionList[i].customerClueItemList.length) {
|
|
|
+ this.filterOption(customerClueOptionList[i].customerClueItemList, params);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ } else {
|
|
|
+ // 赋值选中题
|
|
|
+ let customerClueItemList = params.customerClueItemList[val].customerClueItemList;
|
|
|
+ customerClueItemList.push(...this.deepClone(optionList[val], 0));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -112,52 +121,25 @@ export const clewMixins = {
|
|
|
} else if (optionList[i].answerType == 'bg') {
|
|
|
// 表格
|
|
|
let tableData = optionList[i].tableData;
|
|
|
- if (!this.filterBGData(tableData)) {
|
|
|
+ if (!this.filterBGData(tableData).length) {
|
|
|
this.requiredFlag = false;
|
|
|
this.requiredMessage = '请填写' + optionList[i].customerClueName;
|
|
|
return;
|
|
|
} else {
|
|
|
- optionList[i].answerValue = this.filterBGData(tableData);
|
|
|
+ optionList[i].answerValue = JSON.stringify(tableData);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
filterBGData(tableData) {
|
|
|
- let data = null;
|
|
|
+ let data = [];
|
|
|
const isValid = tableData.data.some((row) => {
|
|
|
if (Object.values(row).every((value) => value.trim() !== '')) {
|
|
|
- data = row;
|
|
|
+ data.push(row);
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- // const hasContent = Object.values(row).some(value => value.trim() !== '');
|
|
|
- // if (hasContent) {
|
|
|
- // for (const key in row) {
|
|
|
- // if (row[key].trim() === '') {
|
|
|
- // this.$set(row, key, ''); // 确保其他输入框也被标记为需要填写
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
return data;
|
|
|
- // let title = remarkData.title;
|
|
|
- // let len = title.length;
|
|
|
- // let data = remarkData.data;
|
|
|
- // let isFlag = false;
|
|
|
- // data.forEach((val) => {
|
|
|
- // for (let i = 0; i < len; i++) {
|
|
|
- // let num = 0;
|
|
|
- // if (val[title[i].prop]) {
|
|
|
- // num = num + 1;
|
|
|
- // }
|
|
|
- // if (num == len) {
|
|
|
- // isFlag = true;
|
|
|
- // } else if (num == 2) {
|
|
|
- // this.requiredFlag = false;
|
|
|
- // this.requiredMessage = '请将' + val.typeName + '填写完整';
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
},
|
|
|
},
|
|
|
};
|