Commit b74cd6cc by chenwq Committed by 杨北旺

编辑sop

1 parent b0a7675e
...@@ -38,12 +38,15 @@ ...@@ -38,12 +38,15 @@
<div class="flex-default event-title"> <div class="flex-default event-title">
<p class="m-r-10">{{ item.eventStartDate }}</p> <p class="m-r-10">{{ item.eventStartDate }}</p>
<p class="m-r-20">{{ item.eventTime }}</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> <p class="m-r-20 txt-blue">{{ baseData.channelTypeList.find(k => k.confId == item.pushChannelType).confName }}</p>
</div> </div>
<div class="event-content">{{ item.eventContent }}</div> <div class="event-content">{{ item.eventContent }}</div>
<div class="event-link">图+字</div> <div class="event-link" v-if="item.object">{{ item.object.objectName }}</div>
<div class="event-btns"> <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" :size="size" @click="handleEventDelete(index)">删除</el-button>
<el-button class="default-blue-btn" :size="size" @click="handleEventEdit('edit', item, index)">编辑</el-button> <el-button class="default-blue-btn" :size="size" @click="handleEventEdit('edit', item, index)">编辑</el-button>
</div> </div>
...@@ -96,7 +99,7 @@ export default { ...@@ -96,7 +99,7 @@ export default {
}, },
editRule: { editRule: {
sopName: [{ required: true, message: '请输入sop名称', trigger: 'change' }], 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' }], customerInfoList: [{ required: true, message: '请选择营销对象', trigger: 'change' }],
}, },
isEdit: true, isEdit: true,
...@@ -177,12 +180,23 @@ export default { ...@@ -177,12 +180,23 @@ export default {
console.log(res) console.log(res)
this.editForm = res this.editForm = res
this.editForm.customerInfoList = this.editForm.customerInfoList || [] this.editForm.customerInfoList = this.editForm.customerInfoList || []
this.editForm.customerInfoList.forEach(item => {
item.id = item.customerId
})
this.editForm.customerInfoList.length && this.recoveryCondLimit()
this.$nextTick(() => { this.$nextTick(() => {
this.editStatus = false this.editStatus = false
}) })
}) })
}, },
// 恢复企微和手机号限制
recoveryCondLimit() {
var obj = this.editForm.customerInfoList[0]
this.condLimitObj.hasQw = obj.isJoin
this.condLimitObj.hasPhone = obj.customerPhone ? 1 : 0
},
// 选择标签 // 选择标签
handleSelect(obj) { handleSelect(obj) {
this.tagging = obj.selectedLabelList this.tagging = obj.selectedLabelList
...@@ -252,6 +266,30 @@ export default { ...@@ -252,6 +266,30 @@ export default {
delete params.customerInfoList delete params.customerInfoList
if (this.routeInfo.addOrEdit == 'edit') { if (this.routeInfo.addOrEdit == 'edit') {
params.id = this.routeInfo.id 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) console.log(params)
this.$apis.sop.insertOrUpdateSopApi(params).then(res => { this.$apis.sop.insertOrUpdateSopApi(params).then(res => {
......
...@@ -114,7 +114,19 @@ export default { ...@@ -114,7 +114,19 @@ export default {
return return
} }
this.dialogVisible = false 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) { handleSizeChange(val) {
this.pageSize = val this.pageSize = val
......
...@@ -176,7 +176,6 @@ export default { ...@@ -176,7 +176,6 @@ export default {
setTableFinishFun() { setTableFinishFun() {
this.tableList = this.$refs.customerRef.data this.tableList = this.$refs.customerRef.data
// this.tableList[0].customerPhone = '13099999999'
this.recoverySelected() this.recoverySelected()
//接收到的数据为空 //接收到的数据为空
this.$refs.customerRef.data.length ? (this.$refs.customerRef.tableHeightValues = '') : this.$refs.customerRef.setTableHeightFun() this.$refs.customerRef.data.length ? (this.$refs.customerRef.tableHeightValues = '') : this.$refs.customerRef.setTableHeightFun()
......
...@@ -16,13 +16,13 @@ ...@@ -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="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"> <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" 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> <p style="width: 50px;">每周</p>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每周指定日期"> <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-option v-for="item in baseData.weekList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
</el-select> </el-select>
</div> </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> <p style="width: 50px;">每月</p>
<el-select :size="size" v-model="editForm[scope.scope.name]" placeholder="请选择每月指定日期"> <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> <el-option v-for="item in baseData.monthList" :key="item.confId" :label="item.confName" :value="item.confId"></el-option>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</template> --> </template> -->
<template v-else-if="itm.attType == 7"> <template v-else-if="itm.attType == 7">
<img src="@/assets/sop/icon-applet.png" alt /> <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>
<!-- <template v-else-if="itm.attType == 5"> <!-- <template v-else-if="itm.attType == 5">
<img src="@/assets/sop/icon-applet.png" alt /> <img src="@/assets/sop/icon-applet.png" alt />
...@@ -469,7 +469,7 @@ export default { ...@@ -469,7 +469,7 @@ export default {
}, },
selectActivity(val) { selectActivity(val) {
console.log(val) this.editForm.object = JSON.parse(JSON.stringify(val))
let idx let idx
const hasActivity = this.previewList.some((item, index) => { const hasActivity = this.previewList.some((item, index) => {
if (item.attType == 7) { if (item.attType == 7) {
...@@ -550,10 +550,15 @@ export default { ...@@ -550,10 +550,15 @@ export default {
this.submit = false this.submit = false
return true return true
} }
if (this.editForm.repeatFlag == 'Y') {
this.$apis.sop.parseEventCountApi(countParams).then(res => { this.$apis.sop.parseEventCountApi(countParams).then(res => {
this.editForm.eventCount = res.eventStatistics.eventCount this.editForm.eventCount = res.eventStatistics.eventCount
this.$emit('handleInfoConfirm', { baseInfo: this.editForm }) this.$emit('handleInfoConfirm', { baseInfo: this.editForm })
}) })
} else {
this.editForm.eventCount = 1
this.$emit('handleInfoConfirm', { baseInfo: this.editForm })
}
}, },
cancelJump() { cancelJump() {
this.$emit('handleTabChange', { activeName: 'baseInfo' }) 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!