Commit c8a30fec by chenwq

bug修复;sop联调

1 parent d9078f60
...@@ -15,7 +15,17 @@ const getCustomerListApi = params => { ...@@ -15,7 +15,17 @@ const getCustomerListApi = params => {
// 标签获取客户列表 // 标签获取客户列表
const getCustomerByTagListApi = params => { const getCustomerByTagListApi = params => {
params.method = 'entmicro.api.customer.getCustomerPageByTag' params.method = 'entmicro.api.customer.getCustomerPageByTag'
params.source = 'scrm-home' return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 人群获取客户列表
const getCustomerCrowdApi = params => {
params.method = 'entmicro.api.customer.crowd.page'
return http({ return http({
url: 'rop-scrm-entmicro/router', url: 'rop-scrm-entmicro/router',
method: 'POST', method: 'POST',
...@@ -204,4 +214,4 @@ const getMomentListApi = params => { ...@@ -204,4 +214,4 @@ const getMomentListApi = params => {
}) })
} }
export default { getCustomerListApi, getCustomerByTagListApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, getTaskStatusApi, parseEventCountApi, deleteSopEventApi, endSopEventApi, batchEditSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi, getGroupListApi, getMaterialListApi, getMomentListApi } export default { getCustomerListApi, getCustomerByTagListApi, getCustomerCrowdApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, getTaskStatusApi, parseEventCountApi, deleteSopEventApi, endSopEventApi, batchEditSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi, getGroupListApi, getMaterialListApi, getMomentListApi }
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
width: footerWidth + 'px' width: footerWidth + 'px'
}"> }">
<el-button type="primary" @click="submitForm('ruleForm')" size="medium" :loading="sloading" v-if="showSubmit">确定</el-button> <el-button type="primary" @click="submitForm('ruleForm')" size="medium" :loading="sloading" v-if="showSubmit">确定</el-button>
<el-button type="primary" @click="goBack" size="medium">取消</el-button> <el-button type="default" @click="goBack" size="medium">取消</el-button>
</div> </div>
<!-- :hasScroll="false" :noBtnOk="true" :noCancel="true" :noClose="false" --> <!-- :hasScroll="false" :noBtnOk="true" :noCancel="true" :noClose="false" -->
<glsx-dialog title="" top="30vh" :hasScroll="false" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isDialogVisible" :showClose="false" @closeDialog="handleClose" @confirmDialog="handleConfirm"> <glsx-dialog title="" top="30vh" :hasScroll="false" width="547px" btnCloseLabel="取消" :noClose="false" :noCancel="true" btnSize="small" :isVisible="isDialogVisible" :showClose="false" @closeDialog="handleClose" @confirmDialog="handleConfirm">
......
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
label: '领取用户', label: '领取用户',
prop: 'userName', prop: 'userName',
formatter: cellValue => { formatter: cellValue => {
return cellValue.userName + ' ' + cellValue.phone return cellValue.userName == cellValue.phone ? cellValue.userName : cellValue.userName + ' ' + cellValue.phone
} }
}, },
{ {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div v-show="item.list.length != 0"> <div v-show="item.list.length != 0">
<div class="customer-box m-t-10"> <div class="customer-box m-t-10">
<!-- <div class="customer-title">{{ condLimitObj.hasQw ? '已加' : '没加' }}企微/{{ condLimitObj.hasPhone ? '有' : '没有' }}手机号:{{ editForm.customerInfoList.length }}人</div> --> <!-- <div class="customer-title">{{ condLimitObj.hasQw ? '已加' : '没加' }}企微/{{ condLimitObj.hasPhone ? '有' : '没有' }}手机号:{{ editForm.customerInfoList.length }}人</div> -->
<div class="customer-title">{{ item.confName }}客户:预估{{}}人</div> <div class="customer-title">{{ item.confName }}客户:预估{{ item.customerCount }}人</div>
<div :key="key" class="el-input-tag input-tag-wrapper"> <div :key="key" class="el-input-tag input-tag-wrapper">
<template v-if="item.confName == '标签'"> <template v-if="item.confName == '标签'">
<div v-for="(subItem, subIdx) in item.list" :key="subIdx"> <div v-for="(subItem, subIdx) in item.list" :key="subIdx">
...@@ -98,9 +98,9 @@ ...@@ -98,9 +98,9 @@
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button> <el-button type="default" @click="handleCancel">取消</el-button>
</div> </div>
<select-Crowd v-if="isCrowdCustVisible" :dialogVisible="isCrowdCustVisible" :selectedCustomerList="customerDataList[0].list" @handleCrowdCustClose="handleCrowdCustClose" @handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd>
<select-tag ref="selectTagForm" @tagSelected="handleDialogConfirm" :dialogVisible="isTagVisible"></select-tag> <select-tag ref="selectTagForm" @tagSelected="handleDialogConfirm" :dialogVisible="isTagVisible"></select-tag>
<select-customer v-if="isAppointCustVisible" :dialogVisible="isAppointCustVisible" :selectedCustomerList="customerDataList[2].list" @handleAppointCustClose="handleAppointCustClose" @handleAppointCustConfirm="handleDialogConfirm"></select-customer> <select-customer v-if="isAppointCustVisible" :dialogVisible="isAppointCustVisible" :selectedCustomerList="customerDataList[2].list" @handleAppointCustClose="handleAppointCustClose" @handleAppointCustConfirm="handleDialogConfirm"></select-customer>
<select-Crowd v-if="isCrowdCustVisible" :dialogVisible="isCrowdCustVisible" :selectedCustomerList="customerDataList[0].list" @handleCrowdCustClose="handleCrowdCustClose" @handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd>
</div> </div>
</template> </template>
...@@ -147,8 +147,10 @@ export default { ...@@ -147,8 +147,10 @@ export default {
currentCustomerIdx: -1, currentCustomerIdx: -1,
customerDataList: [ customerDataList: [
{ {
confId: 1, confId: 2,
confName: '人群', confName: '人群',
reqListName: 'crowdList',
customerCount: '',
listConf: { listConf: {
confId: 'crowdId', confId: 'crowdId',
confName: 'crowdName' confName: 'crowdName'
...@@ -156,13 +158,17 @@ export default { ...@@ -156,13 +158,17 @@ export default {
list: [] list: []
}, },
{ {
confId: 2, confId: 3,
confName: '标签', confName: '标签',
reqListName: 'labelList',
customerCount: '',
list: [] list: []
}, },
{ {
confId: 3, confId: 1,
confName: '指定', confName: '指定',
reqListName: 'customerList',
customerCount: '',
listConf: { listConf: {
confId: 'id', confId: 'id',
confName: 'customerName' confName: 'customerName'
...@@ -178,7 +184,7 @@ export default { ...@@ -178,7 +184,7 @@ export default {
// tagging: [], // tagging: [],
customerOptType: '', customerOptType: '',
customerInfoList: [], customerInfoList: [],
customerIds: [], // customerIds: [],
customerOptUpdate: '2', customerOptUpdate: '2',
eventList: [] eventList: []
}, },
...@@ -209,15 +215,15 @@ export default { ...@@ -209,15 +215,15 @@ export default {
addHtml: 'customerInfoList', addHtml: 'customerInfoList',
customerRadioList: [ customerRadioList: [
{ {
confId: 1, confId: 2,
confName: '按人群选择客户' confName: '按人群选择客户'
}, },
{ {
confId: 2, confId: 3,
confName: '按标签选择客户' confName: '按标签选择客户'
}, },
{ {
confId: 3, confId: 1,
confName: '选择指定客户' confName: '选择指定客户'
} }
], ],
...@@ -306,14 +312,52 @@ export default { ...@@ -306,14 +312,52 @@ export default {
this.editFormData[idx].isDisabled = this.editDisabled this.editFormData[idx].isDisabled = this.editDisabled
}) })
}, },
recoverAppointList() {
var list = []
var sexToObj = {
U: 0,
M: 1,
W: 2
}
this.editForm[this.customerDataList[this.currentCustomerIdx].reqListName].forEach(item => {
list.push({
id: item.customerId,
customerName: item.customerName,
customerPhone: item.customerPhone,
customerSex: sexToObj[item.customerSex],
isJoin: item.customerWxAdd == 'Y' ? 1 : 0,
addTime: item.customerTimeAdd,
oneId: item.externalUserId
})
})
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
this.changeCustomer()
},
recoverCustomerList() {
switch (this.customerDataList[this.currentCustomerIdx].confName) {
case '人群':
break
case '标签':
break
case '指定':
this.recoverAppointList()
break
}
},
getInfo() { getInfo() {
this.$apis.sop.getSopInfoDetailApi({ sopId: this.routeInfo.id }).then(res => { this.$apis.sop.getSopInfoDetailApi({ sopId: this.routeInfo.id }).then(res => {
// console.log(res) // console.log(res)
this.editForm = res this.editForm = res
this.editForm.customerInfoList = this.editForm.customerInfoList || [] this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType)
this.editForm.customerInfoList.forEach(item => { this.recoverCustomerList()
item.id = item.customerId this.editForm.customerOptUpdate = this.editForm.customerOptUpdate + ''
}) // this.editForm.customerInfoList = this.editForm.customerInfoList || []
// this.editForm.customerInfoList.forEach(item => {
// item.id = item.customerId
// })
// this.editForm.customerInfoList.length && this.recoveryCondLimit() // this.editForm.customerInfoList.length && this.recoveryCondLimit()
this.editForm.eventList.forEach(item => { this.editForm.eventList.forEach(item => {
if (item.object) { if (item.object) {
...@@ -370,7 +414,55 @@ export default { ...@@ -370,7 +414,55 @@ export default {
// } // }
// }, // },
getCustomerByCrowdList() {
var params = {
pageSize: 9999,
pageNum: 1,
crowdId: this.customerDataList[this.currentCustomerIdx].list[0].crowdId
}
this.$apis.sop.getCustomerCrowdApi(params).then(res => {
this.customerDataList[this.currentCustomerIdx].customerCount = res.count
})
},
getCustomerByTagList() {
var params = {
combineType: 2,
pageSize: 9999,
pageNum: 1,
tagLists: []
}
this.customerDataList[this.currentCustomerIdx].list &&
this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
item.labelList.length &&
item.labelList.forEach(subItem => {
params.tagLists.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
groupType: item.labelType,
labelId: subItem.id,
labelName: subItem.name
})
})
})
this.$apis.sop.getCustomerByTagListApi(params).then(res => {
this.customerDataList[this.currentCustomerIdx].customerCount = res.count
})
},
changeCustomer() { changeCustomer() {
// 预估人数
switch (this.customerDataList[this.currentCustomerIdx].confName) {
case '人群':
this.customerDataList[this.currentCustomerIdx].list.length && this.getCustomerByCrowdList()
break
case '标签':
this.customerDataList[this.currentCustomerIdx].list.length && this.getCustomerByTagList()
break
case '指定':
this.customerDataList[this.currentCustomerIdx].customerCount = this.customerDataList[this.currentCustomerIdx].list.length
break
}
this.editForm.customerInfoList = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list)) this.editForm.customerInfoList = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list))
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
}, },
...@@ -378,11 +470,13 @@ export default { ...@@ -378,11 +470,13 @@ export default {
// 选择标签 // 选择标签
handleDialogConfirm(obj) { handleDialogConfirm(obj) {
console.log(obj) console.log(obj)
switch (this.currentCustomerIdx) { switch (this.customerDataList[this.currentCustomerIdx].confName) {
case 0: case '人群':
this.handleCrowdCustClose() this.handleCrowdCustClose()
break break
case 2: case '标签':
break
case '指定':
this.handleAppointCustClose() this.handleAppointCustClose()
break break
} }
...@@ -514,6 +608,41 @@ export default { ...@@ -514,6 +608,41 @@ export default {
this.$emit('handleTabChange', { activeName: 'editEvent', addOrEdit: addOrEdit, eventIndex: addOrEdit == 'add' ? '-1' : idx, info: { ...row, sopName: this.editForm.sopName } }) this.$emit('handleTabChange', { activeName: 'editEvent', addOrEdit: addOrEdit, eventIndex: addOrEdit == 'add' ? '-1' : idx, info: { ...row, sopName: this.editForm.sopName } })
}, },
reqCrowdAttrs() { },
reqAppointAttrs() {
var list = []
var sexToObj = {
0: 'U',
1: 'M',
2: 'W'
}
this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
list.push({
customerId: item.id,
customerName: item.customerName,
customerPhone: item.customerPhone,
customerSex: item.customerSex ? sexToObj[item.customerSex] : 'U',
customerWxAdd: item.isJoin ? 'Y' : 'N',
customerTimeAdd: item.addTime,
externalUserId: item.oneid
})
})
console.log(list)
return list
},
reqCustAttrs() {
switch (this.customerDataList[this.currentCustomerIdx].confName) {
case '人群':
return this.reqCrowdAttrs()
case '标签':
return this.reqLabelAttrs()
case '指定':
return this.reqAppointAttrs()
}
},
handleConfirm() { handleConfirm() {
this.submit = true this.submit = true
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
...@@ -522,7 +651,9 @@ export default { ...@@ -522,7 +651,9 @@ export default {
return true return true
} }
var params = this.$common.utils.deepClone(this.editForm) var params = this.$common.utils.deepClone(this.editForm)
params.customerIds = this.editForm.customerInfoList.map(item => item.id).join(',') // params.customerIds = this.editForm.customerInfoList.map(item => item.id).join(',')
params[this.customerDataList[this.currentCustomerIdx].reqListName] = JSON.stringify(this.reqCustAttrs())
params.customerCount = this.customerDataList[this.currentCustomerIdx].customerCount
delete params.customerInfoList delete params.customerInfoList
if (this.routeInfo.addOrEdit == 'edit') { if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id params.id = this.routeInfo.id
...@@ -539,7 +670,10 @@ export default { ...@@ -539,7 +670,10 @@ export default {
repeatFlag: item.repeatFlag, repeatFlag: item.repeatFlag,
repeatMode: item.repeatMode, repeatMode: item.repeatMode,
sopName: item.sopName, sopName: item.sopName,
sopId: this.routeInfo.id sopId: this.routeInfo.id,
followerTypeId: item.followerTypeId,
reachesType: item.reachesType,
reachesTypeSet: item.reachesTypeSet
}) })
if (item.id) { if (item.id) {
params.eventList[idx].id = item.id params.eventList[idx].id = item.id
......
...@@ -54,10 +54,18 @@ export default { ...@@ -54,10 +54,18 @@ export default {
// 搜索 // 搜索
searchFormData: [ searchFormData: [
{ {
label: '关键字', label: '客户名称',
name: 'keyword', name: 'customerName',
type: 'input', type: 'input',
placeholder: '请输入客户名称/手机号' isClear: true,
maxlength: 50
},
{
label: '客户手机号',
name: 'customerPhone',
type: 'input',
isClear: true,
maxlength: 11
} }
], ],
// 表格 // 表格
......
...@@ -134,6 +134,7 @@ export default { ...@@ -134,6 +134,7 @@ export default {
eventCount: '', eventCount: '',
object: {}, object: {},
//营销渠道 //营销渠道
followerTypeId: '',
reachesType: '', reachesType: '',
reachesTypeSet: '' reachesTypeSet: ''
}, },
...@@ -524,6 +525,7 @@ export default { ...@@ -524,6 +525,7 @@ export default {
this.editForm.eventStartDate = moment(this.editForm.eventStartDate).format('YYYY-MM-DD') this.editForm.eventStartDate = moment(this.editForm.eventStartDate).format('YYYY-MM-DD')
this.editForm.eventEndDate = this.editForm.eventEndDate ? moment(this.editForm.eventEndDate).format('YYYY-MM-DD') : '' this.editForm.eventEndDate = this.editForm.eventEndDate ? moment(this.editForm.eventEndDate).format('YYYY-MM-DD') : ''
this.previewList = this.editForm.object ? [{ attContent: JSON.parse(JSON.stringify(this.editForm.object)), additionalType: this.editForm.object.additionalType }] : [] this.previewList = this.editForm.object ? [{ attContent: JSON.parse(JSON.stringify(this.editForm.object)), additionalType: this.editForm.object.additionalType }] : []
this.editForm.followerTypeId = this.editForm.followerTypeId + ''
this.recoveryRepeat() this.recoveryRepeat()
this.recoveryEndTime() this.recoveryEndTime()
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!