Pārlūkot izejas kodu

普通员工首页:点击审计CODE完成率,跳转问卷详情列表,显示所选CODE“已完成”的数据

wangggziwen 8 mēneši atpakaļ
vecāks
revīzija
46c4b9e1c4

+ 11 - 0
rc-admin/src/main/java/com/ruoyi/web/controller/rc/TQuestionnaireController.java

@@ -176,6 +176,17 @@ public class TQuestionnaireController extends BaseController
         return AjaxResult.success();
     }
 
+    /**
+     * 查询问卷列表
+     */
+    @GetMapping("/listByDirectory")
+    public TableDataInfo listByDirectory(TQuestionnaire tQuestionnaire)
+    {
+        startPage();
+        List<TQuestionnaire> list = tQuestionnaireService.selectTQuestionnaireListByDirectory(tQuestionnaire);
+        return getDataTable(list);
+    }
+
     /**
      * 查询问卷列表
      */

+ 2 - 0
rc-buisness/src/main/java/com/ruoyi/rc/mapper/TQuestionnaireMapper.java

@@ -27,6 +27,8 @@ public interface TQuestionnaireMapper
      */
     public List<TQuestionnaire> selectTQuestionnaireList(TQuestionnaire tQuestionnaire);
 
+    public List<TQuestionnaire> selectTQuestionnaireListByDirectory(TQuestionnaire tQuestionnaire);
+
     /**
      * 新增问卷
      * 

+ 2 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/ITQuestionnaireService.java

@@ -27,6 +27,8 @@ public interface ITQuestionnaireService
      */
     public List<TQuestionnaire> selectTQuestionnaireList(TQuestionnaire tQuestionnaire);
 
+    public List<TQuestionnaire> selectTQuestionnaireListByDirectory(TQuestionnaire tQuestionnaire);
+
     /**
      * 新增问卷
      * 

+ 6 - 0
rc-buisness/src/main/java/com/ruoyi/rc/service/impl/TQuestionnaireServiceImpl.java

@@ -43,6 +43,12 @@ public class TQuestionnaireServiceImpl implements ITQuestionnaireService
         return tQuestionnaireMapper.selectTQuestionnaireList(tQuestionnaire);
     }
 
+    @Override
+    public List<TQuestionnaire> selectTQuestionnaireListByDirectory(TQuestionnaire tQuestionnaire)
+    {
+        return tQuestionnaireMapper.selectTQuestionnaireListByDirectory(tQuestionnaire);
+    }
+
     /**
      * 新增问卷
      * 

+ 23 - 0
rc-buisness/src/main/resources/mapper/rc/TQuestionnaireMapper.xml

@@ -39,6 +39,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join t_open_item o on o.questionnaire_id = q.id
     </sql>
 
+    <select id="selectTQuestionnaireListByDirectory" parameterType="TQuestionnaire" resultMap="TQuestionnaireResult">
+        <include refid="selectTQuestionnaireVo"/>
+        <where>
+            <if test="auditId != null "> and audit_id = #{auditId}</if>
+            <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
+            <if test="year != null  and year != ''"> and year = #{year}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="directory != null  and directory != ''"> and directory like concat(#{directory}, '%')</if>
+            <if test="code != null "> and code = #{code}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="yesNoNa != null  and yesNoNa != ''"> and yes_no_na = #{yesNoNa}</if>
+            <if test="minimumStandard != null  and minimumStandard != ''"> and minimum_standard = #{minimumStandard}</if>
+            <if test="goodPractices != null  and goodPractices != ''"> and good_practices = #{goodPractices}</if>
+            <if test="standard != null  and standard != ''"> and standard = #{standard}</if>
+            <if test="completionStatus != null  and completionStatus != ''"> and completion_status = #{completionStatus}</if>
+            <if test="personInCharge != null "> and person_in_charge = #{personInCharge}</if>
+            <if test="reviewer != null "> and reviewer = #{reviewer}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
+        </where>
+        order by (SUBSTR(q.directory, 1, INSTR(q.directory, '.') - 1) + 0) asc
+    </select>
+
     <select id="selectTQuestionnaireList" parameterType="TQuestionnaire" resultMap="TQuestionnaireResult">
         <include refid="selectTQuestionnaireVo"/>
         <where>  

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

@@ -18,6 +18,15 @@ export function applyQuestionnaire(data) {
   })
 }
 
+// 查询问卷列表
+export function listQuestionnaireByDirectory(query) {
+  return request({
+    url: '/rc/questionnaire/listByDirectory',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询问卷列表
 export function listQuestionnaire(query) {
   return request({

+ 13 - 0
ruoyi-ui/src/router/index.js

@@ -166,6 +166,19 @@ export const constantRoutes = [
       }
     ]
   },
+  {
+    path: '/rc',
+    component: Layout,
+    hidden: true,
+    children: [
+      {
+        path: 'home-questionnaire',
+        component: (resolve) => require(['@/views/rc/home-questionnaire/index'], resolve),
+        name: 'HomeQuestionnaire',
+        meta: { title: '已完成CODE列表' }
+      }
+    ]
+  },
 ]
 
 // 动态路由,基于用户权限动态去加载

+ 7 - 6
ruoyi-ui/src/views/home2.vue

@@ -168,12 +168,13 @@ export default {
             case 8: code = 9; break;//CODE 9
             case 9: code = 10; break;//CODE 10
           }
-          // _this.$router.push({
-          //   path: "/rc/auditinfo",
-          //   query: {
-          //     auditId: data.auditId
-          //   }
-          // });
+          _this.$router.push({
+            path: "/rc/home-questionnaire",
+            query: {
+              auditId: data.auditId,
+              code: code
+            }
+          });
         });
       });
     },

+ 461 - 0
ruoyi-ui/src/views/rc/home-questionnaire/index.vue

@@ -0,0 +1,461 @@
+<template>
+  <div class="app-container" style="padding: 0px;">
+    <el-table :height="clientHeight" border v-loading="loading" :data="questionnaireList" @selection-change="handleSelectionChange" style="font-size: 12px;">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="年份" align="center" prop="year">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.year, '{y}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="问卷类型" align="center" prop="type">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.t_sec_sub_chap_type" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="目录" align="center" prop="directory" width="200" />
+      <el-table-column label="序号" align="center" prop="code" />
+      <el-table-column label="名称" align="center" prop="name" width="350" />
+      <el-table-column label="YES" align="center" prop="yesNoNa">
+        <template slot-scope="scope">
+          <span>{{scope.row.yesNoNa == 1 ? "√" : ""}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="NO" align="center" prop="yesNoNa">
+        <template slot-scope="scope">
+          <span>{{scope.row.yesNoNa == 2 ? "√" : ""}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="NA" align="center" prop="yesNoNa">
+        <template slot-scope="scope">
+          <span>{{scope.row.yesNoNa == 3 ? "√" : ""}}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="MinimumStandard" align="center" prop="minimumStandard" width="150" />
+      <el-table-column label="Good Practices" align="center" prop="goodPractices" width="150" />
+      <el-table-column label="标准" align="center" prop="standard" width="150" />
+      <!--<el-table-column label="标准" align="center" prop="standard">-->
+        <!--<template slot-scope="scope">-->
+          <!--<dict-tag :options="dict.type.t_sec_sub_chap_standard" :value="scope.row.standard"/>-->
+        <!--</template>-->
+      <!--</el-table-column>-->
+      <el-table-column label="负责人" align="center" prop="personInChargeName" />
+      <el-table-column label="审核人" align="center" prop="reviewerName" />
+      <el-table-column label="备注" align="center" prop="remarks" width="150" />
+      <el-table-column label="完成情况" align="center" prop="completionStatus" fixed="right">
+        <template slot-scope="scope">
+          <dict-tag :options="dict.type.t_sec_sub_chap_completion_status" :value="scope.row.completionStatus"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="标准附件" align="center" width="100" fixed="right">
+        <template slot-scope="scope">
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" circle @click="handleDoc(scope.row , 'questionnaire-standard')"></el-button>
+        </template>
+      </el-table-column>
+      <el-table-column label="审计文档" align="center" width="100" fixed="right">
+        <template slot-scope="scope">
+          <el-button icon="el-icon-folder" style="color:#6e96fa;" circle @click="handleDoc(scope.row , 'audit')"></el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList()"
+    />
+
+    <!-- 附件对话框 -->
+    <el-dialog  :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="800px" append-to-body >
+      <el-upload ref="doc"
+                 :limit="50"
+                 :headers="doc.headers"
+                 :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
+                 :disabled="doc.isUploading"
+                 :on-progress="handleFileDocProgress"
+                 :on-success="handleFileDocSuccess"
+                 :auto-upload="true"
+                 drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">
+          将文件拖到此处,或
+          <em>点击上传</em>
+        </div>
+      </el-upload>
+      <el-table :data="doc.commonfileList" border>
+        <el-table-column label="文件名" align="center" prop="fileName" :show-overflow-tooltip="true">
+          <template slot-scope="scope">
+            <a  class="link-type"  @click="handleDownload(scope.row)">
+              <span>{{ scope.row.fileName }}</span>
+            </a>
+          </template>
+        </el-table-column>
+        <el-table-column label="大小(Kb)" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
+        <el-table-column label="上传人" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
+        <el-table-column label="操作" align="center" width="220" class-name="small-padding fixed-width">
+          <template slot-scope="scope">
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-download"
+              @click="handleDownload(scope.row)"
+            >下载</el-button>
+            <el-button
+              size="mini"
+              type="text"
+              icon="el-icon-delete"
+              @click="handleDeleteDoc(scope.row)"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import { listQuestionnaireByDirectory, getQuestionnaire, delQuestionnaire, addQuestionnaire, updateQuestionnaire } from "@/api/rc/questionnaire";
+import { listDept } from "@/api/system/dept";
+import { listAllUser } from "@/api/system/user";
+import { getToken } from "@/utils/auth";
+import { addCommonfile, allFileList, delCommonfile, updateCommonfile } from "@/api/rc/commonfile";
+import { listOpenitem, getOpenitem, delOpenitem, addOpenitem, updateOpenitem } from "@/api/rc/openitem";
+
+export default {
+  name: "Questionnaire",
+  dicts: ['t_open_item_result', 't_open_item_type', 't_open_item_level', 't_open_item_status','t_sec_sub_chap_completion_status', 't_sec_sub_chap_yes_no_na', 't_sec_sub_chap_type', 't_sec_sub_chap_standard'],
+  data() {
+    return {
+      clientHeight:300,
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 问卷表格数据
+      questionnaireList: [],
+      // 弹出层标题
+      title: "",
+      openitemTitle: "",
+      // 是否显示弹出层
+      open: false,
+      openitemOpen: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        auditId: null,
+        chapterId: null,
+        year: null,
+        type: null,
+        directory: null,
+        code: null,
+        name: null,
+        yesNoNa: null,
+        minimumStandard: null,
+        goodPractices: null,
+        standard: null,
+        completionStatus: null,
+        personInCharge: null,
+        reviewer: null,
+        remarks: null,
+        deptId: null
+      },
+      // 表单参数
+      form: {},
+      openitemForm: {},
+      // 表单校验
+      rules: {
+      },
+      openitemRules: {
+      },
+      // 用户列表
+      userOptions: [],
+      // 附件参数
+      doc: {
+        file: "",
+        // 是否显示弹出层(报告附件)
+        open: false,
+        // 弹出层标题(报告附件)
+        title: "附件",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 报告附件上传位置编号
+        ids: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/rc/commonfile/uploadFile",
+        commonfileList: null,
+        queryParams: {
+          pId: null,
+          pType: ''
+        },
+        pType: '',
+        pId: null,
+        form: {}
+      },
+    };
+  },
+  created() {
+    //设置表格高度对应屏幕高度
+    this.$nextTick(() => {
+      this.clientHeight = (document.body.clientHeight - 80) * 0.8
+    })
+    this.getList();
+    this.getUserList();
+  },
+  methods: {
+    /** 开项按钮操作 */
+    handleOpenitem(row) {
+      this.resetOpenitem();
+      this.openitemOpen = true;
+      this.openitemTitle = "添加开项";
+      this.openitemForm.deptId = row.deptId;
+      this.openitemForm.auditId = row.auditId;
+      this.openitemForm.questionnaireId = row.id;
+      this.openitemForm.code = row.code;
+    },
+    /** 开项提交按钮 */
+    submitOpenitemForm() {
+      this.$refs["openitemForm"].validate(valid => {
+        if (valid) {
+          addOpenitem(this.openitemForm).then(response => {
+            this.$modal.msgSuccess("新增开项成功");
+            this.openitemOpen = false;
+          });
+        }
+      });
+    },
+    // 取消按钮
+    cancelOpenitem() {
+      this.openitemOpen = false;
+      this.resetOpenitem();
+    },
+    // 开项表单重置
+    resetOpenitem() {
+      this.openitemForm = {
+        id: null,
+        type: null,
+        questionnaireId: null,
+        description: null,
+        level: null,
+        openTime: null,
+        closeTime: null,
+        status: null,
+        personInCharge: null,
+        reviewer: null,
+        result: null,
+        deadline: null,
+        remarks: null,
+        deptId: null
+      };
+      this.resetForm("openitemForm");
+    },
+    /** 附件按钮操作 */
+    handleDoc(row , type) {
+      var typeName = "";
+      if (type === "questionnaire-standard"){
+        typeName = "标准附件";
+        this.doc.pType = type
+        this.doc.queryParams.pType = type
+        this.doc.id = row.id;
+        this.doc.title = "标准附件(CODE " + row.code + ")";
+        this.doc.open = true;
+        this.doc.queryParams.pId = row.id
+        this.doc.pId = row.id
+        this.getFileList();
+      } else if (type === 'audit') {
+        this.$router.push({path: '/rc/file', query: {linkId: row.id, linkName: 'questionnaire'}})
+      }
+    },
+    getFileList(){
+      allFileList(this.doc.queryParams).then(response => {
+        this.doc.commonfileList = response;
+      });
+    },
+    //附件上传中处理
+    handleFileDocProgress(event, file, fileList) {
+      this.doc.file = file;
+      this.doc.isUploading = true;
+    },
+    //附件上传成功处理
+    handleFileDocSuccess(response, file, fileList) {
+      this.doc.isUploading = false;
+      this.$alert(response.msg, '导入结果', { dangerouslyUseHTMLString: true });
+      this.getFileList()
+    },
+    // 文件下载处理
+    handleDownload(row) {
+      var name = row.fileName;
+      var url = row.fileUrl;
+      var suffix = url.substring(url.lastIndexOf("."), url.length);
+      const a = document.createElement('a')
+      a.setAttribute('download', name)
+      a.setAttribute('target', '_blank')
+      a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
+      a.click()
+    },
+    /** 删除按钮操作 */
+    handleDeleteDoc(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除?', '警告', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: "warning"
+      }).then(function() {
+        return delCommonfile(ids);
+      }).then(() => {
+        this.getFileList()
+        this.$message({
+          message: '删除成功',
+          type: 'success'
+        });
+      })
+    },
+    /** 查询用户列表 */
+    getUserList() {
+      listAllUser().then(response => {
+        let data = response.data;
+        for (let i = 0; i < data.length; i++) {
+          // 非顶级节点
+          if (data[i].parentId !== 0) {
+            // 插入用户列表
+            this.userOptions.push({"dictLabel": data[i].nickName, "dictValue": data[i].userId});
+          }
+        }
+      });
+    },
+    /** 编辑左侧章节 */
+    handleEditChapter() {
+      this.$router.push({
+        path: "/rc/editchapter",
+        query: {
+          auditId: this.queryParams.auditId
+        }
+      });
+    },
+    /** 查询问卷列表 */
+    getList() {
+      this.loading = true;
+      this.queryParams.directory = this.$route.query.code + ".";
+      this.queryParams.auditId = this.$route.query.auditId;
+      this.queryParams.completionStatus = "1";
+      listQuestionnaireByDirectory(this.queryParams).then(response => {
+        this.questionnaireList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        chapterId: null,
+        year: null,
+        type: null,
+        directory: null,
+        code: null,
+        name: null,
+        yesNoNa: null,
+        minimumStandard: null,
+        goodPractices: null,
+        standard: null,
+        completionStatus: null,
+        personInCharge: null,
+        reviewer: null,
+        remarks: null,
+        deptId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.form.chapterId = this.queryParams.chapterId;
+      this.form.auditId = this.queryParams.auditId;
+      this.open = true;
+      this.title = "添加问卷";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getQuestionnaire(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改问卷";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateQuestionnaire(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addQuestionnaire(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除问卷编号为"' + ids + '"的数据项?').then(function() {
+        return delQuestionnaire(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('rc/questionnaire/export', {
+        ...this.queryParams
+      }, `questionnaire_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>

+ 0 - 1
ruoyi-ui/src/views/rc/questionnaire/index.vue

@@ -738,7 +738,6 @@ export default {
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      console.log(row)
       this.reset();
       const id = row.id || this.ids
       getQuestionnaire(id).then(response => {