dedsudiyu преди 5 месеца
родител
ревизия
774ce6bc0e

+ 33 - 0
src/api/hierarchicalControl/index.js

@@ -8,6 +8,7 @@ export function laboratoryGradeManageList(data) {
     data: data
     data: data
   })
   })
 }
 }
+//分级管控-条件设置-人员列表
 export function systemUserSelectByPage(data) {
 export function systemUserSelectByPage(data) {
   return request({
   return request({
     url: '/system/user/selectByPage',
     url: '/system/user/selectByPage',
@@ -15,3 +16,35 @@ export function systemUserSelectByPage(data) {
     data: data
     data: data
   })
   })
 }
 }
+//分级管控-条件设置-新增
+export function laboratoryGradeManageAdd(data) {
+  return request({
+    url: '/laboratory/gradeManage/add',
+    method: 'post',
+    data: data
+  })
+}
+//分级管控-条件设置-编辑
+export function laboratoryGradeManageUpdate(data) {
+  return request({
+    url: '/laboratory/gradeManage/update',
+    method: 'post',
+    data: data
+  })
+}
+//分级管控-条件设置-详情
+export function laboratoryGradeManageDetail(query) {
+  return request({
+    url: '/laboratory/gradeManage/detail',
+    method: 'get',
+    params: query
+  })
+}
+//分级管控-条件设置-详情
+export function laboratoryGradeManageDelete(data) {
+  return request({
+    url: '/laboratory/gradeManage/delete',
+    method: 'post',
+    data: data
+  })
+}

+ 24 - 33
src/views/hierarchicalControl/gradeManage/addPage.vue

@@ -48,8 +48,8 @@
                 ></el-option>
                 ></el-option>
               </el-select>
               </el-select>
             </el-form-item>
             </el-form-item>
-            <el-form-item label="安全分级" prop="level" label-width="80px" style="margin-bottom:20px;">
-              <el-select v-model="form.level" placeholder="请选择安全分级" clearable style="width:180px;">
+            <el-form-item label="安全分级" prop="levelId" label-width="80px" style="margin-bottom:20px;">
+              <el-select v-model="form.levelId" placeholder="请选择安全分级" clearable style="width:180px;">
                 <el-option
                 <el-option
                   v-for="dict in levelList"
                   v-for="dict in levelList"
                   :key="dict.levelId"
                   :key="dict.levelId"
@@ -180,12 +180,12 @@
         <div class="table-user-list-box">
         <div class="table-user-list-box">
           <el-table class="table-box" border :data="tableUserListMin">
           <el-table class="table-box" border :data="tableUserListMin">
             <el-table-column label="身份" align="left" prop="positionName"/>
             <el-table-column label="身份" align="left" prop="positionName"/>
-            <el-table-column label="名称" align="left" prop="nickName"/>
-            <el-table-column label="联系方式" align="left" prop="phonenumber"/>
+            <el-table-column label="名称" align="left" prop="userName"/>
+            <el-table-column label="联系方式" align="left" prop="mobile"/>
             <el-table-column label="学院" align="left" prop="deptName"/>
             <el-table-column label="学院" align="left" prop="deptName"/>
-            <el-table-column label="专业" align="left" prop="major">
+            <el-table-column label="专业" align="left" prop="majorName">
               <template slot-scope="scope">
               <template slot-scope="scope">
-                {{scope.row.major ? scope.row.major : '--'}}
+                {{scope.row.majorName ? scope.row.majorName : '--'}}
               </template>
               </template>
             </el-table-column>
             </el-table-column>
             <el-table-column label="班级" align="left" prop="grade">
             <el-table-column label="班级" align="left" prop="grade">
@@ -219,10 +219,11 @@
 
 
 <script>
 <script>
   import {
   import {
-    addGradeManage,getGradeManage,
-    updateGradeManage,listInfo,
-    listUser
-  } from "@/api/hierarchicalControl/indexDemo";
+    laboratoryGradeManageDetail,
+    systemUserSelectByPage,
+    laboratoryGradeManageAdd,
+    laboratoryGradeManageUpdate,
+  } from "@/api/hierarchicalControl/index";
   import {
   import {
     getDeptDropList,
     getDeptDropList,
     laboratoryClassLevelGetList,
     laboratoryClassLevelGetList,
@@ -251,7 +252,6 @@
           deptId:'',
           deptId:'',
           deptName:"",//学院
           deptName:"",//学院
           subs:[],//选中实验室列表
           subs:[],//选中实验室列表
-          subsData:[],
           ruleList:[//添加选项
           ruleList:[//添加选项
             {
             {
               name:"",//名称
               name:"",//名称
@@ -343,7 +343,7 @@
       this.laboratoryClassTypeGetList();
       this.laboratoryClassTypeGetList();
       this.laboratoryClassMoldGetList();
       this.laboratoryClassMoldGetList();
       if(this.propsType){
       if(this.propsType){
-        this.getGradeManage();
+        this.laboratoryGradeManageDetail();
       }
       }
     },
     },
     methods: {
     methods: {
@@ -425,9 +425,9 @@
         });
         });
       },
       },
       //获取数据详情
       //获取数据详情
-      getGradeManage(){
+      laboratoryGradeManageDetail(){
         let self = this;
         let self = this;
-        getGradeManage(this.propsId).then(response=>{
+        laboratoryGradeManageDetail({manageId:this.propsId}).then(response=>{
           let userIds = "";
           let userIds = "";
           for(let i=0;i<response.data.ruleList.length;i++){
           for(let i=0;i<response.data.ruleList.length;i++){
             for(let o=0;o<response.data.ruleList[i].ruleUserList.length;o++){
             for(let o=0;o<response.data.ruleList[i].ruleUserList.length;o++){
@@ -446,28 +446,19 @@
             }
             }
           }
           }
           this.$set(this,'form',response.data);
           this.$set(this,'form',response.data);
-          //获取选中实验室列表
-          let subjectData = {
-            pageNum:1,
-            pageSize:20,
-            subIds:response.data.subIds
-          };
-          listInfo(subjectData).then(response => {
-            this.$set(this.form,'subsData',response.rows)
-          });
           //获取选中人员列表
           //获取选中人员列表
           let userData = {
           let userData = {
             pageNum:1,
             pageNum:1,
             pageSize: 1000,
             pageSize: 1000,
             paramIds:userIds
             paramIds:userIds
           }
           }
-          listUser(userData).then(response => {
-            for(let a=0;a<response.rows.length;a++){
+          systemUserSelectByPage(userData).then(response => {
+            for(let a=0;a<response.data.records.length;a++){
               for(let i=0;i<self.form.ruleList.length;i++){
               for(let i=0;i<self.form.ruleList.length;i++){
                 for(let o=0;o<self.form.ruleList[i].ruleUserList.length;o++){
                 for(let o=0;o<self.form.ruleList[i].ruleUserList.length;o++){
-                  let text = response.rows[a].userId + '';
+                  let text = response.data.records[a].userId + '';
                   if (self.form.ruleList[i].ruleUserList[o].userIds.indexOf(text) != -1){
                   if (self.form.ruleList[i].ruleUserList[o].userIds.indexOf(text) != -1){
-                    self.form.ruleList[i].ruleUserList[o].userList.push(response.rows[a]);
+                    self.form.ruleList[i].ruleUserList[o].userList.push(response.data.records[a]);
                   }
                   }
                 }
                 }
               }
               }
@@ -575,23 +566,23 @@
               }
               }
             }
             }
             if(form.id){
             if(form.id){
-              this.updateGradeManage(form);
+              this.laboratoryGradeManageUpdate(form);
             }else{
             }else{
-              this.addGradeManage(form);
+              this.laboratoryGradeManageAdd(form);
             }
             }
           }
           }
         });
         });
       },
       },
       //编辑接口
       //编辑接口
-      updateGradeManage(obj){
-        updateGradeManage(obj).then(response=>{
+      laboratoryGradeManageUpdate(obj){
+        laboratoryGradeManageUpdate(obj).then(response=>{
           this.msgSuccess("操作成功");
           this.msgSuccess("操作成功");
           this.$parent.clickPageType(1);
           this.$parent.clickPageType(1);
         });
         });
       },
       },
       //新增接口
       //新增接口
-      addGradeManage(obj){
-        addGradeManage(obj).then(response=>{
+      laboratoryGradeManageAdd(obj){
+        laboratoryGradeManageAdd(obj).then(response=>{
           this.msgSuccess("操作成功");
           this.msgSuccess("操作成功");
           this.$parent.clickPageType(1);
           this.$parent.clickPageType(1);
         });
         });

+ 12 - 68
src/views/hierarchicalControl/gradeManage/index.vue

@@ -74,7 +74,7 @@
           </el-form>
           </el-form>
         </div>
         </div>
         <div class="page-content-box">
         <div class="page-content-box">
-          <el-table class="table-box" v-loading="loading" border :data="dataList" @selection-change="handleSelectionChange">
+          <el-table class="table-box" v-loading="loading" border :data="dataList">
             <!--<el-table-column type="selection" width="55" align="center" />-->
             <!--<el-table-column type="selection" width="55" align="center" />-->
             <el-table-column label="管控名称" align="left" prop="name" show-overflow-tooltip/>
             <el-table-column label="管控名称" align="left" prop="name" show-overflow-tooltip/>
             <el-table-column label="学院" align="left" prop="deptName" width="149" show-overflow-tooltip/>
             <el-table-column label="学院" align="left" prop="deptName" width="149" show-overflow-tooltip/>
@@ -125,36 +125,18 @@
     </div>
     </div>
     <!-- 新增编辑 -->
     <!-- 新增编辑 -->
     <add-page v-if="pageType == 2" :propsType="propsType" :propsId="propsId"></add-page>
     <add-page v-if="pageType == 2" :propsType="propsType" :propsId="propsId"></add-page>
-    <!-- 添加或修改分级管控管理对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" placeholder="请输入备注" />
-        </el-form-item>
-        <el-form-item label="安全分级ID" prop="level">
-          <el-input v-model="form.level" placeholder="请输入安全分级ID" />
-        </el-form-item>
-        <el-form-item label="安全分类ID" prop="typeId">
-          <el-input v-model="form.typeId" placeholder="请输入安全分类ID" />
-        </el-form-item>
-        <el-form-item label="适配实验室多选逗号分隔" prop="subIds">
-          <el-input v-model="form.subIds" placeholder="请输入适配实验室多选逗号分隔" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
   import {
   import {
     getGradeManage,
     getGradeManage,
-    delGradeManage, addGradeManage,
+    addGradeManage,
     updateGradeManage,
     updateGradeManage,
   } from "@/api/hierarchicalControl/indexDemo";
   } from "@/api/hierarchicalControl/indexDemo";
+  import {
+    laboratoryGradeManageDelete,
+  } from "@/api/hierarchicalControl/index";
   import {
   import {
     getDeptDropList,
     getDeptDropList,
     laboratoryClassLevelGetList,
     laboratoryClassLevelGetList,
@@ -396,61 +378,23 @@
         })
         })
         this.handleQuery();
         this.handleQuery();
       },
       },
-      // 多选框选中数据
-      handleSelectionChange(selection) {
-        this.ids = selection.map(item => item.id)
-        this.single = selection.length!==1
-        this.multiple = !selection.length
-      },
-      /** 新增按钮操作 */
-      handleAdd() {
-        this.reset();
-        this.open = true;
-        this.title = "添加分级管控管理";
-      },
-      /** 修改按钮操作 */
-      handleUpdate(row) {
-        this.reset();
-        const id = row.id || this.ids
-        getGradeManage(id).then( response => {
-          this.form =  response.data;
-          this.open = true;
-          this.title = "修改分级管控管理";
-        });
-      },
-      /** 提交按钮 */
-      submitForm() {
-        this.$refs["form"].validate(valid => {
-          if (valid) {
-            if (this.form.id != null) {
-              updateGradeManage(this.form).then( response => {
-                this.msgSuccess("修改成功");
-                this.open = false;
-                this.getList();
-              });
-            } else {
-              addGradeManage(this.form).then( response => {
-                this.msgSuccess("新增成功");
-                this.open = false;
-                this.getList();
-              });
-            }
-          }
-        });
-      },
       /** 删除按钮操作 */
       /** 删除按钮操作 */
       handleDelete(row) {
       handleDelete(row) {
-        const ids = row.id || this.ids;
+        let self = this;
         this.$confirm('是否确认删除?', "警告", {
         this.$confirm('是否确认删除?', "警告", {
           confirmButtonText: "确定",
           confirmButtonText: "确定",
           cancelButtonText: "取消",
           cancelButtonText: "取消",
           type: "warning"
           type: "warning"
         }).then(function() {
         }).then(function() {
-          return delGradeManage(ids);
+          self.laboratoryGradeManageDelete(row);
         }).then(() => {
         }).then(() => {
+        }).catch(() => {});
+      },
+      laboratoryGradeManageDelete(row){
+        laboratoryGradeManageDelete({id:row.id}).then( response => {
           this.getList();
           this.getList();
           this.msgSuccess("删除成功");
           this.msgSuccess("删除成功");
-        }).catch(() => {});
+        });
       },
       },
     }
     }
   };
   };

+ 8 - 8
src/views/hierarchicalControl/gradeManage/userList.vue

@@ -25,19 +25,19 @@
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
           <el-form-item>
           <el-form-item>
-            <p class="page-reset-common-style-button" style="margin-right:10px;" @click="handleQuery">查询</p>
-            <p class="page-inquire-common-style-button" @click="resetQuery">重置</p>
+            <p class="page-inquire-common-style-button" style="margin-right:10px;" @click="handleQuery">查询</p>
+            <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
           </el-form-item>
           </el-form-item>
         </el-form>
         </el-form>
         <div class="sheet-expand-box" style="height:40px;display:flex;background:rgba(1,131,250,0.1);border-radius: 5px;margin-bottom:18px;font-size:14px;">
         <div class="sheet-expand-box" style="height:40px;display:flex;background:rgba(1,131,250,0.1);border-radius: 5px;margin-bottom:18px;font-size:14px;">
           <i class="el-icon-warning" style="color:#0045AF;margin:10px 16px 0 14px;height:20px;width:20px;font-size:20px;display: block;"></i>
           <i class="el-icon-warning" style="color:#0045AF;margin:10px 16px 0 14px;height:20px;width:20px;font-size:20px;display: block;"></i>
           <p class="color_99" style="margin:0;width:132px;font-size:14px;height:40px;line-height:40px;">已选择 {{selectedNum}} 项</p>
           <p class="color_99" style="margin:0;width:132px;font-size:14px;height:40px;line-height:40px;">已选择 {{selectedNum}} 项</p>
-          <p class="color_one cursor_hover" style="margin:0;width:60px;font-size:14px;height:40px;line-height:40px;margin-right:20px;" @click="selectPage">全选本页</p>
-          <p class="color_warn cursor_hover" style="margin:0;width:60px;font-size:14px;height:40px;line-height:40px;margin-right:20px;" @click="clearSelection">清除选项</p>
+          <p class="color_one cursor_hover" style="color:#0045af;margin:0;width:60px;font-size:14px;height:40px;line-height:40px;margin-right:20px;" @click="selectPage">全选本页</p>
+          <p class="color_warn cursor_hover" style="color:#ffa312;margin:0;width:60px;font-size:14px;height:40px;line-height:40px;margin-right:20px;" @click="clearSelection">清除选项</p>
         </div>
         </div>
         <el-table class="table-box" v-loading="loading" border :data="userList" @selection-change="handleSelectionChange" ref="multipleTable" :row-key="getRowKeys">
         <el-table class="table-box" v-loading="loading" border :data="userList" @selection-change="handleSelectionChange" ref="multipleTable" :row-key="getRowKeys">
           <el-table-column type="selection" width="55" :reserve-selection="true" align="center" />
           <el-table-column type="selection" width="55" :reserve-selection="true" align="center" />
-          <el-table-column label="姓名" align="left" prop="nickName" />
+          <el-table-column label="姓名" align="left" prop="userName" />
           <el-table-column label="身份" align="left" prop="positionName" />
           <el-table-column label="身份" align="left" prop="positionName" />
           <el-table-column label="工号/学号" align="left" prop="userName" />
           <el-table-column label="工号/学号" align="left" prop="userName" />
           <el-table-column label="联系方式" align="left" prop="phonenumber" />
           <el-table-column label="联系方式" align="left" prop="phonenumber" />
@@ -52,8 +52,8 @@
         />
         />
         <div style="margin-top:30px;padding-top:20px;display: flex;border-top:1px solid #dedede">
         <div style="margin-top:30px;padding-top:20px;display: flex;border-top:1px solid #dedede">
           <p style="flex:1;"></p>
           <p style="flex:1;"></p>
-          <p style="margin-right:20px;" class="reset-button-one" @click="show(2)">取消</p>
-          <p class="inquire-button-one" @click="okButton">确定</p>
+          <p style="margin-right:20px;" class="page-reset-common-style-button" @click="show(2)">取消</p>
+          <p class="page-inquire-common-style-button" @click="okButton">确定</p>
         </div>
         </div>
       </div>
       </div>
     </el-dialog>
     </el-dialog>
@@ -134,7 +134,7 @@
       getList(){
       getList(){
         this.$set(this,'loading',true);
         this.$set(this,'loading',true);
         let obj = JSON.parse(JSON.stringify(this.queryParams));
         let obj = JSON.parse(JSON.stringify(this.queryParams));
-        obj.ids = this.addUserList[0]?this.addUserList+'':null;
+        obj.ids = this.addUserList[0]?this.addUserList:null;
         obj.include = true;
         obj.include = true;
         systemUserSelectByPage(obj).then(response => {
         systemUserSelectByPage(obj).then(response => {
           this.$set(this,'userList',response.data.records);
           this.$set(this,'userList',response.data.records);