dedsudiyu 8 月之前
父节点
当前提交
7f92a33143

+ 1 - 1
src/api/commonality/noPermission.js

@@ -188,7 +188,7 @@ export function laboratorySubRelInfoList(data) {
     data: data
   })
 }
-//根据学院id查询实验室下拉列表
+//根据学院id/实验室名称查询实验室下拉列表
 export function laboratorySubRelInfoGetRelList(data) {
   return request({
     url: '/laboratory/subRelInfo/getRelList',

+ 145 - 2
src/api/safetyCheck/indexDemoOne.js

@@ -1,10 +1,153 @@
 import request from '@/utils/request'
 
-//督导组列表
-export function securityCheckGroupList(query) {
+/**************************** 检查项相关 ****************************/
+//检查项目表-列表
+export function securityCheckOptionList(data) {
+  return request({
+    url: '/security/checkOption/list',
+    method: 'post',
+    data: data
+  })
+}
+//检查项目表-修改
+export function securityCheckOptionUpdate(data) {
+  return request({
+    url: '/security/checkOption/update',
+    method: 'post',
+    data: data
+  })
+}
+//检查项目表-新增
+export function securityCheckOptionAdd(data) {
+  return request({
+    url: '/security/checkOption/add',
+    method: 'post',
+    data: data
+  })
+}
+//检查项目表-删除
+export function securityCheckOptionDelete(data) {
+  return request({
+    url: '/security/checkOption/delete',
+    method: 'post',
+    data: data
+  })
+}
+//检查项目表-批量删除
+export function securityCheckOptionBatchDelete(data) {
+  return request({
+    url: '/security/checkOption/batchDelete',
+    method: 'post',
+    data: data
+  })
+}
+
+/**************************** 督导组相关 ****************************/
+
+/* 通用接口-人员查询(过滤已选/未选)
+   deptId:学院ID
+   searchValue:姓名/工号
+   filtType:1,//1.过滤 2.不过滤
+   selectedUserIds:[],//过滤用户IDS
+   userIds:[],//不过滤用户IDS
+   page:1,
+   pageSize:2,
+*/
+export function findUserList(data) {
+  return request({
+    url: '/system/user/findUserList',
+    method: 'post',
+    data: data
+  })
+}
+//督导组-列表
+export function securityCheckGroupList(data) {
   return request({
     url: '/security/checkGroup/list',
+    method: 'post',
+    data: data
+  })
+}
+//督导组-详情
+export function securityCheckGroupDetail(query) {
+  return request({
+    url: '/security/checkGroup/detail',
+    method: 'get',
+    params: query
+  })
+}
+//督导组-删除
+export function securityCheckGroupDelete(data) {
+  return request({
+    url: '/security/checkGroup/delete',
+    method: 'post',
+    data: data
+  })
+}
+//督导组-启用/停用
+export function securityCheckGroupEnable(data) {
+  return request({
+    url: '/security/checkGroup/enable',
+    method: 'post',
+    data: data
+  })
+}
+//督导组-人员-启用/停用
+export function securityCheckGroupUserEnable(data) {
+  return request({
+    url: '/security/checkGroup/userEnable',
+    method: 'post',
+    data: data
+  })
+}
+//督导组-新增
+export function securityCheckGroupAdd(data) {
+  return request({
+    url: '/security/checkGroup/add',
+    method: 'post',
+    data: data
+  })
+}
+//督导组-修改
+export function securityCheckGroupUpdate(data) {
+  return request({
+    url: '/security/checkGroup/update',
+    method: 'post',
+    data: data
+  })
+}
+
+/**************************** 随手拍 ****************************/
+
+//随手拍-列表
+export function securityCheckPhotoMyList(data) {
+  return request({
+    url: '/security/checkPhoto/myList',
+    method: 'post',
+    data: data
+  })
+}
+//随手拍-详情
+export function securityCheckPhotoDetail(query) {
+  return request({
+    url: '/security/checkPhoto/detail',
     method: 'get',
     params: query
   })
 }
+//随手拍-新增
+export function securityCheckPhotoMyAdd(data) {
+  return request({
+    url: '/security/checkPhoto/myAdd',
+    method: 'post',
+    data: data
+  })
+}
+//随手拍-删除
+export function securityCheckPhotoDelete(data) {
+  return request({
+    url: '/security/checkPhoto/delete',
+    method: 'post',
+    data: data
+  })
+}

+ 198 - 245
src/views/safetyCheck/components/snapshotInfo.vue

@@ -1,9 +1,9 @@
 <template>
   <div class="page-container snapshot-snapshotInfo">
     <div class="page-top-title-box">
-      <p class="page-top-title-name-p">{{addForm.id?'编辑':'新增'}}</p>
+      <p class="page-top-title-name-p">{{lookInfoType?'详情':(addForm.photoId?'编辑':'新增')}}</p>
       <p class="page-top-title-out-p" @click="backPage">返回</p>
-      <p class="page-top-title-add-p" @click="submitForm">提交</p>
+      <p class="page-top-title-add-p" v-if="!lookInfoType" @click="submitForm">提交</p>
     </div>
     <div class="content-box scrollbar-box">
       <el-form class="add-form-box" :model="addForm" ref="form" :rules="rules" label-width="104px">
@@ -13,11 +13,11 @@
         </p>
         <div v-if="itemShowType_1" class="show-box">
           <div class="content-flex-box">
-            <el-form-item label="实验室" prop="data1">
+            <el-form-item label="实验室" prop="subId">
               <el-select
                 :disabled="lookInfoType"
                 style="width:300px;"
-                v-model="addForm.data1"
+                v-model="addForm.subId"
                 filterable
                 remote
                 clearable
@@ -25,7 +25,7 @@
                 @change="selectChange"
                 @clear="selectClear"
                 placeholder="搜索选择实验室"
-                :remote-method="subjectList">
+                :remote-method="laboratorySubRelInfoGetRelList">
                 <el-option
                   v-for="item in subOptions"
                   :key="item.subId"
@@ -37,21 +37,27 @@
             <div class="right-text-box">
               <p class="right-text-name-p" style="width:138px;">分级分类</p>
               <div class="right-text-title-box">
-                <p>{{addForm.data2}}</p>
+                <p v-if="addForm.classLevelName||addForm.classTypeNames" style="color:#333;">
+                  {{addForm.classLevelName}}{{addForm.classLevelName&&addForm.classTypeNames?' | ':''}}{{addForm.classTypeNames}}
+                </p>
+                <p v-else="addForm.classLevelName||addForm.classTypeNames" style="color:#999;">搜索选择实验室</p>
               </div>
             </div>
             <div class="right-text-box">
               <p class="right-text-name-p" style="width:138px;">学院单位</p>
               <div class="right-text-title-box">
-                <p>{{addForm.data3}}</p>
+                <p :style="!addForm.deptName?'color:#999;':'color:#333;'">{{addForm.deptName?addForm.deptName:'搜索选择实验室'}}</p>
               </div>
             </div>
           </div>
           <div class="content-flex-box">
             <div class="right-text-box">
-              <p class="right-text-name-p">学院单位</p>
+              <p class="right-text-name-p">楼栋楼层</p>
               <div class="right-text-title-box">
-                <p>{{addForm.data4}}</p>
+                <p v-if="addForm.buildName||addForm.floorName" style="color:#333;">
+                  {{addForm.buildName}}{{addForm.buildName&&addForm.floorName?'-':''}}{{addForm.floorName}}
+                </p>
+                <p v-else="addForm.buildName||addForm.floorName" style="color:#999;">搜索选择实验室</p>
               </div>
             </div>
           </div>
@@ -61,23 +67,29 @@
           <span :class="itemShowType_2?'el-icon-arrow-down':'el-icon-arrow-up'" @click="itemShowButton(2)"></span>
         </p>
         <div v-if="itemShowType_2" class="show-box">
-          <el-form-item label="名称" prop="data3">
+          <el-form-item label="检查项目" prop="hazardCheckId">
             <el-cascader
+              :disabled="lookInfoType"
+              clearable
+              placeholder="请选择检查项目"
               style="width:704px;"
-              v-model="addForm.data3"
+              v-model="addForm.hazardCheckId"
               :options="options"
+              :props="{ value: 'id', label: 'labelName',emitPath:false }"
               @change="handleChange"></el-cascader>
           </el-form-item>
           <div class="right-text-box">
             <p class="right-text-name-p">检查要点</p>
             <div class="right-text-title-box" style="min-height: 80px;width:704px;">
-              <p>{{addForm.data4}}</p>
+              <p :style="!addForm.hazardCheckPoint?'color:#999;':'color:#333;'">{{addForm.hazardCheckPoint?addForm.hazardCheckPoint:'请选择检查项目'}}</p>
             </div>
           </div>
           <div class="right-text-box">
             <p class="right-text-name-p">隐患等级</p>
             <div class="right-text-title-box" style="width:301px;">
-              <p>{{addForm.data5}}</p>
+              <p :style="!addForm.hazardLevel?'color:#999;':'color:#333;'">
+                {{addForm.hazardLevel==1?'轻微隐患':(addForm.hazardLevel==2?'一般隐患':(addForm.hazardLevel==3?'重大隐患':'请选择检查项目'))}}
+              </p>
             </div>
           </div>
         </div>
@@ -86,17 +98,18 @@
           <span :class="itemShowType_3?'el-icon-arrow-down':'el-icon-arrow-up'" @click="itemShowButton(3)"></span>
         </p>
         <div v-if="itemShowType_3" class="show-box">
-          <el-form-item label="隐患描述" prop="formData5">
+          <el-form-item label="隐患描述" prop="hazardDescribe">
             <el-input placeholder="请输入隐患描述" maxLength='200' type="textarea" style="width:704px;"
-                      resize="none" v-model="addForm.formData5" show-word-limit :rows="3"></el-input>
+                      :disabled="lookInfoType"
+                      resize="none" v-model="addForm.hazardDescribe" show-word-limit :rows="3"></el-input>
           </el-form-item>
           <el-form-item label="现场照片" prop="imgDtoList">
             <div class="snapshotManagement-for-img-box" v-for="(img,imgIndex) in addForm.imgDtoList" :key="imgIndex">
               <img class="for-img" :src="img.fileUrl" @click="fullScreenViewClick(addForm.imgDtoList,imgIndex)">
-              <p class="for-del-button el-icon-circle-close" @click="delImg(imgIndex)"></p>
+              <p class="for-del-button el-icon-circle-close" v-if="!lookInfoType" @click="delImg(imgIndex)"></p>
             </div>
             <el-upload
-              v-if="addForm.imgDtoList.length<6"
+              v-if="addForm.imgDtoList.length<6&&!lookInfoType"
               style="display: inline-block;overflow: hidden"
               class="avatar-uploader"
               :action="uploadImgUrl"
@@ -106,12 +119,11 @@
               :before-upload="(res)=>beforeAvatarUpload(res)">
               <p class="el-icon-plus up-img-p" style="display: inline-block"></p>
             </el-upload>
-            <p class="up-img-text">支持jpg/png/bmp/gif格式,且不超过2M,最多上传6张</p>
+            <p class="up-img-text" v-if="!lookInfoType">支持jpg/png/bmp/gif格式,且不超过2M,最多上传6张</p>
           </el-form-item>
-        </div><!--历史记录-->
-        <history-records-component ref="historyRecordsComponent" :historyRecordsComponentPropsData="historyRecordsComponentPropsData"></history-records-component>
+        </div>
         <!--整改-->
-        <rectification-component ref="rectificationComponent" :recheckComponentPropsData="recheckComponentPropsData"></rectification-component>
+        <rectification-component v-if="infoType === 'rectify'" ref="rectificationComponent" :recheckComponentPropsData="recheckComponentPropsData"></rectification-component>
       </el-form>
     </div>
     <fullScreenView :fullScreenViewProps="fullScreenViewProps" ref="fullScreenView"></fullScreenView>
@@ -120,8 +132,15 @@
 
 <script>
   import { getToken } from "@/utils/auth";
+  import {
+    securityCheckPhotoDetail,
+    securityCheckOptionList,
+    securityCheckPhotoMyAdd,
+  } from '@/api/safetyCheck/indexDemoOne'
+  import {
+    laboratorySubRelInfoGetRelList,
+  } from '@/api/commonality/noPermission'
   import fullScreenView from "@/components/fullScreenView/fullScreenView.vue";
-  import historyRecordsComponent from "./initiateInspect/historyRecordsComponent.vue";
   import rectificationComponent from "./initiateInspect/rectificationComponent.vue";
   //import { getDicts } from "@/api/commonality/noPermission";
   //import { systemUserSelect } from "@/api/commonality/permission";
@@ -130,7 +149,6 @@
     name: 'snapshotInfo',
     components: {
       fullScreenView,
-      historyRecordsComponent,
       rectificationComponent,
     },
     props:{
@@ -147,6 +165,8 @@
         fullScreenViewProps:[],
         //详情模式
         lookInfoType:false,
+        //页面状态 add.新增
+        infoType:'',
         //实验室列表
         subOptions:[],
         //学院列表
@@ -159,22 +179,40 @@
         levelOptions: [],
         //提交表单
         addForm:{
-          data1Id:'',
-          data1Name:'',
+          deptId:'',
+          deptName:'',
+          subId:'',
+          subName:'',
+          subRoom:'',
+          buildId:'',
+          buildName:'',
+          floorId:'',
+          floorName:'',
+          typeId:'',
+          classTypeNames:'',
+          levelId:'',
+          classLevelName:'',
+          hazardCheckId1:'',
+          hazardCheckName1:'',
+          hazardCheckCode1:'',
+          hazardCheckId2:'',
+          hazardCheckName2:'',
+          hazardCheckCode2:'',
+          hazardCheckId:'',
+          hazardCheckName:'',
+          hazardCheckCode:'',
+          hazardCheckPoint:'',
+          hazardLevel:'',
+          hazardDescribe:'',
           imgDtoList:[],
         },
         rules:{
-          formData1: [
-            { required: true, message: "请选择检查项目", trigger: "blur" },
-            { required: true, message: "请选择检查项目", validator: this.spaceJudgment, trigger: "blur" }
-          ],
-          formData4: [
-            { required: true, message: "请选择检查结果", trigger: "blur" },
-            { required: true, message: "请选择检查结果", validator: this.spaceJudgment, trigger: "blur" }
+          subId: [
+            { required: true, message: "搜索选择实验室", trigger: "blur" },
           ],
-          formData5: [
+          hazardDescribe: [
             { required: true, message: "请输入隐患描述", trigger: "blur" },
-            { required: true, message: "请输入隐患描述", validator: this.spaceJudgment, trigger: "blur" }
+            { required: true, message: '请输入隐患描述', validator: this.spaceJudgment, trigger: "blur" }
           ],
           imgDtoList: [
             { required: true, message: "请上传现场照片", trigger: "blur" },
@@ -184,230 +222,123 @@
         itemShowType_1:true,
         itemShowType_2:true,
         itemShowType_3:true,
-        options:[
-          {
-            value: 'zhinan',
-            label: '指南',
-            children: [{
-              value: 'shejiyuanze',
-              label: '设计原则',
-              children: [{
-                value: 'yizhi',
-                label: '一致'
-              }, {
-                value: 'fankui',
-                label: '反馈'
-              }, {
-                value: 'xiaolv',
-                label: '效率'
-              }, {
-                value: 'kekong',
-                label: '可控'
-              }]
-            }, {
-              value: 'daohang',
-              label: '导航',
-              children: [{
-                value: 'cexiangdaohang',
-                label: '侧向导航'
-              }, {
-                value: 'dingbudaohang',
-                label: '顶部导航'
-              }]
-            }]
-          }, {
-            value: 'zujian',
-            label: '组件',
-            children: [{
-              value: 'basic',
-              label: 'Basic',
-              children: [{
-                value: 'layout',
-                label: 'Layout 布局'
-              }, {
-                value: 'color',
-                label: 'Color 色彩'
-              }, {
-                value: 'typography',
-                label: 'Typography 字体'
-              }, {
-                value: 'icon',
-                label: 'Icon 图标'
-              }, {
-                value: 'button',
-                label: 'Button 按钮'
-              }]
-            }, {
-              value: 'form',
-              label: 'Form',
-              children: [{
-                value: 'radio',
-                label: 'Radio 单选框'
-              }, {
-                value: 'checkbox',
-                label: 'Checkbox 多选框'
-              }, {
-                value: 'input',
-                label: 'Input 输入框'
-              }, {
-                value: 'input-number',
-                label: 'InputNumber 计数器'
-              }, {
-                value: 'select',
-                label: 'Select 选择器'
-              }, {
-                value: 'cascader',
-                label: 'Cascader 级联选择器'
-              }, {
-                value: 'switch',
-                label: 'Switch 开关'
-              }, {
-                value: 'slider',
-                label: 'Slider 滑块'
-              }, {
-                value: 'time-picker',
-                label: 'TimePicker 时间选择器'
-              }, {
-                value: 'date-picker',
-                label: 'DatePicker 日期选择器'
-              }, {
-                value: 'datetime-picker',
-                label: 'DateTimePicker 日期时间选择器'
-              }, {
-                value: 'upload',
-                label: 'Upload 上传'
-              }, {
-                value: 'rate',
-                label: 'Rate 评分'
-              }, {
-                value: 'form',
-                label: 'Form 表单'
-              }]
-            }, {
-              value: 'data',
-              label: 'Data',
-              children: [{
-                value: 'table',
-                label: 'Table 表格'
-              }, {
-                value: 'tag',
-                label: 'Tag 标签'
-              }, {
-                value: 'progress',
-                label: 'Progress 进度条'
-              }, {
-                value: 'tree',
-                label: 'Tree 树形控件'
-              }, {
-                value: 'pagination',
-                label: 'Pagination 分页'
-              }, {
-                value: 'badge',
-                label: 'Badge 标记'
-              }]
-            }, {
-              value: 'notice',
-              label: 'Notice',
-              children: [{
-                value: 'alert',
-                label: 'Alert 警告'
-              }, {
-                value: 'loading',
-                label: 'Loading 加载'
-              }, {
-                value: 'message',
-                label: 'Message 消息提示'
-              }, {
-                value: 'message-box',
-                label: 'MessageBox 弹框'
-              }, {
-                value: 'notification',
-                label: 'Notification 通知'
-              }]
-            }, {
-              value: 'navigation',
-              label: 'Navigation',
-              children: [{
-                value: 'menu',
-                label: 'NavMenu 导航菜单'
-              }, {
-                value: 'tabs',
-                label: 'Tabs 标签页'
-              }, {
-                value: 'breadcrumb',
-                label: 'Breadcrumb 面包屑'
-              }, {
-                value: 'dropdown',
-                label: 'Dropdown 下拉菜单'
-              }, {
-                value: 'steps',
-                label: 'Steps 步骤条'
-              }]
-            }, {
-              value: 'others',
-              label: 'Others',
-              children: [{
-                value: 'dialog',
-                label: 'Dialog 对话框'
-              }, {
-                value: 'tooltip',
-                label: 'Tooltip 文字提示'
-              }, {
-                value: 'popover',
-                label: 'Popover 弹出框'
-              }, {
-                value: 'card',
-                label: 'Card 卡片'
-              }, {
-                value: 'carousel',
-                label: 'Carousel 走马灯'
-              }, {
-                value: 'collapse',
-                label: 'Collapse 折叠面板'
-              }]
-            }]
-          }, {
-            value: 'ziyuan',
-            label: '资源',
-            children: [{
-              value: 'axure',
-              label: 'Axure Components'
-            }, {
-              value: 'sketch',
-              label: 'Sketch Templates'
-            }, {
-              value: 'jiaohu',
-              label: '组件交互文档'
-            }]
-          }
-        ],
+        options:[],
         //历史记录组件数据
         historyRecordsComponentPropsData:{},
-        rectificationComponentPropsData:{},
-
+        recheckComponentPropsData:{},
       }
     },
     created(){
-      // this.initialize();
+      this.securityCheckOptionList();
+      this.initialize();
     },
     mounted(){
 
     },
     methods:{
+      //初始化
+      initialize(){
+        if(this.propsData.showType){
+          this.$set(this,'lookInfoType',true);
+          this.securityCheckPhotoDetail();
+        }else{
+          this.$set(this,'lookInfoType',false);
+          if(this.propsData.photoId){
+            this.securityCheckPhotoDetail();
+            this.$set(this,'infoType','rectify');
+          }else{
+            this.$set(this,'infoType','add');
+          }
+        }
+      },
+      //上报详情接口
+      securityCheckPhotoDetail(){
+        securityCheckPhotoDetail({photoId:this.propsData.photoId}).then(response => {
+          response.data.imgDtoList = response.data.yhDtoList;
+          this.$set(this,'addForm',response.data);
+        });
+      },
+      //查询检查项列表
+      securityCheckOptionList(){
+        securityCheckOptionList({}).then( response => {
+          this.$set(this,'options',response.data);
+          this.getCascaderData(this.options)
+        });
+      },
+      //联级选择器数据处理
+      getCascaderData(list){
+        let self = this;
+        for(let i=0;i<list.length;i++){
+          list[i].labelName = list[i].code? list[i].code +' '+ list[i].name:list[i].name
+          if(list[i].level == 1 || list[i].level == 2){
+            self.getCascaderData(list[i].children)
+          }else{
+            delete list[i].children
+          }
+        }
+      },
       // 返回按钮
       backPage(){
         this.$parent.tableButton(6);
       },
       /** 提交按钮 */
       submitForm() {
+        let self = this;
         this.$refs["form"].validate(valid => {
           if (valid) {
-
+            this.$confirm('是否确认提交?', "警告", {
+              confirmButtonText: "确定",
+              cancelButtonText: "取消",
+              type: "warning"
+            }).then(function() {
+            }).then(() => {
+              securityCheckPhotoMyAdd(self.addForm).then(response => {
+                self.msgSuccess(response.message)
+                self.$parent.tableButton(6);
+              });
+            }).catch(() => {});
           }
         })
       },
       handleChange(value) {
-        console.log(value);
+        let self = this;
+        if(value){
+          for(let i=0;i<self.options.length;i++){
+            if(self.options[i].children){
+              for(let o=0;o<self.options[i].children.length;o++){
+                if(self.options[i].children[o].children){
+                  for(let x=0;x<self.options[i].children[o].children.length;x++){
+                    if (value == self.options[i].children[o].children[x].id){
+                      self.$set(self.addForm,'hazardCheckId1',self.options[i].id);
+                      self.$set(self.addForm,'hazardCheckName1',self.options[i].name);
+                      self.$set(self.addForm,'hazardCheckCode1',self.options[i].code);
+                      self.$set(self.addForm,'hazardCheckId2',self.options[i].children[o].id);
+                      self.$set(self.addForm,'hazardCheckName2',self.options[i].children[o].name);
+                      self.$set(self.addForm,'hazardCheckCode2',self.options[i].children[o].code);
+                      self.$set(self.addForm,'hazardCheckId',self.options[i].children[o].children[x].id);
+                      self.$set(self.addForm,'hazardCheckName',self.options[i].children[o].children[x].name);
+                      self.$set(self.addForm,'hazardCheckCode',self.options[i].children[o].children[x].code);
+                      self.$set(self.addForm,'hazardCheckPoint',self.options[i].children[o].children[x].mainPoint);
+                      self.$set(self.addForm,'hazardLevel',self.options[i].children[o].children[x].level);
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }else{
+          self.$set(self.addForm,'hazardCheckId1','');
+          self.$set(self.addForm,'hazardCheckName1','');
+          self.$set(self.addForm,'hazardCheckCode1','');
+          self.$set(self.addForm,'hazardCheckId2','');
+          self.$set(self.addForm,'hazardCheckName2','');
+          self.$set(self.addForm,'hazardCheckCode2','');
+          self.$set(self.addForm,'hazardCheckId','');
+          self.$set(self.addForm,'hazardCheckName','');
+          self.$set(self.addForm,'hazardCheckCode','');
+          self.$set(self.addForm,'hazardCheckPoint','');
+          self.$set(self.addForm,'hazardLevel','');
+        }
       },
       //子项展开隐藏按钮
       itemShowButton(type){
@@ -420,8 +351,8 @@
         }
       },
       //懒加载实验室
-      subjectList(e){
-        subjectList({subName:e}).then(response => {
+      laboratorySubRelInfoGetRelList(e){
+        laboratorySubRelInfoGetRelList({searchValue:e}).then(response => {
           this.subOptions = response.data;
         });
       },
@@ -430,15 +361,38 @@
         let self = this;
         for(let i=0;i<self.subOptions.length;i++){
           if(self.subOptions[i].subId == e){
-            self.$set(self.addForm,"data1Id",self.subOptions[i].subId);
-            self.$set(self.addForm,"data1Name",self.subOptions[i].subName);
+            self.$set(self.addForm,"deptId",self.subOptions[i].deptId);
+            self.$set(self.addForm,"deptName",self.subOptions[i].deptName);
+            self.$set(self.addForm,"subId",self.subOptions[i].subId);
+            self.$set(self.addForm,"subName",self.subOptions[i].subName);
+            self.$set(self.addForm,"subRoom",self.subOptions[i].subRoom);
+            self.$set(self.addForm,"buildId",self.subOptions[i].buildId);
+            self.$set(self.addForm,"buildName",self.subOptions[i].buildName);
+            self.$set(self.addForm,"floorId",self.subOptions[i].floorId);
+            self.$set(self.addForm,"floorName",self.subOptions[i].floorName);
+            self.$set(self.addForm,"typeId",self.subOptions[i].typeId);
+            self.$set(self.addForm,"classTypeNames",self.subOptions[i].classTypeNames);
+            self.$set(self.addForm,"levelId",self.subOptions[i].levelId);
+            self.$set(self.addForm,"classLevelName",self.subOptions[i].classLevelName);
           }
         }
       },
       //实验室清除
       selectClear(){
-        this.$set(this.addForm,"data1Id",'');
-        this.$set(this.addForm,"data1Name",'');
+        let self = this;
+        self.$set(self.addForm,"deptId",'');
+        self.$set(self.addForm,"deptName",'');
+        self.$set(self.addForm,"subId",'');
+        self.$set(self.addForm,"subName",'');
+        self.$set(self.addForm,"subRoom",'');
+        self.$set(self.addForm,"buildId",'');
+        self.$set(self.addForm,"buildName",'');
+        self.$set(self.addForm,"floorId",'');
+        self.$set(self.addForm,"floorName",'');
+        self.$set(self.addForm,"typeId",'');
+        self.$set(self.addForm,"classTypeNames",'');
+        self.$set(self.addForm,"levelId",'');
+        self.$set(self.addForm,"classLevelName",'');
       },
       /*==========上传相关==========*/
       handleAvatarSuccess(res) {
@@ -548,7 +502,7 @@
         .right-text-title-box{
           font-size:14px;
           width:300px;
-          padding:10px 20px;
+          padding:10px 14px;
           background-color: #f5f5f5;
           border: 1px solid #E0E0E0;
           border-radius: 4px 4px 4px 4px;
@@ -706,8 +660,7 @@
         border:1px dashed #E0E0E0;
       }
       .up-img-text{
-        line-height:40px;
-        margin-bottom:20px;
+        line-height:20px;
         font-size:14px;
         color:#999;
       }

+ 31 - 26
src/views/safetyCheck/inspectProject/inspectProjectTable/index.vue

@@ -48,8 +48,8 @@
           <template slot-scope="scope">
             <div class="table-button-box">
               <p class="table-button-null"></p>
-<!--              <p class="table-button-p" v-if="scope.row.level != 4" v-hasPermiRouter="['check:option:add']"
-                 @click="addDialogOpen(2,scope.row)">新增</p>-->
+              <!--<p class="table-button-p" v-if="scope.row.level != 4" v-hasPermiRouter="['check:option:add']"-->
+                 <!--@click="addDialogOpen(2,scope.row)">新增</p>-->
               <p class="table-button-p" @click="addDialogOpen(3,scope.row)" v-hasPermiRouter="['check:option:edit']">编辑</p>
               <p class="table-button-p" @click="delItem(scope.row)" v-hasPermiRouter="['check:option:del']">删除</p>
               <p class="table-button-null"></p>
@@ -82,14 +82,10 @@
             <div class="code-max-box">
               <el-input v-model="addDialogForm.code" placeholder="未选择指标"
                         maxLength="6" disabled style="width:210px;"/>
-<!--              <div class="code-button-box">
-                <p class="el-icon-arrow-up" @click="codeButton(1)"></p>
-                <p class="el-icon-arrow-down" @click="codeButton(2)"></p>
-              </div>-->
             </div>
           </el-form-item>
-          <el-form-item label="隐患等级" prop="hazardLevel">
-            <el-select v-model="addDialogForm.hazardLevel" placeholder="隐患等级" style="width: 220px">
+          <el-form-item label="隐患等级" prop="level" v-if="addDialogLevel == 2">
+            <el-select v-model="addDialogForm.level" placeholder="隐患等级" style="width: 220px">
               <el-option
                 v-for="dict in hazardLevelList"
                 :key="dict.value"
@@ -111,12 +107,12 @@
             style="width:548px;">
           </el-input>
         </el-form-item>
-        <el-form-item label="检查要点" prop="name">
+        <el-form-item label="检查要点" prop="mainPoint" v-if="addDialogLevel == 2">
           <el-input
             type="textarea"
             :autosize="{ minRows: 5, maxRows: 5}"
             placeholder="请输入检查要点内容"
-            v-model="addDialogForm.name"
+            v-model="addDialogForm.mainPoint"
             maxlength="500"
             resize="none"
             show-word-limit
@@ -135,7 +131,13 @@
 </template>
 
 <script>
-  import { checkOptionList,checkOptionAdd,checkOptionUpdate,checkOptionDelete,checkOptionBatchDelete } from '@/api/safetyCheck/index'
+  import {
+    securityCheckOptionList,
+    securityCheckOptionAdd,
+    securityCheckOptionUpdate,
+    securityCheckOptionDelete,
+    securityCheckOptionBatchDelete,
+  } from '@/api/safetyCheck/indexDemoOne'
   import { getToken } from "@/utils/auth";
   //            V3
   import exportComponent from "@/components/exportComponent/exportComponent.vue";
@@ -150,15 +152,15 @@
       return{
         //导出
         exportConfig:{
-          api:'/zd-security/checkOption/export/',             //导出接口地址
+          api:'/security/checkOption/export/',             //导出接口地址
           ids:'',                                       //勾选导出,勾选的IDS
           fileName:'项目检查库',                         //导出文件的命名
         },
         //导入
         importConfig:{
-          upLoadApi:'/zd-security/checkOption/importData',                //上传接口地址
-          downloadApi:'/zd-security/checkOption/importTemplate',          //下载模板接口地址
-          loseApi:'/zd-security/checkOption/importErrorData',             //失败报表接口地址
+          upLoadApi:'/security/checkOption/importData',                //上传接口地址
+          downloadApi:'/security/checkOption/importTemplate',          //下载模板接口地址
+          loseApi:'/security/checkOption/importErrorData',             //失败报表接口地址
           fileName:'导入模板-',                                   //下载模板命名
         },
         uploadImgUrl: window.location.href.split('://')[0]+'://' + this.judgmentNetworkReturnAddress() + "/zd-security/checkOption/importData", // 上传地址
@@ -196,9 +198,9 @@
           code:"",
           name:"",
           mainPoint:"",
-          hazardLevel:"",
+          level:"",
         },
-        hazardLevelList:[{label:'轻微隐患',value:'1'},{label:'一般隐患',value:'2'},{label:'重大隐患',value:'3'},],
+        hazardLevelList:[{label:'轻微隐患',value:1},{label:'一般隐患',value:2},{label:'重大隐患',value:3},],
         // 表单校验
         rules: {
           parentId: [
@@ -209,7 +211,7 @@
             { required: true, message: "请输入检查项目内容", trigger: "change" },
             { required: true, message: "请输入检查项目内容", validator: this.spaceJudgment, trigger: "change" },
           ],
-          hazardLevel: [
+          level: [
             { required: true, message: "请选择隐患等级", trigger: "change" },
             { required: true, message: "请选择隐患等级", validator: this.spaceJudgment, trigger: "change" },
           ],
@@ -222,7 +224,7 @@
 
     },
     mounted(){
-      //this.getList();
+      this.getList();
     },
     methods:{
       //确定按钮
@@ -234,7 +236,7 @@
               let obj = JSON.parse(JSON.stringify(this.addDialogForm))
               obj.level = this.addDialogLevel+1;
               obj.mainPoint = this.addDialogLevel>1?obj.mainPoint:'';
-              checkOptionUpdate(obj).then( response => {
+              securityCheckOptionUpdate(obj).then( response => {
                 this.msgSuccess(response.message)
                 this.addDialogOff();
                 this.getList();
@@ -243,7 +245,7 @@
               //新增
               let obj = JSON.parse(JSON.stringify(this.addDialogForm))
               obj.level = this.addDialogLevel+1;
-              checkOptionAdd(obj).then( response => {
+              securityCheckOptionAdd(obj).then( response => {
                 this.msgSuccess(response.message)
                 this.addDialogOff();
                 this.getList();
@@ -254,7 +256,6 @@
       },
       //添加页面开启
       addDialogOpen(type,row){
-        console.log('row',row)
         if(type == 1){
           //新增
           this.$set(this,'addDialogTitle','添加检查项目');
@@ -264,6 +265,7 @@
             code:"",
             name:"",
             mainPoint:"",
+            level:"",
           });
           this.$set(this,'addDialogType',true);
         }else if(type == 2){
@@ -277,6 +279,7 @@
             code:obj.key,
             name:"",
             mainPoint:"",
+            level:"",
           });
           this.$set(this,'addDialogType',true);
         }else if(type == 3){
@@ -289,6 +292,7 @@
             code:row.code,
             name:row.name,
             mainPoint:row.mainPoint,
+            level:row.level,
           });
           this.getCodeButton(this.cascaderDataPrimitive,row.parentId,row.id);
           this.$set(this,'addDialogType',true);
@@ -310,6 +314,7 @@
         let self = this;
         for(let i=0;i<list.length;i++){
           if(list[i].id == val){
+            console.log('list[i]',list[i])
             let obj = {
               parentId:list[i].id,
               parentKey:list[i].code,
@@ -465,7 +470,7 @@
           cancelButtonText: "取消",
           type: "warning"
         }).then(function() {
-          checkOptionDelete(row.id).then( response => {
+          securityCheckOptionDelete({id:row.id}).then( response => {
             self.msgSuccess(response.message)
             self.getList();
           })
@@ -489,7 +494,7 @@
           for(let i=0;i<list.length;i++){
             ids.push(list[i].id)
           }
-          checkOptionBatchDelete(ids+'').then( response => {
+          securityCheckOptionBatchDelete({ids:ids}).then( response => {
             self.msgSuccess(response.message);
             self.getList();
           })
@@ -499,7 +504,7 @@
       /** 查询检查项选项列表 */
       getList() {
         this.loading = true;
-        checkOptionList(this.queryParams).then( response => {
+        securityCheckOptionList(this.queryParams).then( response => {
           this.$set(this,'tableData',JSON.parse(JSON.stringify(response.data)));
           let list = [{
             id:'0',
@@ -520,7 +525,7 @@
         let self = this;
         for(let i=0;i<list.length;i++){
           list[i].labelName = list[i].code? list[i].code +' '+ list[i].name:list[i].name
-          if(list[i].level == 0 || list[i].level == 1 || list[i].level == 2){
+          if(list[i].level == 0 || list[i].level == 1){
             self.getCascaderData(list[i].children)
           }else{
             delete list[i].children

+ 109 - 36
src/views/safetyCheck/inspectSupervisorGroup/addPage.vue

@@ -7,7 +7,7 @@
     </div>
     <div class="content-box scrollbar-box">
       <el-form class="add-form-box" :model="newData" ref="form" :rules="rules" label-width="120px">
-        <el-form-item label="是否启用" prop="data1" class="page-switch">
+        <el-form-item label="是否启用" prop="enable" class="page-switch">
           <el-switch
             :disabled="propsData.showType"
             class="switch captcha-img"
@@ -15,52 +15,53 @@
             :inactive-value="false"
             active-color="#0183FA"
             inactive-color="#999"
-            v-model="newData.data1"
+            v-model="newData.enable"
             active-text="启用"
             inactive-text="停用"
           ></el-switch>
         </el-form-item>
-        <el-form-item label="督导组名称" prop="data2">
-          <el-input :disabled="propsData.showType" v-model="newData.data2" placeholder="请输入督导组名称" maxLength="20" style="width:693px;"></el-input>
+        <el-form-item label="督导组名称" prop="groupName">
+          <el-input :disabled="propsData.showType" v-model="newData.groupName" placeholder="请输入督导组名称" maxLength="20" style="width:693px;"></el-input>
         </el-form-item>
-        <el-form-item label="上级部门" prop="data3">
-          <el-select :disabled="propsData.showType" v-model="newData.data3" placeholder="请选择上级部门" style="width: 300px">
+        <el-form-item label="上级部门" prop="deptId">
+          <el-select :disabled="propsData.showType" v-model="newData.deptId"
+                     @change="deptChange" placeholder="请选择上级部门" style="width: 300px">
             <el-option
-              v-for="dict in optionDept"
-              :key="dict.value"
-              :label="dict.label"
-              :value="dict.value"
+              v-for="dict in deptOptions"
+              :key="dict.deptId"
+              :label="dict.deptName"
+              :value="dict.deptId"
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="督导组成员" prop="data4">
+        <el-form-item label="督导组成员" prop="checkGroupMemberList">
           <div class="user-list-max-box">
             <div class="user-list-top-button-box">
               <img src="@/assets/ZDimages/safetyCheck/icon_xyxc_cy.png">
               <p>成员列表</p>
               <p @click="tableButton(1)" v-if="!propsData.showType">+ 添加</p>
             </div>
-            <el-table class="table-box table-null-img-20" border :data="newData.data4">
+            <el-table class="table-box table-null-img-20" border :data="newData.checkGroupMemberList">
               <el-table-column label="序号" type="index" width="60"/>
-              <el-table-column label="姓名" prop="name" show-overflow-tooltip/>
-              <el-table-column label="工号" prop="name" width="130" show-overflow-tooltip/>
-              <el-table-column label="所在部门" prop="content" width="188" show-overflow-tooltip/>
+              <el-table-column label="姓名" prop="userName" show-overflow-tooltip/>
+              <el-table-column label="工号" prop="account" width="130" show-overflow-tooltip/>
+              <el-table-column label="所在部门" prop="deptName" width="188" show-overflow-tooltip/>
               <el-table-column :label="propsData.showType?'状态':'操作'" width="228" show-overflow-tooltip>
                 <template slot-scope="scope">
                   <div class="table-button-box" v-if="!propsData.showType">
                     <p class="table-button-null"></p>
                     <p class="table-button-p"
                        @click="tableButton(2,scope.row)"
-                    >{{scope.row.type1?'启用':'停用'}}</p>
+                    >{{scope.row.enable?'启用':'停用'}}</p>
                     <p class="table-button-p"
-                       @click="tableButton(3,scope.row)"
+                       @click="tableButton(3,scope.$index)"
                     >删除</p>
                     <p class="table-button-null"></p>
                   </div>
                   <div class="table-button-box" v-if="propsData.showType">
                     <p class="table-button-null"></p>
                     <p class="table-button-p"
-                    >{{scope.row.type1?'启用':'停用'}}</p>
+                    >{{scope.row.enable?'启用':'停用'}}</p>
                     <p class="table-button-null"></p>
                   </div>
                 </template>
@@ -79,6 +80,14 @@
   //import { getDicts } from "@/api/commonality/noPermission";
   //import { systemUserSelect } from "@/api/commonality/permission";
   //import { getInfo } from "@/api/basicsModules/index";
+  import {
+    securityCheckGroupDetail,
+    securityCheckGroupUpdate,
+    securityCheckGroupAdd,
+  } from "@/api/safetyCheck/indexDemoOne";
+  import {
+    getDeptDropList,
+  } from '@/api/commonality/permission'
   import userCheckComponent from "./userCheckComponent.vue";
   export default {
     name: 'addPage',
@@ -90,60 +99,92 @@
     },
     data(){
       return{
-        optionDept:[],
+        //详情模式
+        lookInfoType:false,
+        deptOptions:[],
         newData:{
-          data1:true,
-          data2:'',
-          data3:null,
-          data4:[],
+          enable:true,
+          groupName:'',
+          deptId:null,
+          deptName:"",
+          checkGroupMemberList:[],
         },
         rules:{
-          data1:[
+          enable:[
             {required: true, message: '请选择是否启用', trigger: 'blur'},
           ],
-          data2:[
+          groupName:[
             {required: true, message: '请输入督导组名称', trigger: 'blur'},
             { required: true, message: '请输入督导组名称', validator: this.spaceJudgment, trigger: "blur" }
           ],
-          data3:[
+          deptId:[
             {required: true, message: '请选择上级部门', trigger: 'blur'},
           ],
-          data4:[
+          checkGroupMemberList:[
             {required: true, message: '请选择督导组成员', trigger: 'blur'},
           ],
         },
+        //人员列表选择
         userCheckComponentType:false,
         userCheckComponentData:{},
       }
     },
     created(){
       this.initialize();
+      this.getDeptDropList()
     },
     mounted(){
 
     },
     methods:{
       initialize(){
-        this.$set(this,'newData',{
-          data1:true,
-          data2:'',
-          data3:null,
-          data4:[],
-        });
+        if(this.propsData.showType){
+          this.$set(this,'lookInfoType',true);
+          this.securityCheckGroupDetail();
+        }else{
+          this.$set(this,'lookInfoType',false);
+          if(this.propsData.groupId){
+            //编辑
+            this.securityCheckGroupDetail();
+          }
+        }
       },
-      tableButton(type,row){
+      tableButton(type,data,index){
+        let self = this;
         if(type == 1){
           //编辑
+          this.$set(this,'userCheckComponentData',JSON.parse(JSON.stringify(self.newData.checkGroupMemberList)));
           this.$set(this,'userCheckComponentType',true);
         }else if(type == 2){
           //启用停用
+          let text = data.enable?'停用':'启用'
+          this.$confirm('是否确认'+text+'?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+          }).then(() => {
+            data.enable = !data.enable;
+          }).catch(() => {});
         }else if(type == 3){
           //删除
+          this.$confirm('是否确认删除?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+          }).then(() => {
+            self.newData.checkGroupMemberList.splice(index,1)
+          }).catch(() => {});
         }else if(type == 4){
           //人员选择关闭
           this.$set(this,'userCheckComponentType',false);
         }else if(type == 5){
           //人员选择确定
+          data.forEach((item)=>{
+            item.enable = true;
+          })
+          this.$set(this.newData,'checkGroupMemberList',JSON.parse(JSON.stringify(data)));
           this.$set(this,'userCheckComponentType',false);
         }
       },
@@ -155,10 +196,42 @@
       submitForm() {
         this.$refs["form"].validate(valid => {
           if (valid) {
-
+            if(this.newData.groupId){
+              securityCheckGroupUpdate(this.newData).then(response => {
+                this.msgSuccess(response.message)
+                this.$parent.tableButton(6);
+              });
+            }else{
+              securityCheckGroupAdd(this.newData).then(response => {
+                this.msgSuccess(response.message)
+                this.$parent.tableButton(6);
+              });
+            }
           }
         })
-      }
+      },
+      //督导组详情
+      securityCheckGroupDetail(){
+        securityCheckGroupDetail({groupId:this.propsData.groupId,userEnable:0}).then(response => {
+          this.$set(this,'newData',response.data);
+        });
+      },
+      /** 查询二级单位列表 */
+      getDeptDropList() {
+        getDeptDropList({ deptName: '', level: 2, deptType: 1 }).then(response => {
+          this.$set(this, 'deptOptions', response.data)
+        })
+      },
+      //学院选中
+      deptChange(type){
+        let self = this;
+        for(let i=0;i<self.deptOptions.length;i++){
+          if(self.deptOptions[i].deptId == type){
+            self.$set(self.newData,'deptName',self.deptOptions[i].deptName);
+          }
+        }
+        console.log('type',type)
+      },
     },
   }
 </script>

+ 53 - 51
src/views/safetyCheck/inspectSupervisorGroup/index.vue

@@ -5,8 +5,8 @@
       <div class="page-form-title-box">
         <el-form :model="queryParams" class="form-box" ref="queryForm"
                  :inline="true" style="width:100%;">
-          <el-form-item label="" prop="queryParamsData1">
-            <el-select v-model="queryParams.queryParamsData1" placeholder="状态" style="width: 200px">
+          <el-form-item label="" prop="enable">
+            <el-select v-model="queryParams.enable" placeholder="状态" style="width: 200px">
               <el-option
                 v-for="dict in optionList"
                 :key="dict.value"
@@ -15,28 +15,28 @@
               />
             </el-select>
           </el-form-item>
-          <el-form-item label="" prop="queryParamsData2">
-            <el-select v-model="queryParams.queryParamsData2" placeholder="上级部门" style="width: 200px">
+          <el-form-item label="" prop="deptId">
+            <el-select v-model="queryParams.deptId" placeholder="上级部门" style="width: 200px">
               <el-option
-                v-for="dict in optionListOne"
-                :key="dict.value"
-                :label="dict.label"
-                :value="dict.value"
+                v-for="dict in deptOptions"
+                :key="dict.deptId"
+                :label="dict.deptName"
+                :value="dict.deptId"
               />
             </el-select>
           </el-form-item>
-          <el-form-item label="" prop="queryParamsData3">
+          <el-form-item label="" prop="groupName">
             <el-input
               maxLength="30"
-              v-model="queryParams.queryParamsData3"
+              v-model="queryParams.groupName"
               placeholder="督导组名称"
               style="width: 200px"
             />
           </el-form-item>
-          <el-form-item label="" prop="queryParamsData4">
+          <el-form-item label="" prop="userName">
             <el-input
               maxLength="30"
-              v-model="queryParams.queryParamsData4"
+              v-model="queryParams.userName"
               placeholder="成员"
               style="width: 200px"
             />
@@ -53,10 +53,10 @@
       <div class="page-content-box">
         <el-table class="table-box" v-loading="loading" border :data="dataList">
           <el-table-column label="序号" type="index" width="60"/>
-          <el-table-column label="督导组名称" prop="name"  show-overflow-tooltip/>
-          <el-table-column label="上级部门" prop="name" width="150" show-overflow-tooltip/>
-          <el-table-column label="成员人数" prop="content" width="150" show-overflow-tooltip/>
-          <el-table-column label="是否启用" prop="state" width="185" show-overflow-tooltip>
+          <el-table-column label="督导组名称" prop="groupName"  show-overflow-tooltip/>
+          <el-table-column label="上级部门" prop="deptName" width="150" show-overflow-tooltip/>
+          <el-table-column label="成员人数" prop="peopleNum" width="150" show-overflow-tooltip/>
+          <el-table-column label="是否启用" prop="enable" width="185" show-overflow-tooltip>
             <template slot-scope="scope">
               <el-switch
                 @click.native="tableButton(5,scope.row)"
@@ -65,14 +65,14 @@
                 :inactive-value="false"
                 active-color="#0183FA"
                 inactive-color="#999"
-                v-model="scope.row.state"
+                v-model="scope.row.enable"
                 active-text="启用"
                 inactive-text="停用"
                 disabled
               ></el-switch>
             </template>
           </el-table-column>
-          <el-table-column label="操作人" prop="content" width="150" show-overflow-tooltip/>
+          <el-table-column label="操作人" prop="updateName" width="150" show-overflow-tooltip/>
           <el-table-column label="创建时间" prop="createTime" width="245" show-overflow-tooltip>
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
@@ -112,9 +112,14 @@
   </div>
 </template>
 <script>
-  import { securityCheckGroupList } from "@/api/safetyCheck/indexDemoOne";
-  //import { systemUserSelect } from "@/api/commonality/permission";
-  //import { getInfo } from "@/api/basicsModules/index";
+  import {
+    securityCheckGroupList,
+    securityCheckGroupEnable,
+    securityCheckGroupDelete,
+  } from "@/api/safetyCheck/indexDemoOne";
+  import {
+    getDeptDropList,
+  } from '@/api/commonality/permission'
   import addPage from "./addPage.vue";
   export default {
     name: 'index',
@@ -129,16 +134,16 @@
         //页面遮罩
         loading:false,
         //下拉列表数据
-        optionList:[{value:true,label:'启用'},{value:false,label:'停用'}],
-        optionListOne:[{value:true,label:'启用'},{value:false,label:'停用'}],
+        optionList:[{value:1,label:'启用'},{value:0,label:'停用'}],
+        deptOptions:[],
         //查询条件
         queryParams:{
           page:1,
           pageSize:20,
-          queryParamsData1 :null,
-          queryParamsData2 :null,
-          queryParamsData3:"",
-          queryParamsData4:"",
+          enable :null,
+          deptId :null,
+          groupName:"",
+          userName:"",
         },
         //时间数据
         dateRange:[],
@@ -151,10 +156,10 @@
       }
     },
     created () {
-
+      this.getDeptDropList()
     },
     mounted () {
-      //this.getList();
+      this.getList();
     },
     methods: {
       //查询按钮
@@ -168,10 +173,10 @@
         this.$set(this,'queryParams',{
           page:1,
           pageSize:20,
-          queryParamsData1 :null,
-          queryParamsData2 :null,
-          queryParamsData3:"",
-          queryParamsData4:"",
+          enable :null,
+          deptId :null,
+          groupName:"",
+          userName:"",
         });
         this.getList();
       },
@@ -179,14 +184,7 @@
       getList(){
         this.$set(this,'loading',true);
         let obj = JSON.parse(JSON.stringify(this.queryParams))
-        if(this.dateRange[0]){
-          obj.startTime = this.dateRange[0]+'T00:00:00'
-          obj.endTime = this.dateRange[1]+'T23:59:59'
-        }else{
-          obj.startTime = "";
-          obj.endTime = "";
-        }
-        getListFunction(obj).then(response => {
+        securityCheckGroupList(obj).then(response => {
           this.$set(this,'loading',false);
           this.$set(this,'dataList',response.data.records);
           this.$set(this,'total',response.data.total);
@@ -201,20 +199,18 @@
           this.$set(this,'pageType',2);
         }else if(type == 2){
           //详情
-          // let obj = JSON.parse(JSON.stringify(row))
           let obj = {
-            data1:true,
-            data2:'222',
-            data3:null,
-            data4:[{}]
+            groupId:row.groupId,
+            showType:true,
           }
-          obj.showType = true;
           this.$set(this,'propsData',obj);
           this.$set(this,'pageType',2);
         }else if(type == 3){
           //编辑
-          let obj = JSON.parse(JSON.stringify(row))
-          obj.showType = false;
+          let obj = {
+            groupId:row.groupId,
+            showType:false,
+          }
           this.$set(this,'propsData',obj);
           this.$set(this,'pageType',2);
         }else if(type == 4){
@@ -232,14 +228,14 @@
           }).catch(() => {});
         }else if(type == 5){
           //启用&停用
-          let text = row.state  ? "停用" : "启用";
+          let text = row.enable  ? "启用" : "停用";
           this.$confirm('是否确认' + text + '?', "警告", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"
           }).then(function() {
           }).then(() => {
-            stateFunction({id:row.id,state:!row.state,}).then(response => {
+            securityCheckGroupEnable({groupId:row.groupId,enable:!row.enable,}).then(response => {
               self.msgSuccess(response.message)
               self.getList();
             });
@@ -250,6 +246,12 @@
           this.getList();
         }
       },
+      /** 查询二级单位列表 */
+      getDeptDropList() {
+        getDeptDropList({ deptName: '', level: 2, deptType: 1 }).then(response => {
+          this.$set(this, 'deptOptions', response.data)
+        })
+      },
     },
   }
 </script>

+ 48 - 61
src/views/safetyCheck/inspectSupervisorGroup/userCheckComponent.vue

@@ -38,8 +38,8 @@
             <el-table class="table-box" ref="leftUserTable" border :data="userTableListLeft" @selection-change="userChangeLeft" :row-key="getRowKeys">
               <el-table-column v-if="editType" type="selection" width="50" :reserve-selection="true" align="center"/>
               <el-table-column label="姓名" align="center" prop="userName" show-overflow-tooltip/>
-              <el-table-column label="工号" align="center" prop="userNumber" show-overflow-tooltip width="150"/>
-              <el-table-column label="所在部门" align="center" prop="phonenumber" show-overflow-tooltip width="270"/>
+              <el-table-column label="工号" align="center" prop="account" show-overflow-tooltip width="150"/>
+              <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="270"/>
             </el-table>
             <pagination :page-sizes="[20, 30, 40, 50]"
                         v-show="userTotalLeft>0"
@@ -86,8 +86,8 @@
             <el-table class="table-box" ref="rightUserTable" border :data="userTableListRight" @selection-change="userChangeRight" :row-key="getRowKeys">
               <el-table-column v-if="editType" type="selection" width="50" :reserve-selection="true" align="center"/>
               <el-table-column label="姓名" align="center" prop="userName" show-overflow-tooltip/>
-              <el-table-column label="工号" align="center" prop="userNumber" show-overflow-tooltip width="150"/>
-              <el-table-column label="所在部门" align="center" prop="phonenumber" show-overflow-tooltip width="270"/>
+              <el-table-column label="工号" align="center" prop="account" show-overflow-tooltip width="150"/>
+              <el-table-column label="所在部门" align="center" prop="deptName" show-overflow-tooltip width="270"/>
             </el-table>
             <pagination :page-sizes="[20, 30, 40, 50]"
                         v-show="userTotalRight>0"
@@ -109,7 +109,7 @@
 </template>
 
 <script>
-  import { checkSet,checkSetAdd,checkStaffUserList } from '@/api/safetyCheck/index'
+  import { findUserList } from "@/api/safetyCheck/indexDemoOne";
   import { getDeptDropList } from '@/api/commonality/permission'
   export default {
     name: 'userCheckComponent',
@@ -130,7 +130,7 @@
           pageSize:20,
           searchValue:"",
           deptId:"",
-          filtType:1
+          filtType:1,
         },
         userTableListLeft:[],
         userTotalLeft:0,
@@ -141,7 +141,7 @@
           pageSize:20,
           deptId:"",
           searchValue:"",
-          filtType:2
+          filtType:2,
         },
         userTableListRight:[],
         userTotalRight:0,
@@ -151,6 +151,8 @@
         dialogTableList:[],
         //选中页面人员列表数据
         dialogTableDataList:[],
+        //选中的人员数据
+        selectedUserIds:[],
       }
     },
     created(){
@@ -162,7 +164,10 @@
     methods:{
       //初始化
       initialize() {
+        this.$set(this,'selectedUserIds',this.userCheckComponentData);
         this.listDepartments();
+        this.userResetQueryLeft();
+        this.userResetQueryRight();
       },
       //选择器
       checkboxChange(val){
@@ -183,7 +188,11 @@
         this.$parent.tableButton(4)
       },
       addUserButton(){
-        this.$parent.tableButton(5)
+        if(!this.selectedUserIds[0]){
+          this.msgError('请勾选人员')
+          return
+        }
+        this.$parent.tableButton(5,this.selectedUserIds)
       },
       /*===================================人员选择相关===================================*/
       //查询
@@ -211,15 +220,11 @@
       userGetListLeft(){
         let self = this;
         let leftObj = JSON.parse(JSON.stringify(this.userQueryParamsLeft));
-        leftObj.filtCheckUserIdList = [];
-        for(let i=0;i<self.dialogTableDataList.length;i++){
-          let obj = {
-            userId:self.dialogTableDataList[i].userId,
-            subId:self.dialogTableDataList[i].subId
-          }
-          leftObj.filtCheckUserIdList.push(obj)
+        leftObj.selectedUserIds = [];
+        for(let i=0;i<self.selectedUserIds.length;i++){
+          leftObj.selectedUserIds.push(self.selectedUserIds[i].userId);
         }
-        checkStaffUserList(leftObj).then(response => {
+        findUserList(leftObj).then(response => {
           this.userTotalLeft = response.data.total;
           this.userTableListLeft = response.data.records;
         });
@@ -249,15 +254,11 @@
       userGetListRight(){
         let self = this;
         let rightObj = JSON.parse(JSON.stringify(this.userQueryParamsRight));
-        rightObj.notFiltCheckUserIdList = [];
-        for(let i=0;i<self.dialogTableDataList.length;i++){
-          let obj = {
-            userId:self.dialogTableDataList[i].userId,
-            subId:self.dialogTableDataList[i].subId
-          }
-          rightObj.notFiltCheckUserIdList.push(obj)
+        rightObj.userIds = [];
+        for(let i=0;i<self.selectedUserIds.length;i++){
+          rightObj.userIds.push(self.selectedUserIds[i].userId);
         }
-        checkStaffUserList(rightObj).then(response => {
+        findUserList(rightObj).then(response => {
           this.userTotalRight = response.data.total;
           this.userTableListRight = response.data.records;
         });
@@ -267,52 +268,38 @@
         let self = this;
         if(type == 1){
           //右至左
-          if(this.$refs.rightUserTable.selection[0]){
-            let list = JSON.parse(JSON.stringify(this.dialogTableDataList));
-            let userIdsRight = JSON.parse(JSON.stringify(this.$refs.rightUserTable.selection))
-            for(let i=0;i<userIdsRight.length;i++){
-              for(let s=0;s<list.length;s++){
-                if(userIdsRight[i].userId == list[s].userId && userIdsRight[i].subId == list[s].subId){
-                  list.splice(s,1);
-                  s--
+          if(self.$refs.rightUserTable.selection[0]){
+            for(let i=0;i<self.$refs.rightUserTable.selection.length;i++){
+              for(let o=0;o<self.selectedUserIds.length;o++){
+                if(self.$refs.rightUserTable.selection[i].userId == self.selectedUserIds[o].userId){
+                  self.selectedUserIds.splice(o,1);
                 }
               }
             }
-            this.$set(this,'dialogTableDataList',list);
-            this.$refs.rightUserTable.clearSelection();
-            this.userHandleQueryLeft();
-            this.userHandleQueryRight();
+            self.$refs.rightUserTable.clearSelection();
+            self.userHandleQueryLeft();
+            self.userHandleQueryRight();
           }else{
-            this.msgError('请先勾选右侧列表')
+            self.msgError('请先勾选右侧列表')
           }
         }else if(type == 2){
           //左至右
-          if(this.$refs.leftUserTable.selection[0]){
-            let list = JSON.parse(JSON.stringify(this.dialogTableDataList));
-            let userIdsLeft = JSON.parse(JSON.stringify(this.$refs.leftUserTable.selection))
-            console.log('userIdsLeft',userIdsLeft)
-            for(let i=0;i<userIdsLeft.length;i++){
-              let obj = {
-                subId:userIdsLeft[i].subId,
-                subName:userIdsLeft[i].subName,
-                subRom:userIdsLeft[i].roomNum,
-                deptId:userIdsLeft[i].deptId,
-                deptName:userIdsLeft[i].deptName,
-                userId:userIdsLeft[i].userId,
-                nickName:userIdsLeft[i].userName,
-                userNumber:userIdsLeft[i].userNumber,
-                phonenumber:userIdsLeft[i].phonenumber,
-                validBeginTime:userIdsLeft[i].validBeginTime,
-                validEndTime:userIdsLeft[i].validEndTime,
-              }
-              list.push(obj);
+          if(self.$refs.leftUserTable.selection[0]){
+            for(let i=0;i<self.$refs.leftUserTable.selection.length;i++){
+              self.selectedUserIds.push({
+                userId: self.$refs.leftUserTable.selection[i].userId,
+                userType: self.$refs.leftUserTable.selection[i].userType,
+                account: self.$refs.leftUserTable.selection[i].account,
+                userName: self.$refs.leftUserTable.selection[i].userName,
+                deptId: self.$refs.leftUserTable.selection[i].deptId,
+                deptName: self.$refs.leftUserTable.selection[i].deptName,
+              })
             }
-            this.$set(this,'dialogTableDataList',list);
-            this.$refs.leftUserTable.clearSelection();
-            this.userHandleQueryLeft();
-            this.userHandleQueryRight();
+            self.$refs.leftUserTable.clearSelection();
+            self.userHandleQueryLeft();
+            self.userHandleQueryRight();
           }else{
-            this.msgError('请先勾选左侧列表')
+            self.msgError('请先勾选左侧列表')
           }
         }
       },

+ 54 - 55
src/views/safetyCheck/snapshot/index.vue

@@ -6,25 +6,25 @@
         <el-form :model="queryParams" class="form-box" ref="queryForm"
                  :inline="true" style="width:100%;">
           <div class="table-school-college-toggle-box">
-            <p :class="tableButtonCheckType==1?'p-check':''" @click="tableCheck(1)">全部</p>
-            <p :class="tableButtonCheckType==2?'p-check':''" @click="tableCheck(2)">待整改</p>
-            <p :class="tableButtonCheckType==3?'p-check':''" @click="tableCheck(3)">已整改</p>
-            <p :class="tableButtonCheckType==4?'p-check':''" @click="tableCheck(4)">暂无法整改</p>
+            <p :class="tableButtonCheckType==null?'p-check':''" @click="tableCheck(null)">全部</p>
+            <p :class="tableButtonCheckType==0?'p-check':''" @click="tableCheck(0)">待整改</p>
+            <p :class="tableButtonCheckType==1?'p-check':''" @click="tableCheck(1)">已整改</p>
+            <p :class="tableButtonCheckType==2?'p-check':''" @click="tableCheck(2)">暂无法整改</p>
           </div>
-          <el-form-item label="" prop="queryParamsData2">
-            <el-select v-model="queryParams.queryParamsData2" placeholder="学院单位" style="width: 160px">
+          <el-form-item label="" prop="deptId">
+            <el-select v-model="queryParams.deptId" placeholder="学院单位" style="width: 160px">
               <el-option
-                v-for="dict in optionList"
-                :key="dict.value"
-                :label="dict.label"
-                :value="dict.value"
+                v-for="dict in deptOptions"
+                :key="dict.deptId"
+                :label="dict.deptName"
+                :value="dict.deptId"
               />
             </el-select>
           </el-form-item>
-          <el-form-item label="" prop="queryParamsData1">
+          <el-form-item label="" prop="searchValue">
             <el-input
               maxLength="30"
-              v-model="queryParams.queryParamsData1"
+              v-model="queryParams.searchValue"
               placeholder="实验室/房间号"
               style="width: 160px"
             />
@@ -54,24 +54,24 @@
       <div class="page-content-box">
         <el-table class="table-box" v-loading="loading" border :data="dataList">
           <el-table-column label="序号" type="index" width="60"/>
-          <el-table-column label="实验室" prop="content" width="220" show-overflow-tooltip/>
-          <el-table-column label="学院单位" prop="content" width="150" show-overflow-tooltip/>
-          <el-table-column label="实验室负责人" prop="content" width="120" show-overflow-tooltip/>
+          <el-table-column label="实验室" prop="subName" width="220" show-overflow-tooltip/>
+          <el-table-column label="学院单位" prop="deptName" width="150" show-overflow-tooltip/>
+          <el-table-column label="实验室负责人" prop="adminName" width="120" show-overflow-tooltip/>
           <el-table-column label="上报时间" prop="createTime" width="150" show-overflow-tooltip>
             <template slot-scope="scope">
               <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="隐患描述" prop="name"  show-overflow-tooltip/>
-          <el-table-column label="整改人" prop="content" width="100" show-overflow-tooltip/>
-          <el-table-column label="处理时间" prop="createTime" width="130" show-overflow-tooltip>
+          <el-table-column label="隐患描述" prop="hazardDescribe"  show-overflow-tooltip/>
+          <el-table-column label="整改人" prop="rectifyUserName" width="100" show-overflow-tooltip/>
+          <el-table-column label="处理时间" prop="rectifyTime" width="130" show-overflow-tooltip>
             <template slot-scope="scope">
-              <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
+              <span>{{ parseTime(scope.row.rectifyTime,"{y}-{m}-{d} {h}:{i}") }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="整改状态" prop="state" width="100" show-overflow-tooltip>
+          <el-table-column label="整改状态" prop="rectifyStatus" width="100" show-overflow-tooltip>
             <template slot-scope="scope">
-
+              {{scope.row.rectifyStatus == 0?'待整改':(scope.row.rectifyStatus == 1?'已完成':(scope.row.rectifyStatus == 2?'暂无法整改':''))}}
             </template>
           </el-table-column>
           <el-table-column label="操作" width="130" show-overflow-tooltip v-if="tableButtonType">
@@ -83,6 +83,7 @@
                    v-hasPermiRouter="['demo:demo:detail']"
                 >详情</p>
                 <p class="table-button-p"
+                   v-if="scope.row.rectifyStatus == 0"
                    @click="tableButton(4,scope.row)"
                    v-hasPermiRouter="['demo:demo:del']"
                 >删除</p>
@@ -104,6 +105,13 @@
   </div>
 </template>
 <script>
+  import {
+    securityCheckPhotoMyList,
+    securityCheckPhotoDelete,
+  } from '@/api/safetyCheck/indexDemoOne'
+  import {
+    getDeptDropList,
+  } from '@/api/commonality/permission'
   //import { getDicts } from "@/api/commonality/noPermission";
   //import { systemUserSelect } from "@/api/commonality/permission";
   //import { getInfo } from "@/api/basicsModules/index";
@@ -117,19 +125,19 @@
       return {
         tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
         //页面状态
-        pageType:2,
+        pageType:1,
         //整改状态选项卡
-        tableButtonCheckType:1,
+        tableButtonCheckType:null,
         //页面遮罩
         loading:false,
         //下拉列表数据
-        optionList:[{value:true,label:'启用'},{value:false,label:'停用'}],
+        deptOptions:[],
         //查询条件
         queryParams:{
           page:1,
           pageSize:20,
-          queryParamsData1:"",
-          queryParamsData2 :null,
+          searchValue:"",
+          deptId :null,
         },
         //时间数据
         dateRange:[],
@@ -145,7 +153,8 @@
 
     },
     mounted () {
-      //this.getList();
+      this.getDeptDropList();
+      this.getList();
     },
     methods: {
       //整改状态选项卡切换
@@ -166,8 +175,8 @@
         this.$set(this,'queryParams',{
           page:1,
           pageSize:20,
-          queryParamsData1:"",
-          queryParamsData2 :null,
+          searchValue:"",
+          deptId :null,
         });
         this.getList();
       },
@@ -182,7 +191,8 @@
           obj.startTime = "";
           obj.endTime = "";
         }
-        getListFunction(obj).then(response => {
+        obj.rectifyStatus = this.tableButtonCheckType
+        securityCheckPhotoMyList(obj).then(response => {
           this.$set(this,'loading',false);
           this.$set(this,'dataList',response.data.records);
           this.$set(this,'total',response.data.total);
@@ -193,20 +203,17 @@
         let self = this;
         if(type == 1){
           //新增
+          this.$set(this,'propsData',{
+            showType:false,
+          });
           this.$set(this,'pageType',2);
-          this.$set(this,'propsData',{});
         }else if(type == 2){
           //详情
+          this.$set(this,'propsData',{
+            showType:true,
+            photoId:row.photoId
+          });
           this.$set(this,'pageType',2);
-          let obj = JSON.parse(JSON.stringify(row))
-          obj.showType = true;
-          this.$set(this,'propsData',obj);
-        }else if(type == 3){
-          //编辑
-          this.$set(this,'pageType',2);
-          let obj = JSON.parse(JSON.stringify(row))
-          obj.showType = false;
-          this.$set(this,'propsData',obj);
         }else if(type == 4){
           //删除
           this.$confirm('是否确认删除?', "警告", {
@@ -215,21 +222,7 @@
             type: "warning"
           }).then(function() {
           }).then(() => {
-            deleteFunction({id:row.id}).then(response => {
-              self.msgSuccess(response.message)
-              self.getList();
-            });
-          }).catch(() => {});
-        }else if(type == 5){
-          //启用&停用
-          let text = row.state  ? "停用" : "启用";
-          this.$confirm('是否确认' + text + '?', "警告", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          }).then(function() {
-          }).then(() => {
-            stateFunction({id:row.id,state:!row.state,}).then(response => {
+            securityCheckPhotoDelete({photoId:row.photoId}).then(response => {
               self.msgSuccess(response.message)
               self.getList();
             });
@@ -240,6 +233,12 @@
           this.getList();
         }
       },
+      /** 查询二级单位列表 */
+      getDeptDropList() {
+        getDeptDropList({ deptName: '', level: 2, deptType: 1 }).then(response => {
+          this.$set(this, 'deptOptions', response.data)
+        })
+      },
     },
   }
 </script>