Commit 7d8e84c1 by 无尘

fix: 修改编辑授权

parent 3d4a8bd2
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-07-21 10:10:57 * @Date: 2020-07-21 10:10:57
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-08-05 10:35:14 * @LastEditTime: 2020-08-05 13:49:08
--> -->
<!-- <!--
门店绑定-选择分组 门店绑定-选择分组
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<div class="select-tree-wrap auth-select-tree m-t-20"> <div class="select-tree-wrap auth-select-tree m-t-20">
<el-tree ref="groupTree" :filter-node-method="filterNode" check-strictly :data="groupData" node-key="storeGroupId" show-checkbox default-expand-all :props="defaultProps" :expand-on-click-node="false" @check="checkGroup"> <el-tree ref="groupTree" :filter-node-method="filterNode" check-strictly :data="groupData" node-key="storeGroupId" show-checkbox default-expand-all :props="defaultProps" :expand-on-click-node="false" @check="checkGroup">
<span :id="data.storeGroupId" class="custom-tree-node" slot-scope="{ node, data }" @click="toShowMsg(node, data)"> <span :id="data.storeGroupId" class="custom-tree-node" slot-scope="{ node, data }" @click="toShowMsg(node, data)">
<span class="font-14 color-606266">{{ node.label }}</span><span v-if="data.bindFlag == 1" class="font-12 color-909399">{{ data.bindWxEnterpriseName }} 企业已授权</span> <span class="font-14 color-606266">{{ node.label }}</span><span v-if="data.bindFlag == 1" class="font-12 color-909399 p-l-10">{{ data.bindWxEnterpriseName }} 企业已授权</span>
</span> </span>
</el-tree> </el-tree>
</div> </div>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2020-07-21 10:10:57 * @Date: 2020-07-21 10:10:57
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-08-04 10:41:05 * @LastEditTime: 2020-08-05 13:49:19
--> -->
<!-- <!--
门店绑定-选择门店(限制50个) 门店绑定-选择门店(限制50个)
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<ul class="el-scrollbar__view el-select-dropdown__list"> <ul class="el-scrollbar__view el-select-dropdown__list">
<li :class="['el-select-dropdown__item', item.select ? 'selected hover' : '']" v-for="item in stores" :key="item.storeInfoId" @click.stop="toShowMsg(item)"> <li :class="['el-select-dropdown__item', item.select ? 'selected hover' : '']" v-for="item in stores" :key="item.storeInfoId" @click.stop="toShowMsg(item)">
<el-checkbox :disabled="item.bindFlag == 1" :label="item.storeInfoId" >{{ item.storeInfoName }}</el-checkbox> <el-checkbox :disabled="item.bindFlag == 1" :label="item.storeInfoId" >{{ item.storeInfoName }}</el-checkbox>
<span v-if="item.bindFlag == 1" class="font-12 color-909399">{{ data.bindWxEnterpriseName }} 企业已授权</span> <span v-if="item.bindFlag == 1" class="font-12 color-909399 p-l-10">{{ data.bindWxEnterpriseName }} 企业已授权</span>
</li> </li>
<li v-if="!stores.length" class="text-center"><span>暂无数据</span></li> <li v-if="!stores.length" class="text-center"><span>暂无数据</span></li>
</ul> </ul>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-08-04 16:44:05 * @LastEditTime: 2020-08-05 15:29:51
--> -->
<template> <template>
<div class="my-customer-wrap common-set-wrap"> <div class="my-customer-wrap common-set-wrap">
...@@ -293,8 +293,8 @@ export default { ...@@ -293,8 +293,8 @@ export default {
shareRange: that.authForm.shareStoreMode != 0 ? that.authForm.shareStoreMode == 1 ? that.authForm.shareRange.map(ele=>ele.storeGroupId).join(',') : that.authForm.shareRange.map(ele=>ele.storeInfoId).join(',') : '', shareRange: that.authForm.shareStoreMode != 0 ? that.authForm.shareStoreMode == 1 ? that.authForm.shareRange.map(ele=>ele.storeGroupId).join(',') : that.authForm.shareRange.map(ele=>ele.storeInfoId).join(',') : '',
bindRange: that.authForm.bindStoreMode != 0 ? that.authForm.bindStoreMode == 1 ? that.authForm.bindRange.map(ele=>ele.storeGroupId).join(',') : that.authForm.bindRange.map(ele=>ele.storeInfoId).join(',') : '', bindRange: that.authForm.bindStoreMode != 0 ? that.authForm.bindStoreMode == 1 ? that.authForm.bindRange.map(ele=>ele.storeGroupId).join(',') : that.authForm.bindRange.map(ele=>ele.storeInfoId).join(',') : '',
auditReason: that.authForm.auditReason, auditReason: that.authForm.auditReason,
shareStoreMode: String(that.authForm.shareStoreMode), // 0 全部 1部分分组 2 部分门店 shareStoreMode: !that.authForm.shareRange.length && that.authForm.shareStoreMode != 0 ? '' : String(that.authForm.shareStoreMode), // 0 全部 1部分分组 2 部分门店
bindStoreMode: String(that.authForm.bindStoreMode), bindStoreMode: !that.authForm.bindRange.length && that.authForm.bindStoreMode != 0 ? '' : String(that.authForm.bindStoreMode),
auditorName: that.auditorName auditorName: that.auditorName
} }
postEnterpriseAuth(para) postEnterpriseAuth(para)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* @Author: 无尘 * @Author: 无尘
* @Date: 2019-03-20 14:36:37 * @Date: 2019-03-20 14:36:37
* @LastEditors: 无尘 * @LastEditors: 无尘
* @LastEditTime: 2020-08-05 12:53:36 * @LastEditTime: 2020-08-05 14:52:20
--> -->
<template> <template>
<div class="my-customer-wrap common-set-wrap"> <div class="my-customer-wrap common-set-wrap">
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
<div class="apps-content-right border-box"> <div class="apps-content-right border-box">
<el-form :model="adminForm" :rules="rules" ref="adminForm" label-width="100px" > <el-form :model="adminForm" :rules="rules" ref="adminForm" label-width="100px" >
<el-form-item label="活动名称" prop="adminList"> <el-form-item label="活动名称" prop="adminList">
<div class="admin-list-wrap"> <div v-if="$route.query.staffId">{{ adminName || '--'}}</div>
<div v-if="!$route.query.staffId" class="admin-list-wrap">
<div class="el-select store-item-content admin-select" @click="showAdmin"> <div class="el-select store-item-content admin-select" @click="showAdmin">
<div v-if="!!adminForm.adminList.length" class="el-select__tags"> <div v-if="!!adminForm.adminList.length" class="el-select__tags">
<span style="display:block;"> <span style="display:block;">
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
</div> </div>
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="活动区域" prop="tableData"> <el-form-item label="活动区域" prop="enterpriseList">
<el-table ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width: 100%"> <el-table ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width: 100%">
<el-table-column label="商户名称" width="150"> <el-table-column label="商户名称" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -40,21 +41,20 @@ ...@@ -40,21 +41,20 @@
</el-table-column> </el-table-column>
<el-table-column label="授权范围"> <el-table-column label="授权范围">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="el-select store-item-content" @click="showStore(1)"> <el-radio v-model="scope.row.radio" label="1">授权</el-radio>
<div v-if="!!scope.row.enterpriseList.length" class="el-select__tags"> <div v-if="scope.row.radio==1" class="el-select store-item-content" @click="showAuth">
<div class="el-select__tags">
<span style="display:block;"> <span style="display:block;">
<template v-for="(item, index) in scope.row.enterpriseList"> <template v-for="(item, index) in scope.row.bindRange">
<span class="el-tag el-tag--info el-tag--small" :key="index+'bind'"> <span class="el-tag el-tag--info el-tag--small" :key="index+'bind'">
<span class="el-select__tags-text">{{ item.storeInfoName || item.storeGroupName }}</span> <span class="el-select__tags-text">{{ item.storeInfoName || item.storeGroupName }}</span>
<i class="el-tag__close el-icon-close" @click.stop="delStore(index, scope.row.enterpriseList)"></i> <i class="el-tag__close el-icon-close" @click.stop="delAuth(index, scope.row.bindRange)"></i>
</span> </span>
</template> </template>
</span> </span>
</div> </div>
<div v-if="!scope.row.enterpriseList.length" class="add-admin-btn font-14 color-606266 cursor-pointer" @click="addAdmin">
<span class="iconfont icontianjiajiahaowubiankuang font-12"></span><span class="p-l-10">添加</span>
</div>
</div> </div>
<el-radio class="m-l-10" v-model="scope.row.radio" label="2">不授权</el-radio>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -63,11 +63,14 @@ ...@@ -63,11 +63,14 @@
</div> </div>
</div> </div>
<select-admin v-if="showAdminFlag" :selectAdmin="adminForm.adminList" @checkAdmins="checkAdmins"></select-admin>
<!-- <vue-gic-footer></vue-gic-footer> --> <!-- <vue-gic-footer></vue-gic-footer> -->
</div> </div>
</template> </template>
<script> <script>
import navCrumb from '@/components/nav/nav.vue'; import navCrumb from '@/components/nav/nav.vue';
import selectAdmin from '@/components/set/select-admin.vue';
import fetch from '@/api/merchantAuth.js'; import fetch from '@/api/merchantAuth.js';
const { getAuthEnterprise } = fetch; const { getAuthEnterprise } = fetch;
// import { _debounce } from '@/common/js/public'; // import { _debounce } from '@/common/js/public';
...@@ -90,18 +93,25 @@ export default { ...@@ -90,18 +93,25 @@ export default {
adminName: !!this.$route.query.staffName ? this.$route.query.staffName : '', adminName: !!this.$route.query.staffName ? this.$route.query.staffName : '',
adminForm: { adminForm: {
adminList: [], adminList: [],
tableData: [], enterpriseList: [],
}, },
rules: { rules: {
adminList: [ adminList: [
{ type: 'array', required: true, message: '请选择管理员', trigger: 'change' }, { type: 'array', required: true, message: '请选择管理员', trigger: 'change' },
], ],
tableData: [ enterpriseList: [
{ type: 'array', required: true, message: '请选择授权范围', trigger: 'change' }, { type: 'array', required: true, message: '请选择授权范围', trigger: 'change' },
] ]
}, },
tableData: [], tableData: [{
showAdminFlag: false, enterpriseId: '',
enterpriseName: '',
radio: '1',
bindStoreMode: '',
bindRange: [],
}],
showAdminFlag: false, // 显示选择管理员
showAuthFlag: false // 显示右侧门店授权范围
}; };
}, },
computed: {}, computed: {},
...@@ -111,6 +121,10 @@ export default { ...@@ -111,6 +121,10 @@ export default {
*/ */
showAdmin() { showAdmin() {
const that = this; const that = this;
// 编辑不可再选管理员
if (that.$route.query.staffId) {
return false
}
that.showAdminFlag = true; that.showAdminFlag = true;
}, },
closeAdmin() { closeAdmin() {
...@@ -118,6 +132,25 @@ export default { ...@@ -118,6 +132,25 @@ export default {
that.showAdminFlag = false; that.showAdminFlag = false;
}, },
/** /**
* 删除已选管理员
*/
delAdmin(index, arr) {
arr.splice(index, 1);
},
/**
* 显示授权
*/
showAuth(){
const that = this;
that.showAuthFlag = true;
},
/**
* 删除已选授权
*/
delAuth(index, arr) {
arr.splice(index, 1);
},
/**
* 路由跳转 * 路由跳转
*/ */
changeRoute(path) { changeRoute(path) {
...@@ -156,7 +189,8 @@ export default { ...@@ -156,7 +189,8 @@ export default {
document.documentElement.style.backgroundColor = '#fff'; document.documentElement.style.backgroundColor = '#fff';
}, },
components: { components: {
navCrumb navCrumb,
selectAdmin
} }
}; };
</script> </script>
...@@ -179,8 +213,12 @@ export default { ...@@ -179,8 +213,12 @@ export default {
border: 1px solid rgba(228,231,237,1); border: 1px solid rgba(228,231,237,1);
} }
}
.store-item-content { .store-item-content {
position: relative; position: relative;
display: inline-block;
vertical-align: middle;
width: 302px; width: 302px;
height: 32px; height: 32px;
overflow: hidden; overflow: hidden;
...@@ -199,7 +237,6 @@ export default { ...@@ -199,7 +237,6 @@ export default {
} }
} }
} }
}
} }
</style> </style>
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