Commit 846871ca by chenwq

新增/编辑sop-标签客户;添加字段

1 parent 6ae940ba
import { http, http_common } from '@/main'
import { http, http_common, http2 } from '@/main'
const defaultPath = 'scrm.api.carlife.'
const getMerchantGoodsListApi = params => {
......@@ -94,4 +94,14 @@ const pictureUpload = params => {
noSignAttr: ['file']
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload }
const querylabeltree = params => {
params.method = 'scrm.api.datahub.labelgroup.queryLabelTree'
// params.sessionId = session
return http2({
url: '/rop-scrm-datahub/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getMerchantGoodsListApi, getGoodsListApi, uploadImgApi, uploadVideoApi, getMerchantList, getSimpleMerchantList, getZoneListApi, getClassifyListApi, pictureUpload, querylabeltree }
......@@ -505,6 +505,14 @@ html {
border-radius: 4px 0px 0px 0px;
border: 1px solid #f4f6fc !important;
}
.marketing .tips-icon {
display: inline-block;
width: 14px;
height: 14px;
margin-right: 12px;
vertical-align: middle;
cursor: pointer;
}
.el-message--info {
height: 40px;
......
......@@ -6,12 +6,11 @@
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '144px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
<span class="tips-icon"></span>
</el-tooltip>
{{ item.label }}
<el-popover placement="top" width="200" trigger="hover" :content="item.tips">
<img slot="reference" class="tips-icon" src="./images/icon-tip.png" />
</el-popover>
</span>
<span v-else-if="!item.isHide && item.label" slot="label">
<span v-else-if="!item.isHide && item.label && !item.tips" slot="label">
<span class="combi-form-label" :style="{ width: item.labelWidth ? item.labelWidth + labelPaddingRight + 'px' : '', 'padding-right': isEdit ? '12px' : labelPaddingRight + 'px' }">{{ item.label }}</span>
</span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
......@@ -307,36 +306,20 @@ export default {
background-color: #fff;
}
/* 提示图标 */
.glsx-combi-form .tips-block {
/* .glsx-combi-form .tips-block {
position: relative;
}
} */
.glsx-combi-form .tips-label {
margin-right: 20px;
margin-right: 2px;
}
.glsx-combi-form .tips-icon {
position: absolute;
display: inline-block;
width: 12px;
height: 12px;
top: 3px;
right: 14px;
margin-right: 4px;
width: 14px;
height: 14px;
margin-right: 12px;
vertical-align: middle;
cursor: pointer;
border: 1px dotted #7f7f7f;
border-radius: 50%;
}
.glsx-combi-form .tips-icon::before {
content: '?';
position: absolute;
width: 8px;
height: 8px;
top: -8px;
left: 1px;
font-size: 10px;
}
/* .glsx-combi-form .tips {
margin: 0;
} */
.glsx-combi-form .combi-form-label {
display: inline-block;
box-sizing: border-box;
......
......@@ -15,6 +15,7 @@ import selectSingleProDialog from '@/components/selectSingleProDialog/index.vue'
import relateStoreDialog from '@/components/relate-store-dialog'
import selectMutiProForcouponDialog from '@/components/selectMutiProDialog/indexForCoupon.vue'
import tableTooltip from '@/components/table-tooltip/index.vue'
import selectTag from '@/components/selectTag/index.vue'
Vue.component('glsx-combi-form', glsxCombiForm)
Vue.component('glsx-dialog', glsxDialog)
......@@ -23,3 +24,4 @@ Vue.component('select-single-pro-dialog', selectSingleProDialog)
Vue.component('relate-store-dialog', relateStoreDialog)
Vue.component('select-muti-pro-forcoupon-dialog', selectMutiProForcouponDialog)
Vue.component('table-tooltip', tableTooltip)
Vue.component('select-tag', selectTag)
<template>
<div class="tag-main">
<el-dialog title="选择标签" :visible.sync="dialogVisible" width="70%" :before-close="handleClose">
<div class="tag-panel">
<div class="tag-panel-select">
<div class="tag-title">预选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">
<el-input size="small" v-model="labelGroupName" placeholder="请输入搜索内容"></el-input>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
</div>
<div class="checkbox-group-box" :style="{ height: heightBox + 'px' }" v-loading="loading">
<div style="margin-bottom: 8px" v-for="(item, index) in labelTreeRets" :key="index">
<span class="el-tree-node__expand-icon el-icon-caret-right" :class="{ expanded: item.checked }" @click.self="item.checked = !item.checked"></span>
<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" @change="handleCheckAllChange(item.checkAll, index)">{{ item.labelGroup.name }}({{ item.tagChecked.length }}/{{ item.labelList.length }} 项)</el-checkbox>
<div style="margin: 15px 0"></div>
<el-checkbox-group class="tag-group" v-model="item.tagChecked" @change="handleCheckedChange(item.tagChecked, index)" v-if="item.checked">
<el-checkbox v-for="(itm, idx) in item.labelList" :label="itm" :key="idx">{{ itm.name }}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
</div>
<div class="tag-panel-selected">
<div class="tag-title">已选标签</div>
<div class="tag-select-box">
<div class="tag-box-header">标签名称({{ selectNum }}项)</div>
<div class="tag-selected-box" :style="{ height: heightBox + 'px' }">
<template v-for="item in labelTreeRetSelect">
<template v-for="(tag, idx) in item.tagChecked">
<el-tag :title="tag.name" type="info" class="tag-selected-item" :key="idx" v-if="tag" closable :disable-transitions="false" @close="remove(item, idx)">
{{ tag.name }}
</el-tag>
</template>
</template>
</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="handleSelect">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import util from '@/utils/util'
export default {
name: 'activityModel',
data() {
return {
loading: false,
heightBox: 200,
dialogVisible: false,
labelGroupName: '',
selectNum: 0,
searchStatus: false,
labelTreeRetSelect: [],
labelTreeRets: []
}
},
watch: {
labelTreeRetSelect: {
handler() {
this.selectNum = 0
this.labelTreeRetSelect.forEach(item => {
this.selectNum += item.tagChecked.length
})
},
deep: true
}
},
methods: {
jumpUrl() {
util.openUrl(location.origin + '/custom/tagsManage/index')
this.dialogVisible = false
},
init(item) {
this.labelGroupName = ''
this.dialogVisible = true
this.querylabeltree(item)
},
handleSearch() {
this.searchStatus = true
this.querylabeltree()
},
querylabeltree(selectItem) {
this.loading = true
this.$apis.common
.querylabeltree({
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
shopId: this.$globalState.session.merchantId,
labelGroupName: this.labelGroupName,
labelTypesStr: '自店标签,企业标签',
edition: this.$globalState.session.merchantModel
}
})
.then(res => {
if (selectItem && selectItem.length > 0) {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
//回显
selectItem.forEach(item => {
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
let labelList = []
item.labelList.forEach(x => {
labelList.push(x.id)
})
this.$nextTick(() => {
tag.tagChecked = tag.labelList.filter(i => labelList.includes(i.id))
})
}
})
})
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index, 1)
})
})
this.$nextTick(() => {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
})
} else {
this.labelTreeRets = res.labelTreeRets.map(item => {
return {
labelGroup: item.labelGroup,
labelList: item.labelList,
checked: false,
tagChecked: [],
isIndeterminate: false,
checkAll: false
}
})
this.labelTreeRets.forEach((item, index) => {
this.labelTreeRetSelect.forEach(itm => {
if (itm.labelGroup.id == item.labelGroup.id && itm.tagChecked.length > 0) {
let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
this.$nextTick(() => {
this.handleCheckedChange(itm.tagChecked, index, 1)
})
}
})
})
if (this.labelTreeRetSelect.length == 0) {
this.labelTreeRetSelect = utils.deepClone(this.labelTreeRets)
}
}
this.$nextTick(() => {
this.loading = false
})
})
},
handleClose() {
this.labelTreeRetSelect = []
this.dialogVisible = false
},
remove(items, idx) {
items.tagChecked.splice(idx, 1)
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
let tagChecked = []
itm.tagChecked.forEach(x => {
tagChecked.push(x.id)
})
this.$nextTick(() => {
item.tagChecked = item.labelList.filter(i => tagChecked.includes(i.id))
})
}
if (item.tagChecked.length == 0) {
this.$nextTick(() => {
item.checkAll = false
})
}
})
})
this.labelTreeRets.forEach((item, index) => {
this.$nextTick(() => {
this.handleCheckedChange(item.tagChecked, index, 1)
})
})
},
//选中
handleSelect() {
this.dialogVisible = false
let labelTreeRets = this.labelTreeRetSelect
.map(item => {
if (item.tagChecked.length) {
return {
labelGroup: item.labelGroup,
labelList: item.tagChecked
}
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets)
},
//全选
handleCheckAllChange(val, index) {
if (val) {
this.labelTreeRets[index].tagChecked = []
this.labelTreeRets[index].labelList.forEach(item => {
this.labelTreeRets[index].tagChecked.push(item)
})
} else {
this.labelTreeRets[index].tagChecked = []
}
this.labelTreeRets[index].isIndeterminate = false
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
itm.tagChecked = utils.deepClone(item.tagChecked)
}
})
})
},
//选中
handleCheckedChange(value, index, status) {
let checkedCount = value.length
this.labelTreeRets[index].checkAll = checkedCount === this.labelTreeRets[index].labelList.length
this.labelTreeRets[index].isIndeterminate = checkedCount > 0 && checkedCount < this.labelTreeRets[index].labelList.length
if (!status) {
this.labelTreeRets.forEach(item => {
this.labelTreeRetSelect.forEach(itm => {
if (item.labelGroup.id == itm.labelGroup.id) {
itm.tagChecked = utils.deepClone(item.tagChecked)
}
})
})
}
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 350
}
}
</script>
<style lang="scss" scoped>
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.tag-panel {
display: flex;
.tag-panel-select {
width: 60%;
/deep/ {
.el-checkbox__label {
width: 100%;
vertical-align: middle;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: break-word;
}
}
}
.tag-panel-selected {
width: 40%;
margin-left: 10px;
.tag-box-header {
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
padding-left: 20px !important;
}
}
.tag-title {
font-size: 16px;
font-weight: 400;
color: #333333;
line-height: 22px;
}
.tag-select-box {
margin-top: 10px;
border-radius: 2px;
border: 1px solid #eeeeee;
padding: 6px;
.tag-box-header {
box-sizing: border-box;
display: flex;
height: 56px;
align-items: center;
border-bottom: 1px solid #eeeeee;
margin: -6px;
margin-bottom: 10px;
padding: 0px 6px;
/deep/ {
.el-input {
width: 60%;
margin-right: 10px;
}
}
}
.tag-selected-item {
margin: 0px 6px 6px 0px;
height: 26px;
line-height: 24px;
font-size: 14px;
color: #666;
max-width: 200px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.el-tree-node__expand-icon {
color: #5850ff;
font-size: 16px;
}
.tag-group {
margin-left: 40px;
display: flex;
flex-wrap: wrap;
.el-checkbox {
width: 40%;
margin-bottom: 6px;
display: flex;
align-items: center;
}
}
}
}
.checkbox-group-box {
overflow: auto;
}
.tag-selected-box {
min-height: 200px;
}
</style>
......@@ -10,16 +10,39 @@
</div>
<div slot="customerInfoList" slot-scope="scope">
<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-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 v-for="(item, index) in scope.scope.customerRadioList" :key="index" :label="item.confId">{{ item.confName }}</el-radio>
</el-radio-group>
</div>
<div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10">
<div class="customer-title">{{ condLimitObj.hasQw ? '已加' : '没加' }}企微/{{ condLimitObj.hasPhone ? '有' : '没有' }}手机号:{{ editForm.customerInfoList.length }}人</div>
<div :key="key" class="el-input-tag input-tag-wrapper">
<el-tag v-for="(item, idx) in editForm.customerInfoList" :key="idx" class="customer-tag" :size="size" type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" @close="handleDeleteCustomer(idx)">
<i class="el-icon-user-solid"></i>
{{ item.customerName }}
</el-tag>
<div v-for="(item, pIdx) in customerDataList" :key="pIdx">
<div v-show="item.confId == editForm[scope.scope.name]">
<el-button v-show="item.list.length == 0" class="default-blue-btn el-icon-plus" :size="size" @click="handleSelectCustomer(pIdx)">去选择</el-button>
<!-- <div v-show="editForm.customerInfoList.length != 0" class="customer-box m-t-10"> -->
<div v-show="item.list.length != 0">
<div class="customer-box m-t-10">
<!-- <div class="customer-title">{{ condLimitObj.hasQw ? '已加' : '没加' }}企微/{{ condLimitObj.hasPhone ? '有' : '没有' }}手机号:{{ editForm.customerInfoList.length }}人</div> -->
<div class="customer-title">{{ item.confName }}客户:预估{{}}人</div>
<div :key="key" class="el-input-tag input-tag-wrapper">
<template v-if="item.confName == '标签'">
<div v-for="(subItem, subIdx) in item.list" :key="subIdx">
<el-tag v-for="(k, n) in subItem.labelList" :key="n" class="customer-tag" :size="size" type="info" :closable="!scope.scope.isDisabled" :disable-transitions="false" @close="handleDeleteCustomer(n, subIdx, item.confName)">
<span>{{ subItem.labelGroup.name }}:{{ k.name }}</span>
</el-tag>
</div>
</template>
<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>
</el-tag>
</template>
</div>
</div>
<el-button type="text" @click="handleSelectCustomer(pIdx)">编辑</el-button>
<el-button type="text" @click="handleResetCustomer(pIdx)">重置</el-button>
</div>
</div>
</div>
</div>
......@@ -75,13 +98,14 @@
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
<SelectLabel ref="selectLabel" @tagSelected="handleSelect" :dialogVisible="isTagVisible"></SelectLabel>
<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>
</div>
</template>
<script>
import url from '@/assets/empty.png'
import SelectLabel from './components/selectLabel.vue'
import selectCustomer from './components/selectCustomer'
export default {
name: 'baseInfo',
data() {
......@@ -115,19 +139,42 @@ export default {
},
// 标签弹窗
isTagVisible: false,
tagging: [],
isAppointCustVisible: false,
// tagging: [],
currentCustomerIdx: -1,
customerDataList: [
{
confId: 1,
confName: '人群',
list: []
},
{
confId: 2,
confName: '标签',
list: []
},
{
confId: 3,
confName: '指定',
list: []
}
],
editForm: {
sopName: '',
// sopTime: '2022-01-01',
startDate: '',
endDate: '',
// tagging: [],
customerFlag: '',
customerInfoList: [],
customerIds: [],
isUpdateCustomer: '2',
eventList: []
},
editRule: {
sopName: [{ required: true, message: '请输入SOP名称', trigger: 'change' }],
isUpdateCustomer: [{ required: true, message: '请选择更新人群', trigger: 'change' }],
customerFlag: [{ required: true, message: '请选择有效对象', trigger: 'change' }],
customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }]
},
isEdit: true,
......@@ -146,9 +193,43 @@ export default {
},
{
label: '营销对象',
name: 'customerInfoList',
// name: 'customerInfoList',
name: 'customerFlag',
addHtml: 'customerInfoList',
customerRadioList: [
{
confId: 1,
confName: '按人群选择客户'
},
{
confId: 2,
confName: '按标签选择客户'
},
{
confId: 3,
confName: '选择指定客户'
}
],
isDisabled: false
},
{
label: '更新人群',
name: 'isUpdateCustomer',
tips: '选择自动更新,每次营销事件执行时会按客户条件重新更新营销对象;选择从不更新,以当前客户条件匹配的客户作为固定的营销对象',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
optionList: [
{
confId: '1',
confName: '自动更新'
},
{
confId: '2',
confName: '从不更新'
}
]
}
],
baseData: {
......@@ -170,10 +251,6 @@ export default {
}
},
components: {
SelectLabel
},
props: {
routeInfo: {
type: Object,
......@@ -188,6 +265,10 @@ export default {
}
},
components: {
selectCustomer
},
watch: {
editForm: {
handler(val) {
......@@ -221,7 +302,7 @@ export default {
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 => {
if (item.object) {
item.object.objectId = item.objectId
......@@ -253,54 +334,66 @@ export default {
},
// 恢复企微和手机号限制
recoveryCondLimit() {
var obj = this.editForm.customerInfoList[0]
this.condLimitObj.hasQw = obj.isJoin
this.condLimitObj.hasPhone = obj.customerPhone ? 1 : 0
this.markCondLimitObj = {
hasQw: this.condLimitObj.hasQw,
hasPhone: this.condLimitObj.hasPhone
}
},
// recoveryCondLimit() {
// var obj = this.editForm.customerInfoList[0]
// this.condLimitObj.hasQw = obj.isJoin
// this.condLimitObj.hasPhone = obj.customerPhone ? 1 : 0
// this.markCondLimitObj = {
// hasQw: this.condLimitObj.hasQw,
// hasPhone: this.condLimitObj.hasPhone
// }
// },
changeCustomer(obj) {
this.editForm.customerInfoList = obj.selectedCustomerList
this.condLimitObj = obj.condLimitObj
if (this.markCondLimitObj.hasQw != -1) {
if (this.markCondLimitObj.hasQw != obj.condLimitObj.hasQw || this.markCondLimitObj.hasPhone != obj.condLimitObj.hasPhone) {
this.editForm.eventList = []
}
}
this.markCondLimitObj = {
hasQw: this.condLimitObj.hasQw,
hasPhone: this.condLimitObj.hasPhone
}
// changeCustomer(obj) {
// this.editForm.customerInfoList = obj.selectedCustomerList
// this.condLimitObj = obj.condLimitObj
// if (this.markCondLimitObj.hasQw != -1) {
// if (this.markCondLimitObj.hasQw != obj.condLimitObj.hasQw || this.markCondLimitObj.hasPhone != obj.condLimitObj.hasPhone) {
// this.editForm.eventList = []
// }
// }
// this.markCondLimitObj = {
// hasQw: this.condLimitObj.hasQw,
// hasPhone: this.condLimitObj.hasPhone
// }
// },
changeCustomer() {
this.editForm.customerInfoList = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list))
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
},
// 选择标签
handleSelect(obj) {
// this.tagging = obj.selectedLabelList
if (this.editForm.eventList.length && (this.markCondLimitObj.hasQw != obj.condLimitObj.hasQw || this.markCondLimitObj.hasPhone != obj.condLimitObj.hasPhone)) {
this.$confirm('修改的客户类型(是否加企微、是否有手机号)不一致,原有营销渠道可能不可用,系统自动重置原有营销事件。是否确定修改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.changeCustomer(obj)
}
}
})
} else {
this.changeCustomer(obj)
handleDialogConfirm(obj) {
console.log(obj)
switch (this.currentCustomerIdx) {
case 2:
this.handleAppointCustClose()
break
}
this.customerDataList[this.currentCustomerIdx].list = obj
this.changeCustomer()
this.key = new Date()
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
},
handleSelectCustomer() {
this.isTagVisible = !this.isTagVisible
this.$refs.selectLabel.init({ condLimitObj: this.condLimitObj, tagList: [], customerInfoList: JSON.parse(JSON.stringify(this.editForm.customerInfoList)), activeName: 'customer' })
handleAppointCustClose() {
this.isAppointCustVisible = !this.isAppointCustVisible
},
handleSelectCustomer(idx) {
this.currentCustomerIdx = idx
// 0-人群;1-标签;2-指定客户
switch (idx) {
case 0:
break
case 1:
this.isTagVisible = !this.isTagVisible
this.$refs.selectTagForm.init(this.customerDataList[idx].list)
break
case 2:
this.handleAppointCustClose()
break
}
},
handleResetCustomer() {
......@@ -323,23 +416,37 @@ export default {
}
},
handleDeleteCustomer(idx) {
if (this.editForm.customerInfoList.length == 1 && this.editForm.eventList.length) {
this.$confirm('修改的客户类型(是否加企微、是否有手机号)不一致,原有营销渠道可能不可用,系统自动重置原有营销事件。是否确定修改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.editForm.customerInfoList.splice(idx, 1)
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
this.editForm.eventList = []
}
deleteCustPop() {
// this.$confirm('修改的客户类型(是否加企微、是否有手机号)不一致,原有营销渠道可能不可用,系统自动重置原有营销事件。是否确定修改?', '提示', {
this.$confirm('修改的客户类型(是否加企微、是否有手机号)不一致,原有营销渠道可能不可用,系统自动重置原有营销事件。是否确定修改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
// this.editForm.customerInfoList.splice(idx, 1)
// this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
this.customerDataList[this.currentCustomerIdx].list = []
this.changeCustomer()
this.editForm.eventList = []
}
})
}
})
},
handleDeleteCustomer(idx, pIdx, attr) {
let currentList = this.customerDataList[this.currentCustomerIdx].list
let isLastOne = attr == '标签' ? currentList.map(item => item.labelList.length).reduce((prev, cur) => prev + cur) : currentList.length
if (isLastOne == 1 && this.editForm.eventList.length) {
this.deleteCustPop()
} else {
this.editForm.customerInfoList.splice(idx, 1)
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
if (attr == '标签') {
currentList[pIdx].labelList.splice(idx, 1)
currentList[pIdx].labelList.length == 0 && currentList.splice(idx, 1)
} else {
this.customerDataList[this.currentCustomerIdx].list.splice(idx, 1)
}
this.changeCustomer()
}
},
......@@ -504,14 +611,14 @@ export default {
height: 39px;
line-height: 39px;
padding: 0 10px;
border-bottom: 1px solid #dcdfe6;
// border-bottom: 1px solid #dcdfe6;
}
.input-tag-wrapper {
max-height: 227px;
overflow: auto;
position: relative;
font-size: 14px;
padding: 10px;
padding: 0 10px 10px;
box-sizing: border-box;
color: #666;
display: inline-block;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!