heyang 1 year ago
parent
commit
11ebe2c952
2 changed files with 14 additions and 6 deletions
  1. 8 0
      src/api/safetyCheck/index.js
  2. 6 6
      src/views/safetyCheck/startInspection/index.vue

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

@@ -755,6 +755,14 @@ export function getHazardInfo(query) {
     params: query
   })
 }
+//通用接口-根据选择的设备id生成检查项
+export function getHazardInfoByJoinIds(query) {
+  return request({
+    url: '/zd-security/checkManage/getHazardInfoByJoinIds',
+    method: 'get',
+    params: query
+  })
+}
 
 //开展检查-提交
 export function checkManageAdd(data) {

+ 6 - 6
src/views/safetyCheck/startInspection/index.vue

@@ -367,7 +367,7 @@
     countHazardNum,
     getGentle,
     getHazardInfoBySubId,
-    getHazardInfo,
+    getHazardInfo, getHazardInfoByJoinIds
   } from '@/api/safetyCheck/index'
   export default {
     name: 'index',
@@ -509,15 +509,15 @@
       handleClick(doType){
         let self=this;
         if(doType=='startBtn'){//开始检查
-          let hazardIds=[];
+          let joinHazardIds=[];
           if(this.multipleSelection[0]){
             this.pageType=2;
             this.checkOptionList();
             this.dialogVisible=false;
             for(let i=0;i<this.multipleSelection.length;i++){
-              hazardIds.push(this.multipleSelection[i].hazardId)
+              joinHazardIds.push(this.multipleSelection[i].joinHazardId)
             }
-            this.getHazardInfo(this.addForm.subId,hazardIds.join(','))
+            this.getHazardInfoByJoinIds(this.addForm.subId,joinHazardIds.join(','))
           }else{
             this.msgError('请先选择实验室内设备!')
           }
@@ -967,8 +967,8 @@
         });
       },
       //根据设备id生成检查项
-      getHazardInfo(id,hazardIds){
-        getHazardInfo({subId:id,hazardIds:hazardIds}).then(response => {
+      getHazardInfoByJoinIds(id,joinHazardIds){
+        getHazardInfoByJoinIds({joinHazardIds:joinHazardIds}).then(response => {
             if(response.data[0]){
               response.data.forEach(function(item) {
                 item.lookType=true;