Commit dfffa617 by liuchenxi

update: 保存后刷新详情数据

parent 01440565
......@@ -322,15 +322,16 @@ export default {
return this.form.type == 1;
}
},
created() {
async created() {
if (this.editFlag) {
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '短信营销', path: '' }, { name: '模板库', path: '/message/temp' }, { name: '编辑模板', path: '' }]); // eslint-disable-line
this.LoadTempInfo();
} else {
const sign = await this.getMsgSign();
this.form.sign = sign.result.signText;
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '短信营销', path: '' }, { name: '模板库', path: '/message/temp' }, { name: '新增模板', path: '' }]); // eslint-disable-line
}
this.getUserData();
this.getMsgSign();
},
methods: {
submit: _debounce(function(formName) {
......@@ -363,13 +364,19 @@ export default {
},
async LoadTempInfo() {
this.loading = true;
let sign = await this.getMsgSign();
let res = await LoadTempInfo({ gicSmsTemplateId: this.$route.params.id });
let content = res.result.smsContent.trim() || '';
if (res.result.smsType == 1 && content.slice(-4) == '回T退订') {
content = content.slice(0, -4);
}
this.form = {
type: res.result.smsType,
content: res.result.smsContent,
content: content,
remark: res.result.remark,
title: res.result.smsTitle,
gicSmsTemplateId: res.result.gicSmsTemplateId
gicSmsTemplateId: res.result.gicSmsTemplateId,
sign: sign.result.signText
};
this.loading = false;
},
......@@ -447,9 +454,11 @@ export default {
},
// 获取短信签名
getMsgSign() {
getSign().then(res => {
this.form.sign = `【${res.result.signText}】` || '';
});
return getSign();
// return getSign().then(res => {
// this.form.sign = `【${res.result.signText}】` || '';
// console.log(12312321, this.form.sign);
// });
}
}
};
......
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