From caaace44a0f0049b6a645d6e0a511af6adf7c1e0 Mon Sep 17 00:00:00 2001
From: 董国庆 <364620639@qq.com>
Date: 星期六, 21 六月 2025 15:37:04 +0800
Subject: [PATCH] 专业报告审批修改bug

---
 laboratory/src/views/reportLibrary/feasibilityReport/index.vue |   41 ++++++++++++++++++++++++++++++++++++-----
 1 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/laboratory/src/views/reportLibrary/feasibilityReport/index.vue b/laboratory/src/views/reportLibrary/feasibilityReport/index.vue
index 5208b0b..d39ee31 100644
--- a/laboratory/src/views/reportLibrary/feasibilityReport/index.vue
+++ b/laboratory/src/views/reportLibrary/feasibilityReport/index.vue
@@ -37,8 +37,8 @@
                         </el-select>
                     </el-form-item>
                     <el-form-item label="" style="margin-left: 63px;">
-                        <el-button type="default" style="margin-right: 10px;">重置</el-button>
-                        <el-button type="primary">查询</el-button>
+                        <el-button type="default" style="margin-right: 10px;" @click="handleReset">重置</el-button>
+                        <el-button type="primary" @click="handleSearch">查询</el-button>
                     </el-form-item>
                 </el-form>
             </template>
@@ -75,11 +75,11 @@
                     <template #default="{ row }">
                         <el-button type="text" @click="handleApproval(row)"
                             v-if="row.status == 1 && [1, 2].includes(roleType)">审核</el-button>
-                        <el-button type="text" @click="handleDetail(row)">详情</el-button>
+                        <el-button type="text" @click="handleDetail(row)" v-if="!isDraft">详情</el-button>
                         <el-button type="text" @click="handleEdit(row)"
-                        v-if="[4, 5].includes(row.status) && roleType == 3">编辑</el-button>
+                         v-if="([4, 5].includes(row.status) && roleType == 3) || isDraft">编辑</el-button>
                         <el-button type="text" @click="handleDelete(row)"
-                            v-if="[4, 5].includes(row.status) && roleType == 3">删除</el-button>
+                             v-if="([4, 5].includes(row.status) && roleType == 3) || isDraft">删除</el-button>
                       
                         <el-button type="text" @click="handleRevoke(row)"
                             v-if="row.status == 1 && roleType == 3">撤销审批</el-button>
@@ -217,6 +217,16 @@
             } else {
                 data = this.form
             }
+            
+            // 处理日期范围
+            if (data.date && data.date.length === 2) {
+                data.startTime = this.formatDate(data.date[0])
+                data.endTime = this.formatDate(data.date[1])
+            } else {
+                data.startTime = ''
+                data.endTime = ''
+            }
+            
             getDataList(data).then(res => {
                 if (res.code === 200) {
                     this.tableData = res.data.records || []
@@ -238,6 +248,27 @@
                     this.getList()
                 }
             })
+        },
+        handleReset() {
+            this.form.teamName = ''
+            this.form.reportName = ''
+            this.form.reportCode = ''
+            this.form.date = ''
+            this.form.status = ''
+            this.form.startTime = ''
+            this.form.endTime = ''
+            this.form.pageNum = 1
+            this.getList()
+        },
+        handleSearch() {
+            this.form.pageNum = 1
+            this.getList()
+        },
+        formatDate(date) {
+            const year = date.getFullYear()
+            const month = String(date.getMonth() + 1).padStart(2, '0')
+            const day = String(date.getDate()).padStart(2, '0')
+            return `${year}-${month}-${day}`
         }
     }
 }

--
Gitblit v1.7.1