From 7946bf542e0650bfb1ea384f69f6b4dd234ddc59 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 23 七月 2024 17:04:26 +0800
Subject: [PATCH] 报备审核记录

---
 src/views/system/report/index.vue |  116 +++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 78 insertions(+), 38 deletions(-)

diff --git a/src/views/system/report/index.vue b/src/views/system/report/index.vue
index 9bacea8..5d0906c 100644
--- a/src/views/system/report/index.vue
+++ b/src/views/system/report/index.vue
@@ -8,14 +8,18 @@
         <el-input v-model="queryParams.pointId" placeholder="鐐逛綅" clearable @keyup.enter.native="handleQuery" />
       </el-form-item>
       <el-form-item label="鎶ュ绫诲瀷" prop="reportType">
-        <el-select v-model="queryParams.reportType" placeholder="鎶ュ绫诲瀷" clearable>
+        <el-select v-model="queryParams.reportType" @change="handleQuery" placeholder="鎶ュ绫诲瀷" clearable>
           <el-option label="浜嬪墠鎶ュ" value="浜嬪墠鎶ュ" />
           <el-option label="浜嬪悗鎶ュ" value="浜嬪悗鎶ュ" />
         </el-select>
       </el-form-item>
-      <el-form-item label="鎶ュ鏃堕棿">
-        <el-date-picker v-model="daterangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
-          range-separator="-" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"></el-date-picker>
+      <el-form-item label="瀹℃牳鐘舵��">
+        <el-select v-model="queryParams.status" @change="handleQuery" placeholder="瀹℃牳鐘舵��" clearable>
+          <el-option label="鍏ㄩ儴" value="" />
+          <el-option label="瀹℃牳涓�" :value="0" />
+          <el-option label="瀹℃牳鏈�氳繃" :value="2" />
+          <el-option label="瀹℃牳閫氳繃" :value="1" />
+        </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">鎼滅储</el-button>
@@ -73,33 +77,23 @@
         </template>
       </el-table-column>
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="杩愮淮鍗曚綅" align="center" prop="unitName" />
+      <el-table-column label="杩愮淮鍗曚綅" width="200" align="center" prop="unitName" />
       <el-table-column label="鎶ュ浜哄憳" align="center" prop="peopleName" />
-      <el-table-column label="鐐逛綅" align="center" prop="pointName" />
+      <el-table-column label="鐐逛綅" width="250" align="center" prop="pointName" />
       <el-table-column label="鎶ュ绫诲瀷" align="center" prop="reportType" />
-      <!-- <el-table-column label="鎶ュ鍐呭" align="center" prop="reportContent" show-overflow-tooltip="true" />
-      <el-table-column label="涓婃姤鏉愭枡" align="center" prop="reportMaterials" show-overflow-tooltip="true">
-        <template slot-scope="scope">
-          <div v-for="(item, index) in scope.row.reportMaterials.split(',')" :key="index">{{
-      item.substring(item.lastIndexOf("/") + 1) }}</div>
-        </template>
-      </el-table-column> -->
+      <el-table-column label="涓婃姤鏃堕棿" width="200" align="center" prop="createTime" />
       <el-table-column label="鏁呴殰绫诲瀷" align="center" prop="errorType" />
       <el-table-column label="瀹℃牳缁撴灉" align="center" prop="status" :formatter="formatStatus"/>
-      <el-table-column label="瀹℃牳鏃堕棿" align="center" prop="auditingTime" width="180">
+      <el-table-column label="鎿嶄綔" fixed="right" width="250" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.auditingTime, '{y}-{m}-{d}') }}</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-edit"-->
-          <!--            @click="handleUpdate(scope.row)"-->
-          <!--            v-hasPermi="['system:report:edit']"-->
-          <!--          >淇敼</el-button>-->
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['system:report:edit']"
+            v-if="scope.row.status === 2 || scope.row.status === 0"
+          >淇敼</el-button>
           <el-button size="mini" type="text" icon="el-icon-edit" @click="handleAuditing(scope.row)"
             v-hasPermi="['system:report:edit']" v-if="scope.row.status === 0">瀹℃牳</el-button>
           <el-button size="mini" type="text" icon="el-icon-s-check" @click="handleAuditingRecord(scope.row.id)"
@@ -136,8 +130,8 @@
             <el-option label="璁惧閬楀け" value="璁惧閬楀け" />
           </el-select>
         </el-form-item>
-        <el-form-item label="鎶ュ鏃堕棿" prop="expirTime">
-          <el-date-picker v-model="form.expirTime" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
+        <el-form-item label="鎶ュ鏃堕棿">
+          <el-date-picker v-model="daterangeCreateTime" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
             range-separator="-" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡"
             @change="handleExpirTimeChange"></el-date-picker>
         </el-form-item>
@@ -149,11 +143,40 @@
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+        <el-button type="primary" @click="submitForm">鎻愪氦瀹℃牳</el-button>
         <el-button @click="cancel">鍙� 娑�</el-button>
       </div>
     </el-dialog>
 
+    <!-- 鏌ョ湅瀹℃牳璁板綍 -->
+    <el-dialog title="鎶ュ瀹℃牳璁板綍" :visible.sync="recordOpen" width="900px">
+      <div slot="footer" class="dialog-footer" style="max-height: 500px;overflow-y: auto;">
+        <el-timeline v-for="record in auditingRecordList" :key="record.id">
+          <el-timeline-item :timestamp="record.createTime" placement="top">
+            <el-card>
+              <el-descriptions title="鎻愪氦鏁版嵁" :column="3" border>
+                <el-descriptions-item label="鐐逛綅" label-class-name="my-label" content-class-name="my-content">{{record.pointName}}</el-descriptions-item>
+                <el-descriptions-item label="鎶ュ绫诲瀷">{{record.reportType}}</el-descriptions-item>
+                <el-descriptions-item label="鏁呴殰绫诲瀷">{{record.errorType}}</el-descriptions-item>
+                <el-descriptions-item label="瀹℃牳缁撴灉">{{formatStatus(record)}}</el-descriptions-item>
+                <el-descriptions-item label="瀹℃牳鎰忚">{{record.auditOpinion}}</el-descriptions-item>
+                <el-descriptions-item label="瀹℃牳鏃堕棿">{{record.auditingTime}}</el-descriptions-item>
+                <el-descriptions-item label="鎶ュ鍐呭">
+                  <div class="content" v-html="getHtmlContent(record.reportContent)"></div>
+                </el-descriptions-item>
+                <el-descriptions-item label="涓婃姤鏉愭枡">
+                  <el-link
+                    v-for="item in record.reportMaterials != null ? record.reportMaterials.split(',') : record.reportMaterials"
+                    :underline="false" type="primary" :key="item" @click="handleDownload(item)">{{ item.substring(item.lastIndexOf("/") + 1)
+                    }}</el-link>
+                </el-descriptions-item>
+              </el-descriptions>
+            </el-card>
+          </el-timeline-item>
+        </el-timeline>
+        <el-button type="primary" @click="recordOpen = false">鍏抽棴</el-button>
+      </div>
+    </el-dialog>
 
     <!-- 瀹℃牳鎶ュ -->
     <el-dialog title="鎶ュ瀹℃牳" :visible.sync="auditingOpen" width="500px" append-to-body>
@@ -185,7 +208,7 @@
         <el-form-item label="涓婃姤鏉愭枡">
           <el-link
             v-for="item in auditingForm.reportMaterials != null ? auditingForm.reportMaterials.split(',') : auditingForm.reportMaterials"
-            :underline="false" :key="item" @click="handleDownload(item)">{{ item.substring(item.lastIndexOf("/") + 1)
+            :underline="false" type="primary" :key="item" @click="handleDownload(item)">{{ item.substring(item.lastIndexOf("/") + 1)
             }}</el-link>
         </el-form-item>
         <el-form-item label="瀹℃牳缁撴灉">
@@ -216,7 +239,7 @@
   data() {
     return {
       fileType: ["doc", "xls", "xlsx", "ppt", "txt", "pdf", "png", "jpg"],
-
+      auditingRecordList: [],
       // 鐐逛綅list
       pointList: [],
       // 閬僵灞�
@@ -239,6 +262,7 @@
       title: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
       open: false,
+      recordOpen: false,
       // 鎶ュ鏃堕棿鑼冨洿
       daterangeCreateTime: [],
       expirTime: [],
@@ -266,7 +290,8 @@
         pointId: null,
         createTime: null,
         auditingTime: null,
-        errorType: null
+        errorType: null,
+        status: 0
       },
       // 琛ㄥ崟鍙傛暟
       form: {},
@@ -302,13 +327,20 @@
     this.getList();
   },
   methods: {
+    getHtmlContent(content) {
+      if (content) {
+        return content
+      } else {
+        return "鏃�"
+      }
+    },
     formatStatus(item) {
       if (item.status === 0) {
-        return '寰呭鏍�'
+        return '瀹℃牳涓�'
       } else if (item.status === 1) {
         return '瀹℃牳閫氳繃'
       } else if (item.status === 2) {
-        return '鏈�氳繃瀹℃牳'
+        return '瀹℃牳鏈�氳繃'
       }
     },
     auditingCancel() {
@@ -316,7 +348,10 @@
     },
     // 鑾峰彇瀹℃牳璁板綍
     handleAuditingRecord(reportId) {
-
+      auditing(reportId).then(res => {
+        this.auditingRecordList = res.data;
+        this.recordOpen = true
+      })
     },
     handleAuditing(row) {
       this.auditingOpen = true;
@@ -416,6 +451,7 @@
       this.reset();
       const id = row.id || this.ids
       getReport(id).then(response => {
+        this.daterangeCreateTime = [response.data.beginCreateTime, response.data.endCreateTime]
         this.form = response.data;
         this.open = true;
         this.title = "淇敼鎶ュ";
@@ -444,11 +480,10 @@
     },
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
-
-      // todo 鍒ゆ柇鏄簨鍓嶆姤澶�
-
       this.$refs["form"].validate(valid => {
         if (valid) {
+          this.form.beginCreateTime = this.daterangeCreateTime[0]
+          this.form.endCreateTime = this.daterangeCreateTime[1]
           if (this.form.id != null) {
             updateReport(this.form).then(response => {
               this.$modal.msgSuccess("淇敼鎴愬姛");
@@ -498,6 +533,11 @@
 </script>
 
 <style lang="scss" scoped>
+.content {
+  height: 100px;
+  max-height: 300px;
+  overflow-y: auto;
+}
 .info-container {
   width: 100%;
   max-height: 400px;

--
Gitblit v1.8.0