Commit 1f946c43 by 前端

修复sop一轮bug

1 parent 2cb0061d
......@@ -25,7 +25,7 @@ const getCustomerByTagListApi = params => {
//群标签获取客户列表
const getCustomerByGroupTagListApi = params => {
params.method = 'entmicro.api.customer.base.page'
params.method = 'entmicro.api.customer.base.getCustomerBasePageByTag'
return http({
url: 'rop-scrm-entmicro/router',
method: 'POST',
......
......@@ -123,6 +123,7 @@ export default {
},
init(item) {
this.labelGroupName = ''
this.labelTreeRetSelect = []
this.dialogVisible = true
this.querylabeltree(item)
},
......@@ -131,7 +132,6 @@ export default {
this.querylabeltree()
},
querylabeltree(selectItem) {
console.log('?????????')
this.loading = true
this.$apis.common
.querylabeltree({
......@@ -160,9 +160,7 @@ export default {
}
})
//回显
console.log('????????')
selectItem.forEach(item => {
console.log(item)
this.labelTreeRets.forEach(tag => {
if (item.labelGroup.id == tag.labelGroup.id) {
let labelList = []
......@@ -256,7 +254,6 @@ export default {
let labelTreeRets = this.labelTreeRetSelect
.map(item => {
if (item.tagChecked.length) {
console.log(item)
return {
labelGroup: item.labelGroup,
labelList: item.tagChecked,
......@@ -265,7 +262,6 @@ export default {
}
})
.filter(item => item)
console.log(labelTreeRets)
this.$emit('tagSelected', labelTreeRets)
},
//全选
......
......@@ -33,8 +33,13 @@
<!-- <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" v-if="editForm.sopType==1">{{ item.confName }}客户 :预估{{ item.customerCount }}人</div>
<div class="customer-title" v-if="editForm.sopType==2">标签群聊 :预估{{ item.customerCount }}个</div>
<div class="customer-title" v-if="editForm.sopType==1">{{ item.confName }}客户
:预估{{ item.customerCount }}人
</div>
<div class="customer-title" v-if="editForm.sopType==2">标签群聊 :预估{{
item.customerCount
}}个
</div>
<div :key="key" class="el-input-tag input-tag-wrapper">
<template v-if="item.confName == '标签' || item.confName == '群标签'">
<div v-for="(subItem, subIdx) in item.list" :key="subIdx">
......@@ -69,10 +74,10 @@
<div class="container edit-container" v-loading="marketingEventLoading">
<div class="edit-title flex" style="align-items: center">
<p>营销事件设置</p>
<el-tooltip :disabled="!(!editForm.customerInfoList.length || !editForm.sopName)" effect="dark"
<el-tooltip :disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)" effect="dark"
content="请先完善sop名称和营销对象" placement="top">
<div>
<el-button class="m-r-20" :disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size"
<el-button class="m-r-20" :disabled="!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName" :size="size"
type="primary" @click="handleEventEdit('add')">添加事件
</el-button>
</div>
......@@ -97,9 +102,12 @@
item.repeatTime
}}重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y'">{{ item.eventEndDate }}</p>
<p class="m-r-20 txt-blue" v-if="editForm.sopType == 1">
<p class="m-r-20 txt-blue" v-if='editForm.sopType== 1'>
{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}
</p>
<p class="m-r-20 txt-blue" v-if='editForm.sopType== 2'>
企微群推送
</p>
</div>
<div>
<div v-for="(obj, index) in backupContentJson(item.backupContent)" :key="index">
......@@ -259,18 +267,20 @@
</div>
</div>
<div class="event-btns">
<el-button v-if="editForm.sopStatus !==1 && routeInfo.addOrEdit !== 'copy' && routeInfo.addOrEdit !== 'add'" type="primary" size="small"
@click="handleEventView(item)">查看
<el-button
v-if="editForm.sopStatus !==1 && routeInfo.addOrEdit !== 'copy' && routeInfo.addOrEdit !== 'add'"
type="primary" size="small"
@click="handleEventView(item)">查看
</el-button>
<el-button v-if="new Date(item.eventStartDate) > new Date() || routeInfo.addOrEdit == 'copy'"
class="default newBtnSty" :size="size" @click="handleEventDelete(index)">删除
</el-button>
<el-tooltip :disabled="!(!editForm.customerInfoList.length || !editForm.sopName)" effect="dark"
<el-tooltip :disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)" effect="dark"
content="请先完善sop名称和营销对象" placement="top">
<div>
<el-button class="default-blue-btn newBtnSty"
v-if="new Date(item.eventStartDate) > new Date() || !item.eventStartDate"
:disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size"
:disabled="!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName" :size="size"
@click="handleEventEdit('edit', item, index)">编辑
</el-button>
</div>
......@@ -314,7 +324,7 @@ export default {
title: '基本信息',
url: url,
marketingEventLoading: false,
marketingSOPLoading:false,
marketingSOPLoading: false,
editChildRef: 'editChildRef',
editStatus: false,
editDisabled: false,
......@@ -390,7 +400,7 @@ export default {
endDate: '',
// tagging: [],
customerOptType: '',
customerInfoList: [],
customerInfoList: null,
// customerIds: [],
customerOptUpdate: '1',
sopType: 1,
......@@ -431,7 +441,7 @@ export default {
],
handleRadioChange: val => {
let hasList
if (this.editForm.customerOptType){
if (this.editForm.customerOptType) {
this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType)
hasList = this.customerDataList[this.currentCustomerIdx]?.list?.length
}
......@@ -444,7 +454,7 @@ export default {
if (action == 'confirm') {
this.editForm.customerOptType = val == 1 ? '' : 4
this.customerDataList[this.currentCustomerIdx].list = []
// this.changeCustomer()
this.changeCustomer()
this.editForm.eventList = []
} else {
this.editForm.sopType = val == 1 ? 2 : 1
......@@ -997,8 +1007,16 @@ export default {
this.customerDataList[this.currentCustomerIdx].list.length && this.getGroupByTagList()
break
}
this.editForm.customerInfoList = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list))
this.$nextTick(()=>{
this.$set(this.editForm,'customerInfoList',JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list)))
this.$refs.editFormRef && this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
}
)
// this.key = new Date()
},
......@@ -1044,7 +1062,6 @@ export default {
break
case 1:
this.isTagVisible = !this.isTagVisible
console.log(JSON.parse(JSON.stringify(this.customerDataList[idx].list)))
this.$refs.selectTagForm.init(JSON.parse(JSON.stringify(this.customerDataList[idx].list)))
break
case 2:
......@@ -1052,6 +1069,7 @@ export default {
break
case 3:
this.isTagVisible = !this.isTagVisible
this.$refs.selectTagForm.init(JSON.parse(JSON.stringify(this.customerDataList[idx].list)))
}
},
......@@ -1065,6 +1083,7 @@ export default {
callback: action => {
if (action == 'confirm') {
this.customerDataList[this.currentCustomerIdx].list = []
// this.$set(this.editForm,'customerInfoList',[])
this.changeCustomer()
// this.editForm.eventList = []
}
......@@ -1143,7 +1162,7 @@ export default {
},
handleEventView(item) {
this.$router.push({path: '/sop/viewEvent', query: {info: item}});
this.$router.push({path: '/sop/viewEvent', query: {info: item, sopType: this.editForm.sopType}});
},
handleEventEdit(addOrEdit, row, idx) {
let currentCustObj = JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx]))
......@@ -1231,7 +1250,7 @@ export default {
const mixedType = materialType && activityType
const obj = {
// videoImageStorage: [],
resourceList:[]
resourceList: []
}
val.forEach(event => {
......@@ -1255,7 +1274,6 @@ export default {
if (event && (event.attType == 7 || event.attType == 4)) {
obj.additionalType = 2
let attContentCopy = JSON.parse(event.attContent)
console.log(attContentCopy)
if (attContentCopy.marketingContent.selectType == 'coupon') {
obj.additionalType = 3
obj.objectType = 5
......@@ -1289,7 +1307,6 @@ export default {
obj.objectId = backupattContent.objectId
}
if (event && (event.attType == 7 || event.attType == 4)) {
console.log(event)
let attContentCopy = JSON.parse(event.attContent)
if (attContentCopy.marketingContent.selectType == 'coupon') {
obj.objectType = 16
......@@ -1316,6 +1333,13 @@ export default {
this.submit = true
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
if (!this.editForm.customerInfoList?.length){
this.$message({
message: '请选择营销对象',
type: 'error'
})
return
}
if (!this.editForm.eventList.length) {
return true
}
......@@ -1360,7 +1384,7 @@ export default {
params.eventList[idx].eventEndDate = item.eventEndDate
}
let backupContent = typeof item.backupContent == 'string' ? JSON.parse(item.backupContent) : item.backupContent
params.eventList[index] = {...params.eventList[index],...this.handleMarketingContentTypes(backupContent)}
params.eventList[index] = {...params.eventList[index], ...this.handleMarketingContentTypes(backupContent)}
idx = idx + 1
} else {
params.eventList.push(item)
......@@ -1385,7 +1409,7 @@ export default {
this.editForm.eventList.forEach((item, index) => {
// params.eventList.push(JSON.parse(JSON.stringify(item)))
// params.eventList[index].resourceList = []
params.eventList[index] = {...item,...this.handleMarketingContentTypes(item.object)}
params.eventList[index] = {...item, ...this.handleMarketingContentTypes(item.object)}
params.eventList[index].backupContent = item.object
delete params.eventList[index].object
})
......
......@@ -177,6 +177,11 @@ export default {
prop: 'commentCount',
}
],
diffsRepeatMode:{
1:'按天',
2:'按周',
3:'按月'
},
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
baseData: {
sopEventList: []
......@@ -236,7 +241,9 @@ export default {
this.labelOptUpdate = this.baseData.sopEventList[0].labelOptUpdate
if (this.baseData.sopEventList.length) {
this.baseData.sopEventList.forEach(item => {
item.confName = item.eventStartDate + (item.repeatFlag == 'Y' ? (''-' + item.eventEndDate' || '') : '') + ' ' + item.eventTime + ' ' + pushChannelTypeList[item.pushChannelType]
console.log(item)
item.confName = item.eventStartDate + ' '+ item.eventTime + ' ' +this.diffsRepeatMode[item.repeatMode] + ' ' + pushChannelTypeList[item.pushChannelType]
// item.confName = item.eventStartDate + (item.repeatFlag == 'Y' ? (''-' + item.eventEndDate' || '') : '') + ' ' + item.eventTime + ' ' + pushChannelTypeList[item.pushChannelType]
})
this.getOptionsList('searchFormData', false)
this.searchForm.eventId = this.baseData.sopEventList[0].id
......
......@@ -201,7 +201,7 @@ export default {
methods: {
handleEventView() {
let info = this.editForm.eventList && this.editForm.eventList[0]
this.$router.push({path: '/sop/viewEvent', query: {info}});
this.$router.push({path: '/sop/viewEvent', query: {info,sopType:this.editForm.sopType}});
},
tramWord(val) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!