Bläddra i källkod

徐明浩
压力容器年检报告-第三方数据-增加数据权限、删除功能
压力管道年检报告-第三方数据-增加数据权限、删除功能

徐明浩 3 år sedan
förälder
incheckning
a68bbdeb24

+ 1 - 1
master/src/main/java/com/ruoyi/project/sems/controller/TReportThirdController.java

@@ -80,7 +80,7 @@ public class TReportThirdController extends BaseController {
     /**
      * 删除压力容器第三方数据文件
      */
-    @PreAuthorize("@ss.hasPermi('third:tReportYlrqThird:remove')")
+    @PreAuthorize("@ss.hasPermi('sems:reportYlgd:remove')")
     @Log(title = "压力容器第三方数据文件", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

+ 23 - 0
master/src/main/java/com/ruoyi/project/sems/domain/TReportThird.java

@@ -45,6 +45,29 @@ public class TReportThird extends BaseEntity {
     @Excel(name = "文件路径")
     private String filePath;
 
+    /** 状态 1 :正常 ;0:删除 */
+    private Long delFlag;
+
+    /** 部门编号 */
+    //@Excel(name = "部门编号")
+    private Long deptId;
+
+    public Long getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Long delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
     public String getType() {
         return type;
     }

+ 2 - 2
master/src/main/java/com/ruoyi/project/sems/mapper/TReportThirdMapper.java

@@ -1,6 +1,6 @@
 package com.ruoyi.project.sems.mapper;
 
-import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScopePlant;
 import com.ruoyi.project.sems.domain.TReportThird;
 
 import java.util.List;
@@ -26,7 +26,7 @@ public interface TReportThirdMapper {
      * @param tReportYlrqThird 压力容器第三方数据文件
      * @return 压力容器第三方数据文件集合
      */
-    @DataScope(deptAlias = "d")
+    @DataScopePlant(deptAlias = "d")
     public List<TReportThird> selectTReportThirdList(TReportThird tReportYlrqThird);
 
     /**

+ 11 - 1
master/src/main/resources/mybatis/sems/TReportThirdMapper.xml

@@ -16,6 +16,8 @@
         <result property="updateTime" column="update_time"/>
         <result property="type" column="type"/>
         <result property="deptName" column="dept_name"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="deptId" column="dept_id"/>
     </resultMap>
 
     <sql id="selectTReportThirdVo">
@@ -28,6 +30,8 @@
                d.create_time,
                d.update_by,
                d.update_time,
+               d.del_flag,
+               d.dept_id,
                d.type
         from t_report_third d
     </sql>
@@ -36,14 +40,16 @@
         <include refid="selectTReportThirdVo"/>
         <where>
             <if test="type != null  and type != ''">and type = #{type}</if>
+            and del_flag = 0
         </where>
         <!-- 数据范围过滤 -->
-        /*${params.dataScope}*/
+        ${params.dataScopePlant}
     </select>
 
     <select id="selectTReportThirdById" parameterType="Long" resultMap="TReportThirdResult">
         <include refid="selectTReportThirdVo"/>
         where id = #{id}
+        and del_flag = 0
     </select>
 
     <insert id="insertTReportThird" parameterType="TReportThird">
@@ -62,6 +68,7 @@
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="type != null">type,</if>
+            <if test="deptId != null">dept_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -74,6 +81,7 @@
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="type != null">#{type},</if>
+            <if test="deptId != null">#{deptId},</if>
         </trim>
     </insert>
 
@@ -88,8 +96,10 @@
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
         </trim>
         where id = #{id}
+        and del_flag = 0
     </update>
 
     <update id="deleteTReportThirdById" parameterType="Long">

+ 8 - 0
ui/src/api/sems/tReportThird.js

@@ -8,3 +8,11 @@ export function listTReportThird(query) {
     params: query
   })
 }
+
+// 删除压力管道年检报告
+export function delReportThird(id) {
+  return request({
+    url: '/third/tReportThird/' + id,
+    method: 'delete'
+  })
+}

+ 3 - 1
ui/src/views/approve/pending/spec-detail.vue

@@ -145,6 +145,7 @@
             align="center"
             :label="$t('安全等级')">
           </el-table-column>
+          <el-table-column  :label="$t('容器管理')" header-align="center">
           <el-table-column
             prop="pj1"
             header-align="center"
@@ -222,6 +223,7 @@
               </el-tooltip>
             </template>
           </el-table-column>
+          </el-table-column>
           <el-table-column  :label="$t('容器本体及运行情况')" header-align="center">
             <el-table-column
               prop="pj8"
@@ -1274,7 +1276,7 @@
       </template>
       <template v-else>
         <el-form-item v-if="!this.taskForm.taskId == ''" :label="$t('审核意见')" prop="comment">
-          <el-input v-model="taskForm.comment" :placeholder="$t('enterOpinion')" maxlength="100" show-word-limit></el-input>
+          <el-input v-model="taskForm.comment" :placeholder="$t('审核意见')" maxlength="100" show-word-limit></el-input>
         </el-form-item>
       </template>
     </el-form>

+ 37 - 7
ui/src/views/sems/reportYlgd/index.vue

@@ -118,7 +118,8 @@
       </el-table-column>
       <el-table-column :label="$t('设计压力')+'(MPa)'" align="center" prop="desPressure" :show-overflow-tooltip="true">
         <template slot-scope="scope">
-          <el-input v-if="scope.row.isEdit" v-model="scope.row.desPressure" :placeholder="$t('请输入')+$t('设计压力')+'(MPa)'"/>
+          <el-input v-if="scope.row.isEdit" v-model="scope.row.desPressure"
+                    :placeholder="$t('请输入')+$t('设计压力')+'(MPa)'"/>
           <span v-else>{{ scope.row.desPressure }}</span>
         </template>
       </el-table-column>
@@ -130,7 +131,8 @@
       </el-table-column>
       <el-table-column :label="$t('操作压力')+'(MPa)'" align="center" prop="optPressure" :show-overflow-tooltip="true">
         <template slot-scope="scope">
-          <el-input v-if="scope.row.isEdit" v-model="scope.row.optPressure" :placeholder="$t('请输入')+$t('操作压力')+'(MPa)'"/>
+          <el-input v-if="scope.row.isEdit" v-model="scope.row.optPressure"
+                    :placeholder="$t('请输入')+$t('操作压力')+'(MPa)'"/>
           <span v-else>{{ scope.row.optPressure }}</span>
         </template>
       </el-table-column>
@@ -596,7 +598,8 @@
       </el-upload>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitFileForm"
-                   v-loading.fullscreen.lock="fullscreenLoading">确 定</el-button>
+                   v-loading.fullscreen.lock="fullscreenLoading">确 定
+        </el-button>
         <el-button @click="upload.open = false">取 消</el-button>
       </div>
       <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
@@ -644,12 +647,13 @@
       </el-upload>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="thirdSubmitFileForm"
-                   v-loading.fullscreen.lock="fullscreenLoading">确 定</el-button>
+                   v-loading.fullscreen.lock="fullscreenLoading">确 定
+        </el-button>
         <el-button @click="thirdUpload.open = false">取 消</el-button>
       </div>
     </el-dialog>
     <!-- 第三方数据列表对话框 -->
-    <el-dialog :title="thirdList.title" :visible.sync="thirdList.open" width="540px" append-to-body>
+    <el-dialog :title="thirdList.title" :visible.sync="thirdList.open" width="650px" append-to-body>
       <el-table
         :data="reportThirdList"
         style="width: 100%">
@@ -677,6 +681,18 @@
             </a>
           </template>
         </el-table-column>
+        <el-table-column :label="$t('操作')" align="center" fixed="right">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              v-hasPermi="['sems:reportYlgd:remove']"
+              @click="handleDeleteThird(scope.row)"
+            >{{ $t('删除') }}
+            </el-button>
+          </template>
+        </el-table-column>
       </el-table>
     </el-dialog>
   </div>
@@ -696,7 +712,7 @@ import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import YearApprove from './yearapprove'
-import {listTReportThird} from "@/api/sems/tReportThird";
+import {listTReportThird,delReportThird} from "@/api/sems/tReportThird";
 import {mylistPlant} from "@/api/system/plant";
 
 export default {
@@ -867,7 +883,7 @@ export default {
     this.getTreeselect();
     this.getDicts("spec_approve_status").then(response => {
       for (let i = 0; i < response.data.length; i++) {
-        if ( ["0","7","8"].includes(response.data[i].dictValue)){
+        if (["0", "7", "8"].includes(response.data[i].dictValue)) {
           this.approveStatusOptions.push(response.data[i])
         }
       }
@@ -1141,6 +1157,20 @@ export default {
         this.msgSuccess(this.$t('删除成功'));
       })
     },
+    /** 第三方文件删除按钮操作 */
+    handleDeleteThird(row) {
+      const ids = row.id;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function () {
+        return delReportThird(ids);
+      }).then(() => {
+        this.thirdPartyList();
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
     //提交报告
     approveHandle(row) {
       var rows = this.dataListSelections.map(item => {

+ 28 - 2
ui/src/views/sems/reportYlrq/index.vue

@@ -863,7 +863,7 @@
       </div>
     </el-dialog>
     <!-- 第三方数据列表对话框 -->
-    <el-dialog :title="thirdList.title" :visible.sync="thirdList.open" width="540px" append-to-body>
+    <el-dialog :title="thirdList.title" :visible.sync="thirdList.open" width="650px" append-to-body>
       <el-table
         :data="reportYlrqThirdList"
         style="width: 100%">
@@ -891,6 +891,18 @@
             </a>
           </template>
         </el-table-column>
+        <el-table-column :label="$t('操作')" align="center" fixed="right">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              v-hasPermi="['sems:reportYlgd:remove']"
+              @click="handleDeleteThird(scope.row)"
+            >{{ $t('删除') }}
+            </el-button>
+          </template>
+        </el-table-column>
       </el-table>
     </el-dialog>
     <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
@@ -914,7 +926,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import YearApprove from './yearapprove'
 import {getToken} from "@/utils/auth";
 import {mylistPlant} from "@/api/system/plant";
-import {listTReportThird} from "@/api/sems/tReportThird";
+import {listTReportThird,delReportThird} from "@/api/sems/tReportThird";
 
 export default {
   name: "ReportYlrq",
@@ -1513,6 +1525,20 @@ export default {
         this.msgSuccess(this.$t('删除成功'));
       })
     },
+    /** 第三方文件删除按钮操作 */
+    handleDeleteThird(row) {
+      const ids = row.id;
+      this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
+        confirmButtonText: this.$t('确定'),
+        cancelButtonText: this.$t('取消'),
+        type: "warning"
+      }).then(function () {
+        return delReportThird(ids);
+      }).then(() => {
+        this.thirdPartyList();
+        this.msgSuccess(this.$t('删除成功'));
+      })
+    },
     //提交报告
     approveHandle(row) {
       var rows = this.dataListSelections.map(item => {