Commit 11a73f0e by chenwq

sop编辑;标签选客户

1 parent d6168f33
......@@ -40,8 +40,8 @@
</template>
</div>
</div>
<el-button type="text" @click="handleSelectCustomer(pIdx)">编辑</el-button>
<el-button type="text" @click="handleResetCustomer(pIdx)">重置</el-button>
<el-button v-if="!editDisabled" type="text" @click="handleSelectCustomer(pIdx)">编辑</el-button>
<el-button v-if="!editDisabled" type="text" @click="handleResetCustomer(pIdx)">重置</el-button>
</div>
</div>
</div>
......@@ -306,13 +306,44 @@ export default {
methods: {
judgeDisable() {
var list = ['sopName', 'customerInfoList']
var list = ['sopName', 'customerOptType', 'customerOptUpdate']
list.forEach(item => {
var idx = this.editFormData.findIndex(k => k.name == item)
this.editFormData[idx].isDisabled = this.editDisabled
})
},
recoverLabelList() {
var list = []
var groupIdList = []
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
this.editForm[this.customerDataList[this.currentCustomerIdx].reqListName].forEach(item => {
let pIdx = groupIdList.findIndex(k => k == item.labelGroupId)
if (list.length && pIdx != -1) {
list[pIdx].labelList.push({
id: item.labelId,
name: item.labelName
})
} else {
groupIdList.push(item.labelGroupId)
list.push({
labelGroup: {
id: item.labelGroupId,
name: item.labelGroupName
},
labelList: [
{
id: item.labelId,
name: item.labelName
}
]
})
}
})
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
this.changeCustomer()
},
recoverAppointList() {
var list = []
var sexToObj = {
......@@ -340,6 +371,7 @@ export default {
case '人群':
break
case '标签':
this.recoverLabelList()
break
case '指定':
this.recoverAppointList()
......@@ -610,6 +642,22 @@ export default {
reqCrowdAttrs() { },
reqLabelAttrs() {
var list = []
console.log(this.customerDataList[this.currentCustomerIdx].list)
this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
item.labelList.forEach(subItem => {
list.push({
labelGroupId: item.labelGroup.id,
labelGroupName: item.labelGroup.name,
labelId: subItem.id,
labelName: subItem.name
})
})
})
return list
},
reqAppointAttrs() {
var list = []
var sexToObj = {
......@@ -628,7 +676,6 @@ export default {
externalUserId: item.oneid
})
})
console.log(list)
return list
},
......@@ -704,7 +751,7 @@ export default {
})
}
params.eventList = JSON.stringify(params.eventList)
// console.log(params)
console.log(params)
if (this.editDisabled) {
var batchEditParams = {
sopId: params.id,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!