Commit 900ad4d4 by Jings

fix: 修改区经权限展示逻辑

parent 0545b20f
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Author : 无尘 * @Author : 无尘
* @Date : 2020-02-13 16:13:59 * @Date : 2020-02-13 16:13:59
* @LastEditors: Drama * @LastEditors: Drama
* @LastEditTime: 2022-10-12 17:20:09 * @LastEditTime: 2022-10-24 16:48:26
* @FilePath: /haoban-3/src/components/company/add-relate-new.vue * @FilePath: /haoban-3/src/components/company/add-relate-new.vue
--> -->
<!-- <!--
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<el-form-item label="关联角色" prop="manageFlag"> <el-form-item label="关联角色" prop="manageFlag">
<el-radio-group v-model="partForm.manageFlag" @change="manageChange"> <el-radio-group v-model="partForm.manageFlag" @change="manageChange">
<el-radio :label="0">导购</el-radio> <el-radio :label="0">导购</el-radio>
<el-radio :label="1">区经/督导</el-radio> <el-radio v-if="isShowSupervisionType" :label="1">区经/督导</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="关联账号" prop="salerName"> <el-form-item label="关联账号" prop="salerName">
...@@ -73,6 +73,9 @@ export default { ...@@ -73,6 +73,9 @@ export default {
default() { default() {
return {}; return {};
} }
},
isShowSupervisionType: {
type: Boolean
} }
}, },
data() { data() {
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</div>--> </div>-->
<!-- <add-relate v-if="addShow" :departObj="relateRow" @refreshData="refreshData"></add-relate> --> <!-- <add-relate v-if="addShow" :departObj="relateRow" @refreshData="refreshData"></add-relate> -->
<!-- 新版关联 --> <!-- 新版关联 -->
<add-relate-new v-if="addShow" :departObj="relateRow" @refreshData="refreshData"></add-relate-new> <add-relate-new v-if="addShow" :departObj="relateRow" @refreshData="refreshData" :isShowSupervisionType="isShowSupervisionType"></add-relate-new>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
...@@ -99,11 +99,24 @@ export default { ...@@ -99,11 +99,24 @@ export default {
total: 0, total: 0,
tableData: [], tableData: [],
addShow: false, addShow: false,
isType: 0 isType: 0,
isShowSupervisionType: false,
addLoading: false
}; };
}, },
computed: {}, computed: {},
methods: { methods: {
async getGicRole() {
this.addLoading = true;
await getRequest('/haoban-manage3-web/hasManagerFlag', {}).then(res => {
this.addLoading = false;
if (res.data.code == 0) {
this.isShowSupervisionType = res.data.result;
} else {
this.$message.error(res.data.message);
}
});
},
refreshData(data) { refreshData(data) {
const that = this; const that = this;
that.addShow = false; that.addShow = false;
...@@ -149,6 +162,8 @@ export default { ...@@ -149,6 +162,8 @@ export default {
* 添加关联 * 添加关联
*/ */
toAddRelate() { toAddRelate() {
// 避免点击过快
if (this.addLoading) return;
const that = this; const that = this;
that.addShow = true; that.addShow = true;
}, },
...@@ -261,6 +276,9 @@ export default { ...@@ -261,6 +276,9 @@ export default {
} }
} }
}, },
created() {
this.getGicRole();
},
mounted() { mounted() {
const that = this; const that = this;
if (Object.keys(that.relateRow).length) { if (Object.keys(that.relateRow).length) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: Drama * @Author: Drama
* @Date: 2022-09-14 11:09:43 * @Date: 2022-09-14 11:09:43
* @LastEditors: Drama * @LastEditors: Drama
* @LastEditTime: 2022-10-18 15:13:58 * @LastEditTime: 2022-10-24 16:46:14
* @FilePath: /haoban-3/src/views/enterprise/guide-setting-new.vue * @FilePath: /haoban-3/src/views/enterprise/guide-setting-new.vue
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
...@@ -46,9 +46,9 @@ export default { ...@@ -46,9 +46,9 @@ export default {
return { return {
roleForm: {}, roleForm: {},
titleList: [ titleList: [
{ title: '导购', isEmpty: false }, // { title: '导购', isEmpty: false },
{ title: '店长', isEmpty: false }, // { title: '店长', isEmpty: false },
{ title: '区经/督导', isEmpty: false } // { title: '区经/督导', isEmpty: false }
], ],
activeNum: 0, activeNum: 0,
defaultProps: { defaultProps: {
...@@ -76,16 +76,45 @@ export default { ...@@ -76,16 +76,45 @@ export default {
copyMenu_1: [], copyMenu_1: [],
copyMenu_2: [], copyMenu_2: [],
loading: false, loading: false,
isShowErrorTip: false isShowErrorTip: false,
isShowSupervisionType: false // 是否展示区经tab
}; };
}, },
computed: {}, computed: {},
async created() {
await this.getGicRole();
},
async mounted() { async mounted() {
// await this.getGicRole();
await this.getMenuRoleList(0); await this.getMenuRoleList(0);
await this.getMenuRoleList(1); await this.getMenuRoleList(1);
await this.getMenuRoleList(2); if (this.isShowSupervisionType) {
// 有权限才获取区经权限
await this.getMenuRoleList(2);
}
}, },
methods: { methods: {
// 判断是否有分权
async getGicRole() {
await getRequest('/haoban-manage3-web/hasManagerFlag', {}).then(res => {
if (res.data.code == 0) {
let normalTitleList = [
{ title: '导购', isEmpty: false },
{ title: '店长', isEmpty: false }
];
this.isShowSupervisionType = res.data.result;
if (this.isShowSupervisionType) {
// 有权限
normalTitleList.push({ title: '区经/督导', isEmpty: false });
this.titleList = normalTitleList;
} else {
this.titleList = normalTitleList;
}
} else {
this.$message.error(res.data.message);
}
});
},
chooseType(index) { chooseType(index) {
this.isShowErrorTip = false; this.isShowErrorTip = false;
this.treeData = deepClone(this['copyMenu_' + index]); this.treeData = deepClone(this['copyMenu_' + index]);
...@@ -251,7 +280,8 @@ export default { ...@@ -251,7 +280,8 @@ export default {
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.isShowSupervisionType ? (this.withoutParents_2.length ? true : false) : true;
// let delMenu_0 = getArrDifference(this.curMenuCode_0, this.withoutParents_0); // let delMenu_0 = getArrDifference(this.curMenuCode_0, this.withoutParents_0);
// let delMenu_1 = getArrDifference(this.curMenuCode_1, this.withoutParents_1); // let delMenu_1 = getArrDifference(this.curMenuCode_1, this.withoutParents_1);
// let delMenu_2 = getArrDifference(this.curMenuCode_2, this.withoutParents_2); // let delMenu_2 = getArrDifference(this.curMenuCode_2, this.withoutParents_2);
...@@ -266,7 +296,10 @@ export default { ...@@ -266,7 +296,10 @@ export default {
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); if (this.isShowSupervisionType) {
this.$set(this.titleList[2], 'isEmpty', !errFlag_2);
}
// this.$set(this.titleList[2], 'isEmpty', !errFlag_2);
this.isShowErrorTip = true; this.isShowErrorTip = true;
return; return;
} }
...@@ -296,6 +329,10 @@ export default { ...@@ -296,6 +329,10 @@ export default {
addMenuCodes: addMenu_2 addMenuCodes: addMenu_2
} }
}; };
// GIC没有权限 需要删除区经参数
if (!this.isShowSupervisionType) {
delete para.managerMenus;
}
postJsonRequest('/haoban-manage3-web/role/edit', para).then(async res => { postJsonRequest('/haoban-manage3-web/role/edit', para).then(async res => {
let data = res.data; let data = res.data;
if (data.code == 0) { if (data.code == 0) {
...@@ -306,11 +343,16 @@ export default { ...@@ -306,11 +343,16 @@ export default {
// 重置校验 // 重置校验
this.$set(this.titleList[0], 'isEmpty', false); this.$set(this.titleList[0], 'isEmpty', false);
this.$set(this.titleList[1], 'isEmpty', false); this.$set(this.titleList[1], 'isEmpty', false);
this.$set(this.titleList[2], 'isEmpty', false); if (this.isShowSupervisionType) {
this.$set(this.titleList[2], 'isEmpty', false);
}
this.isShowErrorTip = false; this.isShowErrorTip = false;
await this.getMenuRoleList(0); await this.getMenuRoleList(0);
await this.getMenuRoleList(1); await this.getMenuRoleList(1);
await this.getMenuRoleList(2); if (this.isShowSupervisionType) {
// 有区经权限-则获取列表
await this.getMenuRoleList(2);
}
} else { } else {
this.$message.warning(data.message); this.$message.warning(data.message);
} }
......
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