From 39c8b288ec8294e026459dfb1955f0bbc49ebb52 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期一, 19 十月 2026 11:10:40 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/archives/childHealth/index.vue |   56 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/src/views/patient/archives/childHealth/index.vue b/src/views/patient/archives/childHealth/index.vue
index 546b5c9..75df597 100644
--- a/src/views/patient/archives/childHealth/index.vue
+++ b/src/views/patient/archives/childHealth/index.vue
@@ -6,7 +6,7 @@
       </el-form-item>
       <el-form-item label="涓撴绫诲瀷">
         <el-select v-model="queryParams.subType" placeholder="璇烽�夋嫨" clearable style="width:180px">
-          <el-option label="楂樺嵄鍎夸笓妗堢鐞�" value="highRisk" />
+          <el-option label="楂樺嵄鍎夸笓妗堢鐞�" value="highrisk" />
           <el-option label="钀ュ吇鎬х柧鐥呬笓妗堢鐞�" value="nutrition" />
           <el-option label="瀛︿範鍥伴毦涓撴绠$悊" value="learning" />
         </el-select>
@@ -56,7 +56,7 @@
           <el-tag :type="subTypeTag(scope.row.subType)">{{ scope.row.subTypeLabel }}</el-tag>
         </template>
       </el-table-column>
-      <el-table-column label="寤烘。鍖荤敓" align="center" prop="archiveForm.doctorName" width="100" />
+      <el-table-column label="鐧昏浜哄憳" align="center" prop="registrant" width="100" />
       <el-table-column label="寤烘。鏃堕棿" align="center" width="160">
         <template slot-scope="scope">{{ scope.row.createTime ? scope.row.createTime.substring(0, 10) : '-' }}</template>
       </el-table-column>
@@ -88,13 +88,17 @@
 
 <script>
 import ArchiveDialog from "@/views/patient/archives/components/ArchiveDialog.vue";
+import { listArchivesByModule, removeArchiveList } from "../apiAdapter";
+
+// 鍎跨涓撴 key -> 鍚庣 archiveType锛�1-钀ュ吇鎬х柧鐥� 2-瀛︿範鍥伴毦 3-楂樺嵄鍎夸笓妗堬級
+const CHILD_TYPE_CODE = { nutrition: "1", learning: "2", highrisk: "3" };
 
 export default {
   name: "ChildHealthArchive",
   components: { ArchiveDialog },
   data() {
     return {
-      loading: false, showSearch: true, multiple: true, ids: [], dateRange: [], total: 0, allList: [], displayList: [],
+      loading: false, showSearch: true, multiple: true, ids: [], selectedRows: [], dateRange: [], total: 0, allList: [], displayList: [],
       createDialogVisible: false,
       queryParams: { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" },
     };
@@ -103,39 +107,41 @@
   methods: {
     getList() {
       this.loading = true;
-      const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
-      this.allList = all.filter((item) => item.mainCategory === "child");
-      let filtered = [...this.allList];
-      if (this.queryParams.patname) filtered = filtered.filter((item) => item.patname && item.patname.includes(this.queryParams.patname));
-      if (this.queryParams.subType) filtered = filtered.filter((item) => item.subType === this.queryParams.subType);
-      if (this.queryParams.deptname) filtered = filtered.filter((item) => item.deptname && item.deptname.includes(this.queryParams.deptname));
+      const params = { pageNum: this.queryParams.pageNum, pageSize: this.queryParams.pageSize };
+      if (this.queryParams.patname) params.patname = this.queryParams.patname;
+      if (this.queryParams.deptname) params.deptname = this.queryParams.deptname;
+      if (this.queryParams.subType) params.archiveType = CHILD_TYPE_CODE[this.queryParams.subType] || "";
       if (this.dateRange && this.dateRange.length === 2) {
-        filtered = filtered.filter((item) => {
-          const d = (item.createTime || "").substring(0, 10);
-          return d >= this.dateRange[0] && d <= this.dateRange[1];
-        });
+        params.params = { beginTime: this.dateRange[0], endTime: this.dateRange[1] };
       }
-      this.total = filtered.length;
-      const start = (this.queryParams.pageNum - 1) * this.queryParams.pageSize;
-      this.displayList = filtered.slice(start, start + this.queryParams.pageSize);
-      this.loading = false;
+      listArchivesByModule("child", params)
+        .then((res) => {
+          this.allList = res.rows || [];
+          this.displayList = this.allList;
+          this.total = res.total || 0;
+        })
+        .catch(() => { this.displayList = []; this.total = 0; })
+        .finally(() => { this.loading = false; });
     },
-    subTypeTag(type) { const map = { highRisk: "danger", nutrition: "warning", learning: "info" }; return map[type] || ""; },
+    subTypeTag(type) { const map = { highrisk: "danger", nutrition: "warning", learning: "info" }; return map[type] || ""; },
     handleQuery() { this.queryParams.pageNum = 1; this.getList(); },
     resetQuery() { this.dateRange = []; this.queryParams = { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" }; this.getList(); },
-    handleSelectionChange(s) { this.ids = s.map(i => i.id); this.multiple = !s.length; },
+    handleSelectionChange(s) {
+      this.selectedRows = s;
+      this.ids = s.map(i => i.id);
+      this.multiple = !s.length;
+    },
     handleDelete() {
       if (this.ids.length === 0) { this.$modal.msgWarning("璇疯嚦灏戦�夋嫨涓�鏉�"); return; }
       this.$modal.confirm("纭鍒犻櫎閫変腑妗f锛�").then(() => {
-        const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
-        const remaining = all.filter((item) => !this.ids.includes(item.id));
-        localStorage.setItem("patientArchives", JSON.stringify(remaining));
-        this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); this.getList();
+        return removeArchiveList(this.selectedRows).then(() => {
+          this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); this.getList();
+        });
       }).catch(() => {});
     },
-    handleSingleDelete(row) { this.ids = [row.id]; this.handleDelete(); },
+    handleSingleDelete(row) { this.selectedRows = [row]; this.ids = [row.id]; this.handleDelete(); },
     handleCreateStandalone() { this.createDialogVisible = true; },
-    goDetail(row) { this.$router.push({ path: "/filing/childDetail", query: { id: row.id } }); },
+    goDetail(row) { this.$router.push({ path: "/filing/childDetail", query: { id: row.id, type: row.subType, detailId: row.detailId || "" } }); },
   },
 };
 </script>

--
Gitblit v1.9.3