Explorar el Código

选择岗位修改

duy hace 2 meses
padre
commit
ffc4f0b56d
Se han modificado 1 ficheros con 40 adiciones y 19 borrados
  1. 40 19
      src/views/digital/signer.vue

+ 40 - 19
src/views/digital/signer.vue

@@ -254,7 +254,7 @@
                             </el-scrollbar>
                         </div>
                         <el-table
-                        
+                        v-loading="elementLoading"
                             v-if="selectedSourceOption === 1&&isEleView"
                             :data="elementList1"
                             border
@@ -283,7 +283,7 @@
                 <div class="bind-post-content">
                     <!-- 参建方分类 + 岗位名称下拉框 -->
                     <div class="dropdown-pair" v-if="!isPosView">
-                        <el-select v-model="partyCategorySelect" placeholder="请选择参建方分类" style="flex: 1; margin-right: 10px;">
+                        <el-select v-model="partyCategorySelect" placeholder="请选择参建方分类" style="flex: 1; margin-right: 10px;"  @change="changePositionName">
                             <el-option
                                 v-for="item in partyCategoryOptions"
                                 :key="item.value"
@@ -291,7 +291,7 @@
                                 :value="item.value">
                             </el-option>
                         </el-select>
-                        <el-select v-model="positionNameSelect" filterable multiple  placeholder="请输入岗位名称进行模糊检索" style="flex: 1;" @change="changePositionName" >
+                        <el-select v-model="positionNameSelect" filterable multiple  placeholder="请输入岗位名称进行模糊检索" style="flex: 1;"   v-loading="positionNameLoading">
 
                             <el-option
                                 v-for="item in positionNameOptions"
@@ -313,7 +313,7 @@
                         </el-scrollbar>
                     </div>
                     <el-table
-                        
+                        v-loading="bindPosLoading"
                         v-if="isPosView"
                         :data="positionList1"
                         border
@@ -332,7 +332,7 @@
                       
                     </el-table>
                 </div>
-                <span slot="footer" class="dialog-footer">
+                <span slot="footer" class="dialog-footer"  v-if="!isPosView">
                     <el-button @click="positionClose">取 消</el-button>
                     <el-button type="primary" @click="confirmBindPostSelection">确 定</el-button>
                 </span>
@@ -390,7 +390,10 @@ import { log } from "@antv/g2plot/lib/utils";
                 ],
                 elementList:[],
                 elementList1:[],
+                elementLoading: false,
+
                 bindPostDialogVisible: false,
+                bindPosLoading: false,
                 partyCategorySelect: '', // 参建方分类选中值
                 positionNameSelect: [], // 岗位名称选中值
                 partyCategoryOptions: [
@@ -399,9 +402,14 @@ import { log } from "@antv/g2plot/lib/utils";
                     { value: '3', label: '业主方' }
                 ],
                 positionNameOptions: [],
+                positionNameLoading: false,
+
                 positionList: [],
                 positionList1:[],
-                isPosView: true, // 是否查看
+                isPosView: true, //
+                //  是否查看
+                selectedPostRow: {},
+                selectedPostIndex: 0,
 
             }
         },
@@ -699,11 +707,12 @@ import { log } from "@antv/g2plot/lib/utils";
             },
             //查看详情
             getEleDetail(id,type){
+                this.elementLoading = true;
                 elementDetail({
                    id
                 }).then(res => {
-                    console.log(res.data,'res.dat');
-                    
+                   
+                    this.elementLoading = false;
                     if (res.data.code == 200) {
                         if(type==1){
                             this.elementList = res.data.data;
@@ -719,10 +728,12 @@ import { log } from "@antv/g2plot/lib/utils";
                 })
             },
             getPosDetail(id){
+            this.bindPosLoading = true;
                 roleDetail({
                    id
                 }).then(res => {
-                    console.log(res.data,'res.dat');
+                    this.bindPosLoading = false;
+                   
                     
                     if (res.data.code == 200) {
                         this.positionList1 = res.data.data;
@@ -826,7 +837,6 @@ import { log } from "@antv/g2plot/lib/utils";
                     
                     this.tableData1.forEach((item, index) => {
                         if (index==this.eleIndex) {
-                            
                             this.tableData1[index].tableType = 1;
                         }
                     })
@@ -858,19 +868,27 @@ import { log } from "@antv/g2plot/lib/utils";
             },
             // 打开绑定岗位弹窗
             selectPost(row,index,type) {
-                console.log(type,'type');
-        
+                this.selectedPostIndex=index;
                 if(type===1){
                     this.isPosView=true
-                    this.getPosDetail(row.id)
+                  
+                    if(row.id){
+                        this.getPosDetail(row.id)
+                    }
                 }else{
                     this.isPosView=false
                     this.partyCategorySelect='1'
                     this.getPositionList();
                     this.selectedPostRow = row;
-                    this.positionNameSelect = [];
-                    this.partyCategorySelect = '';
-                    this.positionList  = [];
+                    if(row.roleIds&&row.roleIds.length>0){
+                            this.positionNameSelect = row.roleIds;
+                            this.partyCategorySelect=row.partyCategory
+                        }else{
+                            this.positionNameSelect = [];
+                            this.partyCategorySelect = '';
+                            this.positionList  = [];
+                        }
+                       
                  }
                 this.bindPostDialogVisible = true;
               
@@ -880,10 +898,11 @@ import { log } from "@antv/g2plot/lib/utils";
             },
             // 获取岗位列表
             getPositionList() {
+                this.positionNameLoading = true;
                 queryAllRoleList({
                     type:this.partyCategorySelect
                 }).then(res => {
-                    
+                    this.positionNameLoading = false;
                     if (res.data.code == 200) {
                         this.positionNameOptions = res.data.data.map(item => ({
                             value: item.id,
@@ -905,15 +924,17 @@ import { log } from "@antv/g2plot/lib/utils";
                 if (this.positionNameSelect.length > 0) {
                         // this.selectedPostRow.roleIds = this.positionNameSelect.join(',');
                         this.tableData1.forEach((item, index) => {
-                            if (item.id === this.selectedPostRow.id) {
+                            if (this.selectedPostIndex == index) {
                                 this.tableData1[index].roleIds =this.positionNameSelect
+                                this.tableData1[index].partyCategory =this.partyCategorySelect
                             }
                         });
                     }else{
                         // this.selectedPostRow.roleIds = '';
                         this.tableData1.forEach((item, index) => {
-                            if (item.id === this.selectedPostRow.id) {
+                            if (this.selectedPostIndex == index) {
                                 this.tableData1[index].roleIds =[]
+                                this.tableData1[index].partyCategory = ''
                             }
                         });
                     }