Commit c6dce127 by crushh

update: 查看所有评价

parent 46f785d9
...@@ -12,9 +12,14 @@ ...@@ -12,9 +12,14 @@
<div class="app-detail-pane border-box p-20"> <div class="app-detail-pane border-box p-20">
<div class="m-b-20"> <div class="m-b-20">
<span class="font-14 p-r-10"></span> <span class="font-14 p-r-10"></span>
<el-switch v-model="myCustomData.guideReplyFlag"></el-switch> <el-switch v-model="myCustomData.guideReplyFlag" :active-value="1" :inactive-value="0"></el-switch>
<span class="p-r-10 font-14 color-303133">禁止订单关联导购回复评价</span><span class="font-12 color-909399 p-l-10">注:开启后,订单关联导购不可回复评价</span> <span class="p-r-10 font-14 color-303133">禁止订单关联导购回复评价</span><span class="font-12 color-909399 p-l-10">注:开启后,订单关联导购不可回复评价</span>
</div> </div>
<div class="m-b-20">
<span class="font-14 p-r-10"></span>
<el-switch v-model="myCustomData.allOrderFlag" :active-value="1" :inactive-value="0"></el-switch>
<span class="p-r-10 font-14 color-303133">允许店员查看所有订单评价</span>
</div>
<div class="m-t-46"> <div class="m-t-46">
<el-button type="primary" :loading="loading" @click="submit('searchFlag')" :disabled="$store.state.wxEnterpriseType">保 存</el-button> <el-button type="primary" :loading="loading" @click="submit('searchFlag')" :disabled="$store.state.wxEnterpriseType">保 存</el-button>
</div> </div>
...@@ -25,7 +30,7 @@ ...@@ -25,7 +30,7 @@
import showMsg from '@/common/js/showmsg'; 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 { _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: {
...@@ -53,7 +58,8 @@ export default { ...@@ -53,7 +58,8 @@ export default {
projectName: '', // 当前项目名 projectName: '', // 当前项目名
wxEnterpriseRelatedId: localStorage.getItem('userInfos') ? JSON.parse(localStorage.getItem('userInfos')).wxEnterpriseId : '', wxEnterpriseRelatedId: localStorage.getItem('userInfos') ? JSON.parse(localStorage.getItem('userInfos')).wxEnterpriseId : '',
myCustomData: { myCustomData: {
guideReplyFlag: false guideReplyFlag: 0,
allOrderFlag: 0
}, },
activeId: '1', activeId: '1',
loading: false loading: false
...@@ -73,18 +79,18 @@ export default { ...@@ -73,18 +79,18 @@ export default {
* 保存-API * 保存-API
*/ */
setData(type) { setData(type) {
const that = this; const { allOrderFlag, guideReplyFlag } = this.myCustomData;
let para = { let para = {
enterpriseId: that.brandId, enterpriseId: this.brandId,
// wxEnterpriseRelatedId: that.wxEnterpriseRelatedId, guideReplyFlag,
guideReplyFlag: that.myCustomData.guideReplyFlag ? 1 : '0' allOrderFlag
}; };
const url = '/haoban-app-aggregation-web/order-evaluation-setting'; const url = '/haoban-app-aggregation-web/order-evaluation-setting';
postRequest(url, para) postRequest(url, para)
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
that.loading = false; this.loading = false;
that.getCustomerSet(); this.getCustomerSet();
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
showMsg.showmsg('保存成功', 'success'); showMsg.showmsg('保存成功', 'success');
return; return;
...@@ -92,8 +98,8 @@ export default { ...@@ -92,8 +98,8 @@ export default {
errMsg.errorMsg(resData); errMsg.errorMsg(resData);
}) })
.catch(function(error) { .catch(function(error) {
that.loading = false; this.loading = false;
that.$message.error({ this.$message.error({
duration: 1000, duration: 1000,
message: error.message message: error.message
}); });
...@@ -109,12 +115,14 @@ export default { ...@@ -109,12 +115,14 @@ export default {
enterpriseId: that.brandId, enterpriseId: that.brandId,
wxEnterpriseRelatedId: that.wxEnterpriseRelatedId wxEnterpriseRelatedId: that.wxEnterpriseRelatedId
}; };
postRequest('/haoban-app-aggregation-web/order-evaluation-find', para) getRequest('/haoban-app-aggregation-web/order-evaluation-find', para)
.then(res => { .then(res => {
let resData = res.data; let resData = res.data;
if (resData.errorCode == 1) { if (resData.errorCode == 1) {
if (!!resData.result) { if (!!resData.result) {
that.myCustomData.guideReplyFlag = resData.result.guideReplyFlag == 1 ? true : false; const { guideReplyFlag, allOrderFlag } = resData.result;
that.myCustomData.guideReplyFlag = guideReplyFlag;
that.myCustomData.allOrderFlag = allOrderFlag;
} }
return; return;
} }
......
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