|
@ -13,7 +13,7 @@ |
|
|
<view>门店权限 </view> |
|
|
<view>门店权限 </view> |
|
|
<view> |
|
|
<view> |
|
|
<view>全选</view> |
|
|
<view>全选</view> |
|
|
<switch @change="storeAllSelect" color="#009874"></switch> |
|
|
|
|
|
|
|
|
<switch @change="storeAllSelect" color="#009874" :checked="isAllStoreChecked"></switch> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="asa-author-list"> |
|
|
<view class="asa-author-list"> |
|
@ -28,7 +28,7 @@ |
|
|
<view>小程序权限 </view> |
|
|
<view>小程序权限 </view> |
|
|
<view > |
|
|
<view > |
|
|
<view>全选</view> |
|
|
<view>全选</view> |
|
|
<switch @change="appAllSelect" color="#009874"></switch> |
|
|
|
|
|
|
|
|
<switch @change="appAllSelect" color="#009874" :checked="isAllAppChecked"></switch> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="aaa-list"> |
|
|
<view class="aaa-list"> |
|
@ -42,31 +42,59 @@ |
|
|
<view v-if="options_query.type == 'singleEdit'" class="ac-btn green" hover-class="hover-active" @click="saveEdit">保存</view> |
|
|
<view v-if="options_query.type == 'singleEdit'" class="ac-btn green" hover-class="hover-active" @click="saveEdit">保存</view> |
|
|
<view v-if="options_query.type == 'singleEdit'" class="ac-btn red" hover-class="hover-active" @click="deleteEmployee">移除员工</view> |
|
|
<view v-if="options_query.type == 'singleEdit'" class="ac-btn red" hover-class="hover-active" @click="deleteEmployee">移除员工</view> |
|
|
|
|
|
|
|
|
<view v-if="options_query.type == 'singleReview' || options_query.type == 'multipleReview'" class="ac-btn green" hover-class="hover-active">审核通过</view> |
|
|
|
|
|
|
|
|
<view |
|
|
|
|
|
v-if="options_query.type == 'singleReview' || options_query.type == 'multipleReview'" |
|
|
|
|
|
class="ac-btn green" |
|
|
|
|
|
hover-class="hover-active" |
|
|
|
|
|
@click="reviewPass" |
|
|
|
|
|
>审核通过</view> |
|
|
<view |
|
|
<view |
|
|
v-if="options_query.type == 'singleReview'" |
|
|
v-if="options_query.type == 'singleReview'" |
|
|
class="ac-btn" |
|
|
class="ac-btn" |
|
|
hover-class="hover-active" |
|
|
hover-class="hover-active" |
|
|
|
|
|
@click="reviewFail" |
|
|
>不通过</view> |
|
|
>不通过</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
import util from '../../../utils/util'; |
|
|
import util from '../../../utils/util'; |
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
|
|
|
|
import { mapGetters, mapState } from 'vuex'; |
|
|
import { servers } from '../../../js/server'; |
|
|
import { servers } from '../../../js/server'; |
|
|
import { API } from '../../../js/api'; |
|
|
import { API } from '../../../js/api'; |
|
|
export default { |
|
|
export default { |
|
|
computed: { |
|
|
computed: { |
|
|
...mapGetters([ 'permissionArr' ]), |
|
|
...mapGetters([ 'permissionArr' ]), |
|
|
|
|
|
...mapState([ 'brandInfo' ]), |
|
|
|
|
|
// 是否全选店铺权限 |
|
|
|
|
|
isAllStoreChecked(){ |
|
|
|
|
|
let { storeList } = this; |
|
|
|
|
|
let _bol = true; |
|
|
|
|
|
if(storeList <= 0)return false; |
|
|
|
|
|
storeList.forEach(e=>{if(!e.isChecked)_bol = false}); |
|
|
|
|
|
return _bol; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
//是否全选小程序权限 |
|
|
|
|
|
isAllAppChecked(){ |
|
|
|
|
|
let { appPermissionArr } = this; |
|
|
|
|
|
let _bol = true; |
|
|
|
|
|
if(appPermissionArr <= 0)return false; |
|
|
|
|
|
appPermissionArr.forEach(e=>{if(!e.isChecked)_bol = false}); |
|
|
|
|
|
return _bol; |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
data(){ |
|
|
data(){ |
|
|
return { |
|
|
return { |
|
|
storeList: [], |
|
|
storeList: [], |
|
|
appPermissionArr: [], |
|
|
appPermissionArr: [], |
|
|
options_query: { |
|
|
|
|
|
userInfo: {}, |
|
|
|
|
|
|
|
|
options_query: { // 页面所需参数 |
|
|
|
|
|
brand_id: '', // 品牌ID |
|
|
|
|
|
userInfo: {}, // 用户信息 id,name,avatar_url,mobile |
|
|
|
|
|
userIDS: [], // 用户id |
|
|
type: '', // singleEdit-> 单个编辑 / singleReview -> 单个审核 / multipleReview -> 多个审核 |
|
|
type: '', // singleEdit-> 单个编辑 / singleReview -> 单个审核 / multipleReview -> 多个审核 |
|
|
|
|
|
tags: [], // 已拥有店铺权限 id 逗号隔开 |
|
|
|
|
|
menu: [], // 已拥有小程序权限 key 逗号隔开 |
|
|
}, |
|
|
}, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
@ -76,16 +104,64 @@ export default { |
|
|
// 获取当前品牌店铺列表 |
|
|
// 获取当前品牌店铺列表 |
|
|
this.getStoreList({ |
|
|
this.getStoreList({ |
|
|
brand_id: _query.brand_id, |
|
|
brand_id: _query.brand_id, |
|
|
tags: _query.tags |
|
|
|
|
|
|
|
|
tags: _query.tags || [] |
|
|
}); |
|
|
}); |
|
|
// 小程序权限列表 |
|
|
// 小程序权限列表 |
|
|
this.appPermissionArr = this.formatAppSelected({ |
|
|
this.appPermissionArr = this.formatAppSelected({ |
|
|
list: this.permissionArr, |
|
|
|
|
|
menu: _query.menu |
|
|
|
|
|
|
|
|
list: util.jsonPar(util.jsonStr(this.permissionArr)), |
|
|
|
|
|
menu: _query.menu || [], |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 审核通过 |
|
|
|
|
|
reviewPass(){ |
|
|
|
|
|
let { options_query, appPermissionArr, storeList, brandInfo } = this; |
|
|
|
|
|
let storeIDS = storeList.filter(ele=>ele.isChecked).map(e=>e.id); |
|
|
|
|
|
let menusKEYS = appPermissionArr.filter(ele=>ele.isChecked).map(e=>e.key); |
|
|
|
|
|
let _query = { |
|
|
|
|
|
brand_id: brandInfo.brand.id, |
|
|
|
|
|
ids: options_query.userIDS.join(','), |
|
|
|
|
|
stadium_ids: storeIDS.join(','), |
|
|
|
|
|
menus: menusKEYS.join(','), |
|
|
|
|
|
status: 1, |
|
|
|
|
|
} |
|
|
|
|
|
this.reviewREQ(_query); |
|
|
|
|
|
}, |
|
|
|
|
|
// 审核不通过 |
|
|
|
|
|
reviewFail(){ |
|
|
|
|
|
let { options_query, brandInfo } = this; |
|
|
|
|
|
let _query = { |
|
|
|
|
|
brand_id: brandInfo.brand.id, |
|
|
|
|
|
ids: options_query.userIDS.join(','), |
|
|
|
|
|
status: 0, |
|
|
|
|
|
}; |
|
|
|
|
|
this.reviewREQ(_query); |
|
|
|
|
|
}, |
|
|
|
|
|
reviewREQ: util.debounce(function(query){ |
|
|
|
|
|
util.showLoad(); |
|
|
|
|
|
servers.get({ |
|
|
|
|
|
url: API.employee.employeeGrant, |
|
|
|
|
|
data: query, |
|
|
|
|
|
isDefaultGet: false |
|
|
|
|
|
}) |
|
|
|
|
|
.then(res=>{ |
|
|
|
|
|
util.hideLoad(); |
|
|
|
|
|
if(res.data.code == 0){ |
|
|
|
|
|
util.showNone(res.data.message || '操作成功!'); |
|
|
|
|
|
setTimeout(_=>{ |
|
|
|
|
|
util.previousPageFunction({ |
|
|
|
|
|
fnName: 'getUserList', |
|
|
|
|
|
query: null |
|
|
|
|
|
}) |
|
|
|
|
|
util.routeTo(); |
|
|
|
|
|
},1200) |
|
|
|
|
|
}else{ |
|
|
|
|
|
util.showNone(res.data.message || '操作失败!'); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(util.hideLoad) |
|
|
|
|
|
},300,300), |
|
|
formatAppSelected({ |
|
|
formatAppSelected({ |
|
|
list=[], |
|
|
list=[], |
|
|
menu=[], |
|
|
menu=[], |
|
@ -138,9 +214,10 @@ export default { |
|
|
url: API.employee.employeeGrant, |
|
|
url: API.employee.employeeGrant, |
|
|
data: { |
|
|
data: { |
|
|
brand_id: options_query.brand_id, |
|
|
brand_id: options_query.brand_id, |
|
|
user_id: options_query.userInfo.id, |
|
|
|
|
|
|
|
|
ids: options_query.userIDS.join(','), |
|
|
stadium_ids: stadium_ids.join(','), |
|
|
stadium_ids: stadium_ids.join(','), |
|
|
menus: menus.join(','), |
|
|
menus: menus.join(','), |
|
|
|
|
|
status: 1, |
|
|
}, |
|
|
}, |
|
|
isDefaultGet: false, |
|
|
isDefaultGet: false, |
|
|
}) |
|
|
}) |
|
@ -193,7 +270,7 @@ export default { |
|
|
if(isAll)ele.isChecked = bol |
|
|
if(isAll)ele.isChecked = bol |
|
|
if(ID == ele.id)ele.isChecked = bol; |
|
|
if(ID == ele.id)ele.isChecked = bol; |
|
|
return ele |
|
|
return ele |
|
|
}) |
|
|
|
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
// 小程序权限全选 |
|
|
// 小程序权限全选 |
|
|
appAllSelect(e){ |
|
|
appAllSelect(e){ |
|
@ -220,6 +297,7 @@ export default { |
|
|
return ele |
|
|
return ele |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 获取品牌店铺列表 |
|
|
getStoreList({ brand_id, tags }){ |
|
|
getStoreList({ brand_id, tags }){ |
|
|
util.showLoad(); |
|
|
util.showLoad(); |
|
|
servers.get({ |
|
|
servers.get({ |
|
@ -253,11 +331,12 @@ export default { |
|
|
<style lang="scss" scoped> |
|
|
<style lang="scss" scoped> |
|
|
@import "../../../style/public.scss"; |
|
|
@import "../../../style/public.scss"; |
|
|
.as-contetnt{ |
|
|
.as-contetnt{ |
|
|
|
|
|
padding-top: 24upx; |
|
|
switch{ |
|
|
switch{ |
|
|
transform: scale(.7); |
|
|
transform: scale(.7); |
|
|
} |
|
|
} |
|
|
.ac-user{ |
|
|
.ac-user{ |
|
|
padding: 38upx 30upx 40upx; |
|
|
|
|
|
|
|
|
padding: 14upx 30upx 40upx; |
|
|
@include centerFlex(flex-start); |
|
|
@include centerFlex(flex-start); |
|
|
>image{ |
|
|
>image{ |
|
|
flex-shrink: 0; |
|
|
flex-shrink: 0; |
|
|