shi'sen'yuan 3 жил өмнө
parent
commit
d34bad99bd

+ 9 - 1
master/src/main/java/com/ruoyi/project/ehs/controller/TEnvironapprovalController.java

@@ -246,7 +246,15 @@ public class TEnvironapprovalController extends BaseController
         {
             String url = FileUploadUtils.upload(RuoYiConfig.getFilePath("/"+ pType), file);
             TEnvironapproval environapproval = tEnvironapprovalService.selectTEnvironapprovalById(Long.parseLong(pId));
-            environapproval.setRequirements(url);
+            if (pType.equals("requirementsWaterPic")) {
+                environapproval.setReqWater(url);
+            }else if (pType.equals("requirementsExhaustPic")) {
+                environapproval.setReqExhaust(url);
+            }else if (pType.equals("contentWaterPic")) {
+                environapproval.setConWater(url);
+            }else if (pType.equals("contentExhaustPic")) {
+                environapproval.setConExhaust(url);
+            }
             tEnvironapprovalService.updateTEnvironapproval(environapproval);
             return AjaxResult.success();
         }

+ 20 - 0
master/src/main/java/com/ruoyi/project/ehs/domain/TEnvironapproval.java

@@ -113,6 +113,8 @@ public class TEnvironapproval extends BaseEntity
     @Excel(name = "排放/监控要求")
     private String requirements;
     private String reqPic;
+    private String reqWater;
+    private String reqExhaust;
 
     /** 回顾人 */
     @Excel(name = "回顾人")
@@ -132,6 +134,9 @@ public class TEnvironapproval extends BaseEntity
     /** 主要内容 */
     @Excel(name = "主要内容")
     private String content;
+    private String conPic;
+    private String conWater;
+    private String conExhaust;
 
     public void setId(Long id)
     {
@@ -336,6 +341,12 @@ public class TEnvironapproval extends BaseEntity
     public String getReqPic() { return reqPic; }
 
     public void setReqPic(String reqPic) { this.reqPic = reqPic; }
+    public String getReqWater() { return reqWater; }
+
+    public void setReqWater(String reqWater) { this.reqWater = reqWater; }
+    public String getReqExhaust() { return reqExhaust; }
+
+    public void setReqExhaust(String reqExhaust) { this.reqExhaust = reqExhaust; }
     public void setReviewer(String reviewer) { this.reviewer = reviewer; }
 
     public String getReviewer() { return reviewer; }
@@ -351,6 +362,15 @@ public class TEnvironapproval extends BaseEntity
     public void setContent(String content) { this.content = content; }
 
     public String getContent() { return content; }
+    public String getConPic() { return conPic; }
+
+    public void setConPic(String conPic) { this.conPic = conPic; }
+    public String getConWater() { return conWater; }
+
+    public void setConWater(String conWater) { this.conWater = conWater; }
+    public String getConExhaust() { return conExhaust; }
+
+    public void setConExhaust(String conExhaust) { this.conExhaust = conExhaust; }
 
     @Override
     public String toString() {

+ 21 - 1
master/src/main/resources/mybatis/ehs/TEnvironapprovalMapper.xml

@@ -31,15 +31,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="allowance"    column="allowance"    />
         <result property="requirements"    column="requirements"    />
         <result property="reqPic"    column="req_pic"    />
+        <result property="reqWater"    column="req_water"    />
+        <result property="reqExhaust"    column="req_exhaust"    />
         <result property="reviewer"    column="reviewer"    />
         <result property="reviewerName"    column="name"    />
         <result property="reviewResult"    column="review_result"    />
         <result property="content"    column="content"    />
+        <result property="conPic"    column="con_pic"    />
+        <result property="conWater"    column="con_water"    />
+        <result property="conExhaust"    column="con_exhaust"    />
         <result property="deptName" column="dept_name" />
     </resultMap>
 
     <sql id="selectTEnvironapprovalVo">
-        select d.id, d.plant_code, d.approvalname, t.name, d.certno, d.effetivedate, d.is_permanent, d.validity_before, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.conttype, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.scope, d.follow, d.allowance, d.requirements, d.req_pic, d.reviewer, d.validity_after, d.review_result, d.content ,s.dept_name from t_environapproval d
+        select d.id, d.plant_code, d.approvalname, t.name, d.certno, d.effetivedate, d.is_permanent, d.validity_before, d.relatedlaw, d.responsauth, d.owner, d.reviewdate, d.nextreviewdate, d.conttype, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id, d.remarks, d.scope, d.follow, d.allowance, d.requirements, d.req_pic, d.req_water, d.req_exhaust, d.reviewer, d.validity_after, d.review_result, d.content, d.con_pic, d.con_water, d.con_exhaust ,s.dept_name from t_environapproval d
       left join sys_dept s on s.dept_id = d.dept_id
       left join t_staffmgr t on t.staffid = d.reviewer
     </sql>
@@ -110,10 +115,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="allowance != null">allowance,</if>
             <if test="requirements != null">requirements,</if>
             <if test="reqPic != null">req_pic,</if>
+            <if test="reqWater != null">req_water,</if>
+            <if test="reqExhaust != null">req_exhaust,</if>
             <if test="reviewer != null">reviewer,</if>
             <if test="reviewResult != null">review_result,</if>
             <if test="validityAfter != null">validity_after,</if>
             <if test="content != null">content,</if>
+            <if test="conPic != null">con_pic,</if>
+            <if test="conWater != null">con_water,</if>
+            <if test="conExhaust != null">con_exhaust,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -141,10 +151,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="allowance != null">#{allowance},</if>
             <if test="requirements != null">#{requirements},</if>
             <if test="reqPic != null">#{reqPic},</if>
+            <if test="reqWater != null">#{reqWater},</if>
+            <if test="reqExhaust != null">#{reqExhaust},</if>
             <if test="reviewer != null">#{reviewer},</if>
             <if test="reviewResult != null">#{reviewResult},</if>
             <if test="validityAfter != null">#{validityAfter},</if>
             <if test="content != null">#{content},</if>
+            <if test="conPic != null">#{conPic},</if>
+            <if test="conWater != null">#{conWater},</if>
+            <if test="conExhaust != null">#{conExhaust},</if>
         </trim>
     </insert>
 
@@ -175,10 +190,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="allowance != null">allowance = #{allowance},</if>
             <if test="requirements != null">requirements = #{requirements},</if>
             <if test="reqPic != null">req_pic = #{reqPic},</if>
+            <if test="reqWater != null">req_water = #{reqWater},</if>
+            <if test="reqExhaust != null">req_exhaust = #{reqExhaust},</if>
             <if test="reviewer != null">reviewer = #{reviewer},</if>
             <if test="reviewResult != null">review_result = #{reviewResult},</if>
             <if test="validityAfter != null">validity_after = #{validityAfter},</if>
             <if test="content != null">content = #{content},</if>
+            <if test="conPic != null">con_pic = #{conPic},</if>
+            <if test="conWater != null">con_water = #{conWater},</if>
+            <if test="conExhaust != null">con_exhaust = #{conExhaust},</if>
         </trim>
         where id = #{id}
     </update>

+ 164 - 36
ui/src/views/ehs/environapproval/index.vue

@@ -83,18 +83,44 @@
       <el-table-column :label="$t('证书有效期')" align="center" width="300" prop="validity" />
       <el-table-column :label="$t('是否需要跟进')" align="center" prop="follow" :formatter="followFormat"/>
       <el-table-column :label="$t('使用/储存/废物最大量')" align="center" prop="allowance" :show-overflow-tooltip="true"/>
-      <el-table-column :label="$t('排放/监控要求')" align="center" prop="requirementsUrl" :show-overflow-tooltip="true">
+      <el-table-column :label="$t('排放/监控要求')" align="center" width="300" :show-overflow-tooltip="true">
         <template slot-scope="scope">
           <span v-if="scope.row.reqPic === 'false'">{{ scope.row.requirements }}</span>
-          <el-image
-            style="width: 100px; height: 100px"
-            v-if="scope.row.reqPic === 'true'"
-            :src="scope.row.requirementsUrl"
-            :preview-src-list="scope.row.srcList">
+          <span v-if="scope.row.reqPic === 'true'">
+            废水
+            <el-image
+              style="width: 100px; height: 100px"
+              :src="scope.row.reqWater"
+              :preview-src-list="scope.row.srcWaterList">
+            </el-image>
+            废气
+            <el-image
+              style="width: 100px; height: 100px"
+              :src="scope.row.reqExhaust"
+              :preview-src-list="scope.row.srcExhaustList">
           </el-image>
+          </span>
+        </template>
+      </el-table-column>
+      <el-table-column :label="$t('主要内容')" align="center" width="300" prop="content">
+        <template slot-scope="scope">
+          <span v-if="scope.row.conPic === 'false'">{{ scope.row.content }}</span>
+          <span v-if="scope.row.conPic === 'true'">
+            废水
+            <el-image
+              style="width: 100px; height: 100px"
+              :src="scope.row.conWater"
+              :preview-src-list="scope.row.conWaterList">
+            </el-image>
+            废气
+            <el-image
+              style="width: 100px; height: 100px"
+              :src="scope.row.conExhaust"
+              :preview-src-list="scope.row.conExhaustList">
+          </el-image>
+          </span>
         </template>
       </el-table-column>
-      <el-table-column :label="$t('主要内容')" align="center" width="250" prop="content"/>
       <el-table-column :label="$t('负责人')" align="center" prop="owner" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('回顾人')" align="center" prop="reviewerName" :show-overflow-tooltip="true"/>
       <el-table-column :label="$t('本次回顾日期')" align="center" prop="reviewdate" width="100">
@@ -243,20 +269,64 @@
         </el-form-item>
         <el-form-item :label="$t('排放/监控要求')" prop="requirements">
           <el-input v-if="form.reqPic === false" v-model="form.requirements" :placeholder="$t('请输入') + $t('排放/监控要求')" />
-          <el-upload
-            ref="requirements"
-            :headers="requirements.headers"
-            :action="requirements.url + '?pType=' + requirements.pType + '&pId=' + requirements.pId"
-            v-if="form.reqPic === true"
-            :show-file-list="false"
-            :on-success="handleAvatarSuccess"
-            list-type="picture-card">
-            <img v-if="requirementsUrl" :src="requirementsUrl" class="avatar">
-            <i v-else class="el-icon-plus "></i>
-          </el-upload>
+          <span v-if="form.reqPic === true">
+            废水
+            <el-upload
+              ref="picture"
+              :headers="picture.headers"
+              :action="picture.url + '?pType=requirementsWaterPic&pId=' + picture.pId"
+              :show-file-list="false"
+              :on-success="handleWaterAvatarSuccess"
+              list-type="picture-card"
+              style="display: inline-block">
+              <img v-if="picWaterUrl" :src="picWaterUrl" class="avatar">
+              <i v-else class="el-icon-plus "></i>
+            </el-upload>
+            废气
+            <el-upload
+              ref="picture"
+              :headers="picture.headers"
+              :action="picture.url + '?pType=requirementsExhaustPic&pId=' + picture.pId"
+              :show-file-list="false"
+              :on-success="handleExhaustAvatarSuccess"
+              list-type="picture-card"
+              style="display: inline-block">
+              <img v-if="picExhaustUrl" :src="picExhaustUrl" class="avatar">
+              <i v-else class="el-icon-plus "></i>
+            </el-upload>
+          </span>
+        </el-form-item>
+        <el-form-item label="主要内容为图表" prop="conPic">
+          <el-checkbox v-model="form.conPic"></el-checkbox>
         </el-form-item>
         <el-form-item :label="$t('主要内容')" prop="content">
-          <el-input v-model="form.content" type="textarea" :placeholder="$t('请输入') + $t('主要内容')" />
+          <el-input v-if="form.conPic === false" v-model="form.content" type="textarea" :placeholder="$t('请输入') + $t('主要内容')" />
+          <span v-if="form.conPic === true">
+            废水
+            <el-upload
+              ref="picture"
+              :headers="picture.headers"
+              :action="picture.url + '?pType=contentWaterPic&pId=' + picture.pId"
+              :show-file-list="false"
+              :on-success="handleWaterConSuccess"
+              list-type="picture-card"
+              style="display: inline-block">
+              <img v-if="conWaterUrl" :src="conWaterUrl" class="avatar">
+              <i v-else class="el-icon-plus "></i>
+            </el-upload>
+            废气
+            <el-upload
+              ref="picture"
+              :headers="picture.headers"
+              :action="picture.url + '?pType=contentExhaustPic&pId=' + picture.pId"
+              :show-file-list="false"
+              :on-success="handleExhaustConSuccess"
+              list-type="picture-card"
+              style="display: inline-block">
+              <img v-if="conExhaustUrl" :src="conExhaustUrl" class="avatar">
+              <i v-else class="el-icon-plus "></i>
+            </el-upload>
+          </span>
         </el-form-item>
         <el-form-item :label="$t('负责人')" prop="owner">
           <el-input v-model="form.owner" :placeholder="$t('请选择') + $t('负责人')" />
@@ -534,7 +604,7 @@ export default {
         pageTotalNum: 1,
         loadedRatio: 0,
       },
-      requirements: {
+      picture: {
         file: "",
         // 报告附件上传位置编号
         ids: 0,
@@ -542,11 +612,14 @@ export default {
         headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
         url: process.env.VUE_APP_BASE_API + "/ehs/environapproval/uploadPic",
-        pType: 'requirementsPic',
+        pType: '',
         pId: null
       },
       //图片url
-      requirementsUrl: '',
+      picWaterUrl: '',
+      picExhaustUrl: '',
+      conWaterUrl: '',
+      conExhaustUrl: '',
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -601,9 +674,6 @@ export default {
         follow: [
           { required: true, message: this.$t('是否需要跟进') + this.$t('不能为空'), trigger: "change" }
         ],
-        requirements: [
-          { required: true, message: this.$t('排放/监控要求') + this.$t('不能为空'), trigger: "blur" }
-        ],
         reviewer: [
           { required: true, message: this.$t('回顾人') + this.$t('不能为空'), trigger: "blur" }
         ],
@@ -648,10 +718,30 @@ export default {
         this.environapprovalList = response.rows;
         this.environapprovalList.forEach(function (item) {
           if (item.reqPic === 'true') {
-            item.requirementsUrl = process.env.VUE_APP_BASE_API + item.requirements;
-            var srcList = [];
-            srcList.push(process.env.VUE_APP_BASE_API + item.requirements);
-            item.srcList = srcList;
+            if (item.reqWater) {
+              var srcWaterList = [];
+              srcWaterList.push(process.env.VUE_APP_BASE_API + item.reqWater);
+              item.srcWaterList = srcWaterList;
+              item.reqWater = process.env.VUE_APP_BASE_API + item.reqWater;
+            }
+            if (item.reqExhaust) {
+              var srcExhaustList = [];
+              srcExhaustList.push(process.env.VUE_APP_BASE_API + item.reqExhaust);
+              item.srcExhaustList = srcExhaustList;
+              item.reqExhaust = process.env.VUE_APP_BASE_API + item.reqExhaust;
+            }
+            if (item.conWater) {
+              var conWaterList = [];
+              conWaterList.push(process.env.VUE_APP_BASE_API + item.conWater);
+              item.conWaterList = conWaterList;
+              item.conWater = process.env.VUE_APP_BASE_API + item.conWater;
+            }
+            if (item.conExhaust) {
+              var conExhaustList = [];
+              conExhaustList.push(process.env.VUE_APP_BASE_API + item.conExhaust);
+              item.conExhaustList = conExhaustList;
+              item.conExhaust = process.env.VUE_APP_BASE_API + item.conExhaust;
+            }
           }
         })
         this.total = response.total;
@@ -688,7 +778,10 @@ export default {
     },
     // 表单重置
     reset() {
-       this.requirementsUrl = '';
+      this.picWaterUrl = '';
+      this.picExhaustUrl = '';
+      this.conWaterUrl = '';
+      this.conExhaustUrl = '';
       this.form = {
         id: null,
         plantCode: null,
@@ -719,7 +812,11 @@ export default {
         validityAfter: null,
         content: null,
         reqPic: null,
-        requirementsUrl: null
+        reqWater: null,
+        reqExhaust: null,
+        conPic: null,
+        conWater: null,
+        conExhaust: null
       };
       this.chooseDate = []
       this.resetForm("form");
@@ -778,10 +875,24 @@ export default {
         }else {
           this.form.reqPic = false
         }
-        if(response.data.requirements) {
-          this.requirementsUrl = process.env.VUE_APP_BASE_API + response.data.requirements;
+        if (this.form.conPic === 'true') {
+          this.form.conPic = true
+        }else {
+          this.form.conPic = false
+        }
+        if(response.data.reqWater) {
+          this.picWaterUrl = process.env.VUE_APP_BASE_API + response.data.reqWater;
+        }
+        if(response.data.reqExhaust) {
+          this.picExhaustUrl = process.env.VUE_APP_BASE_API + response.data.reqExhaust;
+        }
+        if(response.data.conWater) {
+          this.conWaterUrl = process.env.VUE_APP_BASE_API + response.data.conWater;
         }
-        this.requirements.pId = row.id;
+        if(response.data.conExhaust) {
+          this.conExhaustUrl = process.env.VUE_APP_BASE_API + response.data.conExhaust;
+        }
+        this.picture.pId = row.id;
         this.open = true;
         this.title = this.$t('修改') + this.$t('环保批文清单');
       });
@@ -946,8 +1057,20 @@ export default {
         this.msgError(this.$t('pdf加载失败'))
       })
     },
-    handleAvatarSuccess (res, file, fileList) {
-      this.requirementsUrl =  URL.createObjectURL(file.raw);
+    handleWaterAvatarSuccess (res, file, fileList) {
+      this.picWaterUrl =  URL.createObjectURL(file.raw);
+      this.$alert(res.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+    },
+    handleExhaustAvatarSuccess (res, file, fileList) {
+      this.picExhaustUrl =  URL.createObjectURL(file.raw);
+      this.$alert(res.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+    },
+    handleWaterConSuccess (res, file, fileList) {
+      this.conWaterUrl =  URL.createObjectURL(file.raw);
+      this.$alert(res.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
+    },
+    handleExhaustConSuccess (res, file, fileList) {
+      this.conExhaustUrl =  URL.createObjectURL(file.raw);
       this.$alert(res.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
     },
     // pdf上一页
@@ -970,4 +1093,9 @@ export default {
   .el-table .cell {
     white-space: pre-line;
   }
+
+  .avatar {
+    width: 120px;
+    height: 140px;
+  }
 </style>

+ 1 - 1
ui/src/views/system/config/index.vue

@@ -31,7 +31,7 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item :label="$t('')创建时间">
+      <el-form-item :label="$t('创建时间')">
         <el-date-picker
           v-model="dateRange"
           size="small"