|
@@ -381,7 +381,6 @@ export default {
|
|
|
sex:this.page==='editPerson'||this.page==='personal'?JSON.parse(JSON.stringify(this.info.sys_user.sex)):JSON.parse(JSON.stringify(this.info.sex)),
|
|
|
selectedOptions: this.page==='editPerson'||this.page==='personal'?[JSON.parse(JSON.stringify(this.info.sys_user.province_id)),JSON.parse(JSON.stringify(this.info.sys_user.city_id))]:[JSON.parse(JSON.stringify(this.info.province_id)),JSON.parse(JSON.stringify(this.info.city_id))],
|
|
|
desc:this.page==='editPerson'||this.page==='personal'?JSON.parse(JSON.stringify(this.info.sys_user.memo)):JSON.parse(JSON.stringify(this.info.memo)),
|
|
|
- // selectedOptions: '0302',
|
|
|
},
|
|
|
rules: {
|
|
|
name: [
|
|
@@ -521,7 +520,7 @@ export default {
|
|
|
},
|
|
|
// 级联选择器
|
|
|
handleCity(value){
|
|
|
- console.log(value)
|
|
|
+ // console.log(value)
|
|
|
},
|
|
|
// 提交表单
|
|
|
onSubmit(formName){
|
|
@@ -712,15 +711,30 @@ export default {
|
|
|
onSubmitAuth(){
|
|
|
this.loading = true
|
|
|
let MethodName = "/OrgServer/Manager/SysUserManager/UpdateSysUser_Popedom";
|
|
|
+ let finance_popedom_data_scope = {}
|
|
|
+ if(this.financeAuth.selectedOptions.length>0){
|
|
|
+ if(this.financeAuth.selectedOptions[0][0]&&this.financeAuth.selectedOptions[0][0]==='0'){
|
|
|
+ finance_popedom_data_scope.is_all = 'true'
|
|
|
+ }else{
|
|
|
+ finance_popedom_data_scope.is_all = 'false'
|
|
|
+ let province_id_list = []
|
|
|
+ let city_id_list = []
|
|
|
+ this.financeAuth.selectedOptions.forEach(item => {
|
|
|
+ if(province_id_list.indexOf(item[0])===-1){
|
|
|
+ province_id_list.push(item[0])
|
|
|
+ }
|
|
|
+ city_id_list.push(item[1]?item[1]:'')
|
|
|
+ });
|
|
|
+ finance_popedom_data_scope.province_id_list = province_id_list
|
|
|
+ finance_popedom_data_scope.city_id_list = city_id_list
|
|
|
+ }
|
|
|
+ }
|
|
|
let data = {
|
|
|
id: this.page==='personal'?JSON.parse(getToken()).user_id:this.id,
|
|
|
popedom_code_list: this.manageAuth,
|
|
|
data_scope:{
|
|
|
discount_code_view_scope:this.codeAuth.viewCode,
|
|
|
- finance_popedom_data_scope:{
|
|
|
- province_id_list:['03'],
|
|
|
- city_id_list:['02'],
|
|
|
- }
|
|
|
+ finance_popedom_data_scope: finance_popedom_data_scope
|
|
|
}
|
|
|
}
|
|
|
getLogin(MethodName, data)
|
|
@@ -735,9 +749,26 @@ export default {
|
|
|
},
|
|
|
// 取消权限
|
|
|
onCancelAuth(){
|
|
|
- this.manageAuth = []
|
|
|
- this.codeAuth.viewCode = 0
|
|
|
- this.financeAuth.selectedOptions = []
|
|
|
+ this.handleUserAuth()
|
|
|
+ // this.manageAuth = []
|
|
|
+ // this.codeAuth.viewCode = 0
|
|
|
+ // this.financeAuth.selectedOptions = []
|
|
|
+ },
|
|
|
+ // 赋值权限
|
|
|
+ handleUserAuth(){
|
|
|
+ if(this.page==='editPerson'||this.page==='personal'){
|
|
|
+ this.manageAuth = this.info.popedom_code_list?JSON.parse(JSON.stringify(this.info.popedom_code_list)):[]
|
|
|
+ this.codeAuth.viewCode = this.info.data_scope.discount_code_view_scope?JSON.parse(JSON.stringify(this.info.data_scope.discount_code_view_scope)):0
|
|
|
+ if(this.info.data_scope.finance_popedom_data_scope&&this.info.data_scope.finance_popedom_data_scope.is_all==='true'){
|
|
|
+ this.financeAuth.selectedOptions = ['0']
|
|
|
+ }else{
|
|
|
+ let arr = []
|
|
|
+ this.info.data_scope.finance_popedom_data_scope.city_id_list.forEach(item=>{
|
|
|
+ arr.push([item.substring(0,2),item])
|
|
|
+ })
|
|
|
+ this.financeAuth.selectedOptions = arr
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
// 修改管理员权限
|
|
|
onSubmitManager(){
|
|
@@ -777,9 +808,13 @@ export default {
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
+ if(this.info){
|
|
|
+ this.handleUserAuth()
|
|
|
+ }
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
+
|
|
|
},
|
|
|
//生命周期-创建之前
|
|
|
beforeCreated() { },
|