Commit 8d52fa79 by chenwq

新增/编辑sop

1 parent 846871ca
...@@ -94,6 +94,7 @@ const pictureUpload = params => { ...@@ -94,6 +94,7 @@ const pictureUpload = params => {
noSignAttr: ['file'] noSignAttr: ['file']
}) })
} }
const querylabeltree = params => { const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree' params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
// params.sessionId = session // params.sessionId = session
...@@ -104,4 +105,27 @@ const querylabeltree = params => { ...@@ -104,4 +105,27 @@ const querylabeltree = params => {
sign: true sign: true
}) })
} }
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree }
// 人群列表
const getCrowdTreeListApi = params => {
params.method = 'scrm.api.datahub.user.queryCrowdTree'
return http2({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
// 跟进员工类型
const getStaffTypeListApi = params => {
params.method = 'entmicro.api.staff.findStaffByMerchantId'
return http({
url: '/rop-scrm-entmicro/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree, getCrowdTreeListApi, getStaffTypeListApi }
...@@ -53,9 +53,12 @@ ...@@ -53,9 +53,12 @@
<slot :name="item.suffixSlot" :scope="item"></slot> <slot :name="item.suffixSlot" :scope="item"></slot>
</div> </div>
<!-- radio --> <!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange"> <div v-else-if="item.type === 'radio'">
<el-radio-group v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio> <el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group> </el-radio-group>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker> <el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
<template v-else-if="item.type === 'upload'"> <template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p> <p class="photo-top-tips">{{ item.topTips }}</p>
......
<template> <template>
<div> <div>
<base-info v-show="activeName == 'baseInfo'" ref="baseInfoRef" :routeInfo="routeInfo" @handleTabChange="jumpEvent"></base-info> <base-info v-show="activeName == 'baseInfo'" ref="baseInfoRef" :routeInfo="routeInfo" @handleTabChange="jumpEvent"></base-info>
<edit-event v-if="activeName == 'editEvent'" :eventObj="eventObj" :condLimitObj="condLimitObj" @handleTabChange="jumpBaseInfo" @handleInfoConfirm="handleInfoConfirm"></edit-event> <edit-event v-if="activeName == 'editEvent'" :eventObj="eventObj" @handleTabChange="jumpBaseInfo" @handleInfoConfirm="handleInfoConfirm"></edit-event>
</div> </div>
</template> </template>
...@@ -21,11 +21,6 @@ export default { ...@@ -21,11 +21,6 @@ export default {
}, },
// 编辑-标记idx // 编辑-标记idx
eventIndex: '', eventIndex: '',
condLimitObj: {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
},
eventObj: { eventObj: {
addOrEdit: 'add', addOrEdit: 'add',
info: {} info: {}
...@@ -56,8 +51,6 @@ export default { ...@@ -56,8 +51,6 @@ export default {
this.$set(this.eventObj, 'addOrEdit', obj.addOrEdit) this.$set(this.eventObj, 'addOrEdit', obj.addOrEdit)
this.$set(this.eventObj, 'info', obj.info) this.$set(this.eventObj, 'info', obj.info)
this.eventIndex = obj.eventIndex this.eventIndex = obj.eventIndex
this.$set(this.condLimitObj, 'hasPhone', obj.condLimitObj.hasPhone)
this.$set(this.condLimitObj, 'hasQw', obj.condLimitObj.hasQw)
this.activeName = obj.activeName this.activeName = obj.activeName
} }
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div v-if="!scope.scope.isDisabled"> <div v-if="!scope.scope.isDisabled">
<!-- <el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button> <!-- <el-button class="default-blue-btn" :size="size" @click="handleSelectCustomer">选择客户</el-button>
<el-button v-show="editForm.customerInfoList.length" :size="size" @click="handleResetCustomer">重置客户</el-button> --> <el-button v-show="editForm.customerInfoList.length" :size="size" @click="handleResetCustomer">重置客户</el-button> -->
<el-radio-group v-model="editForm[scope.scope.name]"> <el-radio-group v-model="editForm[scope.scope.name]" @change="handleCustTypeChange">
<el-radio v-for="(item, index) in scope.scope.customerRadioList" :key="index" :label="item.confId">{{ item.confName }}</el-radio> <el-radio v-for="(item, index) in scope.scope.customerRadioList" :key="index" :label="item.confId">{{ item.confName }}</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<template v-else> <template v-else>
<el-tag v-for="(subItem, subIdx) in item.list" :key="subIdx" class="customer-tag" :size="size" type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" @close="handleDeleteCustomer(subIdx)"> <el-tag v-for="(subItem, subIdx) in item.list" :key="subIdx" class="customer-tag" :size="size" type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" @close="handleDeleteCustomer(subIdx)">
<!-- <i class="el-icon-user-solid"></i> --> <!-- <i class="el-icon-user-solid"></i> -->
<span>{{ subItem.customerName }}</span> <span>{{ subItem[item.listConf.confName] }}</span>
</el-tag> </el-tag>
</template> </template>
</div> </div>
...@@ -100,12 +100,14 @@ ...@@ -100,12 +100,14 @@
</div> </div>
<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>
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import selectCustomer from './components/selectCustomer' import selectCustomer from './components/selectCustomer'
import selectCrowd from './components/selectCrowd'
export default { export default {
name: 'baseInfo', name: 'baseInfo',
data() { data() {
...@@ -132,20 +134,25 @@ export default { ...@@ -132,20 +134,25 @@ export default {
hasPhone: -1, hasPhone: -1,
hasQw: -1 hasQw: -1
}, },
condLimitObj: { // condLimitObj: {
// 1-有;0-无 // // 1-有;0-无
hasPhone: 0, // hasPhone: 0,
hasQw: 0 // hasQw: 0
}, // },
// 标签弹窗 // 标签弹窗
isTagVisible: false, isTagVisible: false,
isAppointCustVisible: false, isAppointCustVisible: false,
isCrowdCustVisible: false,
// tagging: [], // tagging: [],
currentCustomerIdx: -1, currentCustomerIdx: -1,
customerDataList: [ customerDataList: [
{ {
confId: 1, confId: 1,
confName: '人群', confName: '人群',
listConf: {
confId: 'crowdId',
confName: 'crowdName'
},
list: [] list: []
}, },
{ {
...@@ -156,6 +163,10 @@ export default { ...@@ -156,6 +163,10 @@ export default {
{ {
confId: 3, confId: 3,
confName: '指定', confName: '指定',
listConf: {
confId: 'id',
confName: 'customerName'
},
list: [] list: []
} }
], ],
...@@ -165,16 +176,16 @@ export default { ...@@ -165,16 +176,16 @@ export default {
startDate: '', startDate: '',
endDate: '', endDate: '',
// tagging: [], // tagging: [],
customerFlag: '', customerOptType: '',
customerInfoList: [], customerInfoList: [],
customerIds: [], customerIds: [],
isUpdateCustomer: '2', customerOptUpdate: '2',
eventList: [] eventList: []
}, },
editRule: { editRule: {
sopName: [{ required: true, message: '请输入SOP名称', trigger: 'change' }], sopName: [{ required: true, message: '请输入SOP名称', trigger: 'change' }],
isUpdateCustomer: [{ required: true, message: '请选择更新人群', trigger: 'change' }], customerOptUpdate: [{ required: true, message: '请选择更新人群', trigger: 'change' }],
customerFlag: [{ required: true, message: '请选择有效对象', trigger: 'change' }], customerOptType: [{ required: true, message: '请选择有效对象', trigger: 'change' }],
customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }] customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }]
}, },
isEdit: true, isEdit: true,
...@@ -194,7 +205,7 @@ export default { ...@@ -194,7 +205,7 @@ export default {
{ {
label: '营销对象', label: '营销对象',
// name: 'customerInfoList', // name: 'customerInfoList',
name: 'customerFlag', name: 'customerOptType',
addHtml: 'customerInfoList', addHtml: 'customerInfoList',
customerRadioList: [ customerRadioList: [
{ {
...@@ -214,7 +225,7 @@ export default { ...@@ -214,7 +225,7 @@ export default {
}, },
{ {
label: '更新人群', label: '更新人群',
name: 'isUpdateCustomer', name: 'customerOptUpdate',
tips: '选择自动更新,每次营销事件执行时会按客户条件重新更新营销对象;选择从不更新,以当前客户条件匹配的客户作为固定的营销对象', tips: '选择自动更新,每次营销事件执行时会按客户条件重新更新营销对象;选择从不更新,以当前客户条件匹配的客户作为固定的营销对象',
type: 'radio', type: 'radio',
optionId: 'confId', optionId: 'confId',
...@@ -266,7 +277,8 @@ export default { ...@@ -266,7 +277,8 @@ export default {
}, },
components: { components: {
selectCustomer selectCustomer,
selectCrowd
}, },
watch: { watch: {
...@@ -367,6 +379,9 @@ export default { ...@@ -367,6 +379,9 @@ export default {
handleDialogConfirm(obj) { handleDialogConfirm(obj) {
console.log(obj) console.log(obj)
switch (this.currentCustomerIdx) { switch (this.currentCustomerIdx) {
case 0:
this.handleCrowdCustClose()
break
case 2: case 2:
this.handleAppointCustClose() this.handleAppointCustClose()
break break
...@@ -376,6 +391,16 @@ export default { ...@@ -376,6 +391,16 @@ export default {
this.key = new Date() this.key = new Date()
}, },
// 营销对象类型
handleCustTypeChange(val) {
this.currentCustomerIdx = val
this.changeCustomer()
},
handleCrowdCustClose() {
this.isCrowdCustVisible = !this.isCrowdCustVisible
},
handleAppointCustClose() { handleAppointCustClose() {
this.isAppointCustVisible = !this.isAppointCustVisible this.isAppointCustVisible = !this.isAppointCustVisible
}, },
...@@ -385,6 +410,7 @@ export default { ...@@ -385,6 +410,7 @@ export default {
// 0-人群;1-标签;2-指定客户 // 0-人群;1-标签;2-指定客户
switch (idx) { switch (idx) {
case 0: case 0:
this.handleCrowdCustClose()
break break
case 1: case 1:
this.isTagVisible = !this.isTagVisible this.isTagVisible = !this.isTagVisible
...@@ -398,21 +424,21 @@ export default { ...@@ -398,21 +424,21 @@ export default {
handleResetCustomer() { handleResetCustomer() {
if (this.editForm.eventList.length) { if (this.editForm.eventList.length) {
this.$confirm('重置客户将清空当前已选客户。是否确定重置?', '提示', { this.$confirm('重置将清空当前已选营销对象。是否确定重置?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
callback: action => { callback: action => {
if (action == 'confirm') { if (action == 'confirm') {
this.editForm.customerInfoList = [] this.customerDataList[this.currentCustomerIdx].list = []
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') this.changeCustomer()
this.editForm.eventList = [] this.editForm.eventList = []
} }
} }
}) })
} else { } else {
this.editForm.customerInfoList = [] this.customerDataList[this.currentCustomerIdx].list = []
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') this.changeCustomer()
} }
}, },
...@@ -483,7 +509,8 @@ export default { ...@@ -483,7 +509,8 @@ export default {
}, },
handleEventEdit(addOrEdit, row, idx) { handleEventEdit(addOrEdit, row, idx) {
this.$emit('handleTabChange', { activeName: 'editEvent', addOrEdit: addOrEdit, eventIndex: addOrEdit == 'add' ? '-1' : idx, condLimitObj: this.condLimitObj, info: { ...row, sopName: this.editForm.sopName } }) // this.$emit('handleTabChange', { activeName: 'editEvent', addOrEdit: addOrEdit, eventIndex: addOrEdit == 'add' ? '-1' : idx, condLimitObj: this.condLimitObj, info: { ...row, sopName: this.editForm.sopName } })
this.$emit('handleTabChange', { activeName: 'editEvent', addOrEdit: addOrEdit, eventIndex: addOrEdit == 'add' ? '-1' : idx, info: { ...row, sopName: this.editForm.sopName } })
}, },
handleConfirm() { handleConfirm() {
......
<template>
<div class="select-crowd">
<el-dialog title="选择人群" :visible="dialogVisible" width="1080px" :before-close="handleClose" :close-on-click-modal="false">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="primary" @click="getList">查询</el-button>
</span>
</glsx-combi-form>
<GLTable ref="crowdRef" :pageConf="pageConf" :noDataImg="url" :tableData="crowdList" :tableTotal="total" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'selectCrowd',
data() {
return {
url: url,
searchForm: {
req: {
crowdType: 2
}
},
total: 0,
crowdList: [],
heightBox: 200,
// 搜索
searchFormData: [
{
label: '关键字',
name: 'keyword',
type: 'input',
placeholder: '请输入人群名称'
}
],
// 表格
// getListApi: this.$apis.common.getCrowdTreeListApi,
tableParams: {
listName: 'crowdUnitList',
// 行数据的key
mutiSelectUniqueKey: 'crowdId',
checkSelectKey: 'crowdId',
checkSelectVal: [],
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '人群名称',
prop: 'crowdName',
formatter: cellValue => {
return cellValue.crowdName || '-'
}
},
{
label: '人群描述',
prop: 'crowdDesc',
formatter: cellValue => {
return cellValue.crowdDesc || '-'
}
},
{
label: '预估人数',
prop: 'total',
width: '160px'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
baseData: {}
}
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
selectedLabelList: {
type: Array,
default: () => []
},
selectedCustomerList: {
type: Array,
default: () => []
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
this.getList()
},
methods: {
getList() {
var params = {
req: {
...this.searchForm,
pageNum: this.$refs.crowdRef ? this.$refs.crowdRef.page.pageNum : 1,
pageSize: this.$refs.crowdRef ? this.$refs.crowdRef.page.pageSize : 10
}
}
this.$apis.common.getCrowdTreeListApi(params).then(res => {
this.crowdList = res.crowdUnitList
this.total = res.total
this.recoverySelected()
this.$refs.crowdRef.tableHeightValues = '460px'
})
},
// setTableFinishFun() {
// this.crowdList = this.$refs.crowdRef.data
// this.recoverySelected()
// //接收到的数据为空
// // this.$refs.crowdRef.tableHeightValues = this.$refs.crowdRef.data.length ? '' : '400px'
// this.$refs.crowdRef.tableHeightValues = '460px'
// },
recoverySelected() {
this.$nextTick(() => {
this.selectedCustomerList.forEach(row => {
var idx = this.crowdList.findIndex(k => k.crowdId == row.crowdId)
if (idx != -1) {
this.$refs.crowdRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.crowdList[idx], true)
}
})
})
},
handleSelectionTable(val) {
// 未选客户时,筛选客户条件
// if (!this.selectedCustomerList.length) {
// this.dealCondLimit(val[0])
// }
let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList))
let tableIds = this.crowdList.map(item => item.crowdId)
this.selectedCustomerList = JSON.parse(JSON.stringify(val))
var selectIds = this.selectedCustomerList.map(item => item.crowdId)
currentList.forEach(item => {
if (!selectIds.includes(item.crowdId) && !tableIds.includes(item.crowdId)) {
this.selectedCustomerList.push(item)
}
})
this.recoverySelected()
},
handleClose() {
this.$emit('handleCrowdCustClose')
},
handleConfirm() {
this.$emit('handleCrowdCustConfirm', this.selectedCustomerList)
}
}
}
</script>
<style lang="scss" scoped>
.select-crowd {
.title {
margin-bottom: 12px;
}
.customer-tag-box {
display: flex;
margin: 20px 16px;
.tag-label {
display: inline-block;
height: 30px;
line-height: 30px;
}
.input-tag-wrapper {
max-height: 75px;
overflow: auto;
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 5px;
flex-wrap: wrap;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 648px;
display: flex;
align-items: center;
cursor: pointer;
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
}
// .customer-list {
// width: calc(100% - 280px);
// margin-right: 10px;
// }
.p-16 {
padding: 16px;
}
}
</style>
<template> <template>
<div class="select-cutomer"> <div class="select-cutomer">
<div class="title">备注:为确保营销渠道正常触达,仅支持选择同条件客户(是否加企微、是否有手机号)</div> <el-dialog title="选择客户" :visible="dialogVisible" width="1080px" :before-close="handleClose" :close-on-click-modal="false">
<!-- <div class="title">备注:为确保营销渠道正常触达,仅支持选择同条件客户(是否加企微、是否有手机号)</div> -->
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<div class="flex-default"> <div class="flex-default">
<div class="customer-list"> <div class="customer-list">
<div class="customer-tag-box"> <!-- <div class="customer-tag-box">
<span class="tag-label">用户标签:</span> <span class="tag-label">用户标签:</span>
<div class="el-input-tag input-tag-wrapper" @click="handleClickTag"> <div class="el-input-tag input-tag-wrapper" @click="handleClickTag">
<span v-if="!selectedLabelList.length" style="color: #BFBFBF;">请选择标签筛选客户</span> <span v-if="!selectedLabelList.length" style="color: #BFBFBF;">请选择标签筛选客户</span>
...@@ -11,8 +17,9 @@ ...@@ -11,8 +17,9 @@
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" :disable-transitions="false">{{ tagItem.name }}</el-tag> <el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" :disable-transitions="false">{{ tagItem.name }}</el-tag>
</span> </span>
</div> </div>
</div> </div> -->
<GLTable ref="customerRef" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @selectionTable="handleSelectionTable"></GLTable> <p class="list-title p-16">客户列表(最多仅可选200个客户)</p>
<GLTable ref="customerRef" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" @setTableFinishFun="setTableFinishFun" @selectionTable="handleSelectionTable"></GLTable>
</div> </div>
<div class="selected-list"> <div class="selected-list">
<p class="list-title p-16">已选({{ Array.isArray(selectedCustomerList) ? selectedCustomerList.length : 0 }})</p> <p class="list-title p-16">已选({{ Array.isArray(selectedCustomerList) ? selectedCustomerList.length : 0 }})</p>
...@@ -24,6 +31,12 @@ ...@@ -24,6 +31,12 @@
</div> </div>
</div> </div>
</div> </div>
<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="handleClose">取 消</el-button>
<el-button size="small" type="primary" @click="handleConfirm">确 定</el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
...@@ -38,6 +51,15 @@ export default { ...@@ -38,6 +51,15 @@ export default {
searchForm: {}, searchForm: {},
customerList: [], customerList: [],
heightBox: 200, heightBox: 200,
// 搜索
searchFormData: [
{
label: '关键字',
name: 'keyword',
type: 'input',
placeholder: '请输入客户名称/手机号'
}
],
// 表格 // 表格
getListApi: this.$apis.sop.getCustomerListApi, getListApi: this.$apis.sop.getCustomerListApi,
tableParams: { tableParams: {
...@@ -119,6 +141,10 @@ export default { ...@@ -119,6 +141,10 @@ export default {
}, },
props: { props: {
dialogVisible: {
type: Boolean,
default: false
},
selectedLabelList: { selectedLabelList: {
type: Array, type: Array,
default: () => [] default: () => []
...@@ -126,47 +152,51 @@ export default { ...@@ -126,47 +152,51 @@ export default {
selectedCustomerList: { selectedCustomerList: {
type: Array, type: Array,
default: () => [] default: () => []
},
condLimitObj: {
type: Object,
default: () => {
return {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
}
}
} }
// condLimitObj: {
// type: Object,
// default: () => {
// return {
// // 1-有;0-无
// hasPhone: 0,
// hasQw: 0
// }
// }
// }
}, },
mounted() { mounted() {
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350 this.heightBox = clientHeight - 0.15 * clientHeight - 425
}, },
methods: { methods: {
beforeSearchFn() { // beforeSearchFn() {
return new Promise(resolve => { // return new Promise(resolve => {
this.searchForm = { // this.searchForm = {
combineType: 2, // combineType: 2,
tagLists: [] // tagLists: []
} // }
this.selectedLabelList.length && // this.selectedLabelList.length &&
this.selectedLabelList.forEach(item => { // this.selectedLabelList.forEach(item => {
item.labelList.length && // item.labelList.length &&
item.labelList.forEach(subItem => { // item.labelList.forEach(subItem => {
this.searchForm.tagLists.push({ // this.searchForm.tagLists.push({
groupId: item.labelGroup.id, // groupId: item.labelGroup.id,
groupName: item.labelGroup.name, // groupName: item.labelGroup.name,
groupType: item.labelType, // groupType: item.labelType,
labelId: subItem.id, // labelId: subItem.id,
labelName: subItem.name // labelName: subItem.name
}) // })
}) // })
}) // })
this.getListApi = this.selectedLabelList.length ? this.$apis.sop.getCustomerByTagListApi : this.$apis.sop.getCustomerListApi // this.getListApi = this.selectedLabelList.length ? this.$apis.sop.getCustomerByTagListApi : this.$apis.sop.getCustomerListApi
resolve() // resolve()
}) // })
// },
handleSearch() {
this.$refs.customerRef.refreshTable()
}, },
setTableFinishFun() { setTableFinishFun() {
...@@ -185,32 +215,44 @@ export default { ...@@ -185,32 +215,44 @@ export default {
} }
}) })
// 找到不符合条件的,变为不可选 // 找到不符合条件的,变为不可选
this.tableParams.checkSelectVal = [] // this.tableParams.checkSelectVal = []
if (this.selectedCustomerList.length) { // if (this.selectedCustomerList.length) {
// this.tableList.forEach((row, idx) => {
// if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) {
// this.tableParams.checkSelectVal.push(row.id)
// this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
// }
// })
// }
if (this.selectedCustomerList.length >= 5) {
let tableIds = this.selectedCustomerList.map(item => item.id)
console.log(tableIds)
this.tableList.forEach((row, idx) => { this.tableList.forEach((row, idx) => {
if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) { if (!tableIds.includes(row.id)) {
this.tableParams.checkSelectVal.push(row.id) this.tableParams.checkSelectVal.push(row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false) this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
} }
}) })
} else {
this.tableParams.checkSelectVal = []
} }
}) })
}, },
dealCondLimit(val) { // dealCondLimit(val) {
this.condLimitObj.hasQw = val ? val.isJoin : 0 // this.condLimitObj.hasQw = val ? val.isJoin : 0
this.condLimitObj.hasPhone = val ? (val.customerPhone ? 1 : 0) : 0 // this.condLimitObj.hasPhone = val ? (val.customerPhone ? 1 : 0) : 0
}, // },
handleClickTag() { // handleClickTag() {
this.$emit('handleChangeTag', { condLimitObj: this.condLimitObj, tagList: this.selectedLabelList, customerInfoList: this.selectedCustomerList, activeName: 'tag' }) // this.$emit('handleChangeTag', { condLimitObj: this.condLimitObj, tagList: this.selectedLabelList, customerInfoList: this.selectedCustomerList, activeName: 'tag' })
}, // },
handleSelectionTable(val) { handleSelectionTable(val) {
// 未选客户时,筛选客户条件 // 未选客户时,筛选客户条件
if (!this.selectedCustomerList.length) { // if (!this.selectedCustomerList.length) {
this.dealCondLimit(val[0]) // this.dealCondLimit(val[0])
} // }
let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList)) let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList))
let tableIds = this.tableList.map(item => item.id) let tableIds = this.tableList.map(item => item.id)
this.selectedCustomerList = JSON.parse(JSON.stringify(val)) this.selectedCustomerList = JSON.parse(JSON.stringify(val))
...@@ -221,6 +263,13 @@ export default { ...@@ -221,6 +263,13 @@ export default {
} }
}) })
this.recoverySelected() this.recoverySelected()
},
handleClose() {
this.$emit('handleAppointCustClose')
},
handleConfirm() {
this.$emit('handleAppointCustConfirm', this.selectedCustomerList)
} }
} }
} }
...@@ -268,7 +317,7 @@ export default { ...@@ -268,7 +317,7 @@ export default {
} }
.customer-list { .customer-list {
width: calc(100% - 280px); width: calc(100% - 280px);
border: 1px solid #eeeeee; // border: 1px solid #eeeeee;
margin-right: 10px; margin-right: 10px;
} }
.p-16 { .p-16 {
...@@ -277,7 +326,7 @@ export default { ...@@ -277,7 +326,7 @@ export default {
.selected-list { .selected-list {
width: 280px; width: 280px;
border-radius: 2px; border-radius: 2px;
border: 1px solid #eeeeee; // border: 1px solid #eeeeee;
i { i {
color: #75acff; color: #75acff;
margin-right: 3px; margin-right: 3px;
...@@ -290,6 +339,7 @@ export default { ...@@ -290,6 +339,7 @@ export default {
.list-customers { .list-customers {
// box-sizing: border-box; // box-sizing: border-box;
// height: 61vh; // height: 61vh;
border: 1px solid #eeeeee;
padding: 10px; padding: 10px;
overflow-y: scroll; overflow-y: scroll;
.customer-tag { .customer-tag {
......
...@@ -76,7 +76,21 @@ ...@@ -76,7 +76,21 @@
<!-- 营销渠道 --> <!-- 营销渠道 -->
<div class="container edit-container"> <div class="container edit-container">
<p class="edit-title">营销渠道</p> <p class="edit-title">营销渠道</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefChannel" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataChannel" :formRules="editRule"></glsx-combi-form> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefChannel" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataChannel" :formRules="editRule">
<div slot="channelSuffix" class="edit-tips m-t-8">预估受众用户总数:100/500</div>
<template slot="reachesType" slot-scope="scope">
<el-radio-group v-model="editForm[scope.scope.name]">
<el-radio v-for="(item, index) in scope.scope.optionList" :key="index" :label="item[scope.scope.optionId]">{{ item[scope.scope.optionLabel] }}</el-radio>
</el-radio-group>
<span class="m-l-20" v-if="editForm[scope.scope.name] == 2" id="reachesTypeSet">
同一用户最多参与
<el-form-item prop="reachesTypeSet">
<el-input v-model="editForm.reachesTypeSet"></el-input>
</el-form-item>
次
</span>
</template>
</glsx-combi-form>
</div> </div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button> <el-button type="primary" @click="handleConfirm">确定</el-button>
...@@ -118,7 +132,10 @@ export default { ...@@ -118,7 +132,10 @@ export default {
// 营销内容 // 营销内容
eventContent: '', eventContent: '',
eventCount: '', eventCount: '',
object: {} object: {},
//营销渠道
reachesType: '',
reachesTypeSet: ''
}, },
// 营销内容 // 营销内容
previewList: [], previewList: [],
...@@ -155,7 +172,10 @@ export default { ...@@ -155,7 +172,10 @@ export default {
eventEndDate: [{ required: true, message: '请选择营销结束日期', trigger: 'change' }], eventEndDate: [{ required: true, message: '请选择营销结束日期', trigger: 'change' }],
eventContent: [{ required: true, message: '请输入营销内容', trigger: 'change' }], eventContent: [{ required: true, message: '请输入营销内容', trigger: 'change' }],
repeatFlag: [{ required: true, message: '请选择是否重复', trigger: 'change' }], repeatFlag: [{ required: true, message: '请选择是否重复', trigger: 'change' }],
pushChannelType: [{ required: true, message: '请选择营销渠道', trigger: 'change' }] pushChannelType: [{ required: true, message: '请选择营销渠道', trigger: 'change' }],
// followerTypeId: [{ required: true, message: '请选择跟进员工类型', trigger: 'change' }],
reachesType: [{ required: true, message: '请选择参与次数', trigger: 'change' }],
reachesTypeSet: [{ required: true, message: '请输入参与次数', trigger: 'change' }]
}, },
isEdit: true, isEdit: true,
sopNameFormData: [ sopNameFormData: [
...@@ -292,7 +312,9 @@ export default { ...@@ -292,7 +312,9 @@ export default {
{ {
label: '营销渠道', label: '营销渠道',
name: 'pushChannelType', name: 'pushChannelType',
tips: '企业微信和微信朋友圈会自动给客户的跟进专员派发群发任务;短信会自动推送至客户手机。',
type: 'radio', type: 'radio',
suffixSlot: 'channelSuffix',
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionList: [ optionList: [
...@@ -312,11 +334,46 @@ export default { ...@@ -312,11 +334,46 @@ export default {
isDisabled: false isDisabled: false
} }
] ]
},
{
label: '跟进员工类型',
name: 'followerTypeId',
tips: '系统优先按照跟进员工类型匹配营销对象的跟进员工',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'staffName',
optionsName: 'staffTypeList'
},
{
label: '参与次数',
name: 'reachesType',
addHtml: 'reachesType',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
// {
// confId: 3,
// confName: '不限制',
// isDisabled: false
// },
{
confId: 1,
confName: '单次',
isDisabled: false
},
{
confId: 2,
confName: '多次',
isDisabled: false
}
]
} }
], ],
baseData: { baseData: {
weekList: [], weekList: [],
monthList: [] monthList: [],
staffTypeList: []
} }
} }
}, },
...@@ -331,17 +388,17 @@ export default { ...@@ -331,17 +388,17 @@ export default {
info: {} info: {}
} }
} }
},
condLimitObj: {
type: Object,
default: () => {
return {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
}
}
} }
// condLimitObj: {
// type: Object,
// default: () => {
// return {
// // 1-有;0-无
// hasPhone: 0,
// hasQw: 0
// }
// }
// }
}, },
components: { components: {
...@@ -356,27 +413,28 @@ export default { ...@@ -356,27 +413,28 @@ export default {
this.editStatus = true this.editStatus = true
}, },
deep: true deep: true
},
'editForm.object.additionalType'(val) {
var idx = this.editFormDataChannel.findIndex(item => item.name == 'pushChannelType')
this.editFormDataChannel[idx].optionList[0].isDisabled = val == '4' || !this.condLimitObj.hasQw
this.editFormDataChannel[idx].optionList[1].isDisabled = val == '4' || !this.condLimitObj.hasPhone
if (this.condLimitObj.hasQw) {
this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val)
}
} }
// 'editForm.object.additionalType'(val) {
// var idx = this.editFormDataChannel.findIndex(item => item.name == 'pushChannelType')
// this.editFormDataChannel[idx].optionList[0].isDisabled = val == '4' || !this.condLimitObj.hasQw
// this.editFormDataChannel[idx].optionList[1].isDisabled = val == '4' || !this.condLimitObj.hasPhone
// if (this.condLimitObj.hasQw) {
// this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val)
// }
// }
}, },
created() { created() {
this.getDay('weekList', 7) this.getDay('weekList', 7)
this.getDay('monthList', 31) this.getDay('monthList', 31)
this.limitQwPhone() // this.limitQwPhone()
}, },
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
Object.assign(this.editForm, this.eventObj.info) Object.assign(this.editForm, this.eventObj.info)
this.getStaffTypeList()
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
...@@ -384,16 +442,23 @@ export default { ...@@ -384,16 +442,23 @@ export default {
}, },
methods: { methods: {
limitQwPhone() { // limitQwPhone() {
// 有企微 - 企业微信、微信朋友圈 // // 有企微 - 企业微信、微信朋友圈
// 有手机号 - 短信 // // 有手机号 - 短信
var channelIdx = this.editFormDataChannel.findIndex(item => item.name == 'pushChannelType') // var channelIdx = this.editFormDataChannel.findIndex(item => item.name == 'pushChannelType')
// 企微 // // 企微
this.editFormDataChannel[channelIdx].optionList[0].isDisabled = !this.condLimitObj.hasQw // this.editFormDataChannel[channelIdx].optionList[0].isDisabled = !this.condLimitObj.hasQw
// 短信 // // 短信
this.editFormDataChannel[channelIdx].optionList[1].isDisabled = !this.condLimitObj.hasPhone // this.editFormDataChannel[channelIdx].optionList[1].isDisabled = !this.condLimitObj.hasPhone
// 微信朋友圈 // // 微信朋友圈
this.editFormDataChannel[channelIdx].optionList[2].isDisabled = !this.condLimitObj.hasQw // this.editFormDataChannel[channelIdx].optionList[2].isDisabled = !this.condLimitObj.hasQw
// },
getStaffTypeList() {
this.$apis.common.getStaffTypeListApi({}).then(res => {
console.log(res)
this.baseData.staffTypeList = res
})
}, },
getDay(attrName, day) { getDay(attrName, day) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!