<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
|
<el-form-item label="患者姓名">
|
<el-input v-model="queryParams.patname" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" style="width:180px" />
|
</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="nutrition" />
|
<el-option label="学习困难专案管理" value="learning" />
|
</el-select>
|
</el-form-item>
|
<el-form-item label="科室">
|
<el-input v-model="queryParams.deptname" placeholder="请输入科室" clearable @keyup.enter.native="handleQuery" style="width:180px" />
|
</el-form-item>
|
<el-form-item label="建档日期">
|
<el-date-picker v-model="dateRange" style="width:240px" value-format="yyyy-MM-dd" type="daterange"
|
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" />
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" size="medium" @click="handleQuery">搜索</el-button>
|
<el-button icon="el-icon-refresh" size="medium" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button type="primary" plain icon="el-icon-plus" size="medium" @click="handleCreateStandalone">新建建档</el-button>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button type="danger" plain icon="el-icon-delete" size="medium" :disabled="multiple" @click="handleDelete">删除</el-button>
|
</el-col>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
|
</el-row>
|
|
<el-table v-loading="loading" :data="displayList" @selection-change="handleSelectionChange">
|
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column label="患者姓名" align="center" prop="patname" width="100" />
|
<el-table-column label="性别" align="center" width="60">
|
<template slot-scope="scope">{{ scope.row.sex == 1 ? '男' : '女' }}</template>
|
</el-table-column>
|
<el-table-column label="年龄" align="center" prop="age" width="60" />
|
<el-table-column label="联系电话" align="center" prop="telcode" width="130" />
|
<!-- 家长信息列 -->
|
<el-table-column label="家长姓名" align="center" width="100">
|
<template slot-scope="scope">{{ scope.row.parentInfo ? scope.row.parentInfo.parentName || '-' : '-' }}</template>
|
</el-table-column>
|
<el-table-column label="家长电话" align="center" width="130">
|
<template slot-scope="scope">{{ scope.row.parentInfo ? scope.row.parentInfo.parentPhone || '-' : '-' }}</template>
|
</el-table-column>
|
<el-table-column label="科室" align="center" prop="deptname" width="120" show-overflow-tooltip />
|
<el-table-column label="诊断" align="center" prop="diagname" min-width="150" show-overflow-tooltip />
|
<el-table-column label="专案类型" align="center" width="160">
|
<template slot-scope="scope">
|
<el-tag :type="subTypeTag(scope.row.subType)">{{ scope.row.subTypeLabel }}</el-tag>
|
</template>
|
</el-table-column>
|
<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>
|
<el-table-column label="来源" align="center" width="80">
|
<template slot-scope="scope">
|
<el-tag v-if="scope.row.sourcePage === 'standalone'" type="info" size="mini">独立</el-tag>
|
<span v-else>{{ scope.row.sourcePage === 'inpatient' ? '在院' : '门诊' }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" align="center" fixed="right" width="120">
|
<template slot-scope="scope">
|
<el-button size="medium" type="text" @click="goDetail(scope.row)">
|
<span class="button-textsc"><i class="el-icon-zoom-in" />查看</span>
|
</el-button>
|
<el-button size="medium" type="text" @click="handleSingleDelete(scope.row)">
|
<span style="color:#f56c6c"><i class="el-icon-delete" />删除</span>
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
@pagination="getList" />
|
|
<!-- 独立建档弹窗 -->
|
<ArchiveDialog :visible.sync="createDialogVisible" :standalone="true" @created="getList" />
|
</div>
|
</template>
|
|
<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: [], selectedRows: [], dateRange: [], total: 0, allList: [], displayList: [],
|
createDialogVisible: false,
|
queryParams: { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" },
|
};
|
},
|
created() { this.getList(); },
|
methods: {
|
getList() {
|
this.loading = true;
|
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) {
|
params.params = { beginTime: this.dateRange[0], endTime: this.dateRange[1] };
|
}
|
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] || ""; },
|
handleQuery() { this.queryParams.pageNum = 1; this.getList(); },
|
resetQuery() { this.dateRange = []; this.queryParams = { pageNum: 1, pageSize: 10, patname: "", subType: "", deptname: "" }; this.getList(); },
|
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(() => {
|
return removeArchiveList(this.selectedRows).then(() => {
|
this.$modal.msgSuccess("删除成功"); this.getList();
|
});
|
}).catch(() => {});
|
},
|
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, type: row.subType, detailId: row.detailId || "" } }); },
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.button-textsc { color: #3664d9; }
|
</style>
|