Commit 5220d437 by chenxin

fix:增加提示

parent 81a42df8
......@@ -227,4 +227,8 @@
border-radius: 5px;
line-height: 16px;
}
}
.dm-notification {
z-index: 3000 !important;
}
\ No newline at end of file
......@@ -16,13 +16,14 @@
<el-radio :label="2">十二个月</el-radio>
</el-radio-group>
</div>
<div class="mt30"><el-button type="primary" class="save" @click="submit">保存</el-button></div>
<div class="mt30"><el-button type="primary" class="save" @click="handleSubmit">保存</el-button></div>
</section>
</section>
</template>
<script>
import { saveCallSetting, getCallSetting } from '@/service/api/calllogApi.js';
import { enableAccessControl, confirmInfo, alertInfo } from '@/utils/auth.js';
export default {
name: 'record',
......@@ -40,6 +41,13 @@ export default {
};
},
methods: {
handleSubmit() {
if (enableAccessControl) {
confirmInfo(this.submit);
} else {
this.submit();
}
},
submit() {
this.loading = true;
const { openFlag, storageType } = this;
......@@ -52,6 +60,11 @@ export default {
created() {
this.$store.commit('aside_handler', false);
this.$store.commit('mutations_breadcrumb', [{ name: '会员管理', path: '' }, { name: '通话记录', path: '/calllog/index' }, { name: '录音存储设置', path: '' }]);
},
mounted() {
if (enableAccessControl) {
alertInfo();
}
getCallSetting().then(res => {
const { callSetting, unitFee } = res.result;
if (callSetting) {
......
......@@ -18,13 +18,14 @@
每天赠送 <span v-if="form.shareGiveValueType === 2"><el-input-number controls-position="right" :min="0" class="w200" type="number" :disabled="form.shareGiveValueType !== 2" v-model="form.shareGiveValue"></el-input-number> 体力给好友,仅能送一次</span>
</el-radio>
<span slot="footer" class="dialog-footer">
<el-button @click="submit" type="primary">保 存</el-button>
<el-button @click="handleSubmit" type="primary">保 存</el-button>
<el-button @click="close">关 闭</el-button>
</span>
</el-dialog>
</template>
<script>
import { ptyxConfigDetail, ptyxConfigSave } from '@/service/api/gameApi.js';
import { enableAccessControl, confirmInfo, alertInfo } from '@/utils/auth.js';
export default {
props: {
show: {
......@@ -49,6 +50,9 @@ export default {
show(val) {
if (val) {
this.ptyxConfigDetail();
if (enableAccessControl) {
alertInfo();
}
}
}
},
......@@ -65,26 +69,31 @@ export default {
this.$emit('update:show', false);
},
submit() {
this.loading = true;
ptyxConfigSave(this.form).then(res => {
this.loading = false;
if (res.errorCode === 0) {
this.$tips({ type: 'success', message: '保存成功' });
this.close();
} else {
this.$tips({ type: 'error', message: res.message || '保存失败' });
}
});
},
handleSubmit() {
this.$confirm('是否保存配置?', '提示', {
confirmButtonText: '确定',
cancelBUttonText: '取消',
type: 'warning'
})
.then(() => {
this.loading = true;
ptyxConfigSave(this.form).then(res => {
this.loading = false;
if (res.errorCode === 0) {
this.$tips({ type: 'success', message: '保存成功' });
this.close();
} else {
this.$tips({ type: 'error', message: res.message || '保存失败' });
}
});
if (enableAccessControl) {
confirmInfo(this.submit);
} else {
this.submit();
}
})
.catch(err => {
this.$tips({ type: 'info', message: '取消保存' });
});
.catch(err => {});
}
}
};
......
......@@ -114,7 +114,7 @@
</el-form-item>
</section>
<div class="btn-wrap_fixed" :class="{ on: asideShow }">
<el-button type="primary" @click="updateTempAdvice">保 存</el-button>
<el-button type="primary" @click="handleUpdateTempAdvice">保 存</el-button>
<el-button @click="$router.go(-1)">返 回</el-button>
</div>
<var-dialog :options="options" :show.sync="varShow" @get-data="getVarData"></var-dialog>
......@@ -126,6 +126,7 @@ import { formatDateTimeByType, checkUrl } from '@/utils/index.js';
import varDialog from './variables.vue';
import innerUrl from '@/components/innerUrl/innerUrl';
import linktoolspage from '@/components/linktools/linktoolspage.vue';
import { enableAccessControl, confirmInfo, alertInfo } from '@/utils/auth.js';
export default {
name: 'add-record',
......@@ -180,6 +181,11 @@ export default {
this.$store.commit('mutations_breadcrumb', [{ name: '营销管理', path: '' }, { name: '模板消息', path: '/msg' }, { name: '模板消息编辑', path: '/msg/edit' }]);
this.listTemplateVariables();
},
mounted() {
if (enableAccessControl) {
alertInfo();
}
},
watch: {
'info.urlType'(val) {
if (this.info.urlType === 1) {
......@@ -333,6 +339,102 @@ export default {
this.info[this.currentTxet] += val;
},
updateTempAdvice() {
const params = {
templateId: this.$route.params.id,
weixinTemplateId: this.info.weixinTemplateId
};
let header = this.info.headerText;
let remark = this.info.remarkText;
this.options.map(v => {
if (header.indexOf(v.label) > -1) {
// console.log(new RegExp((v.label+'/g')))
header = header.replace(v.label, v.value);
}
if (remark.indexOf(v.label) > -1) {
remark = remark.replace(v.label, v.value);
}
this.templateKeyDataList.map(w => {
if (w.keyName === '使用渠道:') {
if (w.type.indexOf(v.label) > -1) {
w.type = w.type.replace(v.label, v.value);
}
}
});
});
params.header = header + this.info.headerColor;
params.remark = remark + this.info.remarkColor;
this.templateKeyDataList.map(v => {
v.datas = v.type + v.color;
});
params.list = this.templateKeyDataList;
// 如果是积分即将过期
if (this.info.triggerCode === 'integralexpires') {
params.sendTime = this.info.sendTime;
params.sendType = 1;
params.remindDay = this.info.remindDay;
} else {
params.sendType = 0;
}
let jumpUrlInfoJson = {};
let app = {};
let h5 = '';
if (this.checked1 && !this.checked2) {
jumpUrlInfoJson = {
type1: this.jumpUrlInfoJson.type1
};
h5 = this.info.h5;
params.urlType = 1;
if (this.radio1 === 2) {
jumpUrlInfoJson.type1 = '自定义网址';
}
} else if (!this.checked1 && this.checked2) {
jumpUrlInfoJson = {
type2: this.jumpUrlInfoJson.type2
};
app = this.info.app;
if (!app.id && this.jumpUrlInfoJson.type2) {
app = {};
}
params.urlType = 2;
} else if (this.checked1 && this.checked2) {
jumpUrlInfoJson = {
type1: this.jumpUrlInfoJson.type1,
type2: this.jumpUrlInfoJson.type2
};
if (this.radio1 === 2) {
jumpUrlInfoJson.type1 = '自定义网址';
}
h5 = this.info.h5;
app = this.info.app;
if (!app.id && this.jumpUrlInfoJson.type2) {
app = {};
}
params.urlType = 3;
} else {
params.urlType = 0;
}
updateTempAdvice({
templateAdvice: JSON.stringify(params),
app: app.id ? JSON.stringify(app) : '',
h5: h5,
jumpUrlInfoJson: JSON.stringify(jumpUrlInfoJson)
})
.then(res => {
if (res.errorCode === 0) {
this.$router.go(-1);
this.$tips({ type: 'warning', message: '提交成功' });
} else {
this.$tips({ type: 'error', message: '提交失败' });
}
})
.catch(err => {
this.$tips({ type: 'error', message: '提交失败' });
});
},
handleUpdateTempAdvice() {
if (this.checked1 && this.radio1 === 2) {
this.checkUrl();
}
......@@ -346,105 +448,13 @@ export default {
type: 'warning'
})
.then(() => {
const params = {
templateId: this.$route.params.id,
weixinTemplateId: this.info.weixinTemplateId
};
let header = this.info.headerText;
let remark = this.info.remarkText;
this.options.map(v => {
if (header.indexOf(v.label) > -1) {
// console.log(new RegExp((v.label+'/g')))
header = header.replace(v.label, v.value);
}
if (remark.indexOf(v.label) > -1) {
remark = remark.replace(v.label, v.value);
}
this.templateKeyDataList.map(w => {
if (w.keyName === '使用渠道:') {
if (w.type.indexOf(v.label) > -1) {
w.type = w.type.replace(v.label, v.value);
}
}
});
});
params.header = header + this.info.headerColor;
params.remark = remark + this.info.remarkColor;
this.templateKeyDataList.map(v => {
v.datas = v.type + v.color;
});
params.list = this.templateKeyDataList;
// 如果是积分即将过期
if (this.info.triggerCode === 'integralexpires') {
params.sendTime = this.info.sendTime;
params.sendType = 1;
params.remindDay = this.info.remindDay;
if (enableAccessControl) {
confirmInfo(this.updateTempAdvice);
} else {
params.sendType = 0;
this.updateTempAdvice();
}
let jumpUrlInfoJson = {};
let app = {};
let h5 = '';
if (this.checked1 && !this.checked2) {
jumpUrlInfoJson = {
type1: this.jumpUrlInfoJson.type1
};
h5 = this.info.h5;
params.urlType = 1;
if (this.radio1 === 2) {
jumpUrlInfoJson.type1 = '自定义网址';
}
} else if (!this.checked1 && this.checked2) {
jumpUrlInfoJson = {
type2: this.jumpUrlInfoJson.type2
};
app = this.info.app;
if (!app.id && this.jumpUrlInfoJson.type2) {
app = {};
}
params.urlType = 2;
} else if (this.checked1 && this.checked2) {
jumpUrlInfoJson = {
type1: this.jumpUrlInfoJson.type1,
type2: this.jumpUrlInfoJson.type2
};
if (this.radio1 === 2) {
jumpUrlInfoJson.type1 = '自定义网址';
}
h5 = this.info.h5;
app = this.info.app;
if (!app.id && this.jumpUrlInfoJson.type2) {
app = {};
}
params.urlType = 3;
} else {
params.urlType = 0;
}
updateTempAdvice({
templateAdvice: JSON.stringify(params),
app: app.id ? JSON.stringify(app) : '',
h5: h5,
jumpUrlInfoJson: JSON.stringify(jumpUrlInfoJson)
})
.then(res => {
if (res.errorCode === 0) {
this.$router.go(-1);
this.$tips({ type: 'warning', message: '提交成功' });
} else {
this.$tips({ type: 'error', message: '提交失败' });
}
})
.catch(err => {
this.$tips({ type: 'error', message: '提交失败' });
});
})
.catch(err => {
console.log(err);
this.$tips({ type: 'info', message: '已取消提交' });
});
.catch(err => {});
},
getRightUrl(data) {
console.log(data);
......
......@@ -27,7 +27,7 @@
<el-table-column label="操作" align="left" width="140px" fixed="right">
<template slot-scope="scope">
<el-button v-if="scope.row.bindStatusDesc !== '未绑定'" type="text" @click="$router.push('/msg/edit/' + scope.row.templateId)">编辑</el-button>
<dm-delete v-if="scope.row.bindStatusDesc !== '未绑定'" @confirm="delData(scope.row)" tips="将同步删除公众号后台对应模板,一旦删除无法恢复。您确认吗?">
<dm-delete v-if="scope.row.bindStatusDesc !== '未绑定'" @confirm="handleDel(scope.row)" tips="将同步删除公众号后台对应模板,一旦删除无法恢复。您确认吗?">
<el-button type="text">删除</el-button>
</dm-delete>
</template>
......@@ -39,6 +39,7 @@
<script>
import { pageTemplateMessage, syncWechatMessageTemplate, getLatestSyncTime, deleteTemplateAdvice } from '@/service/api/msgApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
import { enableAccessControl, confirmInfo } from '@/utils/auth.js';
export default {
name: 'sms-record',
data() {
......@@ -142,6 +143,13 @@ export default {
this.listParams.sortBy = obj.order === 'descending' ? obj.prop + ' desc' : obj.prop;
this.pageTemplateMessage();
},
handleDel(row) {
if (enableAccessControl) {
confirmInfo(this.delData, row);
} else {
this.delData(row);
}
},
delData(row) {
deleteTemplateAdvice({ templateId: row.templateId, weixinTemplateId: row.weixinTemplateId })
.then(res => {
......
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