Commit 9b6fa1ff by caoyanzhi

update: 评价回访设置

parent f0e47084
...@@ -73,14 +73,9 @@ module.exports = [ ...@@ -73,14 +73,9 @@ module.exports = [
{ {
menu: ['评价回访', '', 1, 'iconpingjiahuifang'], menu: ['评价回访', '', 1, 'iconpingjiahuifang'],
children: [ children: [
// { {
// menu: ['评价回访设置', '', 1], // TODO 本次新增页面 menu: ['评价回访设置', 'evaluate-set', 1],
// children: [ }
// { menu: ['新增规则策略', '', 1] }, // TODO 本次新增页面
// { menu: ['编辑规则策略', '', 1] }, // TODO 本次新增页面
// { menu: ['查看规则策略', '', 1] }, // TODO 本次新增页面
// ]
// }
] ]
}, },
{ {
......
<!--
* @Descripttion: 当前组件信息
* @version: 1.0.0
* @Author: 无尘
* @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘
* @LastEditTime: 2020-12-18 15:10:29
-->
<template> <template>
<div class="app-detail-wrap"> <div class="evaluate-set" v-loading="loading">
<div class="app-detail-pane border-box p-20"> <el-form>
<div class="m-b-20"> <el-form-item>
<span class="font-14 p-r-10"></span> <dm-sub-title type="fill">订单评价设置</dm-sub-title>
<el-switch v-model="myCustomData.guideReplyFlag" :active-value="1" :inactive-value="0"></el-switch> </el-form-item>
<span class="p-r-10 font-14 color-303133">禁止订单关联导购回复评价</span><span class="font-12 color-909399 p-l-10">注:开启后,订单关联导购不可回复评价</span> <el-form-item>
</div> <el-switch v-model="formData.guideReplyFlag" :active-value="1" :inactive-value="0"></el-switch>
<div class="m-b-20"> <span class="switch-label">禁止订单关联导购回复评价</span>
<span class="font-14 p-r-10"></span> <p class="switch-tip">&nbsp;开启后,订单关联导购不可回复评价</p>
<el-switch v-model="myCustomData.allOrderFlag" :active-value="1" :inactive-value="0"></el-switch> </el-form-item>
<span class="p-r-10 font-14 color-303133">允许店员查看所有订单评价</span> <el-form-item>
</div> <el-switch v-model="formData.allOrderFlag" :active-value="1" :inactive-value="0"></el-switch>
<div class="m-t-46"> <span class="switch-label">允许店员查看所有订单评价</span>
<el-button type="primary" :loading="loading" @click="submit('searchFlag')" :disabled="$store.state.wxEnterpriseType">保 存</el-button> </el-form-item>
</div> <el-form-item>
</div> <dm-sub-title type="fill">不良评价回访设置</dm-sub-title>
</el-form-item>
<el-form :model="formData" :rules="formRules" ref="formData" label-width="110px">
<el-form-item label="不良评价拨打">
<el-checkbox-group v-model="formData.taskCallTypes">
<el-checkbox v-for="el in callTypes" :key="el.value" :label="el.value">
{{ el.label }}
<el-tooltip placement="top">
<template slot="content">
<p v-for="(tip, index) in el.tooltips" :key="index">{{ tip }}</p>
</template>
<i class="call-type-icon iconfont-components3 icon-cp-QuestionCircleOutlined"></i>
</el-tooltip>
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="任务分配" prop="distributeCustomerJudge">
<el-radio-group v-model="formData.distributeCustomerJudge">
<el-radio :label="1">
分配给消费门店店长
<el-tooltip class="item" effect="dark" content="勾选此项,不良评价回访任务将分配给产生该笔消费订单的所在门店店长" placement="top">
<i class="call-type-icon iconfont-components3 icon-cp-QuestionCircleOutlined"></i>
</el-tooltip>
</el-radio>
<el-radio :label="2">
分配给专属导购
<el-tooltip class="item" effect="dark" content="勾选此项,不良评价回访任务将分配给产生该笔消费订单的会员的专属导购" placement="top">
<i class="call-type-icon iconfont-components3 icon-cp-QuestionCircleOutlined"></i>
</el-tooltip>
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="逾期设置" prop="overDayJudge">
<div class="delay-config">
不良评价回访下发后<el-input-number class="delay-count" controls-position="right" v-model="formData.overDayJudge" placeholder="请输入内容" :step="1" :step-strictly="true" :min="0" :max="99999999"></el-input-number>
<p class="delay-tip">注:0天即为当天下发,当天完成,1天即为当天下发,次日24:00之前完成</p>
</div>
</el-form-item>
</el-form>
</el-form>
<el-button type="primary" @click="onSave">保存</el-button>
<!-- <hb-form-bottom>
</hb-form-bottom> -->
</div> </div>
</template> </template>
<script> <script>
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error'; import errMsg from '@/common/js/error';
import { _debounce } from '@/common/js/public'; import { postRequest } from '@/api/api';
import { postRequest, getRequest } from '@/api/api';
export default { export default {
name: 'evaluate-set', name: 'evaluate-set',
props: { props: {
...@@ -39,164 +70,134 @@ export default { ...@@ -39,164 +70,134 @@ export default {
default() { default() {
return ''; return '';
} }
},
tabType: {
type: String,
default() {
return '1';
}
} }
}, },
data() { data() {
const valiDistributeCustomer = (rules, value, callback) => {
if (value != 1 && value != 2) {
return callback(new Error('请设置任务分配'));
}
callback();
};
return { return {
projectName: '', // 当前项目名
wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '', wxEnterpriseRelatedId: sessionStorage.getItem('userInfos') ? JSON.parse(sessionStorage.getItem('userInfos')).wxEnterpriseId : '',
myCustomData: { formData: {
guideReplyFlag: 0, enterpriseId: '',
allOrderFlag: 0 guideReplyFlag: 0, // 导购回复状态1不可回复0可回复
allOrderFlag: 0, // 店员查看所有订单评价,1:是,0:否
taskCallTypes: [],
distributeCustomerJudge: '',
overDayJudge: 2
}, },
activeId: '1', formRules: {
distributeCustomerJudge: { required: true, validator: valiDistributeCustomer, trigger: 'blur' },
overDayJudge: { required: true }
},
callTypes: [
{
label: '企业电话',
value: '1',
tooltips: ['1.对接第三方呼叫中心,外呼显示第三方号码,可监控通话状态。费用结算及通话记录存储于GIC计费中心;', '2.若任务创建时无双向呼叫权限,此项设置勾选也不生效']
},
{
label: '私人电话',
value: '2',
tooltips: ['导购手机呼叫,无法监控通话状态。呼叫结算费用由导购手机自费']
},
{
label: '企微会话',
value: '3',
tooltips: ['通过企微会话完成任务,无法监控通话状态。不产生通话费用']
}
],
loading: false loading: false
}; };
}, },
methods: { methods: {
/** onSave() {
* 保存 this.loading = true;
*/ this.$refs.formData.validate(vali => {
submit: _debounce(function(type) { if (!vali) {
const that = this;
that.loading = true;
that.setData(type);
}, 500),
/**
* 保存-API
*/
setData(type) {
const { allOrderFlag, guideReplyFlag } = this.myCustomData;
let para = {
enterpriseId: this.brandId,
guideReplyFlag,
allOrderFlag
};
const url = '/haoban-app-aggregation-web/order-evaluation-setting';
postRequest(url, para)
.then(res => {
let resData = res.data;
this.loading = false; this.loading = false;
this.getCustomerSet(); return;
if (resData.errorCode == 1) { }
showMsg.showmsg('保存成功', 'success'); const { enterpriseId, guideReplyFlag, allOrderFlag, taskCallTypes, distributeCustomerJudge, overDayJudge } = this.formData;
return; postRequest('/haoban-app-tel-task-three-web/setting/save-task-setting', {
} enterpriseId,
errMsg.errorMsg(resData); guideReplyFlag,
allOrderFlag,
taskCallTypes: taskCallTypes.join(','),
distributeCustomerJudge,
overDayJudge
}) })
.catch(function(error) { .then(res => {
this.loading = false; const { errorCode } = res.data || {};
this.$message.error({ if (errorCode != 1) {
duration: 1000, return errMsg.errorMsg(res.data);
message: error.message
});
});
},
/**
* 获取数据
*/
getCustomerSet(brandId) {
const that = this;
let para = {
enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
};
getRequest('/haoban-app-aggregation-web/order-evaluation-find', para)
.then(res => {
let resData = res.data;
if (resData.errorCode == 1) {
if (!!resData.result) {
const { guideReplyFlag, allOrderFlag } = resData.result;
that.myCustomData.guideReplyFlag = guideReplyFlag;
that.myCustomData.allOrderFlag = allOrderFlag;
} }
return; this.$message.success('保存成功');
} })
errMsg.errorMsg(resData); .finally(() => {
}) setTimeout(() => (this.loading = false), 100);
.catch(function(error) {
that.$message.error({
duration: 1000,
message: error.message
}); });
});
},
getConfig() {
postRequest('/haoban-app-tel-task-three-web/setting/find-task-setting', { enterpriseId: this.formData.enterpriseId, taskType: 0 }).then(res => {
const { errorCode, result } = res.data || {};
if (errorCode != 1) {
return errMsg.errorMsg(res.data);
}
Object.assign(this.formData, {
guideReplyFlag: result.guideReplyFlag,
allOrderFlag: result.allOrderFlag,
taskCallTypes: typeof result.taskCallTypes == 'string' ? result.taskCallTypes.split(',') : [],
distributeCustomerJudge: result.distributeCustomerJudge,
overDayJudge: result.overDayJudge
}); });
});
} }
}, },
watch: { created() {
brandId: function(newData, oldData) { this.formData.enterpriseId = this.brandId;
const that = this; this.getConfig();
if (newData) { }
that.getCustomerSet(that.brandId);
}
}
},
mounted() {
const that = this;
that.$emit('showTab', '1');
if (that.brandId) {
that.getCustomerSet(that.brandId);
}
},
components: {}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.w-500 { .evaluate-set {
width: 500px;
}
.w-195 {
width: 195px;
}
.color-1890ff {
color: #2f54eb;
}
.p-20 {
padding: 20px; padding: 20px;
} .switch-label {
margin-left: 16px;
.p-l-38 { font-size: 14px;
padding-left: 38px; font-weight: 400;
} color: #303133;
.p-l-199 {
padding-left: 199px;
}
.app-detail-wrap {
height: 100%;
background: #fff;
.el-tabs {
background: #fff;
>>> .el-tabs__nav-wrap {
/* height: 48px;
line-height: 48px; */
&::after {
height: 1px;
}
/* .el-tabs__nav-scroll {
padding-left: 20px;
} */
}
} }
.condition-tip { .switch-tip {
width: 740px; padding-left: 56px;
.el-alert--info { font-size: 12px;
background: #e6f7ff; font-weight: 400;
border: 1px solid rgba(145, 213, 255, 1); color: #909399;
.el-alert__icon { line-height: 17px;
font-size: 12px; }
} .call-type-icon {
font-size: 12px;
color: #606266;
}
.delay-config {
font-size: 14px;
font-weight: 400;
color: #303133;
.delay-count {
margin: 0 10px;
width: 115px;
}
.delay-tip {
margin-top: 5px;
font-size: 12px;
font-weight: 400;
color: #909399;
line-height: 17px;
} }
} }
} }
......
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