Browse Source

修改危害物质

jiangbiao 2 years ago
parent
commit
5c23f566c9

+ 11 - 0
master/src/main/java/com/ruoyi/project/configuration/controller/TMatterController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.configuration.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -67,6 +68,16 @@ public class TMatterController extends BaseController {
     public TableDataInfo list(TMatter tMatter) {
         startPage();
         List<TMatter> list = tMatterService.selectTMatterList(tMatter);
+        for (TMatter ml : list) {
+            StringBuilder mpName = new StringBuilder();
+            for (String mp : ml.getMatterProtects().split(",")) {
+                TMatterProtect tMatterProtect = itMatterProtectService.selectTMatterProtectById(Long.valueOf(mp));
+                mpName.append(tMatterProtect.getConservatoryMeasureName()).append("、");
+            }
+            if (StringUtils.isNotEmpty(mpName.toString())) {
+                ml.setMatterProtectsName(mpName.substring(0, mpName.length() - 1));
+            }
+        };
         return getDataTable(list);
     }
 

+ 18 - 0
master/src/main/java/com/ruoyi/project/configuration/domain/TMatter.java

@@ -78,12 +78,14 @@ public class TMatter extends BaseEntity {
      * 相关危害集合
      */
     @Excel(name = "相关危害集合")
+    private String matterFeaturesName;
     private String matterFeatures;
 
     /**
      * 相关防护措施集合
      */
     @Excel(name = "相关防护措施集合")
+    private String matterProtectsName;
     private String matterProtects;
 
     private List<String> matterFeatureList;
@@ -194,6 +196,22 @@ public class TMatter extends BaseEntity {
         return matterProtects;
     }
 
+    public String getMatterFeaturesName() {
+        return matterFeaturesName;
+    }
+
+    public void setMatterFeaturesName(String matterFeaturesName) {
+        this.matterFeaturesName = matterFeaturesName;
+    }
+
+    public String getMatterProtectsName() {
+        return matterProtectsName;
+    }
+
+    public void setMatterProtectsName(String matterProtectsName) {
+        this.matterProtectsName = matterProtectsName;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

BIN
master/src/main/resources/static/word/fireTicket.docx


BIN
master/src/main/resources/static/word/ticket.docx


+ 69 - 3
ui/src/views/configuration/matter/index.vue

@@ -59,8 +59,8 @@
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="编号" align="center" prop="id" :show-overflow-tooltip="true"/>
       <el-table-column label="危害物质名称" align="center" prop="matterName" :show-overflow-tooltip="true"/>
-      <el-table-column label="相关危害集合" align="center" prop="matterFeatures" :show-overflow-tooltip="true"/>
-      <el-table-column label="相关防护措施集合" align="center" prop="matterProtects" :show-overflow-tooltip="true"/>
+      <el-table-column label="相关危害集合" align="center" prop="matterFeaturesName" :show-overflow-tooltip="true"/>
+      <el-table-column label="相关防护措施集合" align="center" prop="matterProtectsName" :show-overflow-tooltip="true"/>
       <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
       <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
         <template slot-scope="scope">
@@ -279,7 +279,7 @@ import {
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {
-  getForType
+  getForType, getProtect
 } from "@/api/configuration/protect";
 
 export default {
@@ -425,6 +425,16 @@ export default {
         this.matterList = response.rows;
         this.total = response.total;
         this.loading = false;
+        this.matterList.forEach(ml => {
+          ml.matterFeaturesName = '';
+          ml.matterFeatures.split(',').forEach(mf => {
+            ml.matterFeaturesName += this.getMatterFeatureName(parseInt(mf)) + '、';
+          })
+          if (ml.matterFeaturesName != '') {
+            ml.matterFeaturesName = ml.matterFeaturesName.substring(0, ml.matterFeaturesName.length - 1)
+          }
+        })
+        console.log(this.matterList)
       });
     },
     /** 查询部门下拉树结构 */
@@ -449,6 +459,11 @@ export default {
       this.cIsHealthHazard = null;
       this.cIsCompressedGas = null;
       this.cIsEnvironmentalHazard = null;
+      this.protectGlove=null;
+      this.rubberBoot=null;
+      this.protectSuit=null;
+      this.resProtect=null;
+      this.safeGoggle=null;
       this.form = {
         id: null,
         delFlag: null,
@@ -522,6 +537,35 @@ export default {
             }
           })
         }
+        if(this.form.matterProtects!=null){
+          this.form.matterProtects.split(',').forEach(mp=>{
+            this.protectGloves.forEach(item=>{
+              if (mp==item.id){
+                this.protectGlove=item.id
+              }
+            })
+            this.safeGoggles.forEach(item=>{
+              if (mp==item.id){
+                this.safeGoggle=item.id
+              }
+            })
+            this.resProtects.forEach(item=>{
+              if (mp==item.id){
+                this.resProtect=item.id
+              }
+            })
+            this.rubberBoots.forEach(item=>{
+              if (mp==item.id){
+                this.rubberBoot=item.id
+              }
+            })
+            this.protectSuits.forEach(item=>{
+              if (mp==item.id){
+                this.protectSuit=item.id
+              }
+            })
+          })
+        }
       });
     },
     //处理选择框
@@ -667,6 +711,28 @@ export default {
     // 提交上传文件
     submitFileForm() {
       this.$refs.upload.submit();
+    },
+    getMatterFeatureName(index) {
+      switch (index) {
+        case 1:
+          return '毒性';
+        case 2:
+          return '易燃性';
+        case 3:
+          return '氧化性';
+        case 4:
+          return '爆炸性';
+        case 5:
+          return '腐蚀性';
+        case 6:
+          return '刺激性/致敏性/毒性';
+        case 7:
+          return '健康危害';
+        case 8:
+          return '压力下气体';
+        case 9:
+          return '危害水生环境';
+      }
     }
   }
 };