Commit 84cdcb62 by 黑潮

update: 任务规则

parent c1107728
......@@ -147,6 +147,12 @@ import { getEntepriseList } from '../assets/api';
import TemplateDialog from './qywx-dialog';
import MaterialItem from './material-item';
const ruleMap = {
1: '专属导购',
2: '最近消费导购',
3: '服务门店店长'
};
export default {
name: 'lib-qywx',
props: {
......@@ -214,6 +220,7 @@ export default {
qywxEnterpriseId: '',
qywxEnterpriseName: '',
remark: '',
clerkRule: '1,2,3',
title: '',
expireDays: 1,
telFlag: 0,
......@@ -222,6 +229,13 @@ export default {
chatContent: null,
smsContent: null
};
this.ecmMarketingTypeRelationId = '';
this.materials = [];
this.ruleList = [
{ key: 1, value: '专属导购' },
{ key: 2, value: '最近消费导购' },
{ key: 3, value: '服务门店店长' }
];
this.step = 0;
this.$refs.form.resetFields();
this.$emit('update:show', false);
......@@ -250,13 +264,13 @@ export default {
if (qywx.chatFlag == 0) {
qywx.chatContent = null;
}
qywx.clerkRule = this.ruleList.map(el => el.key).join();
this.$emit('sendItem', { title: this.form.title, qywx, comName: 'qywx', ecmMarketingTypeRelationId: this.ecmMarketingTypeRelationId });
this.close();
},
async onNext() {
let valid = await this.$refs.form.validate();
if (valid) {
this.form.clerkRule = this.ruleList.map(el => el.key).join();
this.step = 1;
}
},
......@@ -322,16 +336,18 @@ export default {
if (this.item.qywx[key] !== undefined) {
this.form[key] = this.item.qywx[key];
}
if (this.item.qywx.chatContent) {
this.materials = JSON.parse(this.item.qywx.chatContent || '[]');
}
}
if (this.item.qywx && this.item.qywx.chatContent) {
this.materials = JSON.parse(this.item.qywx.chatContent || '[]');
}
this.ruleList = this.item.qywx.clerkRule.split(',').map(el => ({
key: parseInt(el),
value: ruleMap[el]
}));
this.form.title = this.item.title;
this.ecmMarketingTypeRelationId = this.item.ecmMarketingTypeRelationId;
} else {
this.isEdit = false;
this.ecmMarketingTypeRelationId = '';
this.materials = [];
}
},
immediate: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment