Commit 6094e87e by 前端

update

1 parent 501ffdc3
......@@ -124,8 +124,8 @@ export default {
labelTreeReq: {
pageNum: 1,
pageSize: 1000,
// shopId: this.$globalState.session.merchantId,
shopId:'44209846',
shopId: this.$globalState.session.merchantId,
// shopId:'44209846',
labelGroupName: this.labelGroupName,
labelTypesStr: this.labelTypesStr,
edition: this.$globalState.session.merchantModel,
......
......@@ -6,9 +6,8 @@
<p class="edit-title">{{ title }}</p>
<div>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit"
:labelWidth="labelWidth"
:isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData"
:formRules="editRule">
:labelWidth="labelWidth" :isBlock="true" :formRef="editChildRef" :formObj="editForm"
:formData="editFormData" :formRules="editRule">
<div slot="startDate">
<el-input class="w432"
:placeholder="!editForm.eventList.length ? '设置营销事件后自动补充' : editForm.startDate + (editForm.endDate ? ' - ' + editForm.endDate : '')"
......@@ -34,10 +33,7 @@
<!-- <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">
{{ item.confName }}客户
:预估{{ item.customerCount }}人
</div>
<div class="customer-title">{{ item.confName }}客户 :预估{{ 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">
......@@ -49,8 +45,7 @@
</div>
</template>
<template v-else>
<el-tag v-for="(subItem, subIdx) in item.list" :key="subIdx" class="customer-tag"
:size="size"
<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> -->
......@@ -78,7 +73,7 @@
content="请先完善sop名称和营销对象" placement="top">
<div>
<el-button class="m-r-20" :disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size"
type="primary" @click="handleEventEdit('add')">添加事件
type="primary" @click="handleEventEdit('add')">添加事件
</el-button>
</div>
</el-tooltip>
......@@ -90,8 +85,9 @@
<div v-show="editForm.eventList.length" class="event-box">
<div class="event-item" v-for="(item, index) in editForm.eventList" :key="index">
<div class="flex-default event-title">
<p :class="{'m-r-10':true,'editFlag':!item.eventStartDate}">
{{ item.eventStartDate ? item.eventStartDate : '请点击“编辑”完善事件的营销时间' }}</p>
<p :class="{ 'm-r-10': true, editFlag: !item.eventStartDate }">
{{ item.eventStartDate ? item.eventStartDate : '请点击“编辑”完善事件的营销时间' }}
</p>
<p class="m-r-20">{{ item.eventTime }}</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 1">每天重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 2">每周{{
......@@ -102,18 +98,18 @@
}}重复循环至</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">
{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}</p>
{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}
</p>
</div>
<div>
<div v-for="(obj,index) in backupContentJson(item.backupContent)" :key="index">
<div v-for="(obj, index) in backupContentJson(item.backupContent)" :key="index">
<div class="textHidden" :title="obj.attContent" v-if="obj.attType == 1"
v-html="tramWord(obj.attContent)"></div>
</div>
<div class="event-inline" v-for="(obj,index) in backupContentJson(item.backupContent)" :key="index">
<div class="event-inline" v-for="(obj, index) in backupContentJson(item.backupContent)" :key="index">
<div>
<div v-if="obj.attType == 2">
<img class="model-item-img"
:src="obj.attContent" alt/>
<img class="model-item-img" :src="obj.attContent" alt/>
</div>
<div v-if="obj.attType == 3">
<video class="model-item-img" :src="obj.attContent" controls="controls"/>
......@@ -123,7 +119,6 @@
<div class="welcome-activity-box">
<div class="welcome-activity-icon">
<img src="@/assets/welcomeWord/pdf_r.png"
v-if="obj.attContent && !backupContentJson(obj.attContent).isFile"/>
<img src="@/assets/welcomeWord/text.png"
v-if="obj.attContent && backupContentJson(obj.attContent).isFile"/>
......@@ -134,7 +129,7 @@
</div>
</div>
</div>
<div v-if="obj.attType == 7 || obj.attType == 4" >
<div v-if="obj.attType == 7 || obj.attType == 4">
<div class="welcome-activity-panel">
<div class="welcome-activity-box">
<div class="welcome-activity-icon">
......@@ -217,7 +212,7 @@
</div>
</div>
<div class="event-btns">
<el-button v-if="new Date(item.eventStartDate) > new Date() || routeInfo.addOrEdit =='copy'"
<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"
......@@ -225,12 +220,11 @@
<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" @click="handleEventEdit('edit', item, index)">编辑
:disabled="!editForm.customerInfoList.length || !editForm.sopName" :size="size"
@click="handleEventEdit('edit', item, index)">编辑
</el-button>
</div>
</el-tooltip>
</div>
</div>
</div>
......@@ -336,7 +330,7 @@ export default {
reqListName: 'labelList',
customerCount: '',
list: []
},
}
],
editForm: {
sopName: '',
......@@ -376,14 +370,38 @@ export default {
isDisabled: false,
optionList: [
{
confId: '1',
confId: 1,
confName: '客户sop'
},
{
confId: '2',
confId: 2,
confName: '群sop'
}
]
],
handleRadioChange: val => {
this.currentCustomerIdx = this.customerDataList.findIndex(item => item.confId == this.editForm.customerOptType)
let hasList = this.customerDataList[this.currentCustomerIdx]?.list?.length
if (this.editForm.eventList?.length || hasList) {
this.$confirm(`切换sop类型,系统将自动重置已配置的营销对象和营销事件。是否确定切换?`, '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.editForm.customerOptType = val == 1 ? '' : 4
this.customerDataList[this.currentCustomerIdx].list = []
// this.changeCustomer()
this.editForm.eventList = []
} else {
this.editForm.sopType = val == 1 ? 2 : 1
return false
}
}
})
} else {
this.editForm.customerOptType = val == 1 ? '' : 4
}
}
},
{
label: '营销时间',
......@@ -491,23 +509,11 @@ export default {
},
deep: true
},
'editForm.sopType'(val) {
let show = false
this.isGroupTag = val == 1 ? false : true
this.editForm.customerOptType = val == 1 ? '' : 4
if (this.editForm.eventList.length ){
this.$confirm(`切换sop类型,系统将自动重置已配置的营销对象和营销事件。是否确定切换?`, '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => {
})
}
'editForm.sopType': {
handler(val) {
this.isGroupTag = val == 1 ? false : true
},
immediate: true
}
},
......@@ -520,7 +526,6 @@ export default {
} else if (this.routeInfo.info) {
this.setCustomer()
}
},
methods: {
......@@ -529,20 +534,20 @@ export default {
},
async getTheMaterialActivityCollection() {
await this.$apis.welcomeword.getMaterialListApi({
pageNum: 1,
pageSize: 100000,
merchant: this.$globalState.session.merchantId,
status: 0
}).then(res =>
this.materialGroupSet = res.data
)
await this.$apis.welcomeword
.getMaterialListApi({
pageNum: 1,
pageSize: 100000,
merchant: this.$globalState.session.merchantId,
status: 0
})
.then(res => (this.materialGroupSet = res.data))
},
async getEachActivity(interfaceName) {
let params = {
pageNum: 1,
pageSize: 100000,
pageSize: 100000
}
// 权益卡
if (interfaceName == 'merchant') {
......@@ -556,40 +561,35 @@ export default {
switch (interfaceName) {
case 'merchant':
this.equityCardCollection = res
break;
break
case 'getPackage':
this.equityPackageCollection = res.list
break;
break
case 'getMerchant':
this.mallCouponCollection = res.list
break;
break
case 'getActivity':
this.seckillActivitySet = res.list
}
})
},
tramWord(val) {
let htm = val.replace(
/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi,
function (res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
}
)
let htm = val.replace(/\[([\u4E00-\u9FA56]{1,4}|OK|NO|666)]/gi, function (res) {
let word = res.replace(/\[|\]/gi, '')
const list = emoji.flat(Infinity)
let index = parseInt(list.indexOf(word)) + 1
if (index < 10) {
index = '00' + index
} else if (index >= 10 && index < 100) {
index = '0' + index
}
return `<img style='width:25px;height:25px' src="https://img01.glsx.com.cn/weapp/resource/saas/scrm/emoji/${index}.png">`
})
return htm
},
backupContentJson(val) {
if (typeof (val) == 'string') {
if (typeof val == 'string') {
return JSON.parse(val)
} else {
return val
......@@ -597,7 +597,7 @@ export default {
},
marketingContentJSON(val) {
if (typeof (val.attContent) == 'string') {
if (typeof val.attContent == 'string') {
return JSON.parse(val.attContent).marketingContent
} else {
return val.attContent.marketingContent
......@@ -629,7 +629,7 @@ export default {
var list = []
var groupIdList = []
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
this.editForm[this.customerDataList[this.currentCustomerIdx].reqListName].forEach(item => {
this.editForm[this.customerDataList[this.currentCustomerIdx].reqListName]?.forEach(item => {
let pIdx = groupIdList.findIndex(k => k == item.labelGroupId)
if (list.length && pIdx != -1) {
list[pIdx].labelList.push({
......@@ -674,7 +674,7 @@ export default {
customerSex: sexToObj[item.customerSex],
isJoin: item.customerWxAdd == 'Y' ? 1 : 0,
addTime: item.customerTimeAdd,
oneId: item.externalUserId,
oneId: item.externalUserId
})
})
this.customerDataList[this.currentCustomerIdx].list = JSON.parse(JSON.stringify(list))
......@@ -746,7 +746,7 @@ export default {
effectivedDay,
effectiveType,
freeDay,
selectType: 'card',
selectType: 'card'
}
}
})
......@@ -766,7 +766,7 @@ export default {
marketingContent: {
packageName,
packagePrice,
selectType: 'package',
selectType: 'package'
}
}
})
......@@ -787,7 +787,7 @@ export default {
couponName,
effectiveType,
residueAmount,
selectType: 'coupon',
selectType: 'coupon'
}
}
})
......@@ -808,7 +808,7 @@ export default {
activityName,
endTime,
startTime,
selectType: 'activity',
selectType: 'activity'
}
}
})
......@@ -819,9 +819,9 @@ export default {
let material = this.materialGroupSet && this.materialGroupSet.filter(it => it.id == item.objectId)
let {id, materialContentRpcResponse} = material[0]
let detail = {
'fileName': materialContentRpcResponse.materialName,
'objectId': id,
'isFile': decodeURIComponent(materialContentRpcResponse.materialUrl),
fileName: materialContentRpcResponse.materialName,
objectId: id,
isFile: decodeURIComponent(materialContentRpcResponse.materialUrl)
}
backUpContent.push({
attType: 6,
......@@ -838,7 +838,8 @@ export default {
getInfo() {
this.$apis.sop.getSopInfoDetailApi({sopId: this.routeInfo.id}).then(async res => {
if (this.routeInfo.addOrEdit == 'copy') {
res.eventList && res.eventList.map(item => {
res.eventList &&
res.eventList.map(item => {
item.eventStartDate = ''
item.eventTime = ''
})
......@@ -874,7 +875,7 @@ export default {
})
},
// 群标签 预估
getGroupByTagList(){
getGroupByTagList() {
var params = {
combineType: 2,
pageSize: 1,
......@@ -959,7 +960,6 @@ export default {
break
}
this.customerDataList[this.currentCustomerIdx].list = obj
console.log(this.customerDataList)
this.changeCustomer()
},
......@@ -1103,7 +1103,7 @@ export default {
addOrEdit: addOrEdit,
eventIndex: addOrEdit == 'add' ? '-1' : idx,
parentCustomerObj: this.parentCustomerObj,
info: {...row, sopName: this.editForm.sopName,sopType:this.editForm.sopType}
info: {...row, sopName: this.editForm.sopName, sopType: this.editForm.sopType}
})
},
......@@ -1112,7 +1112,6 @@ export default {
return list
},
reqLabelAttrs() {
var list = []
this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
......@@ -1126,7 +1125,6 @@ export default {
})
})
})
console.log(list)
return list
},
......@@ -1138,7 +1136,6 @@ export default {
2: 'W'
}
this.customerDataList[this.currentCustomerIdx].list.forEach(item => {
list.push({
customerId: item.id,
customerName: item.customerName,
......@@ -1191,23 +1188,22 @@ export default {
var idx = 0
this.editForm.eventList.forEach((item, index) => {
if (new Date(item.eventStartDate) > new Date()) {
params.eventList.push(
{
backupContent: item.backupContent,
eventStartDate: item.eventStartDate,
eventTime: item.eventTime,
pushChannelType: item.pushChannelType,
repeatFlag: item.repeatFlag,
repeatMode: item.repeatMode,
predictCount: item.predictCount,
// sopName: item.sopName,
// sopId: this.routeInfo.id,
followerTypeId: item.followerTypeId,
followerTypeName: item.followerTypeName,
reachesType: item.reachesType,
reachesTypeSet: item.reachesTypeSet,
resourceList: []
})
params.eventList.push({
backupContent: item.backupContent,
eventStartDate: item.eventStartDate,
eventTime: item.eventTime,
pushChannelType: item.pushChannelType,
repeatFlag: item.repeatFlag,
repeatMode: item.repeatMode,
predictCount: item.predictCount,
// sopName: item.sopName,
// sopId: this.routeInfo.id,
followerTypeId: item.followerTypeId,
followerTypeName: item.followerTypeName,
reachesType: item.reachesType,
reachesTypeSet: item.reachesTypeSet,
resourceList: []
})
if (item.id) {
params.eventList[index].id = item.id
}
......@@ -1215,7 +1211,7 @@ export default {
params.eventList[idx].repeatTime = item.repeatTime
params.eventList[idx].eventEndDate = item.eventEndDate
}
let backupContent = typeof (item.backupContent) == 'string' ? JSON.parse(item.backupContent) : item.backupContent
let backupContent = typeof item.backupContent == 'string' ? JSON.parse(item.backupContent) : item.backupContent
if (backupContent && backupContent.length <= 2) {
backupContent.forEach(obj => {
if (obj && obj.attType == 1) {
......@@ -1243,7 +1239,6 @@ export default {
params.eventList[index].additionalType = 3
params.eventList[index].objectType = 5
params.eventList[index].objectId = attContentCopy.marketingId
}
if (attContentCopy.marketingContent.selectType == 'card') {
params.eventList[index].objectType = 6
......@@ -1254,17 +1249,16 @@ export default {
params.eventList[index].objectId = attContentCopy.marketingId
}
// 还差一个秒杀活动
if (attContentCopy.marketingContent.selectType == 'activity' || attContentCopy.marketingContent.selectType == 'crowdfunding' ) {
if (attContentCopy.marketingContent.selectType == 'activity' || attContentCopy.marketingContent.selectType == 'crowdfunding') {
params.eventList[index].objectType = 8
params.eventList[index].objectId = attContentCopy.marketingId
}
}
// 素材
if (obj && obj.attType == 6) {
params.eventList[index].additionalType = 1
params.eventList[index].objectType = 10
let backupattContent = typeof (obj.attContent) == 'string' ? JSON.parse(obj.attContent) : obj.attContent
let backupattContent = typeof obj.attContent == 'string' ? JSON.parse(obj.attContent) : obj.attContent
params.eventList[index].objectId = backupattContent.objectId
}
})
......@@ -1280,10 +1274,10 @@ export default {
}
if (obj && obj.attType == 6) {
params.eventList[index].additionalType = 6
let backupattContent = typeof (obj.attContent) == 'string' ? JSON.parse(obj.attContent) : obj.attContent
let backupattContent = typeof obj.attContent == 'string' ? JSON.parse(obj.attContent) : obj.attContent
params.eventList[index].objectId = backupattContent.objectId
}
if (obj && (obj.attType == 7 || obj.attTye ==4)) {
if (obj && (obj.attType == 7 || obj.attTye == 4)) {
let attContentCopy = JSON.parse(obj.attContent)
if (attContentCopy.marketingContent.selectType == 'coupon') {
params.eventList[index].objectType = 16
......@@ -1350,10 +1344,10 @@ export default {
if (obj && obj.attType == 6) {
params.eventList[index].additionalType = 1
params.eventList[index].objectType = 10
let backupattContent = typeof (obj.attContent) == 'string' ? JSON.parse(obj.attContent) : obj.attContent
let backupattContent = typeof obj.attContent == 'string' ? JSON.parse(obj.attContent) : obj.attContent
params.eventList[index].objectId = backupattContent.objectId
}
if (obj && (obj.attType == 7 || obj.attType == 4 )) {
if (obj && (obj.attType == 7 || obj.attType == 4)) {
params.eventList[index].additionalType = 2
let attContentCopy = JSON.parse(obj.attContent)
if (attContentCopy.marketingContent.selectType == 'coupon') {
......@@ -1389,7 +1383,7 @@ export default {
}
if (obj && obj.attType == 6) {
params.eventList[index].additionalType = 6
let backupattContent = typeof (obj.attContent) == 'string' ? JSON.parse(obj.attContent) : obj.attContent
let backupattContent = typeof obj.attContent == 'string' ? JSON.parse(obj.attContent) : obj.attContent
params.eventList[index].objectId = backupattContent.objectId
}
if (obj && (obj.attType == 7 || obj.attType == 4)) {
......@@ -1418,7 +1412,6 @@ export default {
})
}
if (this.editDisabled) {
var batchEditParams = {
sopId: params.id,
......@@ -1609,7 +1602,6 @@ export default {
}
}
.welcome-activity-panel {
display: flex;
margin-right: 10px;
......@@ -1726,7 +1718,7 @@ export default {
.event-inline {
margin-top: 8px;
display: inline-block
display: inline-block;
}
.editFlag {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!