Commit b74cd6cc by chenwq Committed by 杨北旺

编辑sop

1 parent b0a7675e
......@@ -38,12 +38,15 @@
<div class="flex-default event-title">
<p class="m-r-10">{{ item.eventStartDate }}</p>
<p class="m-r-20">{{ item.eventTime }}</p>
<p class="m-r-20">{{ item.eventEndDate }}</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">每周{{ item.repeatTime }}重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y' && item.repeatMode == 3">每月{{ item.repeatTime }}重复循环至</p>
<p class="m-r-20" v-show="item.repeatFlag == 'Y'">{{ item.eventEndDate }}</p>
<p class="m-r-20 txt-blue">{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}</p>
</div>
<div class="event-content">{{ item.eventContent }}</div>
<div class="event-link">图+字</div>
<div class="event-btns">
<div class="event-link" v-if="item.object">{{ item.object.objectName }}</div>
<div v-if="new Date(item.eventStartDate) > new Date()" class="event-btns">
<el-button class="default" :size="size" @click="handleEventDelete(index)">删除</el-button>
<el-button class="default-blue-btn" :size="size" @click="handleEventEdit('edit', item, index)">编辑</el-button>
</div>
......@@ -96,7 +99,7 @@ export default {
},
editRule: {
sopName: [{ required: true, message: '请输入sop名称', trigger: 'change' }],
sopTime: [{ required: true, message: '请选择营销时间', trigger: 'change' }],
// sopTime: [{ required: true, message: '请选择营销时间', trigger: 'change' }],
customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }],
},
isEdit: true,
......@@ -177,12 +180,23 @@ export default {
console.log(res)
this.editForm = res
this.editForm.customerInfoList = this.editForm.customerInfoList || []
this.editForm.customerInfoList.forEach(item => {
item.id = item.customerId
})
this.editForm.customerInfoList.length && this.recoveryCondLimit()
this.$nextTick(() => {
this.editStatus = false
})
})
},
// 恢复企微和手机号限制
recoveryCondLimit() {
var obj = this.editForm.customerInfoList[0]
this.condLimitObj.hasQw = obj.isJoin
this.condLimitObj.hasPhone = obj.customerPhone ? 1 : 0
},
// 选择标签
handleSelect(obj) {
this.tagging = obj.selectedLabelList
......@@ -252,6 +266,30 @@ export default {
delete params.customerInfoList
if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id
params.eventList = []
this.editForm.eventList.forEach((item, index) => {
params.eventList.push({
eventContent: item.eventContent,
eventCount: item.eventCount,
eventStartDate: item.eventStartDate,
eventTime: item.eventTime,
pushChannelType: item.pushChannelType,
repeatFlag: item.repeatFlag,
repeatMode: item.repeatMode,
sopName: item.sopName,
sopId: this.routeInfo.id
})
if (item.id) {
params.eventList[index].id = item.id
}
if (item.repeatFlag == 'Y') {
params.eventList[index].repeatTime = item.repeatTime
params.eventList[index].eventEndDate = item.eventEndDate
}
if (item.object) {
params.eventList[index].object = item.object
}
})
}
console.log(params)
this.$apis.sop.insertOrUpdateSopApi(params).then(res => {
......
......@@ -114,7 +114,19 @@ export default {
return
}
this.dialogVisible = false
this.$emit('selectActivity', { marketingId: this.selectItem.id ? this.selectItem.id : this.selectItem.equityClassId, marketingType: this.activeName, marketingName: this.activeName == 3 ? this.selectItem.equityName : this.activeName == 4 ? this.selectItem.packageName : this.activeName == 5 ? this.selectItem.activityName : this.activeName == 2 ? this.selectItem.couponName : this.selectItem.equityName })
console.log(this.selectItem)
var typeToObj = {
2: 5,
3: 6,
4: 7,
5: 8
}
// this.$emit('selectActivity', { marketingId: this.selectItem.id ? this.selectItem.id : this.selectItem.equityClassId, marketingType: this.activeName, marketingName: this.activeName == 3 ? this.selectItem.equityName : this.activeName == 4 ? this.selectItem.packageName : this.activeName == 5 ? this.selectItem.activityName : this.activeName == 2 ? this.selectItem.couponName : this.selectItem.equityName })
this.$emit('selectActivity', {
objectId: this.selectItem.id ? this.selectItem.id : this.selectItem.equityClassId,
objectType: typeToObj[this.activeName],
objectName: this.activeName == 3 ? 2 : this.activeName == 4 ? 2 : this.activeName == 5 ? 2 : this.activeName == 2 ? 3 : this.selectItem.equityName
})
},
handleSizeChange(val) {
this.pageSize = val
......
......@@ -176,7 +176,6 @@ export default {
setTableFinishFun() {
this.tableList = this.$refs.customerRef.data
// this.tableList[0].customerPhone = '13099999999'
this.recoverySelected()
//接收到的数据为空
this.$refs.customerRef.data.length ? (this.$refs.customerRef.tableHeightValues = '') : this.$refs.customerRef.setTableHeightFun()
......
......@@ -16,13 +16,13 @@
<glsx-combi-form ref="editFormRefRepeat" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataRepeat" :formRules="editRule"></glsx-combi-form>
<glsx-combi-form ref="editFormRefTime" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :formRef="editChildRef" :formObj="editForm" :formData="editFormDataTime" :formRules="editRule">
<div class="flex-default m-r-20" slot="repeatTime" slot-scope="scope">
<div class="flex-default m-r-20" v-if="editForm.repeatMode == '2'">
<div class="flex-default m-r-20" v-if="editForm.repeatMode == 2">
<p style="width: 50px;">每周</p>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每周指定日期">
<el-option v-for="item in baseData.weekList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
</el-select>
</div>
<div class="flex-default m-r-20" v-if="editForm.repeatMode == '3'">
<div class="flex-default m-r-20" v-if="editForm.repeatMode == 3">
<p style="width: 50px;">每月</p>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每月指定日期">
<el-option v-for="item in baseData.monthList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
......@@ -56,7 +56,7 @@
</template> -->
<template v-else-if="itm.attType == 7">
<img src="@/assets/sop/icon-applet.png" alt />
<span :title="itm.attContent.marketingName">{{ itm.attContent.marketingName }}</span>
<span :title="itm.attContent.objectName">{{ itm.attContent.objectName }}</span>
</template>
<!-- <template v-else-if="itm.attType == 5">
<img src="@/assets/sop/icon-applet.png" alt />
......@@ -469,7 +469,7 @@ export default {
},
selectActivity(val) {
console.log(val)
this.editForm.object = JSON.parse(JSON.stringify(val))
let idx
const hasActivity = this.previewList.some((item, index) => {
if (item.attType == 7) {
......@@ -550,10 +550,15 @@ export default {
this.submit = false
return true
}
this.$apis.sop.parseEventCountApi(countParams).then(res => {
this.editForm.eventCount = res.eventStatistics.eventCount
if (this.editForm.repeatFlag == 'Y') {
this.$apis.sop.parseEventCountApi(countParams).then(res => {
this.editForm.eventCount = res.eventStatistics.eventCount
this.$emit('handleInfoConfirm', { baseInfo: this.editForm })
})
} else {
this.editForm.eventCount = 1
this.$emit('handleInfoConfirm', { baseInfo: this.editForm })
})
}
},
cancelJump() {
this.$emit('handleTabChange', { activeName: 'baseInfo' })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!