dedsudiyu 2 years ago
parent
commit
a2c35189f8

+ 36 - 0
src/api/safetyCheck/index.js

@@ -234,6 +234,15 @@ export function checkSetAdd(data) {
   })
 }
 
+//检查配置 人员列表查询
+export function checkStaffUserList(query) {
+  return request({
+    url: '/zd-security/checkStaffUser/list',
+    method: 'get',
+    params: query
+  })
+}
+
 /***************************检查计划***************************/
 
 //检查计划-列表
@@ -272,6 +281,33 @@ export function getHistoryPlanTitles(query) {
   })
 }
 
+//检查计划-查询当前学校下实验室数量
+export function getAllSubNum(query) {
+  return request({
+    url: '/zd-laboratory/subject/getAllSubNum',
+    method: 'get',
+    params: query
+  })
+}
+
+//检查计划-查询当前学校下学院列表与实验室数量
+export function conditionCollegeInfo(query) {
+  return request({
+    url: '/zd-laboratory/subject/conditionCollegeInfo',
+    method: 'get',
+    params: query
+  })
+}
+
+//检查计划-查询选中院系下的实验室列表
+export function findSubInfoByDeptIds(query) {
+  return request({
+    url: '/zd-laboratory/subject/findSubInfoByDeptIds',
+    method: 'get',
+    params: query
+  })
+}
+
 /***************************校院巡察组***************************/
 
 //校院巡察组-分页获取校院巡查组列表

+ 179 - 35
src/views/safetyCheck/checkConfiguration/configDialog.vue

@@ -1,7 +1,7 @@
 <template>
   <el-dialog class="configDialog"
              :title="configDialogData.staffType==1?'检查人员配置':'整改人员配置'" :visible.sync="configDialogType" v-if="configDialogType"
-             @close="addDialogAllOff" width="1303px" append-to-body>
+             @close="addDialogAllOff" width="1373px" append-to-body>
     <div class="configDialog-box" v-if="configPageType == 1">
       <div class="configDialog-content-box">
         <div class="configDialog-content-min-box">
@@ -41,9 +41,9 @@
                 <el-select v-model="userQueryParamsLeft.deptId" clearable placeholder="选择部门" style="width: 110px">
                   <el-option
                     v-for="item in deptSelectList"
-                    :key="item.key"
-                    :label="item.label"
-                    :value="item.key">
+                    :key="item.deptId"
+                    :label="item.deptName"
+                    :value="item.deptId">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -73,17 +73,21 @@
                 <p class="inquire-button-one" @click="userResetQueryLeft" style="width:60px;margin-right:0;">重置</p>
               </el-form-item>
             </el-form>
-            <el-table  border :data="userTableListLeft" @selection-change="userChangeLeft" :row-key="getRowKeys">
+            <el-table ref="leftUserTable" border :data="userTableListLeft" @selection-change="userChangeLeft" :row-key="getRowKeys">
               <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
-              <el-table-column label="姓名" align="center" prop="deptName" show-overflow-tooltip/>
-              <el-table-column label="工号" align="center" prop="deptName" show-overflow-tooltip width="150"/>
-              <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="168"/>
+              <el-table-column label="姓名" align="center" prop="userName" show-overflow-tooltip/>
+              <el-table-column label="学号" align="center" prop="userNumber" show-overflow-tooltip width="80"/>
+              <el-table-column label="手机号" align="center" prop="phonenumber" show-overflow-tooltip width="100"/>
+              <el-table-column label="实验室" align="center" prop="subjectName" show-overflow-tooltip width="80"/>
+              <el-table-column label="准入有效期" align="center" prop="deptName" show-overflow-tooltip width="200">
+                <template slot-scope="scope">{{scope.row.validBeginTime}}至{{scope.row.validEndTime}}</template>
+              </el-table-column>
             </el-table>
             <pagination :page-sizes="[20, 30, 40, 50]"
                         v-show="userTotalLeft>0"
                         :total="userTotalLeft"
-                        :page.sync="userTableListLeft.pageNum"
-                        :limit.sync="userTableListLeft.pageSize"
+                        :page.sync="userQueryParamsLeft.pageNum"
+                        :limit.sync="userQueryParamsLeft.pageSize"
                         @pagination="userGetListLeft"/>
           </div>
         </div>
@@ -102,9 +106,9 @@
                 <el-select v-model="userQueryParamsRight.deptId" clearable placeholder="选择部门" style="width: 110px">
                   <el-option
                     v-for="item in deptSelectList"
-                    :key="item.key"
-                    :label="item.label"
-                    :value="item.key">
+                    :key="item.deptId"
+                    :label="item.deptName"
+                    :value="item.deptId">
                   </el-option>
                 </el-select>
               </el-form-item>
@@ -134,17 +138,21 @@
                 <p class="inquire-button-one" @click="userResetQueryRight" style="width:60px;margin-right:0;">重置</p>
               </el-form-item>
             </el-form>
-            <el-table  border :data="userTableListRight" @selection-change="userChangeRight" :row-key="getRowKeys">
+            <el-table ref="rightUserTable" border :data="userTableListRight" @selection-change="userChangeRight" :row-key="getRowKeys">
               <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
-              <el-table-column label="姓名" align="center" prop="deptName" show-overflow-tooltip/>
-              <el-table-column label="工号" align="center" prop="deptName" show-overflow-tooltip width="150"/>
-              <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="168"/>
+              <el-table-column label="姓名" align="center" prop="userName" show-overflow-tooltip/>
+              <el-table-column label="学号" align="center" prop="userNumber" show-overflow-tooltip width="80"/>
+              <el-table-column label="手机号" align="center" prop="phonenumber" show-overflow-tooltip width="100"/>
+              <el-table-column label="实验室" align="center" prop="subjectName" show-overflow-tooltip width="80"/>
+              <el-table-column label="准入有效期" align="center" prop="deptName" show-overflow-tooltip width="200">
+                <template slot-scope="scope">{{scope.row.validBeginTime}}至{{scope.row.validEndTime}}</template>
+              </el-table-column>
             </el-table>
             <pagination :page-sizes="[20, 30, 40, 50]"
                         v-show="userTotalRight>0"
                         :total="userTotalRight"
-                        :page.sync="userTableListRight.pageNum"
-                        :limit.sync="userTableListRight.pageSize"
+                        :page.sync="userQueryParamsRight.pageNum"
+                        :limit.sync="userQueryParamsRight.pageSize"
                         @pagination="userGetListRight"/>
           </div>
         </div>
@@ -152,7 +160,7 @@
       <div class="dialog-footer-box">
         <p class="dialog-footer-button-null"></p>
         <p class="dialog-footer-button-info" @click="addDialogOff">返回</p>
-        <p class="dialog-footer-button-primary">确定</p>
+        <p class="dialog-footer-button-primary" @click="addUserButton">确定</p>
         <p class="dialog-footer-button-null"></p>
       </div>
     </div>
@@ -160,7 +168,8 @@
 </template>
 
 <script>
-  import { checkSet,checkSetAdd } from '@/api/safetyCheck/index'
+  import { listDepartments } from "@/api/system/dept";
+  import { checkSet,checkSetAdd,checkStaffUserList } from '@/api/safetyCheck/index'
   export default {
     name: 'configDialog',
     props:{
@@ -193,23 +202,33 @@
         /*===================================人员选择相关===================================*/
         deptSelectList:[],
         userQueryParamsLeft:{
-          deptId:"",
+          pageNum:1,
+          pageSize:20,
           searchValue:"",
+          deptId:"",
+          filtType:1
         },
-        userTableListLeft:[{}],
+        userTableListLeft:[],
         userTotalLeft:0,
         userNumLeft:0,
         userIdsLeft:[],
         userQueryParamsRight:{
+          pageNum:1,
+          pageSize:20,
           deptId:"",
           searchValue:"",
+          filtType:2
         },
-        userTableListRight:[{}],
+        userTableListRight:[],
         userTotalRight:0,
         userNumRight:0,
         userIdsRight:[],
         leftDateRange:[],
         rightDateRange:[],
+        //选中巡查人员列表
+        dialogTableList:[],
+        //选中页面人员列表数据
+        dialogTableDataList:[],
       }
     },
     created(){
@@ -217,6 +236,7 @@
     },
     mounted(){
       this.checkSet();
+      this.listDepartments();
     },
     methods:{
       //提交
@@ -228,7 +248,6 @@
           setSubjectSafety:false,
           setTeacher:false,
           setStudent:false,
-          sysUserVoList:[],
         };
         for(let i=0;i<self.checkDataList.length;i++){
           if(self.checkDataList[i] == '1'){
@@ -241,6 +260,7 @@
             obj.setStudent = true;
           }
         }
+        obj.sysUserVoList = obj.setStudent?this.dialogTableList:[]
         checkSetAdd(obj).then(response => {
           this.msgSuccess(response.msg);
           this.$parent.configButton(3)
@@ -268,12 +288,24 @@
             this.$set(this,'checkType',true);
           }
           this.$set(this,'checkDataList',list);
+          this.$set(this,'dialogTableList',response.data.userStuList);
         });
       },
       //人员选择
       configUserButton(type){
+        let self = this;
         if(this.configPageType != type){
-          this.$set(this,'configPageType',type);
+          if(type == 2){
+            this.$set(self,'dialogTableDataList',JSON.parse(JSON.stringify(this.dialogTableList)));
+            this.userResetQueryLeft();
+            this.userResetQueryRight();
+            this.$set(this,'configPageType',type);
+          }else{
+            checkStaffUserList.then(response => {
+              this.dialogTableList = response.data;
+            });
+            this.$set(this,'configPageType',type);
+          }
         }
       },
       //选择器
@@ -301,50 +333,156 @@
           this.$set(this,'configPageType',1);
         }
       },
+      addUserButton(){
+        this.$set(this,'dialogTableList',this.dialogTableDataList);
+        this.$set(this,'configPageType',1);
+      },
       /*===================================人员选择相关===================================*/
       //查询
       userHandleQueryLeft(){
         this.$set(this.userQueryParamsLeft,'pageNum',1);
+        this.$set(this,'userNumLeft',0);
+        this.$set(this,'userIdsLeft',[]);
+        if (this.$refs.leftUserTable){
+          this.$refs.leftUserTable.clearSelection();
+        }
         this.userGetListLeft();
       },
       //重置
       userResetQueryLeft(){
-        this.$set(this,'userQueryParamsLeft',{ searchValue:"", });
+        this.$set(this,'leftDateRange',[])
+        this.$set(this,'userQueryParamsLeft',{
+          pageNum:1,
+          pageSize:20,
+          searchValue:"",
+          deptId:"",
+          filtType:1
+        });
         this.userHandleQueryLeft();
       },
       //查询接口
       userGetListLeft(){
-
+        let self = this;
+        let leftObj = JSON.parse(JSON.stringify(this.userQueryParamsLeft));
+        leftObj.filtCheckUserIdList = [];
+        for(let i=0;i<self.dialogTableDataList.length;i++){
+          leftObj.filtCheckUserIdList.push(self.dialogTableDataList[i].userId);
+        }
+        leftObj.filtCheckUserIdList = leftObj.filtCheckUserIdList+'';
+        if(this.leftDateRange[0]){
+          leftObj.beginTime = this.leftDateRange[0]
+        }else{
+          leftObj.beginTime = ""
+        }
+        if(this.leftDateRange[1]){
+          leftObj.endTime = this.leftDateRange[1]
+        }else{
+          leftObj.endTime = ""
+        }
+        checkStaffUserList(leftObj).then(response => {
+          this.userTotalLeft = response.data.total;
+          this.userTableListLeft = response.data.records;
+        });
       },
       //查询
       userHandleQueryRight(){
         this.$set(this.userQueryParamsRight,'pageNum',1);
+        this.$set(this,'userNumRight',0);
+        this.$set(this,'userIdsRight',[]);
+        if(this.$refs.rightUserTable){
+          this.$refs.rightUserTable.clearSelection();
+        }
         this.userGetListRight();
       },
       //重置
       userResetQueryRight(){
+        this.$set(this,'rightDateRange',[])
         this.$set(this,'userQueryParamsRight',{
           pageNum:1,
           pageSize:20,
-          classType:"",
-          classified:"",
           deptId:"",
           searchValue:"",
+          filtType:2
         });
         this.userHandleQueryRight();
       },
       //查询接口
       userGetListRight(){
+        let self = this;
+        let rightObj = JSON.parse(JSON.stringify(this.userQueryParamsRight));
+        rightObj.notFiltCheckUserIdList = [];
+        for(let i=0;i<self.dialogTableDataList.length;i++){
+          rightObj.notFiltCheckUserIdList.push(self.dialogTableDataList[i].userId);
+        }
+        rightObj.notFiltCheckUserIdList = rightObj.notFiltCheckUserIdList+'';
 
+        if(this.rightDateRange[0]){
+          rightObj.beginTime = this.rightDateRange[0]
+        }else{
+          rightObj.beginTime = ""
+        }
+        if(this.rightDateRange[1]){
+          rightObj.endTime = this.rightDateRange[1]
+        }else{
+          rightObj.endTime = ""
+        }
+        checkStaffUserList(rightObj).then(response => {
+          this.userTotalRight = response.data.total;
+          this.userTableListRight = response.data.records;
+        });
       },
+      //穿梭按钮
       userArrowButton(type){
+        let self = this;
         if(type == 1){
+          //右至左
           if(this.userIdsRight[0]){
-
+            let list = JSON.parse(JSON.stringify(this.dialogTableDataList));
+            for(let i=0;i<self.userIdsRight.length;i++){
+              for(let s=0;s<list.length;s++){
+                if(self.userIdsRight[i] == list[s].userId){
+                  list.splice(s,1);
+                  s--
+                }
+              }
+            }
+            this.$set(this,'dialogTableDataList',list);
+            this.$refs.rightUserTable.clearSelection();
+            this.userGetListLeft();
+            this.userGetListRight();
+          }else{
+            this.msgError('请先勾选右侧列表')
           }
         }else if(type == 2){
+          //左至右
           if(this.userIdsLeft[0]){
-
+            let list = JSON.parse(JSON.stringify(this.dialogTableDataList));
+            for(let i=0;i<self.userIdsLeft.length;i++){
+              for(let o=0;o<self.userTableListLeft.length;o++){
+                if(self.userIdsLeft[i] == self.userTableListLeft[o].userId){
+                  let obj = {
+                    subId:self.userTableListLeft[o].subjectId,
+                    subName:self.userTableListLeft[o].subjectName,
+                    subRom:self.userTableListLeft[o].roomNum,
+                    deptId:self.userTableListLeft[o].deptId,
+                    deptName:self.userTableListLeft[o].deptName,
+                    userId:self.userTableListLeft[o].userId,
+                    nickName:self.userTableListLeft[o].userName,
+                    userNumber:self.userTableListLeft[o].userNumber,
+                    phonenumber:self.userTableListLeft[o].phonenumber,
+                    validBeginTime:self.userTableListLeft[o].validBeginTime,
+                    validEndTime:self.userTableListLeft[o].validEndTime,
+                  }
+                  list.push(obj);
+                }
+              }
+            }
+            this.$set(this,'dialogTableDataList',list);
+            this.$refs.leftUserTable.clearSelection();
+            this.userGetListLeft();
+            this.userGetListRight();
+          }else{
+            this.msgError('请先勾选左侧列表')
           }
         }
       },
@@ -353,7 +491,7 @@
         需要在selection 添加 :reserve-selection="true"
       */
       getRowKeys(row) {
-        return row.userId
+        return row.id
       },
       userChangeLeft(selection){
         this.userNumLeft = selection.length;
@@ -363,6 +501,12 @@
         this.userNumRight = selection.length;
         this.userIdsRight = selection.map(item => item.userId);
       },
+      //获取学院列表
+      listDepartments(){
+        listDepartments().then(response => {
+          this.deptSelectList = response.data;
+        });
+      },
     }
   }
 </script>
@@ -474,14 +618,14 @@
           display: flex;
           flex-direction: column;
           overflow: hidden;
-          width:604px;
+          width:639px;
         }
         .right-max-box{
           height:550px;
           display: flex;
           flex-direction: column;
           overflow: hidden;
-          width:604px;
+          width:639px;
         }
         .center-box{
           width:60px;

+ 59 - 65
src/views/safetyCheck/schoolInspection/inspectionGroup/addDialog.vue

@@ -76,51 +76,51 @@
     </div>
     <div class="inspectionPlan-dialog-user-box" v-show="addDialogBoxType == 2">
       <div class="left-max-box">
-        <div class="dept-table-title-box">
-          <p>待选人员</p>
-          <p>{{userNumLeft}}/{{userTotalLeft}}</p>
-        </div>
-        <div class="dept-table-max-box">
-          <el-form :model="userQueryParamsLeft" class="form-box" ref="queryForm" :inline="true" label-width="50px">
-            <el-form-item label="" prop="deptId">
-              <el-select v-model="userQueryParamsLeft.deptId" clearable placeholder="选择部门" style="width: 110px">
-                <el-option
-                  v-for="item in deptSelectList"
-                  :key="item.deptId"
-                  :label="item.deptName"
-                  :value="item.deptId">
-                </el-option>
-              </el-select>
-            </el-form-item>
-            <el-form-item label="" prop="searchValue" class="form-index">
-              <el-input
-                maxLength="20"
-                v-model="userQueryParamsLeft.searchValue"
-                placeholder="搜索姓名/工号"
-                clearable
-                style="width: 240px">
-                <p class="el-icon-search" slot="append" @click="userHandleQueryLeft"></p>
-              </el-input>
-            </el-form-item>
-            <el-form-item style="margin-right:0;">
-              <p class="reset-button-one" @click="userResetQueryLeft" style="width:60px;">重置</p>
-            </el-form-item>
-          </el-form>
-          <el-table ref="leftUserTable" border :data="userTableListLeft" @selection-change="userChangeLeft" :row-key="getRowKeys">
-            <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
-            <el-table-column label="姓名" align="center" prop="nickName" show-overflow-tooltip/>
-            <el-table-column label="工号" align="center" prop="userName" show-overflow-tooltip width="150"/>
-            <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="168"/>
-          </el-table>
-          <pagination layout="total, prev, pager, next, jumper"
-                      v-show="userTotalLeft>0"
-                      :total="userTotalLeft"
-                      :pager-count="5"
-                      :page.sync="userQueryParamsLeft.pageNum"
-                      :limit.sync="userQueryParamsLeft.pageSize"
-                      @pagination="userGetListLeft"/>
-        </div>
+      <div class="dept-table-title-box">
+        <p>待选人员</p>
+        <p>{{userNumLeft}}/{{userTotalLeft}}</p>
+      </div>
+      <div class="dept-table-max-box">
+        <el-form :model="userQueryParamsLeft" class="form-box" ref="queryForm" :inline="true" label-width="50px">
+          <el-form-item label="" prop="deptId">
+            <el-select v-model="userQueryParamsLeft.deptId" clearable placeholder="选择部门" style="width: 110px">
+              <el-option
+                v-for="item in deptSelectList"
+                :key="item.deptId"
+                :label="item.deptName"
+                :value="item.deptId">
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="searchValue" class="form-index">
+            <el-input
+              maxLength="20"
+              v-model="userQueryParamsLeft.searchValue"
+              placeholder="搜索姓名/工号"
+              clearable
+              style="width: 240px">
+              <p class="el-icon-search" slot="append" @click="userHandleQueryLeft"></p>
+            </el-input>
+          </el-form-item>
+          <el-form-item style="margin-right:0;">
+            <p class="reset-button-one" @click="userResetQueryLeft" style="width:60px;">重置</p>
+          </el-form-item>
+        </el-form>
+        <el-table ref="leftUserTable" border :data="userTableListLeft" @selection-change="userChangeLeft" :row-key="getRowKeys">
+          <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
+          <el-table-column label="姓名" align="center" prop="nickName" show-overflow-tooltip/>
+          <el-table-column label="工号" align="center" prop="userName" show-overflow-tooltip width="150"/>
+          <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="168"/>
+        </el-table>
+        <pagination layout="total, prev, pager, next, jumper"
+                    v-show="userTotalLeft>0"
+                    :total="userTotalLeft"
+                    :pager-count="5"
+                    :page.sync="userQueryParamsLeft.pageNum"
+                    :limit.sync="userQueryParamsLeft.pageSize"
+                    @pagination="userGetListLeft"/>
       </div>
+    </div>
       <div class="center-box">
         <p class="el-icon-arrow-left" @click="userArrowButton(1)"></p>
         <p class="el-icon-arrow-right" @click="userArrowButton(2)"></p>
@@ -215,6 +215,7 @@
           pageSize: 20,
           deptId:"",
           searchValue:"",
+          filtType:1
         },
         userTableListLeft:[],
         userTotalLeft:0,
@@ -225,6 +226,7 @@
           pageSize: 20,
           deptId:"",
           searchValue:"",
+          filtType:2
         },
         userTableListRight:[],
         userTotalRight:0,
@@ -261,7 +263,7 @@
     methods:{
       //获取详情
       checkGroupFind(){
-        checkGroupFind({id:this.addDialogData.id}).then(response => {
+        checkGroupFind({id:this.addDialogData.id,selectEnable:0}).then(response => {
           this.$set(this.dialogForm,'id',response.data.id?response.data.id:'');
           this.$set(this.dialogForm,'enable',response.data.enable);
           this.$set(this.dialogForm,'groupName',response.data.groupName);
@@ -345,24 +347,8 @@
         let self = this;
         if(type == 2){
           this.$set(self,'dialogTableDataList',JSON.parse(JSON.stringify(this.dialogTableList)));
-          let leftObj = JSON.parse(JSON.stringify(this.userQueryParamsLeft));
-          let rightObj = JSON.parse(JSON.stringify(this.userQueryParamsRight));
-          rightObj.userIds = [];
-          leftObj.selectedUserIds = [];
-          for(let i=0;i<self.dialogTableDataList.length;i++){
-            leftObj.selectedUserIds.push(self.dialogTableDataList[i].userId);
-            rightObj.userIds.push(self.dialogTableDataList[i].userId);
-          }
-          if(rightObj.userIds[0]){
-            findUserList(rightObj).then(response => {
-              this.userTotalRight = response.total;
-              this.userTableListRight = response.rows;
-            });
-          }
-          findUserList(leftObj).then(response => {
-            this.userTotalLeft = response.total;
-            this.userTableListLeft = response.rows;
-          });
+          this.userResetQueryLeft();
+          this.userResetQueryRight();
           this.$set(this,'addDialogBoxType',type);
         }else{
           this.$set(this,'addDialogBoxType',type);
@@ -381,6 +367,9 @@
       //查询
       userHandleQueryLeft(){
         this.$set(this.userQueryParamsLeft,'pageNum',1);
+        this.$set(this,'userNumLeft',0);
+        this.$set(this,'userIdsLeft',[]);
+        this.$refs.leftUserTable.clearSelection();
         this.userGetListLeft();
       },
       //重置
@@ -390,6 +379,7 @@
           pageSize: 20,
           deptId:"",
           searchValue:"",
+          filtType:1
         });
         this.userHandleQueryLeft();
       },
@@ -409,6 +399,9 @@
       //查询
       userHandleQueryRight(){
         this.$set(this.userQueryParamsRight,'pageNum',1);
+        this.$set(this,'userNumRight',0);
+        this.$set(this,'userIdsRight',[]);
+        this.$refs.rightUserTable.clearSelection();
         this.userGetListRight();
       },
       //重置
@@ -418,6 +411,7 @@
           pageSize: 20,
           deptId:"",
           searchValue:"",
+          filtType:2
         });
         this.userHandleQueryRight();
       },
@@ -450,6 +444,7 @@
               }
             }
             this.$set(this,'dialogTableDataList',list);
+            this.$refs.rightUserTable.clearSelection();
             this.userGetListLeft();
             this.userGetListRight();
           }else{
@@ -475,14 +470,13 @@
               }
             }
             this.$set(this,'dialogTableDataList',list);
+            this.$refs.leftUserTable.clearSelection();
             this.userGetListLeft();
             this.userGetListRight();
           }else{
             this.msgError('请先勾选左侧列表')
           }
         }
-        this.$refs.leftUserTable.clearSelection();
-        this.$refs.rightUserTable.clearSelection();
       },
       /*===记录勾选数据===
         需要再el-table 添加  :row-key="getRowKeys"

+ 237 - 67
src/views/safetyCheck/schoolInspection/inspectionPlan/addDialog.vue

@@ -43,10 +43,11 @@
               </div>
             </div>
           </el-form-item>
-          <el-form-item label="检查范围:" prop="data4">
+          <el-form-item label="检查范围:" prop="checkRange">
             <div class="dialog-range-max-box">
               <div class="dialog-range-select-box">
-                <el-select :disabled="lookInfoType" v-model="dialogForm.data4" placeholder="请选择检查范围" style="width:450px;">
+                <el-select :disabled="lookInfoType" @change="rangeChange"
+                           v-model="dialogForm.checkRange" placeholder="请选择检查范围" style="width:450px;">
                   <el-option
                     v-for="item in dialogRangeOptions"
                     :key="item.value"
@@ -56,10 +57,10 @@
                 </el-select>
               </div>
               <div class="dialog-range-text-box">
-                <p class="inquire-button-one button-p" v-if="dialogForm.data4 == 2" @click="dialogClickType(2)">{{lookInfoType?'查看':'选择学院'}}</p>
-                <p class="inquire-button-one button-p" v-if="dialogForm.data4 == 3" @click="dialogClickType(3)">{{lookInfoType?'查看':'选择实验室'}}</p>
-                <p class="text-p" v-if="dialogForm.data4 == 2">已选择{{deptCheckNum}}个学院,共{{subCheckNum}}间实验室</p>
-                <p class="text-p" v-if="dialogForm.data4 != 2">已选择{{subCheckNum}}间实验室</p>
+                <p class="inquire-button-one button-p" v-if="dialogForm.checkRange == 2" @click="dialogClickType(2)">{{lookInfoType?'查看':'选择学院'}}</p>
+                <p class="inquire-button-one button-p" v-if="dialogForm.checkRange == 3" @click="dialogClickType(3)">{{lookInfoType?'查看':'选择实验室'}}</p>
+                <p class="text-p" v-if="dialogForm.checkRange == 2">已选择{{deptCheckNum}}个学院,共{{deptSubCheckNum}}间实验室</p>
+                <p class="text-p" v-if="dialogForm.checkRange != 2">已选择{{subCheckNum}}间实验室</p>
               </div>
             </div>
           </el-form-item>
@@ -122,8 +123,8 @@
                 </div>
                 <el-table border :data="dialogTableList">
                   <el-table-column label="序号" align="center"  type="index" width="140"/>
-                  <el-table-column label="工号" align="center" prop="deptName" show-overflow-tooltip/>
-                  <el-table-column label="姓名" align="center" prop="deptName" show-overflow-tooltip width="150"/>
+                  <el-table-column label="工号" align="center" prop="jobNum" show-overflow-tooltip/>
+                  <el-table-column label="姓名" align="center" prop="name" show-overflow-tooltip width="150"/>
                   <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="150"/>
                   <el-table-column label="操作" align="center" prop="deptName" width="150" v-if="!lookInfoType">
                     <template slot-scope="scope">
@@ -164,7 +165,7 @@
               <p class="inquire-button-one" @click="deptResetQueryLeft" style="width:60px;margin-right:0;">重置</p>
             </el-form-item>
           </el-form>
-          <el-table  border :data="deptTableListLeft" @selection-change="deptChange" :row-key="getRowKeys">
+          <el-table ref="leftDeptTable" border :data="deptTableListLeft" @selection-change="deptChange" :row-key="getDeptRowKeys">
             <el-table-column v-if="!lookInfoType" type="selection" width="50" :reserve-selection="true" align="center"/>
             <el-table-column label="学院" align="center" prop="deptName" show-overflow-tooltip/>
           </el-table>
@@ -201,9 +202,9 @@
               <el-select v-model="deptQueryParamsRight.deptId" clearable placeholder="选择学院" style="width: 120px">
                 <el-option
                   v-for="item in deptSelectList"
-                  :key="item.key"
-                  :label="item.label"
-                  :value="item.key">
+                  :key="item.deptId"
+                  :label="item.deptName"
+                  :value="item.deptId">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -270,9 +271,9 @@
               <el-select v-model="subQueryParamsLeft.deptId" clearable placeholder="学院" style="width: 80px">
                 <el-option
                   v-for="item in deptSelectList"
-                  :key="item.key"
-                  :label="item.label"
-                  :value="item.key">
+                  :key="item.deptId"
+                  :label="item.deptName"
+                  :value="item.deptId">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -290,7 +291,7 @@
               <p class="inquire-button-one" @click="subResetQueryLeft" style="width:60px;margin-right:0;">重置</p>
             </el-form-item>
           </el-form>
-          <el-table  border :data="subTableListLeft" @selection-change="subChangeLeft" :row-key="getRowKeys">
+          <el-table  border :data="subTableListLeft" @selection-change="subChangeLeft" :row-key="getSubRowKeys">
             <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
             <el-table-column label="实验室" align="center" prop="deptName" show-overflow-tooltip/>
             <el-table-column label="分类分级" align="center" prop="deptName" show-overflow-tooltip width="120"/>
@@ -340,9 +341,9 @@
               <el-select v-model="subQueryParamsRight.deptId" clearable placeholder="学院" style="width: 80px">
                 <el-option
                   v-for="item in deptSelectList"
-                  :key="item.key"
-                  :label="item.label"
-                  :value="item.key">
+                  :key="item.deptId"
+                  :label="item.deptName"
+                  :value="item.deptId">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -360,7 +361,7 @@
               <p class="inquire-button-one" @click="subResetQueryRight" style="width:60px;margin-right:0;">重置</p>
             </el-form-item>
           </el-form>
-          <el-table border :data="subTableListRight" @selection-change="subChangeRight" :row-key="getRowKeys">
+          <el-table border :data="subTableListRight" @selection-change="subChangeRight" :row-key="getSubRowKeys">
             <el-table-column v-if="!lookInfoType" type="selection" width="50" :reserve-selection="true" align="center"/>
             <el-table-column label="实验室" align="center" prop="deptName" show-overflow-tooltip/>
             <el-table-column label="分类分级" align="center" prop="deptName" show-overflow-tooltip width="120"/>
@@ -386,16 +387,16 @@
             <el-form-item label="" prop="deptId">
               <el-select v-model="userQueryParamsLeft.deptId" clearable placeholder="选择部门" style="width: 110px">
                 <el-option
-                  v-for="item in classTypeList"
-                  :key="item.key"
-                  :label="item.label"
-                  :value="item.key">
+                  v-for="item in deptSelectList"
+                  :key="item.deptId"
+                  :label="item.deptName"
+                  :value="item.deptId">
                 </el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="" prop="searchValue" class="form-index">
               <el-input
-                maxLength="30"
+                maxLength="20"
                 v-model="userQueryParamsLeft.searchValue"
                 placeholder="搜索姓名/工号"
                 clearable
@@ -404,20 +405,21 @@
               </el-input>
             </el-form-item>
             <el-form-item style="margin-right:0;">
-              <p class="inquire-button-one" @click="userResetQueryLeft" style="width:60px;margin-right:0;">重置</p>
+              <p class="reset-button-one" @click="userResetQueryLeft" style="width:60px;">重置</p>
             </el-form-item>
           </el-form>
-          <el-table  border :data="userTableListLeft" @selection-change="userChangeLeft" :row-key="getRowKeys">
+          <el-table ref="leftUserTable" border :data="userTableListLeft" @selection-change="userChangeLeft" :row-key="getRowKeys">
             <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
-            <el-table-column label="姓名" align="center" prop="deptName" show-overflow-tooltip/>
-            <el-table-column label="工号" align="center" prop="deptName" show-overflow-tooltip width="150"/>
+            <el-table-column label="姓名" align="center" prop="nickName" show-overflow-tooltip/>
+            <el-table-column label="工号" align="center" prop="userName" show-overflow-tooltip width="150"/>
             <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="168"/>
           </el-table>
-          <pagination :page-sizes="[20, 30, 40, 50]"
+          <pagination layout="total, prev, pager, next, jumper"
                       v-show="userTotalLeft>0"
                       :total="userTotalLeft"
-                      :page.sync="userTableListLeft.pageNum"
-                      :limit.sync="userTableListLeft.pageSize"
+                      :pager-count="5"
+                      :page.sync="userQueryParamsLeft.pageNum"
+                      :limit.sync="userQueryParamsLeft.pageSize"
                       @pagination="userGetListLeft"/>
         </div>
       </div>
@@ -436,15 +438,15 @@
               <el-select v-model="userQueryParamsRight.deptId" clearable placeholder="选择部门" style="width: 110px">
                 <el-option
                   v-for="item in deptSelectList"
-                  :key="item.key"
-                  :label="item.label"
-                  :value="item.key">
+                  :key="item.deptId"
+                  :label="item.deptName"
+                  :value="item.deptId">
                 </el-option>
               </el-select>
             </el-form-item>
             <el-form-item label="" prop="searchValue" class="form-index">
               <el-input
-                maxLength="30"
+                maxLength="20"
                 v-model="userQueryParamsRight.searchValue"
                 placeholder="搜索姓名/工号"
                 clearable
@@ -453,20 +455,21 @@
               </el-input>
             </el-form-item>
             <el-form-item style="margin-right:0;">
-              <p class="inquire-button-one" @click="userResetQueryRight" style="width:60px;margin-right:0;">重置</p>
+              <p class="reset-button-one" @click="userResetQueryRight" style="width:60px;">重置</p>
             </el-form-item>
           </el-form>
-          <el-table  border :data="userTableListRight" @selection-change="userChangeRight" :row-key="getRowKeys">
+          <el-table ref="rightUserTable" border :data="userTableListRight" @selection-change="userChangeRight" :row-key="getRowKeys">
             <el-table-column type="selection" width="50" :reserve-selection="true" align="center"/>
-            <el-table-column label="姓名" align="center" prop="deptName" show-overflow-tooltip/>
-            <el-table-column label="工号" align="center" prop="deptName" show-overflow-tooltip width="150"/>
+            <el-table-column label="姓名" align="center" prop="nickName" show-overflow-tooltip/>
+            <el-table-column label="工号" align="center" prop="userName" show-overflow-tooltip width="150"/>
             <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="168"/>
           </el-table>
-          <pagination :page-sizes="[20, 30, 40, 50]"
+          <pagination layout="total, prev, pager, next, jumper"
                       v-show="userTotalRight>0"
                       :total="userTotalRight"
-                      :page.sync="userTableListRight.pageNum"
-                      :limit.sync="userTableListRight.pageSize"
+                      :pager-count="5"
+                      :page.sync="userQueryParamsRight.pageNum"
+                      :limit.sync="userQueryParamsRight.pageSize"
                       @pagination="userGetListRight"/>
         </div>
       </div>
@@ -480,7 +483,7 @@
     <div slot="footer" class="dialog-footer dialog-footer-box" style="display: flex">
       <p class="dialog-footer-button-null"></p>
       <p class="dialog-footer-button-info" @click="addDialogOff">{{addDialogBoxType==1?'取消':'返回'}}</p>
-      <p class="dialog-footer-button-primary" v-if="!lookInfoType">确定</p>
+      <p class="dialog-footer-button-primary" v-if="!lookInfoType" @click="addUserButton">确定</p>
       <p class="dialog-footer-button-null"></p>
     </div>
   </el-dialog>
@@ -488,7 +491,8 @@
 
 <script>
   import { getToken } from "@/utils/auth";
-  import { getHistoryPlanTitles,findGroupList,checkGroupFind } from '@/api/safetyCheck/index'
+  import { listDepartments } from "@/api/system/dept";
+  import { getHistoryPlanTitles,findGroupList,checkGroupFind,findUserList,getAllSubNum,conditionCollegeInfo,findSubInfoByDeptIds } from '@/api/safetyCheck/index'
   export default {
     name: 'addDialog',
     props:{
@@ -533,6 +537,7 @@
         dialogRangeOptions:[{label:"全校",value:"1"},{label:"学院",value:"2"},{label:"实验室",value:"3"}],
         //巡查院系数量
         deptCheckNum:0,
+        deptSubCheckNum:0,
         //巡查院系列表
         deptList:[],
         //巡查实验室数量
@@ -544,7 +549,7 @@
           data1:"",
           data2:"",
           data3:[],
-          data4:"1",
+          checkRange:"",
           data5:"",
           data6:"",
         },
@@ -557,7 +562,7 @@
           data3: [
             { required: true, message: "请选择检查周期", trigger: "change" },
           ],
-          data4: [
+          checkRange: [
             { required: true, message: "请选择检查范围", trigger: "change" },
           ],
         },
@@ -574,7 +579,13 @@
         deptTotalLeft:0,
         deptNumLeft:0,
         deptIdsLeft:[],
-        deptQueryParamsRight:{},
+        deptQueryParamsRight:{
+          pageNum:1,
+          pageSize:20,
+          deptId:"",
+          level:"",
+          searchValue:"",
+        },
         deptTableListRight:[{}],
         deptTotalRight:0,
         /*===================================实验室选择相关===================================*/
@@ -600,21 +611,28 @@
         subIdsRight:[],
         /*===================================人员选择相关===================================*/
         userQueryParamsLeft:{
+          pageNum: 1,
+          pageSize: 20,
           deptId:"",
           searchValue:"",
+          filtType:1
         },
-        userTableListLeft:[{}],
+        userTableListLeft:[],
         userTotalLeft:0,
         userNumLeft:0,
         userIdsLeft:[],
         userQueryParamsRight:{
+          pageNum: 1,
+          pageSize: 20,
           deptId:"",
           searchValue:"",
+          filtType:2
         },
-        userTableListRight:[{}],
+        userTableListRight:[],
         userTotalRight:0,
         userNumRight:0,
         userIdsRight:[],
+        dialogTableDataList:[],
         /*===================================文档预览===================================*/
         iframeSrc:"",
         /*===================================弹窗相关结束===================================*/
@@ -648,13 +666,71 @@
         findGroupList({checkLevel:0}).then(response => {
           this.$set(this,'dialogOptions',response.data);
         });
+        //获取学院列表
+        listDepartments().then(response => {
+          this.deptSelectList = response.data;
+        });
+      },
+      //选中检查范围
+      rangeChange(val){
+        if(val == 1){
+          //全校
+          getAllSubNum().then(response => {
+            this.$set(this,'subCheckNum',response.data.subCount);
+          })
+        }
       },
       //选中巡察组
       groupChange(val){
-        checkGroupFind({id:val}).then(response => {
+        checkGroupFind({id:val,selectEnable:1}).then(response => {
           this.$set(this,'dialogTableList',response.data.checkGroupMemberList);
         });
       },
+      //确定
+      addUserButton(){
+        let self = this;
+        if(this.addDialogBoxType == 1){
+
+        }else if(this.addDialogBoxType == 4){
+          //人员选择确定
+          let list = [];
+          let newObj = {};
+          for(let o=0;o<self.dialogTableDataList.length;o++){
+            let num = 0;
+            for(let i=0;i<self.dialogTableList.length;i++){
+              if(self.dialogTableList[i].userId == self.dialogTableDataList[o].userId){
+                num++
+                newObj = JSON.parse(JSON.stringify(self.dialogTableList[i]))
+              }
+            }
+            if(num == 0){
+              let obj = {
+                userId:self.dialogTableDataList[o].userId,
+                name:self.dialogTableDataList[o].name,
+                jobNum:self.dialogTableDataList[o].jobNum,
+                deptName:self.dialogTableDataList[o].deptName,
+                deptId:self.dialogTableDataList[o].deptId,
+                userType:self.dialogTableDataList[o].userType,
+                enable:1,
+              };
+              list.push(obj)
+            }else{
+              let obj = {
+                userId:self.dialogTableDataList[o].userId,
+                name:self.dialogTableDataList[o].name,
+                jobNum:self.dialogTableDataList[o].jobNum,
+                deptName:self.dialogTableDataList[o].deptName,
+                deptId:self.dialogTableDataList[o].deptId,
+                userType:self.dialogTableDataList[o].userType,
+                enable:newObj.enable,
+              };
+              list.push(obj)
+            }
+          }
+          this.$set(this,'dialogTableList',list);
+          this.dialogClickType(1);
+        }
+      },
       /*===================================弹窗相关===================================*/
       //弹窗关闭
       addDialogAllOff(){
@@ -669,9 +745,23 @@
       },
       //弹窗状态切换
       dialogClickType(type,item){
+        let self = this;
         if(type == 5){
           this.$set(this,'iframeSrc',this.urlJudge(item.url));
           this.$set(this,'addDialogBoxType',type);
+        }else if(type == 4){
+          //添加成员
+          this.$set(self,'dialogTableDataList',JSON.parse(JSON.stringify(this.dialogTableList)));
+          this.userResetQueryLeft();
+          this.userResetQueryRight();
+          this.$set(this,'addDialogBoxType',type);
+        }else if(type == 2){
+          //选择学院
+          this.deptResetQueryLeft();
+          this.$set(this,'addDialogBoxType',type);
+        }else if(type == 3){
+          //选择实验室
+          this.$set(this,'addDialogBoxType',type);
         }else{
           this.$set(this,'addDialogBoxType',type);
         }
@@ -739,25 +829,25 @@
       //重置
       deptResetQueryLeft(){
         this.$set(this,'deptQueryParamsLeft',{ searchValue:"", });
+        this.$set(this,'deptNumLeft',0);
+        this.$set(this,'deptIdsLeft',[]);
+        this.$refs.leftDeptTable.clearSelection();
         this.deptGetListLeft();
       },
       //查询接口
       deptGetListLeft(){
-
+        conditionCollegeInfo(this.deptQueryParamsLeft).then(response => {
+          this.$set(this,'deptTableListLeft',response.data);
+          this.$set(this,'deptTotalLeft',response.data.length);
+        })
       },
       //查询
       deptHandleQueryRight(){
-        this.$set(this.deptQueryParamsRight,'pageNum',1);
         this.deptGetListRight();
       },
       //重置
       deptResetQueryRight(){
         this.$set(this,'deptQueryParamsRight',{
-          pageNum:1,
-          pageSize:20,
-          classType:"",
-          classified:"",
-          deptId:"",
           searchValue:"",
         });
         this.deptHandleQueryRight();
@@ -765,6 +855,12 @@
       //查询接口
       deptGetListRight(){
 
+        console.log('selection',selection);
+        let obj = JSON.parse(JSON.stringify(this.deptQueryParamsRight));
+        findSubInfoByDeptIds(obj).then(response => {
+          this.userTotalLeft = response.total;
+          this.userTableListLeft = response.rows;
+        });
       },
       /*===================================实验室选择相关===================================*/
       //查询
@@ -817,46 +913,114 @@
       //查询
       userHandleQueryLeft(){
         this.$set(this.userQueryParamsLeft,'pageNum',1);
+        this.$set(this,'userNumLeft',0);
+        this.$set(this,'userIdsLeft',[]);
+        this.$refs.leftUserTable.clearSelection();
         this.userGetListLeft();
       },
       //重置
       userResetQueryLeft(){
-        this.$set(this,'userQueryParamsLeft',{ searchValue:"", });
+        this.$set(this,'userQueryParamsLeft',{
+          pageNum: 1,
+          pageSize: 20,
+          deptId:"",
+          searchValue:"",
+          filtType:1
+        });
         this.userHandleQueryLeft();
       },
       //查询接口
       userGetListLeft(){
-
+        let self = this;
+        let leftObj = JSON.parse(JSON.stringify(this.userQueryParamsLeft));
+        leftObj.selectedUserIds = [];
+        for(let i=0;i<self.dialogTableDataList.length;i++){
+          leftObj.selectedUserIds.push(self.dialogTableDataList[i].userId);
+        }
+        findUserList(leftObj).then(response => {
+          this.userTotalLeft = response.total;
+          this.userTableListLeft = response.rows;
+        });
       },
       //查询
       userHandleQueryRight(){
         this.$set(this.userQueryParamsRight,'pageNum',1);
+        this.$set(this,'userNumRight',0);
+        this.$set(this,'userIdsRight',[]);
+        this.$refs.rightUserTable.clearSelection();
         this.userGetListRight();
       },
       //重置
       userResetQueryRight(){
         this.$set(this,'userQueryParamsRight',{
-          pageNum:1,
-          pageSize:20,
-          classType:"",
-          classified:"",
+          pageNum: 1,
+          pageSize: 20,
           deptId:"",
           searchValue:"",
+          filtType:2
         });
         this.userHandleQueryRight();
       },
       //查询接口
       userGetListRight(){
-
+        let self = this;
+        let rightObj = JSON.parse(JSON.stringify(this.userQueryParamsRight));
+        rightObj.userIds = [];
+        for(let i=0;i<self.dialogTableDataList.length;i++){
+          rightObj.userIds.push(self.dialogTableDataList[i].userId);
+        }
+        findUserList(rightObj).then(response => {
+          this.userTotalRight = response.total;
+          this.userTableListRight = response.rows;
+        });
       },
+      //穿梭按钮
       userArrowButton(type){
+        let self = this;
         if(type == 1){
+          //右至左
           if(this.userIdsRight[0]){
-
+            let list = JSON.parse(JSON.stringify(this.dialogTableDataList));
+            for(let i=0;i<self.userIdsRight.length;i++){
+              for(let s=0;s<list.length;s++){
+                if(self.userIdsRight[i] == list[s].userId){
+                  list.splice(s,1);
+                  s--
+                }
+              }
+            }
+            this.$set(this,'dialogTableDataList',list);
+            this.$refs.rightUserTable.clearSelection();
+            this.userGetListLeft();
+            this.userGetListRight();
+          }else{
+            this.msgError('请先勾选右侧列表')
           }
         }else if(type == 2){
+          //左至右
           if(this.userIdsLeft[0]){
-
+            let list = JSON.parse(JSON.stringify(this.dialogTableDataList));
+            for(let i=0;i<self.userIdsLeft.length;i++){
+              for(let o=0;o<self.userTableListLeft.length;o++){
+                if(self.userIdsLeft[i] == self.userTableListLeft[o].userId){
+                  let obj = {
+                    userId:self.userTableListLeft[o].userId,
+                    name:self.userTableListLeft[o].nickName,
+                    jobNum:self.userTableListLeft[o].userName,
+                    deptName:self.userTableListLeft[o].deptName,
+                    deptId:self.userTableListLeft[o].deptId,
+                    userType:self.userTableListLeft[o].userType,
+                  }
+                  list.push(obj);
+                }
+              }
+            }
+            this.$set(this,'dialogTableDataList',list);
+            this.$refs.leftUserTable.clearSelection();
+            this.userGetListLeft();
+            this.userGetListRight();
+          }else{
+            this.msgError('请先勾选左侧列表')
           }
         }
       },
@@ -900,6 +1064,12 @@
       getRowKeys(row) {
         return row.userId
       },
+      getDeptRowKeys(row) {
+        return row.deptId
+      },
+      getSubRowKeys(row) {
+        return row.subId
+      },
       deptChange(selection){
         this.deptNumLeft = selection.length;
         this.deptIdsLeft = selection.map(item => item.userId);