Commit 2816e2ef by Jings

add: 导购设置页面修改

parent eda23a93
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @version: 1.0.0 * @version: 1.0.0
* @Author: 无尘 * @Author: 无尘
* @Date: 2018-10-10 14:44:45 * @Date: 2018-10-10 14:44:45
* @LastEditors: 无尘 * @LastEditors: Drama
* @LastEditTime: 2020-12-14 16:54:50 * @LastEditTime: 2022-09-20 15:03:02
*/ */
import Vue from 'vue'; import Vue from 'vue';
import Router from 'vue-router'; import Router from 'vue-router';
...@@ -119,7 +119,8 @@ export const constantRouterMap = [ ...@@ -119,7 +119,8 @@ export const constantRouterMap = [
{ {
path: '/guide-setting', path: '/guide-setting',
name: '导购设置', name: '导购设置',
component: _import('enterprise', 'guide-setting') // component: _import('enterprise', 'guide-setting')
component: _import('enterprise', 'guide-setting-copy')
}, },
{ {
path: '/setting', path: '/setting',
...@@ -168,6 +169,12 @@ export const constantRouterMap = [ ...@@ -168,6 +169,12 @@ export const constantRouterMap = [
name: '话务任务详情', name: '话务任务详情',
component: _import('salesleads/trafficTask', 'taskViewDetail') component: _import('salesleads/trafficTask', 'taskViewDetail')
}, },
// TODO: 导购视图
// {
// path: '/shopGuidView',
// name: '导购视图',
// component: _import('salesleads/trafficTask', 'shopGuidView')
// },
{ {
path: '/trafficTaskSet', path: '/trafficTaskSet',
name: '话务任务设置', name: '话务任务设置',
...@@ -433,6 +440,8 @@ export const constantRouterMap = [ ...@@ -433,6 +440,8 @@ export const constantRouterMap = [
path: '/goodsShowSet', path: '/goodsShowSet',
name: '商品展示设置', name: '商品展示设置',
component: _import('apps/shoppingCenter', 'goodsShowSet') component: _import('apps/shoppingCenter', 'goodsShowSet')
// component: _import('apps/shoppingCenter', 'goodsShowSetCopy')
}, },
// 订单评价 // 订单评价
{ {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* @version: 1.0.0 * @version: 1.0.0
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘 * @LastEditors: Drama
* @LastEditTime: 2020-08-26 10:01:07 * @LastEditTime: 2022-09-19 10:09:46
--> -->
<!-- <!--
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</div> </div>
<div> <div>
<el-checkbox v-if="$getButtonLimit($buttonCode.groupExpire)" :limit-code="$buttonCode.groupExpire" v-model="overTimeSeeFlag" @change="saveGroupSet" :disabled="$store.state.wxEnterpriseType"> <el-checkbox v-if="$getButtonLimit($buttonCode.groupExpire)" :limit-code="$buttonCode.groupExpire" v-model="overTimeSeeFlag" @change="saveGroupSet" :disabled="$store.state.wxEnterpriseType">
<el-tooltip class="item" effect="dark" content="开启后,GIC中设置的好办端会员分组失效后,即使在GIC开启好办展示,好办移动端也不再展示该条分组" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;margin-left:-4px;" class="font-14 color-606266 m-r-20">会员分组失效后不展示</span></el-tooltip> <el-tooltip class="item" effect="dark" content="勾选后,失效的分组不在好办小程序端展示" placement="top-start"> <span style="cursor: pointer;padding-bottom: 2px; border-bottom: 1px dashed #2F54EB;margin-left:-4px;" class="font-14 color-606266 m-r-20">会员分组失效后不展示</span></el-tooltip>
</el-checkbox> </el-checkbox>
<el-button v-if="$getButtonLimit($buttonCode.syncGroup)" :limit-code="$buttonCode.syncGroup" type="primary" :loading="loadingBtn" @click="toSync" :disabled="$store.state.wxEnterpriseType">立即同步</el-button> <el-button v-if="$getButtonLimit($buttonCode.syncGroup)" :limit-code="$buttonCode.syncGroup" type="primary" :loading="loadingBtn" @click="toSync" :disabled="$store.state.wxEnterpriseType">立即同步</el-button>
<span v-if="syncDate" class="font-14 color-606266 p-r-10">最近一次同步时间:{{ syncDate | formatTimeStamp }}</span> <span v-if="syncDate" class="font-14 color-606266 p-r-10">最近一次同步时间:{{ syncDate | formatTimeStamp }}</span>
......
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
* @Author: Drama * @Author: Drama
* @Date: 2022-09-14 11:09:43 * @Date: 2022-09-14 11:09:43
* @LastEditors: Drama * @LastEditors: Drama
* @LastEditTime: 2022-09-16 14:49:14 * @LastEditTime: 2022-09-20 14:59:20
* @FilePath: /haoban-3/src/views/enterprise/guide-setting-copy.vue * @FilePath: /haoban-3/src/views/enterprise/guide-setting-copy.vue
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
<template> <template>
<div class="app-detail-wrap"> <div class="app-detail-wrap">
<div class="border-box p-t-30 p-l-26 p-r-211"> <div class="border-box p-t-30 p-l-26 p-r-211">
<el-form v-model="roleForm" label-width="100px"> <el-form ref="ruleForm" v-model="roleForm" label-width="100px">
<el-form-item label="应用权限" required> <el-form-item label="应用权限" required>
<div class="dis-f"> <div class="dis-f">
<div class="title-wrap border-box border-radio-2"> <div class="title-wrap border-box border-radio-2">
...@@ -24,20 +24,11 @@ ...@@ -24,20 +24,11 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="" prop="" class=""> <el-form-item label="" prop="" class="">
<!-- TODO: 权限树 是否使用vue-gic-auth-tree组件 -->
<!-- <div class="right-config">
<div class="title">
<p>权限设置</p>
</div>
</div> -->
<!-- <div class="right-wrap_ account-limit-wrap expend" v-loading="loading">
<elNewTree :data="treeData" show-checkbox ref="tree1" node-key="rightId" :default-checked-keys="withoutParents" :default-expanded-keys="setDefaultExpandedKeys(treeData)" :props="defaultProps"> </elNewTree>
</div> -->
<vue-gic-auth-tree class="auth-tree" :data="treeData" show-checkbox ref="tree" node-key="menuCode" :default-checked-keys="withoutParents" default-expand-all :props="defaultProps" showButtonFlag></vue-gic-auth-tree> <vue-gic-auth-tree class="auth-tree" :data="treeData" show-checkbox ref="tree" node-key="menuCode" :default-checked-keys="withoutParents" default-expand-all :props="defaultProps" showButtonFlag></vue-gic-auth-tree>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<!-- TODO: save按钮 --> <!-- save按钮 -->
<div class="fixed-save-btn border-box" v-if="$getButtonLimit($buttonCode.saveGoodsSet)"> <div class="fixed-save-btn border-box" v-if="$getButtonLimit($buttonCode.saveGoodsSet)">
<el-button :limit-code="$buttonCode.saveGoodsSet" type="primary" :loading="loading" @click="submit" :disabled="$store.state.wxEnterpriseType">保存</el-button> <el-button :limit-code="$buttonCode.saveGoodsSet" type="primary" :loading="loading" @click="submit" :disabled="$store.state.wxEnterpriseType">保存</el-button>
</div> </div>
...@@ -45,13 +36,12 @@ ...@@ -45,13 +36,12 @@
</template> </template>
<script> <script>
import elNewTree from '@/components/tree/tree'; import { deepClone, arrToTree, getArrDifference } from '@/utils';
import { deepClone, debounce, arrToTree } from '@/utils'; import { getRequest, postJsonRequest } from '@/api/api';
import { getRequest } from '@/api/api'; import { _debounce } from '@/common/js/public';
export default { export default {
name: 'GuideSetting', name: 'GuideSetting',
components: { elNewTree },
data() { data() {
return { return {
roleForm: {}, roleForm: {},
...@@ -67,6 +57,9 @@ export default { ...@@ -67,6 +57,9 @@ export default {
}, },
withoutParents: [], //不包含父节点 withoutParents: [], //不包含父节点
treeData: [], treeData: [],
treeData_0: [],
treeData_1: [],
treeData_2: [],
withoutParents_0: [], withoutParents_0: [],
withoutParents_1: [], withoutParents_1: [],
withoutParents_2: [], withoutParents_2: [],
...@@ -76,7 +69,9 @@ export default { ...@@ -76,7 +69,9 @@ export default {
roleId_0: '', roleId_0: '',
roleId_1: '', roleId_1: '',
roleId_2: '', roleId_2: '',
copyMenu: [], copyMenu_0: [],
copyMenu_1: [],
copyMenu_2: [],
loading: false, loading: false,
isShowErrorTip: false isShowErrorTip: false
}; };
...@@ -86,392 +81,15 @@ export default { ...@@ -86,392 +81,15 @@ export default {
return treeData => treeData.map(el => el.rightId); return treeData => treeData.map(el => el.rightId);
} }
}, },
mounted() { async mounted() {
// TODO: 测试数据 await this.getMenuRoleList(0);
// this.treeData = [ await this.getMenuRoleList(1);
// { await this.getMenuRoleList(2);
// menuCode: 'workbench',
// menuName: '工作台',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 0,
// menuSort: 0,
// parentCode: 0,
// statusFlag: 1,
// createTime: 1663145657000,
// updateTime: 1663145657000,
// routePath: '',
// menuBOList: [
// {
// menuCode: 'dataSummary',
// menuName: '数据面板',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145657000,
// updateTime: 1663145657000,
// routePath: '',
// menuBOList: []
// },
// {
// menuCode: 'customer',
// menuName: '我的顾客',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145658000,
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/customer/list/list',
// menuBOList: [
// {
// menuLevel: null,
// menuName: '全品牌搜索',
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/customer/list/search/search',
// menuUrl: 'pages/hbapp/customer/list/list',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerList_allSearch',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '分配会员',
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/customer/distributeMember/distributeMember',
// menuUrl: 'pages/hbapp/customer/list/list',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerList_distribute',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '离职继承',
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/customer/dimissionInherit/inheritMain/inheritMain',
// menuUrl: 'pages/hbapp/customer/list/list',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerList_inheritCustomer',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '群发助手',
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/customer/massTextingAssistant/massTextingDetail/massTextingDetail',
// menuUrl: 'pages/hbapp/customer/list/list',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerList_massAssistant',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '会员导出',
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/customer/fileExport/exportList/exportList',
// menuUrl: 'pages/hbapp/customer/list/list',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerList_customerExport',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '导购二维码',
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/customer/list/guideQRCode/guideQRCode',
// menuUrl: 'pages/hbapp/customer/list/list',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerList_clerkQRCode',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '联系好友',
// updateTime: 1663145658000,
// routePath: '',
// menuUrl: 'pages/hbapp/customer/detail/detail',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerDetail_connectFriend',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '添加好友',
// updateTime: 1663145658000,
// routePath: '',
// menuUrl: 'pages/hbapp/customer/detail/detail',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerDetail_addFriend',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '电话',
// updateTime: 1663145658000,
// routePath: '',
// menuUrl: 'pages/hbapp/customer/detail/detail',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerDetail_call',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '短信',
// updateTime: 1663145658000,
// routePath: '',
// menuUrl: 'pages/hbapp/customer/detail/detail',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerDetail_smsMsg',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '分配导购',
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/customer/detail/changeGuide/changgeGuide',
// menuUrl: 'pages/hbapp/customer/detail/detail',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerDetail_mainClerkExchange',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '打标签',
// updateTime: 1663145658000,
// routePath: '',
// menuUrl: 'pages/hbapp/customer/detail/detail',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerDetail_mark',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// },
// {
// menuLevel: null,
// menuName: '客户跟进',
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/customer/list/guideQRCode/guideQRCode',
// menuUrl: 'pages/hbapp/customer/detail/detail',
// parentCode: 'customer',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'customerDetail_clerkQRCode',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// }
// ]
// },
// {
// menuCode: 'marketingTask',
// menuName: '营销任务',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145658000,
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/marketingTask/taskList/taskList',
// menuBOList: [
// {
// menuLevel: null,
// menuName: '指派任务',
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/task/phoneTaskDistribute/phoneTaskDistribute',
// menuUrl: 'pages/hbapp/marketingTask/phoneTaskList/phoneTaskList',
// parentCode: 'marketingTask',
// createTime: 1663145658000,
// menuBOList: [],
// menuCode: 'marketingTaskList_distribute',
// menuType: 1,
// iconUrl: '',
// menuSort: 0,
// statusFlag: 1
// }
// ]
// },
// {
// menuCode: 'dashboard',
// menuName: '看数据',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145658000,
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/reportManagement/summaryReport/summaryReport',
// menuBOList: []
// },
// {
// menuCode: 'dailyReport',
// menuName: '云日报',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145658000,
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/dailyReport/list/list',
// menuBOList: []
// },
// {
// menuCode: 'kpi',
// menuName: '月指标',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145658000,
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/kpi/monthlyList/monthlyList',
// menuBOList: []
// },
// {
// menuCode: 'commodityCenter',
// menuName: '商品中心',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145658000,
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/commodityCenter/commodityList/commondityList',
// menuBOList: []
// },
// {
// menuCode: 'orderComment',
// menuName: '订单评价',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145658000,
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/orderComment/orderComment/orderComment',
// menuBOList: []
// },
// {
// menuCode: 'writeOff',
// menuName: '扫码核销',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145658000,
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/cancelVerification/scan/scan',
// menuBOList: []
// },
// {
// menuCode: 'commission',
// menuName: '订单评价',
// menuUrl: 'pages/workbench/workbench',
// iconUrl: '',
// menuLevel: null,
// menuType: 1,
// menuSort: 0,
// parentCode: 'workbench',
// statusFlag: 1,
// createTime: 1663145658000,
// updateTime: 1663145658000,
// routePath: 'pages/hbapp/commission/commissionReport/commissionReport',
// menuBOList: []
// }
// ]
// }
// ];
this.getMenuRoleList();
}, },
methods: { methods: {
chooseType(index) { chooseType(index) {
this.isShowErrorTip = false;
this.treeData = deepClone(this['copyMenu_' + index]);
this.titleList.forEach(item => { this.titleList.forEach(item => {
item.isEmpty = false; item.isEmpty = false;
}); });
...@@ -479,71 +97,55 @@ export default { ...@@ -479,71 +97,55 @@ export default {
// 切换tab时 缓存上个tag选择的节点 // 切换tab时 缓存上个tag选择的节点
this['withoutParents_' + this.activeNum] = [...isChooseList]; this['withoutParents_' + this.activeNum] = [...isChooseList];
this.activeNum = index; this.activeNum = index;
this.treeData = deepClone(this.copyMenu); // this.treeData = deepClone(this.copyMenu);
this.withoutParents = this['withoutParents_' + this.activeNum]; this.withoutParents = this['withoutParents_' + this.activeNum];
this.isShowErrorTip = false;
this.activeNum = index;
}, },
// TODO: 获取类型选择菜单 // 获取类型选择菜单
getQueryMenuList() { getQueryMenuList(clerkType) {
// index 当前页签
let clerkType = 0;
if (this.activeNum == 2) {
clerkType = 3;
} else {
clerkType = this.activeNum;
}
let params = { let params = {
clerkType clerkType
}; };
getRequest('/haoban-manage3-web/role/queryMenuByClerkType', params).then(res => { getRequest('/haoban-manage3-web/role/queryMenuByClerkType', params).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
if (res.data.result) { if (res.data.result) {
// 接口当前选中 this['roleId_' + clerkType] = res.data.result.roleId;
this.treeData = deepClone(this.copyMenu); this['curMenuCode_' + clerkType] = [...res.data.result.menuCodes]; // 保存当前类别选中状态,保存的时候用用于记录操作的区别
let resData = res.data; this['withoutParents_' + clerkType] = [...res.data.result.menuCodes];
let menuCodes = ['customerList_allSearch', 'workbench', 'customer']; if (clerkType == 0) {
// let menuCodes = resData.result.menuCodes; // 当前导购选中
this['roleId_' + this.activeNum] = resData.result.roleId; this.withoutParents = [...res.data.result.menuCodes];
this['curMenuCode_' + this.activeNum] = [...menuCodes]; // 保存当前类别选中状态,保存的时候用用于记录操作的区别 }
let assginArr = [...new Set(this['withoutParents_' + this.activeNum].concat(menuCodes))];
this.withoutParents = [...assginArr];
console.log(assginArr, '去重');
console.log(this.withoutParents, '当前-----');
} else { } else {
this.treeData = deepClone(this.copyMenu); this['withoutParents_' + clerkType] = [];
this.withoutParents = [];
console.log(this.withoutParents, 'aasdsadsa');
} }
} else { } else {
this.$message.error(res.data.message); this.$message.error(res.data.message);
} }
}); });
}, },
// TODO: 获取菜单列表 // 获取菜单列表
getMenuRoleList() { async getMenuRoleList(clerkType) {
const that = this;
let query = { let query = {
clerkType: this.activeNum clerkType
}; };
getRequest('/haoban-manage3-web/role/getHaobanMenuTreeList', query).then(res => { await getRequest('/haoban-manage3-web/role/getHaobanMenuTreeList', query).then(res => {
if (res.data.code == 0) { if (res.data.code == 0) {
if (res.data.result) { if (res.data.result) {
let resData = res.data; let resData = res.data;
let arr = resData.result; let arr = resData.result;
arr.forEach(item => { arr.forEach(item => {
if (item.menuType == 0) { if (item.menuType == 0) {
item.parentCode = 0; item.parentCode = 0;
} }
if (item.menuBOList.length) {
item.menuBOList = item.menuBOList.filter(data => data.menuType != 2);
}
}); });
that.treeData = arrToTree(arr, 0, { idName: 'menuCode', parentIdName: 'parentCode', childName: 'menuBOList' }); this['treeData_' + clerkType] = deepClone(arrToTree(arr, 0, { idName: 'menuCode', parentIdName: 'parentCode', childName: 'menuBOList' }));
that.copyMenu = deepClone(that.treeData); if (clerkType == 0) {
that.getQueryMenuList(); this.treeData = deepClone(this.treeData_0);
}
this['copyMenu_' + clerkType] = deepClone(this['treeData_' + clerkType]);
this.getQueryMenuList(clerkType);
} else { } else {
this['treeData_' + clerkType] = [];
this.treeData = []; this.treeData = [];
} }
} else { } else {
...@@ -551,21 +153,58 @@ export default { ...@@ -551,21 +153,58 @@ export default {
} }
}); });
}, },
submit: debounce(function() { // 保存
submit: _debounce(function() {
let currentChooseList = this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys()); let currentChooseList = this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys());
this['withoutParents_' + this.activeNum] = [...currentChooseList]; this['withoutParents_' + this.activeNum] = [...currentChooseList];
console.log(this.withoutParents_0);
console.log(this.withoutParents_1);
console.log(this.withoutParents_2);
let errFlag_0 = this.withoutParents_0.length ? true : false; let errFlag_0 = this.withoutParents_0.length ? true : false;
let errFlag_1 = this.withoutParents_1.length ? true : false; let errFlag_1 = this.withoutParents_1.length ? true : false;
let errFlag_2 = this.withoutParents_2.length ? true : false; let errFlag_2 = this.withoutParents_2.length ? true : false;
let delMenu_0 = getArrDifference(this.curMenuCode_0, this.withoutParents_0);
let delMenu_1 = getArrDifference(this.curMenuCode_1, this.withoutParents_1);
let delMenu_2 = getArrDifference(this.curMenuCode_2, this.withoutParents_2);
if (!errFlag_0 || !errFlag_1 || !errFlag_2) { if (!errFlag_0 || !errFlag_1 || !errFlag_2) {
this.$set(this.titleList[0], 'isEmpty', !errFlag_0); this.$set(this.titleList[0], 'isEmpty', !errFlag_0);
this.$set(this.titleList[1], 'isEmpty', !errFlag_1); this.$set(this.titleList[1], 'isEmpty', !errFlag_1);
this.$set(this.titleList[2], 'isEmpty', !errFlag_2); this.$set(this.titleList[2], 'isEmpty', !errFlag_2);
this.isShowErrorTip = true;
return;
}
let para = {
clerkMenus: {
roleId: this.roleId_0,
clerkType: 0, // 导购
menuCodes: [...this.withoutParents_0], // 权限id
delMenuCodes: delMenu_0 // 删除的code
},
manegeClerkMenus: {
roleId: this.roleId_1,
clerkType: 1, // 店长
menuCodes: [...this.withoutParents_1],
delMenuCodes: delMenu_1
},
managerMenus: {
roleId: this.roleId_2,
clerkType: 2, // 区经
menuCodes: [...this.withoutParents_2],
delMenuCodes: delMenu_2
} }
}) };
postJsonRequest('/haoban-manage3-web/role/edit', para).then(async res => {
let data = res.data;
if (data.code == 0) {
this.$message.success(res.data.message);
this.activeNum = 0;
this.treeData = [];
this.withoutParents = [];
await this.getMenuRoleList(0);
await this.getMenuRoleList(1);
await this.getMenuRoleList(2);
} else {
this.$message.warning(data.message);
}
});
}, 500)
} }
}; };
</script> </script>
......
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