Commit b3e919ff by 杨北旺

编辑sop-营销时间

1 parent 3adda9d6
...@@ -52,6 +52,7 @@ export default { ...@@ -52,6 +52,7 @@ export default {
// console.log(this.$refs.baseInfoRef.editForm.eventList) // console.log(this.$refs.baseInfoRef.editForm.eventList)
this.eventObj.addOrEdit == 'add' ? this.$refs.baseInfoRef.editForm.eventList.push(info.baseInfo) : this.$set(this.$refs.baseInfoRef.editForm.eventList, this.eventIndex, info.baseInfo) this.eventObj.addOrEdit == 'add' ? this.$refs.baseInfoRef.editForm.eventList.push(info.baseInfo) : this.$set(this.$refs.baseInfoRef.editForm.eventList, this.eventIndex, info.baseInfo)
console.log(this.$refs.baseInfoRef.editForm) console.log(this.$refs.baseInfoRef.editForm)
this.$refs.baseInfoRef.dealSopTime()
this.jumpBaseInfo({ activeName: 'baseInfo' }) this.jumpBaseInfo({ activeName: 'baseInfo' })
}, },
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<p class="edit-title">{{ title }}</p> <p class="edit-title">{{ title }}</p>
<glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"> <glsx-combi-form class="edit-form-container m-r-20" ref="editFormRef" :isEdit="isEdit" :labelWidth="labelWidth" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<div slot="startDate"> <div slot="startDate">
<div v-show="editForm.eventList.length">{{ editForm.startDate }} <div v-show="editForm.eventList.length">
{{ editForm.startDate }}
<span v-show="editForm.endDate">- {{ editForm.endDate }}</span> <span v-show="editForm.endDate">- {{ editForm.endDate }}</span>
</div> </div>
</div> </div>
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div class="container edit-container"> <div class="container edit-container">
<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.length || !editForm.sopName)" effect="dark" content="请先完善sop名称和营销对象" placement="top"> <el-tooltip :disabled="!(!editForm.customerInfoList.length || !editForm.sopName)" effect="dark" content="请先完善sop名称和营销对象" placement="top">
<div> <div>
...@@ -111,7 +112,7 @@ export default { ...@@ -111,7 +112,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,
editFormData: [ editFormData: [
...@@ -263,6 +264,22 @@ export default { ...@@ -263,6 +264,22 @@ export default {
this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList') this.$refs.editFormRef.$refs[this.editChildRef].validateField('customerInfoList')
}, },
// 处理营销时间
dealSopTime() {
if (!this.editForm.eventList.length) {
this.editForm.startDate = ''
this.editForm.endDate = ''
return true
}
var val = this.editForm.eventList[0]
this.editForm.startDate = val.eventStartDate
this.editForm.endDate = val.repeatFlag == 'Y' ? val.eventEndDate : ''
this.editForm.eventList.forEach(item => {
this.editForm.startDate = new Date(this.editForm.startDate) < new Date(item.eventStartDate) ? this.editForm.startDate : item.eventStartDate
this.editForm.endDate = item.repeatFlag == 'Y' ? (new Date(this.editForm.endDate) > new Date(item.eventEndDate) ? this.editForm.endDate : item.eventEndDate) : this.editForm.endDate
})
},
handleEventDelete(idx) { handleEventDelete(idx) {
this.$confirm('是否删除该条营销事件', '删除', { this.$confirm('是否删除该条营销事件', '删除', {
confirmButtonText: '确定', confirmButtonText: '确定',
...@@ -273,6 +290,7 @@ export default { ...@@ -273,6 +290,7 @@ export default {
let obj = this.editForm.eventList[idx] let obj = this.editForm.eventList[idx]
obj.id && this.deleteIdList.push(obj.id) obj.id && this.deleteIdList.push(obj.id)
this.editForm.eventList.splice(idx, 1) this.editForm.eventList.splice(idx, 1)
this.dealSopTime()
} }
} }
}) })
...@@ -384,7 +402,7 @@ export default { ...@@ -384,7 +402,7 @@ export default {
.then(() => { .then(() => {
this.cancelJump() this.cancelJump()
}) })
.catch(() => { }) .catch(() => {})
} else { } else {
this.cancelJump() this.cancelJump()
} }
......
...@@ -105,6 +105,9 @@ export default { ...@@ -105,6 +105,9 @@ export default {
// needTip: ['editProduct'], // needTip: ['editProduct'],
activeName: '1', activeName: '1',
modelList: [], modelList: [],
selectItem: {
id: ''
},
// 分页 // 分页
pageNum: 1, pageNum: 1,
pageSize: 12, pageSize: 12,
...@@ -161,6 +164,7 @@ export default { ...@@ -161,6 +164,7 @@ export default {
pageSize: this.pageSize pageSize: this.pageSize
} }
this.$apis.sop.getMomentListApi(params).then(res => { this.$apis.sop.getMomentListApi(params).then(res => {
console.log(res)
this.modelList = res.data this.modelList = res.data
this.tableTotal = res.count this.tableTotal = res.count
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!