From ccc970e575ef3f3e5c67af8da210263f4ac549f9 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 10 四月 2026 16:44:55 +0800
Subject: [PATCH] 2026.4.10

---
 src/views/inspection/report/ReportManage.vue |  180 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 179 insertions(+), 1 deletions(-)

diff --git a/src/views/inspection/report/ReportManage.vue b/src/views/inspection/report/ReportManage.vue
index 3695ea1..3962cab 100644
--- a/src/views/inspection/report/ReportManage.vue
+++ b/src/views/inspection/report/ReportManage.vue
@@ -1 +1,179 @@
-<template>宸℃煡璇勪及鎶ュ憡</template>
+<template>
+  <div class="report-manage-container">
+    <h2>宸℃煡璇勪及鎶ュ憡</h2>
+
+    <!-- 鏌ヨ鏉′欢鍖哄煙 -->
+    <div class="search-section">
+      <el-form :inline="true" :model="searchForm" class="search-form">
+        <el-form-item label="鍖哄幙">
+          <el-select v-model="searchForm.district" placeholder="璇烽�夋嫨鍖哄幙" style="width: 120px">
+            <el-option
+              v-for="district in districts"
+              :key="district.value"
+              :label="district.label"
+              :value="district.value"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="searchReports">鏌ヨ</el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+
+    <!-- 鎶ュ憡琛ㄦ牸鍖哄煙 -->
+    <div class="table-section">
+      <el-table :data="reportList" style="width: 100%">
+        <el-table-column prop="index" label="绱㈠紩缂栧彿" width="80" />
+        <el-table-column prop="name" label="鎶ュ憡鍚嶇О" min-width="200" />
+        <el-table-column prop="district" label="鍖哄幙" width="120" />
+        <el-table-column prop="reportMonth" label="鎶ュ憡鏃堕棿" width="120" />
+        <el-table-column prop="generateTime" label="鐢熸垚鏃堕棿" width="180" />
+        <el-table-column prop="auditStatus" label="瀹℃牳鐘舵��" width="100">
+          <template #default="scope">
+            <el-tag :type="scope.row.auditStatus === '宸插鏍�' ? 'success' : 'warning'">
+              {{ scope.row.auditStatus }}
+            </el-tag>
+          </template>
+        </el-table-column>
+        <el-table-column label="鎿嶄綔" width="120" fixed="right">
+          <template #default="scope">
+            <el-button size="small" type="primary" @click="viewReport(scope.row)">
+              鏌ョ湅鎶ュ憡
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+
+    <!-- 鎶ュ憡棰勮鎶藉眽 -->
+    <el-drawer v-model="drawerVisible" title="鎶ュ憡棰勮" direction="rtl" size="80%">
+      <!-- <div class="report-preview">
+        <iframe :src="reportUrl" width="100%" height="800px" frameborder="0"></iframe>
+      </div> -->
+      <div ref="refWord" class="report-preview">
+        <div :id="`word-preview`"></div>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script setup>
+import { ref, onMounted } from 'vue'
+import {
+  exportDocx,
+  prepareDocxBlob,
+  preparePdf,
+  previewDocx,
+  downloadDocx,
+  print,
+} from '@/utils/doc'
+
+const refWord = ref(null)
+
+// 涓婃捣甯傚尯鍘垮垪琛�
+const districts = [
+  { value: 'xuhui', label: '寰愭眹鍖�' },
+  { value: 'changning', label: '闀垮畞鍖�' },
+  { value: 'jingan', label: '闈欏畨鍖�' },
+  { value: 'putuo', label: '鏅檧鍖�' },
+  { value: 'hongkou', label: '铏瑰彛鍖�' },
+  { value: 'yangpu', label: '鏉ㄦ郸鍖�' },
+  { value: 'minhang', label: '闂佃鍖�' },
+  { value: 'baoshan', label: '瀹濆北鍖�' },
+  { value: 'pudong', label: '娴︿笢鏂板尯' },
+  { value: 'jiading', label: '鍢夊畾鍖�' },
+  { value: 'jinshan', label: '閲戝北鍖�' },
+  { value: 'songjiang', label: '鏉炬睙鍖�' },
+  { value: 'qingpu', label: '闈掓郸鍖�' },
+  { value: 'fengxian', label: '濂夎搐鍖�' },
+  { value: 'chongming', label: '宕囨槑鍖�' },
+]
+
+// 鏌ヨ琛ㄥ崟
+const searchForm = ref({
+  district: 'xuhui', // 榛樿閫変腑寰愭眹鍖�
+})
+
+// 鎶ュ憡鍒楄〃鏁版嵁
+const reportList = ref([])
+
+// 鎶藉眽鐘舵��
+const drawerVisible = ref(false)
+// 鎶ュ憡棰勮URL
+const reportUrl = ref('')
+
+// 妯℃嫙鏁版嵁鐢熸垚
+const generateMockData = () => {
+  const data = []
+  const baseName = '椁愰ギ鐩戠绠�鎶�'
+  const areas = ['澶╅挜妗�', '寰愬姹�', '琛″北璺�', '榫欏崕']
+
+  for (let i = 1; i <= 10; i++) {
+    const area = areas[Math.floor(Math.random() * areas.length)]
+    const month = Math.floor(Math.random() * 12) + 1
+    const date = new Date()
+    date.setMonth(month - 1)
+
+    data.push({
+      index: i,
+      name: `${searchForm.value.district === 'xuhui' ? '寰愭眹鍖�' : '鍏朵粬鍖�'}${baseName}锛�${area}锛�-2025骞�${month}鏈坄,
+      district: searchForm.value.district === 'xuhui' ? '寰愭眹鍖�' : '鍏朵粬鍖�',
+      reportMonth: `2025骞�${month}鏈坄,
+      generateTime: new Date().toLocaleString('zh-CN'),
+      auditStatus: Math.random() > 0.5 ? '宸插鏍�' : '鏈鏍�',
+    })
+  }
+
+  return data
+}
+
+// 鏌ヨ鎶ュ憡
+const searchReports = () => {
+  reportList.value = generateMockData()
+}
+
+// 鏌ョ湅鎶ュ憡
+const viewReport = (row) => {
+  // 浣跨敤妯℃嫙鐨勬姤鍛婃枃浠�
+  reportUrl.value = '/寰愭眹鍖洪楗洃绠$畝鎶ワ紙澶╅挜妗ワ級-2025骞�8鏈�(1).docx'
+  drawerVisible.value = true
+
+  prepareDocxBlob(reportUrl.value).then((blob) => {
+    previewDocx(blob, document.getElementById(`word-preview`))
+  })
+}
+
+// 椤甸潰鍔犺浇鏃剁敓鎴愬垵濮嬫暟鎹�
+onMounted(() => {
+  searchReports()
+})
+</script>
+
+<style scoped>
+.report-manage-container {
+  padding: 20px;
+}
+
+.search-section {
+  margin-bottom: 20px;
+  padding: 20px;
+  background-color: #f5f7fa;
+  border-radius: 4px;
+}
+
+.search-form {
+  display: flex;
+  align-items: center;
+}
+
+.table-section {
+  background-color: #fff;
+  border-radius: 4px;
+  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
+}
+
+.report-preview {
+  padding: 20px;
+}
+</style>

--
Gitblit v1.9.3