| | |
| | | </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> |
| | |
| | | <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> |
| | |
| | | |
| | | <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: "" }, |
| | | }; |
| | |
| | | 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("确认删除选中档案?").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> |