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/maternalHealth/index.vue | 62 +++++++++++++++++--------------
1 files changed, 34 insertions(+), 28 deletions(-)
diff --git a/src/views/patient/archives/maternalHealth/index.vue b/src/views/patient/archives/maternalHealth/index.vue
index c8bf90a..27328c4 100644
--- a/src/views/patient/archives/maternalHealth/index.vue
+++ b/src/views/patient/archives/maternalHealth/index.vue
@@ -48,13 +48,13 @@
<el-tag :type="scope.row.subType === 'pregnancy' ? 'success' : 'warning'">{{ scope.row.subTypeLabel }}</el-tag>
</template>
</el-table-column>
- <el-table-column label="瀛曞懆" align="center" width="70">
- <template slot-scope="scope">{{ scope.row.subType === 'pregnancy' ? (scope.row.archiveForm.gestationalWeek || '-') : '-' }}</template>
+ <el-table-column label="濡婂鎯呭喌" align="center" width="120" show-overflow-tooltip>
+ <template slot-scope="scope">{{ scope.row.subType === 'pregnancy' ? (scope.row.pregnancyStatus || '-') : '-' }}</template>
</el-table-column>
- <el-table-column label="KMI璇勫垎" align="center" width="90">
- <template slot-scope="scope">{{ scope.row.subType === 'menopause' ? (scope.row.archiveForm.kmiScore || '-') : '-' }}</template>
+ <el-table-column label="闅忚鍛ㄦ湡" align="center" width="110" show-overflow-tooltip>
+ <template slot-scope="scope">{{ scope.row.subType === 'menopause' ? (scope.row.followupCycles || '-') : '-' }}</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>
@@ -85,13 +85,14 @@
<script>
import ArchiveDialog from "@/views/patient/archives/components/ArchiveDialog.vue";
+import { listArchivesByModule, removeArchiveList } from "../apiAdapter";
export default {
name: "MaternalHealthArchive",
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: "" },
};
@@ -100,38 +101,43 @@
methods: {
getList() {
this.loading = true;
- const all = JSON.parse(localStorage.getItem("patientArchives") || "[]");
- this.allList = all.filter((item) => item.mainCategory === "maternal");
- 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));
- 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];
- });
+ 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;
+ // 涓撴绫诲瀷锛氳浆鎴愬悗绔� archiveType锛堝绉� 1-鏃╁瓡鍏崇埍 2-鍥寸粷缁忔湡MHI锛�
+ if (this.queryParams.subType) {
+ params.archiveType = this.queryParams.subType === "pregnancy" ? "1" : "2";
}
- 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;
+ if (this.dateRange && this.dateRange.length === 2) {
+ params.params = { beginTime: this.dateRange[0], endTime: this.dateRange[1] };
+ }
+ listArchivesByModule("maternal", 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; });
},
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/maternalDetail", query: { id: row.id } }); },
+ goDetail(row) { this.$router.push({ path: "/filing/maternalDetail", query: { id: row.id, type: row.subType, detailId: row.detailId || "" } }); },
},
};
</script>
--
Gitblit v1.9.3