Commit 790cdc41 by ym

role

1 parent df980388
......@@ -34,7 +34,7 @@ export default {
mapInit() {
map = new AMap.Map("container", {
resizeEnable: true,
zoom: 10,
zoom: 15,
});
AMap.plugin(["AMap.PlaceSearch"], function () {
//构造地点查询类
......
......@@ -34,6 +34,7 @@
v-model="accountAddForm.merchantOrgcode"
placeholder="请输入组织机构号码"
v-if="accountAddForm.merchantType == 2"
maxlength="50"
>
<el-select
v-model="accountAddForm.merchantType"
......
......@@ -306,9 +306,9 @@ export default {
this.$router.push("/account/index");
},
//保存
handleSave(status) {
handleSave() {
let product = this.$refs.productForm.getSelectInfo();
if (status == 2&& product && product.every((item) => item.products.length == 0)) {
if (product && product.every((item) => item.products.length == 0)) {
this.$message.error("请选择产品");
return;
}
......@@ -320,7 +320,7 @@ export default {
};
this.$apis.store.updatePermissions(params).then((res) => {
if (res) {
status ? this.handleTabs(status) : this.$router.push("/account/index");
this.$router.push("/account/index");
}
});
},
......
......@@ -181,7 +181,7 @@ export default {
label: "关联的企业微信",
prop: "entmicroName",
formatter: (cellValue) => {
return cellValue.entmicroName ? cellValue.entmicroName : "--";
return cellValue.entmicroName ? cellValue.entmicroName : "-";
},
},
{
......@@ -202,7 +202,7 @@ export default {
label: "上级商户",
prop: "parentMerchant",
formatter: (cellValue) => {
return cellValue.parentMerchant ? cellValue.parentMerchant : "--";
return cellValue.parentMerchant ? cellValue.parentMerchant : "-";
},
},
{
......@@ -214,7 +214,7 @@ export default {
label: "联系人",
prop: "merchantLegalPerson",
formatter: (cellValue) => {
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : "--";
return cellValue.merchantLegalPerson ? cellValue.merchantLegalPerson : "-";
},
},
{
......
<template>
<div class="account-body scrm-box-f" v-loading="loading" v-if="tabMenu.length > 0">
<div class="account-body scrm-box-f" v-loading="loading" v-if="tabMenuStatus">
<div class="account-title">{{ title }}</div>
<el-tabs
v-if="tabMenu.length != 0"
......@@ -104,6 +104,7 @@ export default {
data() {
return {
loading: false,
tabMenuStatus: false,
treeHeight: 450,
tabMenu: [],
tabMenu_r: [],
......@@ -123,13 +124,22 @@ export default {
accountTypes: [],
};
},
watch: {
tabMenu: {
handler() {
this.tabMenuStatus = this.tabMenu.every(item=>item)
},
deep: true,
},
},
methods: {
handleClik(tab, event) {
console.log(tab, event);
const tabId = tab.name;
this.productTab = this.tabMenu.find(
const productTab = this.tabMenu.find(
(i) => i.accounttypeId == tabId
).productsArr[0].productId;
)
this.productTab = productTab.productsArr[0]?productTab.productsArr[0].productId:'';
},
selectPro(data) {
this.$parent.roleRootRules = false;
......@@ -141,7 +151,7 @@ export default {
var arr = tabMenu
.find((i) => i.accounttypeId == tabName)
.products.find((j) => j.productId == productTab).merchantProTreeResponses;
this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr));
this.$refs[`tree_${tabName}_${productTab}`]?this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr)):'';
console.log(tabMenu);
},
productClick(productId) {
......@@ -223,6 +233,9 @@ export default {
this.accountList.forEach((itm) => {
if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm);
if(!item.productList) {
return
}
item.productList.forEach((i) => {
itm.products.forEach((j) => {
if (i.productId == j.productId) {
......@@ -378,6 +391,7 @@ export default {
return arr;
},
getSelectInfo() {
this.tabMenu = this.tabMenu.filter(item=>item)
this.accountTypes = this.tabMenu.map((item) => {
let products = [];
let productList = [];
......
......@@ -14,7 +14,7 @@ const cdn = {
`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`,
`${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`,
`${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`,
'https://webapi.amap.com/maps?v=2.0&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder'
'http://webapi.amap.com/maps?v=2.0&key=bd290dc27d0945959280753215ddda71&plugin=AMap.Geocoder'
]
}
module.exports = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!