Commit a0742fa2 by 前端

修复一轮bug

1 parent 1f946c43
...@@ -74,10 +74,14 @@ ...@@ -74,10 +74,14 @@
<div class="container edit-container" v-loading="marketingEventLoading"> <div class="container edit-container" v-loading="marketingEventLoading">
<div class="edit-title flex" style="align-items: center"> <div class="edit-title flex" style="align-items: center">
<p>营销事件设置</p> <p>营销事件设置</p>
<el-tooltip :disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)" effect="dark" <el-tooltip
:disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)"
effect="dark"
content="请先完善sop名称和营销对象" placement="top"> content="请先完善sop名称和营销对象" placement="top">
<div> <div>
<el-button class="m-r-20" :disabled="!(editForm.customerInfoList && 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')">添加事件 type="primary" @click="handleEventEdit('add')">添加事件
</el-button> </el-button>
</div> </div>
...@@ -275,12 +279,15 @@ ...@@ -275,12 +279,15 @@
<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)">删除 class="default newBtnSty" :size="size" @click="handleEventDelete(index)">删除
</el-button> </el-button>
<el-tooltip :disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)" effect="dark" <el-tooltip
:disabled="!(!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName)"
effect="dark"
content="请先完善sop名称和营销对象" placement="top"> content="请先完善sop名称和营销对象" placement="top">
<div> <div>
<el-button class="default-blue-btn newBtnSty" <el-button class="default-blue-btn newBtnSty"
v-if="new Date(item.eventStartDate) > new Date() || !item.eventStartDate" v-if="new Date(item.eventStartDate) > new Date() || !item.eventStartDate"
:disabled="!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName" :size="size" :disabled="!(editForm.customerInfoList && editForm.customerInfoList.length) || !editForm.sopName"
:size="size"
@click="handleEventEdit('edit', item, index)">编辑 @click="handleEventEdit('edit', item, index)">编辑
</el-button> </el-button>
</div> </div>
...@@ -1008,13 +1015,11 @@ export default { ...@@ -1008,13 +1015,11 @@ export default {
break break
} }
this.$nextTick(()=>{ this.$nextTick(() => {
this.$set(this.editForm,'customerInfoList',JSON.parse(JSON.stringify(this.customerDataList[this.currentCustomerIdx].list))) 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.$refs.editFormRef && this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
} }
) )
// this.key = new Date() // this.key = new Date()
...@@ -1245,6 +1250,7 @@ this.$nextTick(()=>{ ...@@ -1245,6 +1250,7 @@ this.$nextTick(()=>{
// 处理营销内容类型 // 处理营销内容类型
handleMarketingContentTypes(val) { handleMarketingContentTypes(val) {
console.log(val)
const materialType = val.some(item => item.attType == 6) const materialType = val.some(item => item.attType == 6)
const activityType = val.some(item => item.attType == 7 || item.attType == 4) const activityType = val.some(item => item.attType == 7 || item.attType == 4)
const mixedType = materialType && activityType const mixedType = materialType && activityType
...@@ -1273,7 +1279,7 @@ this.$nextTick(()=>{ ...@@ -1273,7 +1279,7 @@ this.$nextTick(()=>{
// 活动 // 活动
if (event && (event.attType == 7 || event.attType == 4)) { if (event && (event.attType == 7 || event.attType == 4)) {
obj.additionalType = 2 obj.additionalType = 2
let attContentCopy = JSON.parse(event.attContent) let attContentCopy = typeof event.attContent == 'string' ? JSON.parse(event.attContent) : event.attContent
if (attContentCopy.marketingContent.selectType == 'coupon') { if (attContentCopy.marketingContent.selectType == 'coupon') {
obj.additionalType = 3 obj.additionalType = 3
obj.objectType = 5 obj.objectType = 5
...@@ -1333,7 +1339,7 @@ this.$nextTick(()=>{ ...@@ -1333,7 +1339,7 @@ this.$nextTick(()=>{
this.submit = true this.submit = true
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
if (!this.editForm.customerInfoList?.length){ if (!this.editForm.customerInfoList?.length) {
this.$message({ this.$message({
message: '请选择营销对象', message: '请选择营销对象',
type: 'error' type: 'error'
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
<!-- :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="sopNameFormData"--> <!-- :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="sopNameFormData"-->
<!-- :formRules="editRule"></glsx-combi-form>--> <!-- :formRules="editRule"></glsx-combi-form>-->
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefDate" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRefDate" :isEdit="isEdit"
:labelWidth="labelWidth" defaultWidth="320px"
:formRef="editChildRef" :formObj="editForm" :formData="editFormDataDate" :formRules="editRule"> :formRef="editChildRef" :formObj="editForm" :formData="editFormDataDate" :formRules="editRule">
<div slot="eventStartDate" slot-scope="scope"> <div slot="eventStartDate" slot-scope="scope">
<el-date-picker class="m-r-20" <el-date-picker class="m-r-20"
...@@ -78,8 +79,10 @@ ...@@ -78,8 +79,10 @@
</div> </div>
<div class="preview"> <div class="preview">
<Preview :previewVal="previewList" v-if="editForm.pushChannelType == 1 && editForm.sopType ==1"></Preview> <Preview :previewVal="previewList" v-if="editForm.pushChannelType == 1 && editForm.sopType ==1"></Preview>
<MessagePreview :previewView="previewList" v-if="editForm.pushChannelType == 2"></MessagePreview> <MessagePreview :previewView="previewList"
<FriendGroupPreview :previewView="previewList" v-if="editForm.pushChannelType == 3"></FriendGroupPreview> v-if="editForm.pushChannelType == 2 && editForm.sopType ==1"></MessagePreview>
<FriendGroupPreview :previewView="previewList"
v-if="editForm.pushChannelType == 3 && editForm.sopType ==1"></FriendGroupPreview>
<GoupchatPreview :previewVal="previewList" v-if="editForm.sopType ==2"></GoupchatPreview> <GoupchatPreview :previewVal="previewList" v-if="editForm.sopType ==2"></GoupchatPreview>
</div> </div>
</div> </div>
...@@ -492,6 +495,7 @@ export default { ...@@ -492,6 +495,7 @@ export default {
addHtml: 'eventContent' addHtml: 'eventContent'
} }
], ],
editFormDataChannelCopy: null,
editFormDataChannel: [ editFormDataChannel: [
{ {
label: '营销设置', label: '营销设置',
...@@ -633,6 +637,14 @@ export default { ...@@ -633,6 +637,14 @@ export default {
this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val) this.editFormDataChannel[idx].optionList[2].isDisabled = [1, 2, 3].includes(val)
}, },
'editForm.pushChannelType'(newValue) { 'editForm.pushChannelType'(newValue) {
if (newValue == 2) {
this.editFormDataChannel = this.editFormDataChannel.filter(item => {
return item.name !== 'followerTypeId'
})
} else {
this.editFormDataChannel = this.editFormDataChannelCopy
}
setTimeout(() => { setTimeout(() => {
this.previewList = JSON.parse(JSON.stringify(this.previewList)) this.previewList = JSON.parse(JSON.stringify(this.previewList))
}) })
...@@ -651,6 +663,7 @@ export default { ...@@ -651,6 +663,7 @@ export default {
Object.assign(this.editForm, this.eventObj.info) Object.assign(this.editForm, this.eventObj.info)
this.editFormDataChannelCopy = JSON.parse(JSON.stringify(this.editFormDataChannel))
// 客户sop还是群sop做营销设置处理 // 客户sop还是群sop做营销设置处理
if (this.editForm.sopType == 2) { if (this.editForm.sopType == 2) {
this.editForm.pushChannelType = 1 this.editForm.pushChannelType = 1
...@@ -668,12 +681,11 @@ export default { ...@@ -668,12 +681,11 @@ export default {
methods: { methods: {
previewForm(val) { previewForm(val) {
console.log(this.previewList)
this.previewList = val this.previewList = val
val.forEach(item => { val.forEach(item => {
if ([2, 3].includes(item.attType)) { if ([2, 3].includes(item.attType)) {
this.editFormDataChannel[0].optionList[1].isDisabled = true this.editFormDataChannel[0].optionList[1].isDisabled = true
if (this.editForm.pushChannelType == 2) { if (this.editForm.pushChannelTypepushChannelType == 2) {
this.editForm.pushChannelType = '' this.editForm.pushChannelType = ''
} }
} else { } else {
...@@ -773,7 +785,6 @@ export default { ...@@ -773,7 +785,6 @@ export default {
getWelcomeDetails() { getWelcomeDetails() {
let backupContent = typeof (this.editForm.backupContent) == 'string' ? JSON.parse(this.editForm.backupContent) : this.editForm.backupContent let backupContent = typeof (this.editForm.backupContent) == 'string' ? JSON.parse(this.editForm.backupContent) : this.editForm.backupContent
console.log(backupContent)
if (backupContent) { if (backupContent) {
const previewList = backupContent.map(item => { const previewList = backupContent.map(item => {
if (item.attType == 7 || item.attType == 4) item.attContent = typeof (item.attContent) == 'string' ? JSON.parse(item.attContent) : item.attContent if (item.attType == 7 || item.attType == 4) item.attContent = typeof (item.attContent) == 'string' ? JSON.parse(item.attContent) : item.attContent
...@@ -804,7 +815,6 @@ export default { ...@@ -804,7 +815,6 @@ export default {
handleMarketingContent() { handleMarketingContent() {
let params = {} let params = {}
const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList const previewList = this.$common ? this.$common.utils.deepClone(this.$refs.welcome.previewList) : this.$refs.welcome.previewList
console.log(previewList)
if ((previewList[0] && previewList[0].attType == 1 && previewList[0].attContent == '') || !previewList.length || (previewList[0] && previewList[0].attType !== 1)) { if ((previewList[0] && previewList[0].attType == 1 && previewList[0].attContent == '') || !previewList.length || (previewList[0] && previewList[0].attType !== 1)) {
this.hasEventContentDisplaySpecial = true this.hasEventContentDisplaySpecial = true
} else { } else {
...@@ -1015,12 +1025,10 @@ export default { ...@@ -1015,12 +1025,10 @@ export default {
this.submit = false this.submit = false
return true return true
} }
console.log(this.editForm)
this.$emit('handleInfoConfirm', {baseInfo: this.editForm, predictCountObj: this.predictCountObj}) this.$emit('handleInfoConfirm', {baseInfo: this.editForm, predictCountObj: this.predictCountObj})
}) })
} else { } else {
// this.editForm.eventCount = 1 // this.editForm.eventCount = 1
console.log(this.editForm)
this.$emit('handleInfoConfirm', {baseInfo: this.editForm, predictCountObj: this.predictCountObj}) this.$emit('handleInfoConfirm', {baseInfo: this.editForm, predictCountObj: this.predictCountObj})
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!