Browse Source

电签角色修改

duy 2 tháng trước cách đây
mục cha
commit
5d4d523c9b
1 tập tin đã thay đổi với 25 bổ sung1 xóa
  1. 25 1
      src/views/digital/signer.vue

+ 25 - 1
src/views/digital/signer.vue

@@ -437,8 +437,12 @@ import { log } from "@antv/g2plot/lib/utils";
                 }
             },
             positionNameSelect(newVal) {
+             
+                
                 if (newVal) {
                     let arr=[]; 
+                    console.log(newVal,'newVal');
+                    console.log(this.allPositionNameOptions,'this.allPositionNameOptions');
                     this.allPositionNameOptions.forEach(item => {
                         newVal.forEach(roleName => {
                             if (item.value === roleName) {
@@ -773,8 +777,18 @@ import { log } from "@antv/g2plot/lib/utils";
                     
                     if (res.data.code == 200) {
                         this.positionList1 = res.data.data;
+                        this.positionList = res.data.data;
+                        this.positionNameSelect=res.data.data.map(item => item.id)
+                        
+                        this.positionList.map(item => {
+                            item.label = item.name;
+                            item.value = item.id;
+                            item.checked = true
+                          });
+                       
                     }else{
                         this.positionList1 = [];
+                        this.positionList = [];
                     }
                 })
             },
@@ -919,6 +933,8 @@ import { log } from "@antv/g2plot/lib/utils";
             // 打开绑定岗位弹窗
             selectPost(row,index,type) {
                 this.selectedPostIndex=index;
+                this.getAllPositionNameOptions();
+                this.positionNameOptions=this.allPositionNameOptions;
                 if(type===1){
                     this.isPosView=true
                   
@@ -926,11 +942,19 @@ import { log } from "@antv/g2plot/lib/utils";
                         this.getPosDetail(row.id)
                     }
                 }else{
+                    if(row.id){
+                        this.getPosDetail(row.id)
+                        
+                        
+                    }
                     this.isPosView=false
                     this.partyCategorySelect='1'
                     this.getPositionList();
                     this.selectedPostRow = row;
-                    if(row.roleIds&&row.roleIds.length>0){
+               
+                    
+                    // this.positionNameSelect=arr
+                    if(!row.id&&row.roleIds&&row.roleIds.length>0){
                             this.positionNameSelect = row.roleIds;
                             this.partyCategorySelect=row.partyCategory
                         }else{