|
|
@@ -140,42 +140,56 @@ export default {
|
|
|
params.customerClueItemList.push(...this.deepClone(this.taskGather, 0));
|
|
|
// let optionList = this.taskGather[0].customerClueOptionList;
|
|
|
this.filterOption(this.taskGather, params);
|
|
|
+ console.log(params);
|
|
|
// 必填验证
|
|
|
if (this.requiredFlag) {
|
|
|
- // this.toastLoading(0, '加载中...', true);
|
|
|
- // insertFollowCustomerClueAnswer(params).then((res) => {
|
|
|
- // this.toastLoading().clear();
|
|
|
- // if (res.code == 200) {
|
|
|
- // this.$toast(res.msg);
|
|
|
- // window.location.replace(window.location.origin + '/mobile/clew');
|
|
|
- // } else {
|
|
|
- // this.$toast(res.msg);
|
|
|
- // }
|
|
|
- // });
|
|
|
+ this.toastLoading(0, '加载中...', true);
|
|
|
+ insertFollowCustomerClueAnswer(params).then((res) => {
|
|
|
+ this.toastLoading().clear();
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$toast(res.msg);
|
|
|
+ window.location.replace(window.location.origin + '/mobile/clew');
|
|
|
+ } else {
|
|
|
+ this.$toast(res.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
} else {
|
|
|
this.$toast(this.requiredMessage);
|
|
|
}
|
|
|
},
|
|
|
filterOption(optionList, params) {
|
|
|
- // debugger;
|
|
|
- let copy = null;
|
|
|
for (let val = 0; val < optionList.length; val++) {
|
|
|
- // for (let i = 0; i < optionList[val].length; i++) {
|
|
|
- if (optionList[val].value == 'Y') {
|
|
|
- if (optionList[val].customerClueItemList) {
|
|
|
- // 必填校验
|
|
|
- this.isRequiredFlag(optionList[val].customerClueItemList);
|
|
|
- params.customerClueItemList[val].push(
|
|
|
- ...this.deepClone(optionList[val].customerClueItemList, 0)
|
|
|
- );
|
|
|
- if (optionList[val].customerClueItemList[0]) {
|
|
|
- this.filterOption(optionList[val].customerClueItemList, params);
|
|
|
+ if (
|
|
|
+ optionList[val].isMust == '0' &&
|
|
|
+ optionList[val].searchValue == null &&
|
|
|
+ optionList[val].answerType == 'dx'
|
|
|
+ ) {
|
|
|
+ // 题目必填校验
|
|
|
+ this.requiredFlag = false;
|
|
|
+ this.requiredMessage = '请选择' + optionList[val].customerClueName;
|
|
|
+ return;
|
|
|
+ } else if (optionList[val].isMust == '0' && optionList[val].searchValue) {
|
|
|
+ let customerClueOptionList = optionList[val].customerClueOptionList;
|
|
|
+ for (let i = 0; i < customerClueOptionList.length; i++) {
|
|
|
+ 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[0]) {
|
|
|
+ this.filterOption(customerClueOptionList[i].customerClueItemList, params);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // }
|
|
|
}
|
|
|
},
|
|
|
+ // 深拷贝指定拷贝层级
|
|
|
deepClone(obj, num) {
|
|
|
// 检查是否为对象或数组
|
|
|
if (obj === null || typeof obj !== 'object') {
|
|
|
@@ -196,7 +210,7 @@ export default {
|
|
|
return copy;
|
|
|
},
|
|
|
isRequiredFlag(optionList) {
|
|
|
- console.log(optionList);
|
|
|
+ // console.log(optionList);
|
|
|
// 必填类型
|
|
|
for (let i = 0; i < optionList.length; i++) {
|
|
|
if (optionList[i].answerType == 'wb' && optionList[i].isMust == 0) {
|