Commit becf5bbc by chenwq

选择客户

1 parent 72db2480
import { http } from '@/main'
// 获取客户列表
const getCustomerListApi = params => {
params.method = 'entmicro.api.customer.page'
params.source = 'scrm-home'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
// 标签获取客户列表
const getCustomerByTagListApi = params => {
params.method = 'entmicro.api.customer.getCustomerPageByTag'
......@@ -191,4 +203,4 @@ const getMomentListApi = params => {
})
}
export default { getCustomerByTagListApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, getTaskStatusApi, parseEventCountApi, deleteSopEventApi, endSopEventApi, batchEditSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi, getGroupListApi, getMaterialListApi, getMomentListApi }
export default { getCustomerListApi, getCustomerByTagListApi, getSopInfoListApi, getSopBaseInfoApi, getEventListApi, getSopCustomerStatisticsListApi, getSopStaffTaskListApi, getTaskStatusApi, parseEventCountApi, deleteSopEventApi, endSopEventApi, batchEditSopEventApi, insertOrUpdateSopApi, getSopInfoDetailApi, getGroupListApi, getMaterialListApi, getMomentListApi }
......@@ -317,13 +317,13 @@ export default {
console.log(action)
if (action == 'confirm') {
this.isTagVisible = !this.isTagVisible
this.$refs.selectLabel.init({ condLimitObj: this.condLimitObj, tagList: this.tagging, customerInfoList: this.editForm.customerInfoList })
this.$refs.selectLabel.init({ condLimitObj: this.condLimitObj, tagList: this.tagging, customerInfoList: this.editForm.customerInfoList, activeName: 'customer' })
}
}
})
} else {
this.isTagVisible = !this.isTagVisible
this.$refs.selectLabel.init({ condLimitObj: this.condLimitObj, tagList: this.tagging, customerInfoList: this.editForm.customerInfoList })
this.$refs.selectLabel.init({ condLimitObj: this.condLimitObj, tagList: this.tagging, customerInfoList: this.editForm.customerInfoList, activeName: 'customer' })
}
// console.log(this.isTagVisible)
},
......
......@@ -3,7 +3,7 @@
<div class="title">备注:为确保营销渠道正常触达,仅支持选择同条件客户(是否加企微、是否有手机号)</div>
<div class="flex-default">
<div class="customer-list">
<div v-show="selectedLabelList.length != 0" class="tag-box">
<div class="tag-box">
<span class="tag-label">用户标签:</span>
<div class="el-input-tag input-tag-wrapper" @click="handleClickTag">
<span v-for="(tag, idx) in selectedLabelList" :key="idx">
......@@ -39,7 +39,7 @@ export default {
selectedSum: 0,
heightBox: 200,
// 表格
getListApi: this.$apis.sop.getCustomerByTagListApi,
getListApi: this.$apis.sop.getCustomerListApi,
tableParams: {
listName: 'data',
// 行数据的key
......@@ -170,6 +170,7 @@ export default {
})
})
})
this.getListApi = this.selectedLabelList.length ? this.$apis.sop.getCustomerByTagListApi : this.$apis.sop.getCustomerListApi
resolve()
})
},
......@@ -178,7 +179,7 @@ export default {
this.tableList = this.$refs.customerRef.data
this.recoverySelected()
//接收到的数据为空
this.$refs.customerRef.data.length ? (this.$refs.customerRef.tableHeightValues = '') : this.$refs.customerRef.setTableHeightFun()
this.$refs.customerRef.tableHeightValues = ''
},
recoverySelected() {
......@@ -201,12 +202,12 @@ export default {
},
dealCondLimit(val) {
this.condLimitObj.hasQw = val.isJoin
this.condLimitObj.hasPhone = val.customerPhone ? 1 : 0
this.condLimitObj.hasQw = val ? val.isJoin : 0
this.condLimitObj.hasPhone = val ? (val.customerPhone ? 1 : 0) : 0
},
handleClickTag() {
this.$emit('handleChangeTag', { condLimitObj: this.condLimitObj, tagList: this.selectedLabelList, customerInfoList: this.selectedCustomerList })
this.$emit('handleChangeTag', { condLimitObj: this.condLimitObj, tagList: this.selectedLabelList, customerInfoList: this.selectedCustomerList, activeName: 'tag' })
},
handleSelectionTable(val) {
......
......@@ -42,7 +42,7 @@
</div>
</div>
</div>
<select-customer v-if="activeName == 'cutomer'" ref="customerRef" :selectedLabelList="selectedLabelList" :condLimitObj.sync="condLimitObj" :selectedCustomerList.sync="selectedCustomerList" @handleChangeTag="init"></select-customer>
<select-customer v-if="activeName == 'customer'" ref="customerRef" :selectedLabelList="selectedLabelList" :condLimitObj.sync="condLimitObj" :selectedCustomerList.sync="selectedCustomerList" @handleChangeTag="handleChangeTag"></select-customer>
<span slot="footer" class="dialog-footer">
<!-- <a class="dialog-jump" @click="jumpUrl" v-if="this.$globalState.session.accountLevel == 4 && this.$globalState.session.merchantModel == 2">没有意向标签?点我创建</a> -->
<el-button size="small" @click="dialogVisible = false">取 消</el-button>
......@@ -138,13 +138,18 @@ export default {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
handleChangeTag(item) {
this.selectedCustomerList = item.customerInfoList ? JSON.parse(JSON.stringify(item.customerInfoList)) : []
this.condLimitObj = JSON.parse(JSON.stringify(item.condLimitObj))
this.activeName = item.activeName
},
init(item) {
this.labelGroupName = ''
this.dialogVisible = true
this.activeName = 'tag'
this.selectedCustomerList = item.customerInfoList ? JSON.parse(JSON.stringify(item.customerInfoList)) : ''
this.selectedCustomerList = item.customerInfoList ? JSON.parse(JSON.stringify(item.customerInfoList)) : []
this.condLimitObj = JSON.parse(JSON.stringify(item.condLimitObj))
this.querylabeltree(item.tagList)
this.activeName = item.activeName
},
handleSearch() {
this.searchStatus = true
......@@ -265,10 +270,11 @@ export default {
console.log(this.selectedLabelList)
// 标签
if (this.activeName == 'tag') {
this.activeName = 'cutomer'
this.activeName = 'customer'
return false
}
// 客户
this.activeName = 'tag'
this.$emit('tagSelected', { selectedLabelList: this.selectedLabelList, selectedCustomerList: this.$refs.customerRef.selectedCustomerList, condLimitObj: this.$refs.customerRef.condLimitObj })
this.dialogVisible = false
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!