Commit 8d52fa79 by chenwq

新增/编辑sop

1 parent 846871ca
......@@ -94,6 +94,7 @@ const pictureUpload = params => {
noSignAttr: ['file']
})
}
const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
// params.sessionId = session
......@@ -104,4 +105,27 @@ const querylabeltree = params => {
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 @@
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- 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">
<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>
<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-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>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
......
<template>
<div>
<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>
</template>
......@@ -21,11 +21,6 @@ export default {
},
// 编辑-标记idx
eventIndex: '',
condLimitObj: {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
},
eventObj: {
addOrEdit: 'add',
info: {}
......@@ -56,8 +51,6 @@ export default {
this.$set(this.eventObj, 'addOrEdit', obj.addOrEdit)
this.$set(this.eventObj, 'info', obj.info)
this.eventIndex = obj.eventIndex
this.$set(this.condLimitObj, 'hasPhone', obj.condLimitObj.hasPhone)
this.$set(this.condLimitObj, 'hasQw', obj.condLimitObj.hasQw)
this.activeName = obj.activeName
}
}
......
......@@ -12,7 +12,7 @@
<div v-if="!scope.scope.isDisabled">
<!-- <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-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-group>
</div>
......@@ -35,7 +35,7 @@
<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)">
<!-- <i class="el-icon-user-solid"></i> -->
<span>{{ subItem.customerName }}</span>
<span>{{ subItem[item.listConf.confName] }}</span>
</el-tag>
</template>
</div>
......@@ -100,12 +100,14 @@
</div>
<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-Crowd v-if="isCrowdCustVisible" :dialogVisible="isCrowdCustVisible" :selectedCustomerList="customerDataList[0].list" @handleCrowdCustClose="handleCrowdCustClose" @handleCrowdCustConfirm="handleDialogConfirm"></select-Crowd>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import selectCustomer from './components/selectCustomer'
import selectCrowd from './components/selectCrowd'
export default {
name: 'baseInfo',
data() {
......@@ -132,20 +134,25 @@ export default {
hasPhone: -1,
hasQw: -1
},
condLimitObj: {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
},
// condLimitObj: {
// // 1-有;0-无
// hasPhone: 0,
// hasQw: 0
// },
// 标签弹窗
isTagVisible: false,
isAppointCustVisible: false,
isCrowdCustVisible: false,
// tagging: [],
currentCustomerIdx: -1,
customerDataList: [
{
confId: 1,
confName: '人群',
listConf: {
confId: 'crowdId',
confName: 'crowdName'
},
list: []
},
{
......@@ -156,6 +163,10 @@ export default {
{
confId: 3,
confName: '指定',
listConf: {
confId: 'id',
confName: 'customerName'
},
list: []
}
],
......@@ -165,16 +176,16 @@ export default {
startDate: '',
endDate: '',
// tagging: [],
customerFlag: '',
customerOptType: '',
customerInfoList: [],
customerIds: [],
isUpdateCustomer: '2',
customerOptUpdate: '2',
eventList: []
},
editRule: {
sopName: [{ required: true, message: '请输入SOP名称', trigger: 'change' }],
isUpdateCustomer: [{ required: true, message: '请选择更新人群', trigger: 'change' }],
customerFlag: [{ required: true, message: '请选择有效对象', trigger: 'change' }],
customerOptUpdate: [{ required: true, message: '请选择更新人群', trigger: 'change' }],
customerOptType: [{ required: true, message: '请选择有效对象', trigger: 'change' }],
customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }]
},
isEdit: true,
......@@ -194,7 +205,7 @@ export default {
{
label: '营销对象',
// name: 'customerInfoList',
name: 'customerFlag',
name: 'customerOptType',
addHtml: 'customerInfoList',
customerRadioList: [
{
......@@ -214,7 +225,7 @@ export default {
},
{
label: '更新人群',
name: 'isUpdateCustomer',
name: 'customerOptUpdate',
tips: '选择自动更新,每次营销事件执行时会按客户条件重新更新营销对象;选择从不更新,以当前客户条件匹配的客户作为固定的营销对象',
type: 'radio',
optionId: 'confId',
......@@ -266,7 +277,8 @@ export default {
},
components: {
selectCustomer
selectCustomer,
selectCrowd
},
watch: {
......@@ -367,6 +379,9 @@ export default {
handleDialogConfirm(obj) {
console.log(obj)
switch (this.currentCustomerIdx) {
case 0:
this.handleCrowdCustClose()
break
case 2:
this.handleAppointCustClose()
break
......@@ -376,6 +391,16 @@ export default {
this.key = new Date()
},
// 营销对象类型
handleCustTypeChange(val) {
this.currentCustomerIdx = val
this.changeCustomer()
},
handleCrowdCustClose() {
this.isCrowdCustVisible = !this.isCrowdCustVisible
},
handleAppointCustClose() {
this.isAppointCustVisible = !this.isAppointCustVisible
},
......@@ -385,6 +410,7 @@ export default {
// 0-人群;1-标签;2-指定客户
switch (idx) {
case 0:
this.handleCrowdCustClose()
break
case 1:
this.isTagVisible = !this.isTagVisible
......@@ -398,21 +424,21 @@ export default {
handleResetCustomer() {
if (this.editForm.eventList.length) {
this.$confirm('重置客户将清空当前已选客户。是否确定重置?', '提示', {
this.$confirm('重置将清空当前已选营销对象。是否确定重置?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.editForm.customerInfoList = []
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
this.customerDataList[this.currentCustomerIdx].list = []
this.changeCustomer()
this.editForm.eventList = []
}
}
})
} else {
this.editForm.customerInfoList = []
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
this.customerDataList[this.currentCustomerIdx].list = []
this.changeCustomer()
}
},
......@@ -483,7 +509,8 @@ export default {
},
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() {
......
<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>
<div class="select-cutomer">
<div class="title">备注:为确保营销渠道正常触达,仅支持选择同条件客户(是否加企微、是否有手机号)</div>
<div class="flex-default">
<div class="customer-list">
<div class="customer-tag-box">
<span class="tag-label">用户标签:</span>
<div class="el-input-tag input-tag-wrapper" @click="handleClickTag">
<span v-if="!selectedLabelList.length" style="color: #BFBFBF;">请选择标签筛选客户</span>
<span v-for="(tag, idx) in selectedLabelList" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" :disable-transitions="false">{{ tagItem.name }}</el-tag>
</span>
</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="customer-list">
<!-- <div class="customer-tag-box">
<span class="tag-label">用户标签:</span>
<div class="el-input-tag input-tag-wrapper" @click="handleClickTag">
<span v-if="!selectedLabelList.length" style="color: #BFBFBF;">请选择标签筛选客户</span>
<span v-for="(tag, idx) in selectedLabelList" :key="idx">
<el-tag v-for="(tagItem, idx1) in tag.labelList" :key="idx1" :size="size" type="info" :disable-transitions="false">{{ tagItem.name }}</el-tag>
</span>
</div>
</div> -->
<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>
<GLTable ref="customerRef" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun" @selectionTable="handleSelectionTable"></GLTable>
</div>
<div class="selected-list">
<p class="list-title p-16">已选({{ Array.isArray(selectedCustomerList) ? selectedCustomerList.length : 0 }})</p>
<div class="list-customers" :style="{ height: heightBox + 'px' }">
<el-tag class="customer-tag" v-for="(item, idx) in selectedCustomerList" :key="idx" :size="size" type="info" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
{{ item.customerName }}
</el-tag>
<div class="selected-list">
<p class="list-title p-16">已选({{ Array.isArray(selectedCustomerList) ? selectedCustomerList.length : 0 }})</p>
<div class="list-customers" :style="{ height: heightBox + 'px' }">
<el-tag class="customer-tag" v-for="(item, idx) in selectedCustomerList" :key="idx" :size="size" type="info" :disable-transitions="false">
<i class="el-icon-user-solid"></i>
{{ item.customerName }}
</el-tag>
</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>
</template>
......@@ -38,6 +51,15 @@ export default {
searchForm: {},
customerList: [],
heightBox: 200,
// 搜索
searchFormData: [
{
label: '关键字',
name: 'keyword',
type: 'input',
placeholder: '请输入客户名称/手机号'
}
],
// 表格
getListApi: this.$apis.sop.getCustomerListApi,
tableParams: {
......@@ -119,6 +141,10 @@ export default {
},
props: {
dialogVisible: {
type: Boolean,
default: false
},
selectedLabelList: {
type: Array,
default: () => []
......@@ -126,47 +152,51 @@ export default {
selectedCustomerList: {
type: Array,
default: () => []
},
condLimitObj: {
type: Object,
default: () => {
return {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
}
}
}
// condLimitObj: {
// type: Object,
// default: () => {
// return {
// // 1-有;0-无
// hasPhone: 0,
// hasQw: 0
// }
// }
// }
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
this.heightBox = clientHeight - 0.15 * clientHeight - 425
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm = {
combineType: 2,
tagLists: []
}
this.selectedLabelList.length &&
this.selectedLabelList.forEach(item => {
item.labelList.length &&
item.labelList.forEach(subItem => {
this.searchForm.tagLists.push({
groupId: item.labelGroup.id,
groupName: item.labelGroup.name,
groupType: item.labelType,
labelId: subItem.id,
labelName: subItem.name
})
})
})
this.getListApi = this.selectedLabelList.length ? this.$apis.sop.getCustomerByTagListApi : this.$apis.sop.getCustomerListApi
resolve()
})
// beforeSearchFn() {
// return new Promise(resolve => {
// this.searchForm = {
// combineType: 2,
// tagLists: []
// }
// this.selectedLabelList.length &&
// this.selectedLabelList.forEach(item => {
// item.labelList.length &&
// item.labelList.forEach(subItem => {
// this.searchForm.tagLists.push({
// groupId: item.labelGroup.id,
// groupName: item.labelGroup.name,
// groupType: item.labelType,
// labelId: subItem.id,
// labelName: subItem.name
// })
// })
// })
// this.getListApi = this.selectedLabelList.length ? this.$apis.sop.getCustomerByTagListApi : this.$apis.sop.getCustomerListApi
// resolve()
// })
// },
handleSearch() {
this.$refs.customerRef.refreshTable()
},
setTableFinishFun() {
......@@ -185,32 +215,44 @@ export default {
}
})
// 找到不符合条件的,变为不可选
this.tableParams.checkSelectVal = []
if (this.selectedCustomerList.length) {
// this.tableParams.checkSelectVal = []
// 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) => {
if (row.isJoin != this.condLimitObj.hasQw || !!row.customerPhone != this.condLimitObj.hasPhone) {
if (!tableIds.includes(row.id)) {
this.tableParams.checkSelectVal.push(row.id)
this.$refs.customerRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.tableList[idx], false)
}
})
} else {
this.tableParams.checkSelectVal = []
}
})
},
dealCondLimit(val) {
this.condLimitObj.hasQw = val ? val.isJoin : 0
this.condLimitObj.hasPhone = val ? (val.customerPhone ? 1 : 0) : 0
},
// dealCondLimit(val) {
// 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, activeName: 'tag' })
},
// handleClickTag() {
// this.$emit('handleChangeTag', { condLimitObj: this.condLimitObj, tagList: this.selectedLabelList, customerInfoList: this.selectedCustomerList, activeName: 'tag' })
// },
handleSelectionTable(val) {
// 未选客户时,筛选客户条件
if (!this.selectedCustomerList.length) {
this.dealCondLimit(val[0])
}
// if (!this.selectedCustomerList.length) {
// this.dealCondLimit(val[0])
// }
let currentList = JSON.parse(JSON.stringify(this.selectedCustomerList))
let tableIds = this.tableList.map(item => item.id)
this.selectedCustomerList = JSON.parse(JSON.stringify(val))
......@@ -221,6 +263,13 @@ export default {
}
})
this.recoverySelected()
},
handleClose() {
this.$emit('handleAppointCustClose')
},
handleConfirm() {
this.$emit('handleAppointCustConfirm', this.selectedCustomerList)
}
}
}
......@@ -268,7 +317,7 @@ export default {
}
.customer-list {
width: calc(100% - 280px);
border: 1px solid #eeeeee;
// border: 1px solid #eeeeee;
margin-right: 10px;
}
.p-16 {
......@@ -277,7 +326,7 @@ export default {
.selected-list {
width: 280px;
border-radius: 2px;
border: 1px solid #eeeeee;
// border: 1px solid #eeeeee;
i {
color: #75acff;
margin-right: 3px;
......@@ -290,6 +339,7 @@ export default {
.list-customers {
// box-sizing: border-box;
// height: 61vh;
border: 1px solid #eeeeee;
padding: 10px;
overflow-y: scroll;
.customer-tag {
......
......@@ -76,7 +76,21 @@
<!-- 营销渠道 -->
<div class="container edit-container">
<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 class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" @click="handleConfirm">确定</el-button>
......@@ -118,7 +132,10 @@ export default {
// 营销内容
eventContent: '',
eventCount: '',
object: {}
object: {},
//营销渠道
reachesType: '',
reachesTypeSet: ''
},
// 营销内容
previewList: [],
......@@ -155,7 +172,10 @@ export default {
eventEndDate: [{ required: true, message: '请选择营销结束日期', trigger: 'change' }],
eventContent: [{ 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,
sopNameFormData: [
......@@ -292,7 +312,9 @@ export default {
{
label: '营销渠道',
name: 'pushChannelType',
tips: '企业微信和微信朋友圈会自动给客户的跟进专员派发群发任务;短信会自动推送至客户手机。',
type: 'radio',
suffixSlot: 'channelSuffix',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
......@@ -312,11 +334,46 @@ export default {
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: {
weekList: [],
monthList: []
monthList: [],
staffTypeList: []
}
}
},
......@@ -331,17 +388,17 @@ export default {
info: {}
}
}
},
condLimitObj: {
type: Object,
default: () => {
return {
// 1-有;0-无
hasPhone: 0,
hasQw: 0
}
}
}
// condLimitObj: {
// type: Object,
// default: () => {
// return {
// // 1-有;0-无
// hasPhone: 0,
// hasQw: 0
// }
// }
// }
},
components: {
......@@ -356,27 +413,28 @@ export default {
this.editStatus = 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() {
this.getDay('weekList', 7)
this.getDay('monthList', 31)
this.limitQwPhone()
// this.limitQwPhone()
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
Object.assign(this.editForm, this.eventObj.info)
this.getStaffTypeList()
this.$nextTick(() => {
this.editStatus = false
})
......@@ -384,16 +442,23 @@ export default {
},
methods: {
limitQwPhone() {
// 有企微 - 企业微信、微信朋友圈
// 有手机号 - 短信
var channelIdx = this.editFormDataChannel.findIndex(item => item.name == 'pushChannelType')
// 企微
this.editFormDataChannel[channelIdx].optionList[0].isDisabled = !this.condLimitObj.hasQw
// 短信
this.editFormDataChannel[channelIdx].optionList[1].isDisabled = !this.condLimitObj.hasPhone
// 微信朋友圈
this.editFormDataChannel[channelIdx].optionList[2].isDisabled = !this.condLimitObj.hasQw
// limitQwPhone() {
// // 有企微 - 企业微信、微信朋友圈
// // 有手机号 - 短信
// var channelIdx = this.editFormDataChannel.findIndex(item => item.name == 'pushChannelType')
// // 企微
// this.editFormDataChannel[channelIdx].optionList[0].isDisabled = !this.condLimitObj.hasQw
// // 短信
// this.editFormDataChannel[channelIdx].optionList[1].isDisabled = !this.condLimitObj.hasPhone
// // 微信朋友圈
// 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) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!