|
@@ -188,9 +188,11 @@ import radioGroup from './radioGroup';
|
|
|
import followUpHistory from './followUpHistory';
|
|
import followUpHistory from './followUpHistory';
|
|
|
import { getDictOption } from '@/api/index';
|
|
import { getDictOption } from '@/api/index';
|
|
|
import { updateCustomerClueDept, getDeptInfo } from '@/api/clew';
|
|
import { updateCustomerClueDept, getDeptInfo } from '@/api/clew';
|
|
|
|
|
+import { clewMixins } from '@/mixin/clew.js';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'complaintDetail',
|
|
name: 'complaintDetail',
|
|
|
|
|
+ mixins: [clewMixins],
|
|
|
components: {
|
|
components: {
|
|
|
infoDetail,
|
|
infoDetail,
|
|
|
complaintLog,
|
|
complaintLog,
|
|
@@ -299,27 +301,13 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
onSubmit() {
|
|
onSubmit() {
|
|
|
- // 没有选择跟进记录
|
|
|
|
|
- // if (!this.taskGather[0].searchValue) {
|
|
|
|
|
- // this.$toast('请选择跟进结果');
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
- this.requiredFlag = true;
|
|
|
|
|
- let customerClueItemList = [];
|
|
|
|
|
- // 每一个层级都是一道题的题目,子级就是题,被选中和填写的题要带上题目一块上传(题的同级也要上传)
|
|
|
|
|
- // 第一级题目下的题默认都要上传
|
|
|
|
|
- let params = {
|
|
|
|
|
- customerClueItemList: [],
|
|
|
|
|
- customerClassify: this.customerClassify,
|
|
|
|
|
- customerSubClassify: this.customerSubClassify,
|
|
|
|
|
- };
|
|
|
|
|
- params.customerClueItemList.push(...this.deepClone(this.taskGather, 0));
|
|
|
|
|
- // let optionList = this.taskGather[0].customerClueOptionList;
|
|
|
|
|
- this.filterOption(this.taskGather, params);
|
|
|
|
|
- console.log(JSON.stringify(params));
|
|
|
|
|
- // 必填验证
|
|
|
|
|
- if (this.requiredFlag) {
|
|
|
|
|
|
|
+ this.purchaseSubmit((data) => {
|
|
|
this.toastLoading(0, '加载中...', true);
|
|
this.toastLoading(0, '加载中...', true);
|
|
|
|
|
+ let params = {
|
|
|
|
|
+ customerClueItemList: data.customerClueItemList,
|
|
|
|
|
+ customerClassify: this.customerClassify,
|
|
|
|
|
+ customerSubClassify: this.customerSubClassify,
|
|
|
|
|
+ };
|
|
|
insertCustomerClueAnswerKs(params).then((res) => {
|
|
insertCustomerClueAnswerKs(params).then((res) => {
|
|
|
this.toastLoading().clear();
|
|
this.toastLoading().clear();
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -329,98 +317,7 @@ export default {
|
|
|
this.$toast(res.msg);
|
|
this.$toast(res.msg);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- } else {
|
|
|
|
|
- this.$toast(this.requiredMessage);
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- filterOption(optionList, params) {
|
|
|
|
|
- for (let val = 0; val < optionList.length; val++) {
|
|
|
|
|
- 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++) {
|
|
|
|
|
- // 选中的题目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[0]) {
|
|
|
|
|
- this.filterOption(customerClueOptionList[i].customerClueItemList, params);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // 深拷贝指定拷贝层级
|
|
|
|
|
- deepClone(obj, num) {
|
|
|
|
|
- // 检查是否为对象或数组
|
|
|
|
|
- if (obj === null || typeof obj !== 'object') {
|
|
|
|
|
- return obj; // 基本类型直接返回
|
|
|
|
|
- }
|
|
|
|
|
- // 创建一个数组或对象
|
|
|
|
|
- const copy = Array.isArray(obj) ? [] : {};
|
|
|
|
|
- // 遍历对象的每个属性
|
|
|
|
|
- for (const key in obj) {
|
|
|
|
|
- if (obj.hasOwnProperty(key) && num < 2) {
|
|
|
|
|
- // 递归调用深拷贝
|
|
|
|
|
- if (key == 'customerClueOptionList' || key == 'customerClueItemList') {
|
|
|
|
|
- num = num + 1;
|
|
|
|
|
- }
|
|
|
|
|
- copy[key] = this.deepClone(obj[key], num);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- return copy;
|
|
|
|
|
- },
|
|
|
|
|
- isRequiredFlag(optionList) {
|
|
|
|
|
- // console.log(optionList);
|
|
|
|
|
- for (let i = 0; i < optionList.length; i++) {
|
|
|
|
|
- // 是否必填
|
|
|
|
|
- if (optionList[i].isMust == 0) {
|
|
|
|
|
- // 输入框
|
|
|
|
|
- if (optionList[i].answerType == 'wb' || optionList[i].answerType == 'sz') {
|
|
|
|
|
- if (!optionList[i].answerValue) {
|
|
|
|
|
- // 必填类型
|
|
|
|
|
- this.requiredFlag = false;
|
|
|
|
|
- this.requiredMessage = optionList[i].remark;
|
|
|
|
|
- return;
|
|
|
|
|
- } else {
|
|
|
|
|
- // 条件校验
|
|
|
|
|
- if (optionList[i].minTextLength) {
|
|
|
|
|
- // 输入内容长度校验
|
|
|
|
|
- if (optionList[i].answerValue.length < optionList[i].minTextLength) {
|
|
|
|
|
- this.requiredFlag = false;
|
|
|
|
|
- this.requiredMessage = optionList[i].remark;
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- } else if (optionList[i].answerType == 'zp') {
|
|
|
|
|
- // 照片
|
|
|
|
|
- if (!optionList[i].fileInfoList || !optionList[i].fileInfoList.length) {
|
|
|
|
|
- this.requiredFlag = false;
|
|
|
|
|
- this.requiredMessage = optionList[i].remark;
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
// 校验错误返回信息
|
|
// 校验错误返回信息
|
|
|
onFailed(errorInfo) {
|
|
onFailed(errorInfo) {
|