소스 검색

定期会议 - 添加“涉及审计”筛选条件
定期会议 - 台账添加“涉及审计”列
定期会议 - 新增、修改功能“涉及审计”、“涉及章节”、“涉及CODE”联动代码修改

wangggziwen 8 달 전
부모
커밋
4cd5019586

+ 27 - 0
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TAuditController.java

@@ -335,6 +335,33 @@ public class TAuditController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询审计记录列表(全部)
+     */
+    @PreAuthorize("@ss.hasPermi('rc:audit:list')")
+    @GetMapping("/listAll")
+    public AjaxResult listAll(TAudit tAudit)
+    {
+        List<TAudit> list = tAuditService.selectTAuditList(tAudit);
+        for (TAudit obj : list) {
+            String deptId = obj.getDeptId();
+            if (StringUtils.isNotEmpty(deptId)) {
+                if (deptId.indexOf(",") != -1) {
+                    StringBuffer sb = new StringBuffer();
+                    String[] ids = deptId.split(",");
+                    for (String id : ids) {
+                        SysDept sysDept = deptService.selectDeptById(Long.parseLong(id));
+                        sb.append(sysDept.getDeptName()).append(" / ");
+                    }
+                    obj.setDeptName(sb.toString().substring(0, sb.length() - 3));
+                } else {
+                    obj.setDeptName(deptService.selectDeptById(Long.parseLong(deptId)).getDeptName());
+                }
+            }
+        }
+        return AjaxResult.success(list);
+    }
+
     /**
      * 导出审计记录列表
      */

+ 9 - 9
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TMeetingController.java

@@ -68,19 +68,19 @@ public class TMeetingController extends BaseController
     /**
      * 查询章节列表
      */
-    @GetMapping("/listChapter")
-    public AjaxResult listChapter() {
-        TAudit audit = new TAudit();
-        audit.setDeptId(getLoginUser().getDeptId().toString());
-        TAudit latest = tAuditService.selectTAuditLatest(audit);
-        if (latest != null) {
-            Long auditId = latest.getId();
+    @GetMapping("/listChapter/{auditId}")
+    public AjaxResult listChapter(@PathVariable("auditId") Long auditId) {
+//        TAudit audit = new TAudit();
+//        audit.setDeptId(getLoginUser().getDeptId().toString());
+//        TAudit latest = tAuditService.selectTAuditLatest(audit);
+//        if (latest != null) {
+//            Long auditId = latest.getId();
             TChapter chapter = new TChapter();
             chapter.setAuditId(auditId);
             List<TChapter> tChapters = tChapterService.selectTChapterList(chapter);
             return AjaxResult.success(tChapters);
-        }
-        return AjaxResult.success();
+//        }
+//        return AjaxResult.success();
     }
 
     /**

+ 38 - 0
rc-buisness/src/main/java/com/ruoyi/rc/domain/TMeeting.java

@@ -1,10 +1,13 @@
 package com.ruoyi.rc.domain;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseEntity;
 
+import java.util.Date;
+
 /**
  * 会议对象 t_meeting
  * 
@@ -22,6 +25,17 @@ public class TMeeting extends BaseEntity
     @Excel(name = "年份")
     private String year;
 
+    /** 涉及审计 */
+    @Excel(name = "涉及审计")
+    private Long auditId;
+
+    private String auditName;
+
+    /** 审计时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "审计时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date auditTime;
+
     /** 涉及code */
     @Excel(name = "涉及code")
     private Long questionnaireId;
@@ -63,6 +77,22 @@ public class TMeeting extends BaseEntity
     /** 开项问题处理状态 */
     private String openItemStatus;
 
+    public String getAuditName() {
+        return auditName;
+    }
+
+    public void setAuditName(String auditName) {
+        this.auditName = auditName;
+    }
+
+    public Date getAuditTime() {
+        return auditTime;
+    }
+
+    public void setAuditTime(Date auditTime) {
+        this.auditTime = auditTime;
+    }
+
     public String getOpenItemStatus() {
         return openItemStatus;
     }
@@ -172,6 +202,14 @@ public class TMeeting extends BaseEntity
         return deptId;
     }
 
+    public Long getAuditId() {
+        return auditId;
+    }
+
+    public void setAuditId(Long auditId) {
+        this.auditId = auditId;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 14 - 6
rc-buisness/src/main/resources/mapper/rc/TMeetingMapper.xml

@@ -14,28 +14,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="personInChargeName"    column="person_in_charge_name"    />
         <result property="chapName"    column="chap_name"    />
         <result property="openItemStatus"    column="open_item_status"    />
+        <result property="auditId"    column="audit_id"    />
+        <result property="auditTime"    column="audit_time"    />
     </resultMap>
 
     <sql id="selectTMeetingVo">
-        select m.id, m.year, m.questionnaire_id, m.person_in_charge, m.remarks, m.dept_id, m.open_item_status,
+        select m.id, m.year, m.questionnaire_id, m.person_in_charge, m.remarks, m.dept_id, m.open_item_status, m.audit_id,
         u.nick_name as person_in_charge_name,
         q.directory, q.code, q.name,
-        c.name as chap_name
+        c.name as chap_name,
+        a.audit_time
         from t_meeting m
         left join sys_user u on m.person_in_charge = u.user_id
         left join t_questionnaire q on q.id = m.questionnaire_id
         left join t_chapter c on c.id = q.chapter_id
         left join sys_dept d on d.dept_id = m.dept_id
+        left join t_audit a on a.id = m.audit_id
     </sql>
 
     <select id="selectTMeetingList" parameterType="TMeeting" resultMap="TMeetingResult">
         <include refid="selectTMeetingVo"/>
         <where>  
-            <if test="year != null  and year != ''"> and year = #{year}</if>
-            <if test="questionnaireId != null "> and questionnaire_id = #{questionnaireId}</if>
-            <if test="personInCharge != null "> and person_in_charge = #{personInCharge}</if>
-            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="year != null  and year != ''"> and m.year = #{year}</if>
+            <if test="questionnaireId != null "> and m.questionnaire_id = #{questionnaireId}</if>
+            <if test="personInCharge != null "> and m.person_in_charge = #{personInCharge}</if>
+            <if test="remarks != null  and remarks != ''"> and m.remarks = #{remarks}</if>
             <if test="deptId != null  and deptId != ''"> and m.dept_id = #{deptId}</if>
+            <if test="auditId != null  and auditId != ''"> and m.audit_id = #{auditId}</if>
             ${params.dataScope}
         </where>
     </select>
@@ -53,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="personInCharge != null">person_in_charge,</if>
             <if test="remarks != null">remarks,</if>
             <if test="deptId != null">dept_id,</if>
+            <if test="auditId != null">audit_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="year != null">#{year},</if>
@@ -60,6 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="personInCharge != null">#{personInCharge},</if>
             <if test="remarks != null">#{remarks},</if>
             <if test="deptId != null">#{deptId},</if>
+            <if test="auditId != null">#{auditId},</if>
          </trim>
     </insert>
 
@@ -72,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remarks != null">remarks = #{remarks},</if>
             <if test="deptId != null">dept_id = #{deptId},</if>
             <if test="openItemStatus != null">open_item_status = #{openItemStatus},</if>
+            <if test="auditId != null">audit_id = #{auditId},</if>
         </trim>
         where id = #{id}
     </update>

+ 9 - 0
ruoyi-ui/src/api/rc/audit.js

@@ -56,6 +56,15 @@ export function getCurrent() {
   })
 }
 
+// 查询审计记录列表(全部)
+export function listAllAudit(query) {
+  return request({
+    url: '/rc/audit/listAll',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询审计记录列表
 export function listAudit(query) {
   return request({

+ 2 - 2
ruoyi-ui/src/api/rc/meeting.js

@@ -1,9 +1,9 @@
 import request from '@/utils/request'
 
 // 查询章节列表
-export function listChapter() {
+export function listChapter(auditId) {
   return request({
-    url: '/rc/meeting/listChapter',
+    url: '/rc/meeting/listChapter/' + auditId,
     method: 'get'
   })
 }

+ 67 - 15
ruoyi-ui/src/views/rc/meeting/index.vue

@@ -1,6 +1,16 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
+      <el-form-item label="涉及审计" prop="auditId">
+        <el-select clearable v-model="queryParams.auditId" placeholder="请选择涉及审计" filterable>
+          <el-option
+            v-for="dict in auditOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="年份" prop="year">
         <el-date-picker clearable
                         v-model="queryParams.year"
@@ -9,14 +19,6 @@
                         placeholder="请选择年份">
         </el-date-picker>
       </el-form-item>
-      <!--<el-form-item label="涉及code" prop="questionnaireId">-->
-        <!--<el-input-->
-          <!--v-model="queryParams.questionnaireId"-->
-          <!--placeholder="请输入涉及code"-->
-          <!--clearable-->
-          <!--@keyup.enter.native="handleQuery"-->
-        <!--/>-->
-      <!--</el-form-item>-->
       <el-form-item label="负责人" prop="personInCharge">
         <el-select clearable v-model="queryParams.personInCharge" placeholder="请选择负责人"
                    @keyup.enter.native="handleQuery">
@@ -92,13 +94,20 @@
 
     <el-table border v-loading="loading" :data="meetingList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="涉及审计" align="center" prop="auditName" width="150">
+        <template slot-scope="scope">
+          <span>
+            {{scope.row.deptName}}<br/>
+            ({{ parseTime(scope.row.auditTime, '{yy}-{mm}-{dd}') }})
+          </span>
+        </template>
+      </el-table-column>
       <el-table-column label="装置" align="center" prop="deptName" width="120" />
       <el-table-column label="年份" align="center" prop="year" width="120">
         <template slot-scope="scope">
           <span>{{ parseTime(scope.row.year, '{y}') }}</span>
         </template>
       </el-table-column>
-      <!--<el-table-column label="涉及code" align="center" prop="questionnaireId" width="100" />-->
       <el-table-column label="章节" align="center" prop="chapName" width="250"/>
       <el-table-column label="目录" align="center" prop="directory" width="100" />
       <el-table-column label="涉及CODE" align="center" prop="code" width="100" />
@@ -169,9 +178,16 @@
                           placeholder="请选择年份">
           </el-date-picker>
         </el-form-item>
-        <!--<el-form-item label="涉及code" prop="questionnaireId">-->
-          <!--<el-input v-model="form.questionnaireId" placeholder="请输入涉及code" />-->
-        <!--</el-form-item>-->
+        <el-form-item label="涉及审计" prop="auditId" v-if="!form.id">
+          <el-select clearable v-model="form.auditId" placeholder="请选择涉及审计" filterable @change="handleAuditChange">
+            <el-option
+              v-for="dict in auditOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
+            ></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item label="涉及章节" prop="chapterId" v-if="!form.id">
           <el-select clearable v-model="form.chapterId" placeholder="请选择涉及章节" filterable @change="handleChapterChange">
             <el-option
@@ -374,6 +390,7 @@
 <script>
 import { listMeeting, getMeeting, delMeeting, addMeeting, updateMeeting, listChapter, listCode } from "@/api/rc/meeting";
 import { listDept } from "@/api/system/dept";
+import { listAllAudit } from "@/api/rc/audit";
 import { listAllUser } from "@/api/system/user";
 import { getToken } from "@/utils/auth";
 import { addCommonfile, allFileList, delCommonfile, updateCommonfile } from "@/api/rc/commonfile";
@@ -426,6 +443,8 @@ export default {
       deptOptions: [],
       // 用户列表
       userOptions: [],
+      // 审计列表
+      auditOptions: [],
       chapterOptions: [],
       questionnaireOptions: [],
       // 附件参数
@@ -454,13 +473,22 @@ export default {
         pId: null,
         form: {}
       },
+      // 表单校验
+      rules: {
+        chapterId: [{required: true, message: "涉及章节不可为空", trigger: "blur"}],
+        questionnaireId: [{required: true, message: "涉及CODE不可为空", trigger: "blur"}],
+        deptId: [{required: true, message: "装置不可为空", trigger: "blur"}],
+        auditId: [{required: true, message: "涉及审计不可为空", trigger: "blur"}],
+        year: [{required: true, message: "年份不可为空", trigger: "blur"}],
+      },
     };
   },
   created() {
     this.getList();
     this.getDeptList();
     this.getUserList();
-    this.getChapterList();
+    this.getAuditList();
+    // this.getChapterList();
   },
   methods: {
     /** 开项按钮操作 */
@@ -510,14 +538,25 @@ export default {
       };
       this.resetForm("openitemForm");
     },
+    handleAuditChange() {
+      this.chapterOptions = [];
+      this.form.chapterId = null;
+      this.form.questionnaireId = null;
+      listChapter(this.form.auditId).then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          this.chapterOptions.push({"dictLabel": data[i].code + " - " + data[i].name, "dictValue": data[i].id});
+        }
+      });
+    },
     handleChapterChange() {
+      this.questionnaireOptions = [];
+      this.form.questionnaireId = null;
       listCode(this.form.chapterId).then(response => {
         let data = response.data;
-        this.questionnaireOptions = [];
         for (let i = 0; i < data.length; i++) {
           this.questionnaireOptions.push({"dictLabel": data[i].directory + " - " + data[i].code, "dictValue": data[i].id});
         }
-        console.log(this.questionnaireOptions)
       });
     },
     /** 附件按钮操作 */
@@ -595,6 +634,18 @@ export default {
         }
       });
     },
+    /** 查询审计列表 */
+    getAuditList() {
+      listAllAudit().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          this.auditOptions.push({
+            "dictLabel": data[i].deptName + "(" + data[i].auditTime + ")",
+            "dictValue": data[i].id
+          });
+        }
+      });
+    },
     /** 查询会议列表 */
     getList() {
       this.loading = true;
@@ -606,6 +657,7 @@ export default {
     },
     /** 查询章节列表 */
     getChapterList() {
+      this.chapterOptions = [];
       listChapter().then(response => {
         let data = response.data;
         for (let i = 0; i < data.length; i++) {