|
@@ -200,9 +200,6 @@
|
|
|
{ required: true, message: `请输入客户电话`, trigger: 'change' },
|
|
|
{ pattern:/^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/, message: '电话号码格式不正确', trigger: 'blur' }
|
|
|
],
|
|
|
- userMobile2: [
|
|
|
- { required: true, message: '请输入客户电话或座机', trigger: 'blur' }
|
|
|
- ],
|
|
|
userName: [
|
|
|
{ required: true, message: '请输入客户名称', trigger: 'blur' }
|
|
|
],
|
|
@@ -258,22 +255,36 @@
|
|
|
getActiveDetail(id,items){
|
|
|
getActiveDetail({id}).then(res => {
|
|
|
this.formData.activeDate = [res.data.startTime,res.data.endTime]
|
|
|
+ this.formData.promotionActivityId = res.data.promotionQuestionnaireId
|
|
|
res.data.promotionQuestionnaireItems.forEach((item,index)=>{
|
|
|
item.answer = JSON.parse(item.answer)
|
|
|
if(items){
|
|
|
- item.answer.forEach((it,ind) => {
|
|
|
- let data = JSON.parse(items[index].answer)
|
|
|
- console.log(data[ind]?.option_value,it.option_value)
|
|
|
- if(data[ind]?.active && data[ind]?.option_value == it.option_value){
|
|
|
- it.active = true;
|
|
|
- }else{
|
|
|
- it.active = false;
|
|
|
- }
|
|
|
- if(items[index].type == 3){
|
|
|
- item.inputValue = data[ind]?.option_value
|
|
|
- }else if(item.type == 4 || item.type == 5){
|
|
|
- item.inputValue = [{url: data[ind]?.option_value}]
|
|
|
- }
|
|
|
+ item.answer.forEach(it1 => {
|
|
|
+ items.forEach(it2=>{
|
|
|
+ JSON.parse(it2.answer).forEach(t=>{
|
|
|
+ if(item.id == it2.id && t.active && it1.option_value == t.option_value){
|
|
|
+ console.log(t.option_value)
|
|
|
+ it1.active = true;
|
|
|
+ }
|
|
|
+ if(it2.type == 3){
|
|
|
+ item.inputValue = t.option_value
|
|
|
+ }else if(it2 == 4 || it2 == 5){
|
|
|
+ item.inputValue = [{url: t.option_value}]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ // let data = JSON.parse(items[index].answer)
|
|
|
+ // console.log(data[ind]?.option_value,it.option_value)
|
|
|
+ // if(data[ind]?.active && data[ind]?.option_value == it.option_value){
|
|
|
+ // it.active = true;
|
|
|
+ // }else{
|
|
|
+ // it.active = false;
|
|
|
+ // }
|
|
|
+ // if(items[index].type == 3){
|
|
|
+ // item.inputValue = data[ind]?.option_value
|
|
|
+ // }else if(item.type == 4 || item.type == 5){
|
|
|
+ // item.inputValue = [{url: data[ind]?.option_value}]
|
|
|
+ // }
|
|
|
})
|
|
|
}else{
|
|
|
if(item.type == 4 || item.type == 5){
|
|
@@ -287,6 +298,7 @@
|
|
|
}
|
|
|
})
|
|
|
this.activeItems = res.data.promotionQuestionnaireItems
|
|
|
+ console.log(this.activeItems,111)
|
|
|
})
|
|
|
},
|
|
|
clickOption(index, idx) {
|
|
@@ -328,7 +340,7 @@
|
|
|
for(let index = 0; index < activeItems.length; index++) {
|
|
|
// 单选题多选题
|
|
|
if ((activeItems[index].type == 1 || activeItems[index].type == 2)) {
|
|
|
- // activeItems[index].answer = activeItems[index].answer.filter(o => o.active);
|
|
|
+ activeItems[index].answer = activeItems[index].answer.filter(o => o.active);
|
|
|
activeItems[index].answer = JSON.stringify(activeItems[index].answer);
|
|
|
items.push(activeItems[index]);
|
|
|
}
|