Преглед на файлове

隐患问题需求变更

jiawuxian преди 2 години
родител
ревизия
57a69a676f

+ 0 - 10
src/api/question/list.js

@@ -37,13 +37,3 @@ export function confirmDissent(data) {
     showLoading: true,
   });
 }
-
-// 整改
-export function reform(data) {
-  return request({
-    url: "/core/question/reform/" + data.id,
-    method: "put",
-    data,
-    showLoading: true,
-  });
-}

+ 29 - 0
src/api/question/reform.js

@@ -0,0 +1,29 @@
+import request from "@/utils/request";
+
+// 查询列表隐患问题清单
+export function page(query) {
+  return request({
+    url: "/core/questionreform/page",
+    method: "get",
+    params: query,
+  });
+}
+
+// 查询详细隐患问题清单
+export function get(id) {
+  return request({
+    url: "/core/questionreform/info/" + id,
+    method: "get",
+  });
+}
+
+
+// 整改
+export function reform(data) {
+  return request({
+    url: "/core/questionreform/reform/" + data.id,
+    method: "put",
+    data,
+    showLoading: true,
+  });
+}

+ 7 - 38
src/views/question/list/dialog.vue

@@ -2,16 +2,16 @@
   <DialogCom :title="title" :visible.sync="open" width="800px" append-to-body @close="cancel">
     <div class="question-dialog-body">
       <el-descriptions :column="2" class="contentArea">
-      <el-descriptions-item label="隐患所属机构">{{
+      <el-descriptions-item label="机构名称">{{
         data.orgName
       }}</el-descriptions-item>
-      <el-descriptions-item label="来源任务">{{
+      <el-descriptions-item label="隐患来源">{{
         data.srcTaskName
       }}</el-descriptions-item>
-      <el-descriptions-item label="检查项">{{
+      <el-descriptions-item label="标准项">{{
         data.checkItem
       }}</el-descriptions-item>
-      <el-descriptions-item label="检查内容">
+      <el-descriptions-item label="标准依据">
         {{ data.checkContent }}
       </el-descriptions-item>
       <el-descriptions-item label="隐患描述">
@@ -20,8 +20,8 @@
       <el-descriptions-item label="提出人">
         {{ data.submitorName }}</el-descriptions-item
       >
-      <el-descriptions-item label="发现日期">
-        {{ dayjs(data.submitTime).format("YYYY-MM-DD") }}</el-descriptions-item
+      <el-descriptions-item label="发现时间">
+        {{ dayjs(data.submitTime).format("YYYY-MM-DD HH:mm:ss") }}</el-descriptions-item
       >
       <el-descriptions-item label="整改期限">
         {{
@@ -137,38 +137,7 @@
         ></el-input>
       </el-form-item>
     </el-form>
-    <el-form
-      ref="reformForm"
-      :model="reformData"
-      label-width="100px"
-      class="form"
-      v-if="type == 'reform'"
-      :rules="reformRule"
-    >
-      <el-form-item label="整改时间" prop="reformDate">
-        <el-date-picker
-          v-model="reformData.reformDate"
-          type="date"
-          placeholder="选择日期"
-          :pickerOptions="pickerOptions"
-        >
-        </el-date-picker>
-      </el-form-item>
-      <el-form-item label="整改描述" prop="description">
-        <el-input
-          v-model="reformData.description"
-          maxlength="255"
-          placeHolder="请输入整改描述"
-        ></el-input>
-      </el-form-item>
-      <el-form-item label="整改图片" prop="images">
-        <imgUpload
-          type="more"
-          :value="reformData.images"
-          @input="imageListChanged"
-        ></imgUpload>
-      </el-form-item>
-    </el-form>
+    
 
     </div>
     <div slot="footer" class="dialog-footer">

+ 10 - 8
src/views/question/list/index.vue

@@ -4,7 +4,7 @@
       <el-col :span="4" :xs="24">
         <org-tree
           v-model="queryParams.orgId"
-          @defaultKey="getDefaultKey"
+          @defaultOrg="getDefaultOrg"
           @checkChange="checkChange"
           @click="clickTreeNode"
           :businessTree="true"
@@ -104,7 +104,7 @@
         <el-table
           v-loading="loading"
           :data="questionList"
-          
+
         >
           <el-table-column
             type="index"
@@ -124,7 +124,7 @@
           />
           <el-table-column
             label="检查标准"
-            prop="checkContent"
+            prop="checkItem"
             v-if="columns[3].visible"
           />
           <el-table-column
@@ -241,7 +241,7 @@ export default {
       total: 0,
       // 隐患问题清单表格数据
       questionList: [],
-
+      selectedOrgName:null,
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -314,11 +314,11 @@ export default {
     /** 导出按钮操作 */
     handleExport() {
       this.download(
-        "system/question/export",
+        "core/question/export",
         {
           ...this.queryParams,
         },
-        `question_${new Date().getTime()}.xlsx`
+        `【隐患问题清单】_${this.selectedOrgName}_${dayjs().format("YYYYMMDD")}.xlsx`
       );
     },
     //单选框状态改变
@@ -326,13 +326,15 @@ export default {
       this.queryParams.checkSub = state;
       this.getList();
     },
-    getDefaultKey(key) {
-      this.queryParams.orgId = key;
+    getDefaultOrg(org) {
+      this.queryParams.orgId = org.id;
+      this.selectedOrgName=org.shortName;
       this.getList();
     },
     // 节点单击事件
     clickTreeNode(data) {
       this.queryParams.orgId = data.id;
+      this.selectedOrgName=data.shortName;
       this.getList();
     },
   },

+ 354 - 0
src/views/question/reform/dialog.vue

@@ -0,0 +1,354 @@
+<template>
+  <DialogCom :title="title" :visible.sync="open" width="800px" append-to-body @close="cancel">
+    <div class="question-dialog-body">
+      <el-descriptions :column="2" class="contentArea">
+      <el-descriptions-item label="机构名称">{{
+        data.orgName
+      }}</el-descriptions-item>
+      <el-descriptions-item label="隐患来源">{{
+        data.srcTaskName
+      }}</el-descriptions-item>
+      <el-descriptions-item label="标准项">{{
+        data.checkItem
+      }}</el-descriptions-item>
+      <el-descriptions-item label="标准依据">
+        {{ data.checkContent }}
+      </el-descriptions-item>
+      <el-descriptions-item label="隐患描述">
+        {{ data.questionDesc }}</el-descriptions-item
+      >
+      <el-descriptions-item label="提出人">
+        {{ data.submitorName }}</el-descriptions-item
+      >
+      <el-descriptions-item label="发现时间">
+        {{ dayjs(data.submitTime).format("YYYY-MM-DD HH:mm:ss") }}</el-descriptions-item
+      >
+      <el-descriptions-item label="整改期限">
+        {{
+          dayjs(data.reformDeadline).format("YYYY-MM-DD")
+        }}</el-descriptions-item
+      >
+      <el-descriptions-item label="隐患图片">
+        <div class="imageList">
+          <el-image
+            style="width: 100px"
+            v-for="url in data.images"
+            :src="url"
+            :preview-src-list="data.images"
+          >
+          </el-image></div
+      ></el-descriptions-item>
+    </el-descriptions>
+    <el-descriptions :column="2" class="contentArea" v-if="data.confirm">
+      <el-descriptions-item label="确认结果">{{
+        data.confirm.executeStatus == 0 ? "确认" : "提出异议"
+      }}</el-descriptions-item>
+      <el-descriptions-item label="确认人">{{
+        data.confirm.executorName
+      }}</el-descriptions-item>
+      <el-descriptions-item label="异议内容" :span="2" v-if="data.confirm.executeStatus==1">{{
+        data.confirm.description
+      }}</el-descriptions-item>
+    </el-descriptions>
+
+    <el-descriptions :column="2" class="contentArea" v-if="data.confirmDissent">
+      <el-descriptions-item label="审核结果">{{
+        data.confirmDissent.executeStatus == 0 ? "同意" : "不同意"
+      }}</el-descriptions-item>
+      <el-descriptions-item label="审核人">{{
+        data.confirmDissent.executorName
+      }}</el-descriptions-item>
+      <el-descriptions-item label="描述" :span="2" v-if="data.confirmDissent.executeStatus==1">{{
+        data.confirmDissent.description
+      }}</el-descriptions-item>
+    </el-descriptions>
+
+    <el-descriptions :column="2" class="contentArea" v-if="data.reform">
+      <el-descriptions-item label="整改时间">{{
+        dayjs(data.reform.executeTime).format("YYYY-MM-DD")
+      }}</el-descriptions-item>
+      <el-descriptions-item label="整改状态">{{
+        data.reform.executeStatus == 0 ? "已整改" : "未整改"
+      }}</el-descriptions-item>
+      <el-descriptions-item label="描述" :span="2">{{
+        data.reform.description
+      }}</el-descriptions-item>
+      <el-descriptions-item label="整改图片" :span="2">
+        <div class="imageList">
+          <el-image
+            style="width: 100px; height: 100px"
+            v-for="url in data.reform.images"
+            :src="url"
+            :preview-src-list="data.reform.images"
+          >
+          </el-image></div
+      ></el-descriptions-item>
+    </el-descriptions>
+    <el-form
+      ref="reformForm"
+      :model="reformData"
+      label-width="100px"
+      class="form"
+      v-if="type == 'reform'"
+      :rules="reformRule"
+    >
+      <el-form-item label="整改时间" prop="reformDate">
+        <el-date-picker
+          v-model="reformData.reformDate"
+          type="date"
+          placeholder="选择日期"
+          :pickerOptions="pickerOptions"
+        >
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="整改描述" prop="description">
+        <el-input
+          v-model="reformData.description"
+          maxlength="255"
+          placeHolder="请输入整改描述"
+        ></el-input>
+      </el-form-item>
+      <el-form-item label="整改图片" prop="images">
+        <imgUpload
+          type="more"
+          :value="reformData.images"
+          @input="imageListChanged"
+        ></imgUpload>
+      </el-form-item>
+    </el-form>
+
+    </div>
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" @click="submitForm" v-if="type!='detail'">确 定</el-button>
+      <el-button @click="cancel">取 消</el-button>
+    </div>
+ </DialogCom>
+</template>
+<script>
+import {
+  get,
+  reform,
+} from "@/api/question/reform.js";
+import dayjs from "dayjs";
+import imgUpload from "@/components/ImageUpload/index.vue";
+export default {
+  data() {
+    return {
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {},
+      row: null,
+      type: null,
+      data: {},
+      confirmData: {
+        id: null,
+        status: 0,
+        description: null,
+      },
+      confirmDissentData: {
+        id: null,
+        status: 0,
+        description: null,
+      },
+      reformData: {
+        id: null,
+        reformDate: null,
+        description: null,
+        images: null,
+      },
+      confirmRule: {
+        description: [
+          { required: true, message: "请输入异议内容", trigger: "blur" },
+        ],
+      },
+
+      confirmDissentRule: {
+        description: [
+          { required: true, message: "请输入原因", trigger: "blur" },
+        ],
+      },
+      reformRule: {
+        reformDate: [
+          { required: true, message: "请选择整改日期", trigger: "blur" },
+        ],
+      },
+      pickerOptions: {
+        disabledDate(time) {
+          return time.getTime() > Date.now();
+        },
+      },
+    };
+  },
+  components: { imgUpload },
+  methods: {
+    dayjs,
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    show(row, type) {
+      this.row = row;
+      this.type = type;
+      this.setTitle(type);
+      get(row.id).then((r) => {
+        this.data = r.data;
+        this.data.confirmDissent = r.data.flows.find((d) => d.executeStep == 2);
+        this.data.confirm = r.data.flows.find((d) => d.executeStep == 1);
+        this.data.reform = r.data.flows.find((d) => d.executeStep == 11);
+        if(this.data.reform && this.data.reform.images)     {
+          this.data.reform.images=this.data.reform.images.split(",")
+        }
+        this.open = true;
+      });
+    },
+    setTitle(type) {
+      switch (type) {
+        case "detail":
+          this.title = "详情";
+          break;
+        case "confirm":
+          this.title = "隐患确认";
+          break;
+        case "confirmDissent":
+          this.title = "异议审批";
+          break;
+        case "reform":
+          this.title = "隐患整改";
+          break;
+      }
+    },
+    // 表单重置
+    reset() {
+      this.confirmData = {
+        id: null,
+        status: 0,
+        description: null,
+      };
+      this.confirmDissentData = {
+        id: null,
+        status: 0,
+        description: null,
+      };
+      this.reformData = {
+        id: null,
+        reformDate: null,
+        description: null,
+        images: null,
+      };
+      this.resetForm("confirmForm");
+      this.resetForm("confirmDissentForm");
+      this.resetForm("reformForm");
+    },
+    imageListChanged(value) {
+      this.reformData.images = value;
+    },
+    /** 提交按钮 */
+    submitForm() {
+      if (this.type == "confirm") {
+        this.submitConfirm();
+      } else if (this.type == "confirmDissent") {
+        this.submitConfirmDissent();
+      } else if (this.type === "reform") {
+        this.submitReform();
+      }
+    },
+    submitConfirm() {
+      this.$refs["confirmForm"].validate((valid) => {
+        if (!valid) {
+          return;
+        }
+        let data = { ...this.confirmData, id: this.data.id };
+        confirm(data).then((r) => {
+          if (r.data) {
+            this.$message.info("确认成功");
+            this.$emit("success");
+            this.open = false;
+          }
+        });
+      });
+    },
+    submitConfirmDissent() {
+      this.$refs["confirmDissentForm"].validate((valid) => {
+        if (!valid) {
+          return;
+        }
+        let data = { ...this.confirmDissentData, id: this.data.id };
+        confirmDissent(data).then((r) => {
+          if (r.data) {
+            this.$message.info("异议审批成功");
+            this.$emit("success");
+            this.open = false;
+          }
+        });
+      });
+    },
+    submitReform() {
+      this.$refs["reformForm"].validate((valid) => {
+        if (!valid) {
+          return;
+        }
+        let data = { ...this.reformData, id: this.data.id };
+        reform(data).then((r) => {
+          if (r.data) {
+            this.$message.info("整改成功");
+            this.$emit("success");
+            this.open = false;
+          }
+        });
+      });
+    },
+    // handleConfirmStatusChange(value) {
+    //   if (value == 1) {
+    //     this.confirmRule["description"].required = true;
+    //   } else {
+    //     this.confirmRule["description"].required = false;
+    //   }
+    // },
+    // handleConfirmDissentStatusChange(value) {
+    //   if (value == 1) {
+    //     this.confirmDissentRule["description"].required = true;
+    //   } else {
+    //     this.confirmRule["description"].required = false;
+    //   }
+    // },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.form {
+  padding-top: 20px;
+}
+.imageList div {
+  margin-left: 5px;
+  margin-right: 5px;
+}
+.question-dialog-body{
+  max-height: 500px;
+  overflow-y: auto;
+  padding-right: 20px;
+}
+
+.question-dialog-body>div{
+  border-bottom: 1px solid #606266;
+  padding-bottom: 20px;
+
+  ::v-deep .el-descriptions-item__label {
+    width: 100px;
+    text-align: right;
+    display: inline-block;
+  }
+}
+
+.question-dialog-body>div:not(:first-child){
+  padding-top: 20px;
+}
+.question-dialog-body>div:last-child{
+  border: none;
+}
+</style>

+ 300 - 0
src/views/question/reform/index.vue

@@ -0,0 +1,300 @@
+<template>
+  <div class="app-container">
+    <el-row :gutter="20">
+      <el-col :span="4" :xs="24">
+        <org-tree
+          v-model="queryParams.orgId"
+          @defaultOrg="getDefaultOrg"
+          @checkChange="checkChange"
+          @click="clickTreeNode"
+          :businessTree="true"
+        ></org-tree>
+      </el-col>
+      <el-col :span="20" :xs="24">
+        <el-form
+          :model="queryParams"
+          ref="queryForm"
+          size="small"
+          :inline="true"
+          v-show="showSearch"
+          label-width="68px"
+        >
+          <el-form-item label="关键字" prop="searchKey">
+            <el-input
+              v-model="queryParams.searchKey"
+              placeholder="请输入关键字"
+              clearable
+            />
+          </el-form-item>          
+          <el-form-item prop="reformStatus" label="整改状态">
+            <el-select
+              prop="reformStatus"
+              label="整改状态"
+              v-model="queryParams.reformStatus"
+              placeholder="请选择整改状态"
+              clearable
+            >
+              <el-option
+                v-for="dict in dict.type.question_reform_status"
+                :key="dict.value"
+                :label="dict.label"
+                :value="dict.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="整改期限" prop="reformRange">
+            <el-date-picker
+              clearable
+              v-model="queryParams.reformRange"
+              type="daterange"
+              format="yyyy-MM-dd"
+              placeholder="请选择整改期限"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-form>
+
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="1.5">
+            <el-button
+            type="primary"
+            icon="el-icon-search"
+            size="mini"
+            @click="handleQuery"
+            >搜索</el-button
+          >
+          <el-button  type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery"
+            >重置</el-button
+          >
+            <el-button
+              type="primary"
+              plain
+              icon="el-icon-download"
+              size="mini"
+              @click="handleExport"
+              >导出</el-button
+            >
+          </el-col>
+          <right-toolbar
+            :showSearch.sync="showSearch"
+            @queryTable="getList"
+            :columns="columns"
+          ></right-toolbar>
+        </el-row>
+
+        <el-table
+          v-loading="loading"
+          :data="questionList"
+        >
+          <el-table-column
+            type="index"
+            label="序号"
+            width="60px"
+            v-if="columns[0].visible"
+          ></el-table-column>
+          <el-table-column
+            label="所属机构"
+            prop="orgName"
+            v-if="columns[1].visible"
+          />          
+          <el-table-column
+            label="标准依据"
+            prop="checkContent"
+            v-if="columns[2].visible"
+          />
+          <el-table-column
+            label="隐患描述"
+            prop="questionDesc"
+            v-if="columns[3].visible"
+          />
+         
+          <el-table-column
+            label="整改期限"
+            prop="submitTime"
+            width="120"
+            v-if="columns[4].visible"
+          >
+            <template slot-scope="scope">
+              <span>{{
+                dayjs(scope.row.reformDeadline).format("YYYY-MM-DD")
+              }}</span>
+            </template>
+          </el-table-column>          
+          <el-table-column
+            label="整改状态"
+            prop="reformStatus"
+            width="80px"
+            v-if="columns[5].visible"
+          >
+            <template slot-scope="scope">
+              <span>{{
+                getLabel(
+                  dict.type.question_reform_status,
+                  scope.row.reformStatus
+                )
+              }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="操作"
+            align="center"
+            class-name="small-padding fixed-width"
+          >
+            <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-tickets"
+                @click="handleDetail(scope.row)"
+                v-hasPermi="['question:reform:query']"
+                >详情</el-button
+              >             
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-s-unfold"
+                @click="handleReform(scope.row)"
+                v-hasPermi="['question:reform:reform']"
+                v-if="scope.row.orgId==orgId && scope.row.confirmStatus==2 && scope.row.reformStatus!=11"
+                >整改</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-col>
+    </el-row>
+    <Dialog ref="dialog" @success="getList()"></Dialog>
+  </div>
+</template>
+
+<script>
+import {
+  page,
+} from "@/api/question/reform.js";
+import OrgTree from "@/components/orgTree";
+import Dialog from "./dialog.vue";
+import { mapGetters } from "vuex";
+import dayjs from "dayjs";
+import { getLabel } from "./../../commonOption";
+export default {
+  name: "QuestionReform",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // // 选中数组
+      // ids: [],
+      // // 非单个禁用
+      // single: true,
+      // // 非多个禁用
+      // multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 隐患问题清单表格数据
+      questionList: [],
+
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orgId: this.orgId,
+        reformRange: null,
+        reformStatus: null,
+        checkSub: true,
+      },
+      columns: [
+        { key: 0, label: `序号`, visible: true },
+        { key: 1, label: `机构名称`, visible: true },
+        { key: 2, label: `标准依据`, visible: true },
+        { key: 3, label: `隐患描述`, visible: true },
+        { key: 4, label: `整改期限`, visible: true },
+        { key: 5, label: `整改状态`, visible: true },
+      ],
+    };
+  },
+  dicts: ["question_reform_status"],
+  components: { OrgTree, Dialog },
+  computed: {
+    ...mapGetters(["orgId","userId"]),
+  },
+  created() {},
+  methods: {
+    dayjs,
+    getLabel,
+    /** 查询隐患问题清单列表 */
+    getList() {
+      this.loading = true;
+      page(this.queryParams).then((response) => {
+        this.questionList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+
+    /** 搜索按钮操作 */
+    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;
+    // },
+    handleDetail(row){
+      this.$refs.dialog.show(row,'detail')
+    },
+    handleConfirm(row){
+      this.$refs.dialog.show(row,'confirm')
+    },
+    handleConfirmDissent(row){
+      this.$refs.dialog.show(row,'confirmDissent')
+    },
+    handleReform(row){
+      this.$refs.dialog.show(row,'reform')
+    },
+    /** 导出按钮操作 */ 
+    handleExport() {
+      this.download(
+        "core/questionreform/export",
+        {
+          ...this.queryParams,
+        },
+        `整改情况跟踪_${this.selectedOrgName}_${dayjs().format("YYYYMMDD")}.xlsx`
+      );
+    },
+    //单选框状态改变
+    checkChange(state) {
+      this.queryParams.checkSub = state;
+      this.getList();
+    },
+    getDefaultOrg(org) {
+      this.queryParams.orgId = org.id;
+      this.selectedOrgName=org.shortName;
+      this.getList();
+    },
+    // 节点单击事件
+    clickTreeNode(data) {
+      this.queryParams.orgId = data.id;
+      this.selectedOrgName=data.shortName;
+      this.getList();
+    },
+  },
+};
+</script>