From dc082351978a1e9f75d7a1471a0ca7ebeac552a5 Mon Sep 17 00:00:00 2001
From: WXL <wl_5969728@163.com>
Date: 星期一, 01 六月 2026 11:07:50 +0800
Subject: [PATCH] opo维护
---
src/views/business/decide/index.vue | 550 +++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 393 insertions(+), 157 deletions(-)
diff --git a/src/views/business/decide/index.vue b/src/views/business/decide/index.vue
index 1430372..48a0536 100644
--- a/src/views/business/decide/index.vue
+++ b/src/views/business/decide/index.vue
@@ -62,11 +62,20 @@
<el-card class="tool-card">
<el-row :gutter="10">
<el-col :span="16">
- <!-- <el-button type="primary" icon="el-icon-plus" @click="handleCreate"
- >鏂板缓姝讳骸鍒ゅ畾</el-button
+ <!-- <el-button
+ type="primary"
+ icon="el-icon-plus"
+ @click="handleCreate"
+ >鏂板鑴戞浜″垽瀹�</el-button
>
<el-button
type="success"
+ icon="el-icon-plus"
+ @click="handleCreateHeartDeath"
+ >鏂板蹇冩浜″垽瀹�</el-button
+ >
+ <el-button
+ type="warning"
icon="el-icon-edit"
:disabled="single"
@click="handleUpdate"
@@ -93,27 +102,32 @@
v-loading="loading"
:data="deathJudgmentList"
@selection-change="handleSelectionChange"
+ :header-cell-style="{ background: '#f5f7fa', 'font-weight': 'bold' }"
>
<el-table-column type="selection" width="55" align="center" />
- <el-table-column
- label="妗堜緥缂栧彿"
- align="center"
- prop="caseNo"
- width="120"
- />
+
+ <!-- 鍩虹淇℃伅鍒� -->
<el-table-column
label="浣忛櫌鍙�"
align="center"
prop="inpatientno"
width="120"
+ fixed="left"
/>
<el-table-column
- label="鎹愮尞鑰呭鍚�"
+ label="濮撳悕"
align="center"
prop="name"
- width="120"
+ width="100"
+ fixed="left"
/>
- <el-table-column label="鎬у埆" align="center" prop="sex" width="80">
+ <el-table-column
+ label="鎬у埆"
+ align="center"
+ prop="sex"
+ width="80"
+ fixed="left"
+ >
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_user_sex"
@@ -121,14 +135,14 @@
/>
</template>
</el-table-column>
- <el-table-column label="骞撮緞" align="center" prop="age" width="80" />
<el-table-column
- label="娌荤枟鍖婚櫌"
+ label="骞撮緞"
align="center"
- prop="treatmenthospitalname"
- width="180"
- show-overflow-tooltip
+ prop="age"
+ width="80"
+ fixed="left"
/>
+
<el-table-column
label="鐤剧梾璇婃柇"
align="center"
@@ -136,74 +150,141 @@
min-width="200"
show-overflow-tooltip
/>
+ <!-- 鐘舵�佷俊鎭� -->
<el-table-column
- label="姝讳骸鍘熷洜"
+ label="鍒ゅ畾鐘舵��"
align="center"
- prop="deathreason"
- width="120"
- >
- <template slot-scope="scope">
- <el-tag :type="reasonFilter(scope.row.deathreason)">
- {{ reasonTextFilter(scope.row.deathreason) }}
- </el-tag>
- </template>
- </el-table-column>
- <el-table-column
- label="姝讳骸鏃堕棿"
- align="center"
- prop="deathtime"
- width="160"
- >
- <template slot-scope="scope">
- <span>{{
- scope.row.deathtime
- ? parseTime(scope.row.deathtime, "{y}-{m}-{d} {h}:{i}")
- : "-"
- }}</span>
- </template>
- </el-table-column>
- <el-table-column
- label="鍒ゅ畾鍖荤敓涓�"
- align="center"
- prop="deathjudgedocto"
- width="120"
- />
- <el-table-column
- label="鍒ゅ畾鍖荤敓浜�"
- align="center"
- prop="deathjudgedoctt"
- width="120"
- />
- <el-table-column
- label="璁板綍鐘舵��"
- align="center"
- prop="recordstate"
+ prop="state"
width="100"
>
<template slot-scope="scope">
- <el-tag :type="statusFilter(scope.row.recordstate)">
- {{ statusTextFilter(scope.row.recordstate) }}
- </el-tag>
+ <dict-tag
+ :options="dict.type.decide_type"
+ :value="scope.row.state"
+ />
</template>
</el-table-column>
+ <!-- 鑴戞浜″垽瀹氫俊鎭� -->
+ <el-table-column label="鑴戞浜″垽瀹�" align="center">
+ <el-table-column
+ label="姝讳骸鍘熷洜"
+ align="center"
+ prop="deathreason"
+ width="120"
+ >
+ <template slot-scope="scope">
+ <el-tag
+ v-if="scope.row.deathreason"
+ type="danger"
+ >
+ {{ scope.row.deathreason }}
+ </el-tag>
+ <span v-else>-</span>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="姝讳骸鏃堕棿"
+ align="center"
+ prop="deathtime"
+ width="160"
+ >
+ <template slot-scope="scope">
+ <span>{{
+ scope.row.deathtime ? formatTime(scope.row.deathtime) : "-"
+ }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鍒ゅ畾鍖荤敓涓�"
+ align="center"
+ prop="deathjudgedocto"
+ width="120"
+ >
+ <template slot-scope="scope">
+ {{ scope.row.deathjudgedocto || "-" }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鍒ゅ畾鍖荤敓浜�"
+ align="center"
+ prop="deathjudgedoctt"
+ width="120"
+ >
+ <template slot-scope="scope">
+ {{ scope.row.deathjudgedoctt || "-" }}
+ </template>
+ </el-table-column>
+ </el-table-column>
+
+ <!-- 蹇冩浜″垽瀹氫俊鎭� -->
+ <el-table-column label="蹇冩浜″垽瀹�" align="center">
+ <el-table-column
+ label="姝讳骸鍘熷洜"
+ align="center"
+ prop="heartdeathreason"
+ width="120"
+ >
+ <template slot-scope="scope">
+ <el-tag v-if="scope.row.heartdeathreason" type="danger">
+ {{ scope.row.heartdeathreason }}
+ </el-tag>
+ <span v-else>-</span>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="姝讳骸鏃堕棿"
+ align="center"
+ prop="heartdeathtime"
+ width="160"
+ >
+ <template slot-scope="scope">
+ <span>{{
+ scope.row.heartdeathtime
+ ? formatTime(scope.row.heartdeathtime)
+ : "-"
+ }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鍒ゅ畾鍖荤敓涓�"
+ align="center"
+ prop="heartdeathjudgedocto"
+ width="120"
+ >
+ <template slot-scope="scope">
+ {{ scope.row.heartdeathjudgedocto || "-" }}
+ </template>
+ </el-table-column>
+ <el-table-column
+ label="鍒ゅ畾鍖荤敓浜�"
+ align="center"
+ prop="heartdeathjudgedoctt"
+ width="120"
+ >
+ <template slot-scope="scope">
+ {{ scope.row.heartdeathjudgedoctt || "-" }}
+ </template>
+ </el-table-column>
+ </el-table-column>
+
+ <!-- 鍒ゅ畾鏃堕棿鍜屾搷浣滃垪 -->
<el-table-column
- label="鍒涘缓鏃堕棿"
+ label="鍒ゅ畾鏃堕棿"
align="center"
prop="createTime"
width="160"
>
<template slot-scope="scope">
<span>{{
- scope.row.createTime
- ? parseTime(scope.row.createTime, "{y}-{m}-{d} {h}:{i}")
- : "-"
+ scope.row.createTime ? formatTime(scope.row.createTime) : "-"
}}</span>
</template>
</el-table-column>
+
<el-table-column
label="鎿嶄綔"
align="center"
- width="180"
+ width="200"
fixed="right"
class-name="small-padding fixed-width"
>
@@ -215,13 +296,23 @@
@click="handleView(scope.row)"
>璇︽儏</el-button
>
- <el-button
+ <el-dropdown
size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- >淇敼</el-button
+ @command="command => handleUpdateDropdown(scope.row, command)"
>
+ <el-button
+ size="mini"
+ type="text"
+ icon="el-icon-edit"
+ class="el-button--text"
+ >
+ 淇敼<i class="el-icon-arrow-down el-icon--right"></i>
+ </el-button>
+ <el-dropdown-menu slot="dropdown">
+ <el-dropdown-item command="brainDeath">鑴戞浜�</el-dropdown-item>
+ <el-dropdown-item command="heartDeath">蹇冩浜�</el-dropdown-item>
+ </el-dropdown-menu>
+ </el-dropdown>
</template>
</el-table-column>
</el-table>
@@ -249,7 +340,7 @@
export default {
name: "DeathJudgmentList",
components: { Pagination },
- dicts: ["sys_user_sex"],
+ dicts: ["sys_user_sex", "decide_type"],
data() {
return {
// 閬僵灞�
@@ -274,49 +365,63 @@
deathTimeRange: []
},
// 鎵�鏈夋暟鎹紙鐢ㄤ簬鍓嶇绛涢�夛級
- allTableData: []
+ allTableData: [],
+ // 姝讳骸鍘熷洜鏄犲皠
+ deathReasonMap: {
+ brain_death: { text: "鑴戞浜�", type: "primary" },
+ heart_death: { text: "蹇冩浜�", type: "danger" },
+ other: { text: "鍏朵粬", type: "info" }
+ },
+ // 蹇冩浜″師鍥犳槧灏�
+ heartDeathReasonMap: {
+ cardiac_arrest: { text: "蹇冩悘楠ゅ仠", type: "danger" },
+ myocardial_infarction: { text: "蹇冭倢姊楁", type: "danger" },
+ heart_failure: { text: "蹇冨姏琛扮", type: "danger" },
+ other: { text: "鍏朵粬", type: "info" }
+ },
+ // 鐘舵�佹槧灏�
+ statusMap: {
+ "0": { text: "缁存姢涓�", type: "warning" },
+ "1": { text: "宸插畬鎴�", type: "success" },
+ "2": { text: "瀹℃牳涓�", type: "info" },
+ "99": { text: "宸茬粓姝�", type: "danger" }
+ }
};
},
created() {
this.getList();
},
methods: {
- // 姝讳骸鍘熷洜杩囨护鍣�
- reasonFilter(reason) {
- const reasonMap = {
- brain_death: "primary",
- heart_death: "danger",
- other: "info"
- };
- return reasonMap[reason] || "info";
+ // 鑾峰彇姝讳骸鍘熷洜鏍囩绫诲瀷
+ getDeathReasonTagType(reason) {
+ return this.deathReasonMap[reason]?.type || "info";
},
- reasonTextFilter(reason) {
- const reasonMap = {
- brain_death: "鑴戞浜�",
- heart_death: "蹇冩浜�",
- other: "鍏朵粬"
- };
- return reasonMap[reason] || "鏈煡";
+ // 鑾峰彇姝讳骸鍘熷洜鏂囨湰
+ getDeathReasonText(reason) {
+ return this.deathReasonMap[reason]?.text || "鏈煡";
},
- // 璁板綍鐘舵�佽繃婊ゅ櫒
- statusFilter(status) {
- const statusMap = {
- "0": "warning", // 缁存姢涓�
- "1": "success", // 宸插畬鎴�
- "99": "danger" // 宸茬粓姝�
- };
- return statusMap[status] || "info";
+ // 鑾峰彇蹇冩浜″師鍥犳枃鏈�
+ getHeartDeathReasonText(reason) {
+ if (!reason) return "-";
+ return this.heartDeathReasonMap[reason]?.text || reason;
},
- statusTextFilter(status) {
- const statusMap = {
- "0": "缁存姢涓�",
- "1": "宸插畬鎴�",
- "99": "宸茬粓姝�"
- };
- return statusMap[status] || "鏈煡鐘舵��";
+ // 鑾峰彇鐘舵�佹爣绛剧被鍨�
+ getStatusTagType(status) {
+ return this.statusMap[status]?.type || "info";
+ },
+
+ // 鑾峰彇鐘舵�佹枃鏈�
+ getStatusText(status) {
+ return this.statusMap[status]?.text || "鏈煡鐘舵��";
+ },
+
+ // 鏍煎紡鍖栨椂闂�
+ formatTime(time) {
+ if (!time) return "-";
+ return this.parseTime(time, "{y}-{m}-{d} {h}:{i}");
},
// 鏌ヨ姝讳骸鍒ゅ畾鍒楄〃
@@ -327,21 +432,13 @@
// 鏍规嵁瀹為檯鎺ュ彛杩斿洖缁撴瀯璋冩暣
let realData = [];
- realData = response.data;
- this.total = response.total;
- // if (Array.isArray(response)) {
- // realData = response;
- // } else if (response && response.data) {
- // realData = response.data;
- // } else if (response && response.rows) {
- // realData = response.rows;
- // this.total = response.total || response.rows.length;
- // } else if (response && response.code === 200) {
- // realData = response.data.rows || response.data;
- // this.total = response.data.total || realData.length;
- // } else {
- // realData = [];
- // }
+ if (response.code === 200) {
+ realData = response.rows || response.data || [];
+ this.total = response.total || realData.length;
+ } else {
+ realData = [];
+ this.total = 0;
+ }
// 瀛樺偍鎵�鏈夋暟鎹敤浜庡墠绔瓫閫�
this.allTableData = realData;
@@ -350,12 +447,14 @@
let filteredData = this.applyFrontendFilter(realData);
// 鍓嶇鍒嗛〉澶勭悊锛堝鏋滄帴鍙d笉鏀寔鍚庣鍒嗛〉锛�
- if (!response.total && !response.data) {
+ if (
+ this.total === filteredData.length &&
+ this.total > this.queryParams.pageSize
+ ) {
const startIndex =
(this.queryParams.pageNum - 1) * this.queryParams.pageSize;
const endIndex = startIndex + this.queryParams.pageSize;
this.deathJudgmentList = filteredData.slice(startIndex, endIndex);
- this.total = filteredData.length;
} else {
// 鎺ュ彛宸插垎椤碉紝鐩存帴浣跨敤杩斿洖鏁版嵁
this.deathJudgmentList = filteredData;
@@ -379,22 +478,33 @@
filteredData = filteredData.filter(
item =>
item.inpatientno &&
- item.inpatientno.includes(this.queryParams.inpatientno)
+ item.inpatientno
+ .toString()
+ .toLowerCase()
+ .includes(this.queryParams.inpatientno.toLowerCase())
);
}
// 濮撳悕绛涢��
if (this.queryParams.name) {
filteredData = filteredData.filter(
- item => item.name && item.name.includes(this.queryParams.name)
+ item =>
+ item.name &&
+ item.name
+ .toLowerCase()
+ .includes(this.queryParams.name.toLowerCase())
);
}
// 姝讳骸鍘熷洜绛涢��
if (this.queryParams.deathreason) {
- filteredData = filteredData.filter(
- item => item.deathreason === this.queryParams.deathreason
- );
+ filteredData = filteredData.filter(item => {
+ // 鍚屾椂绛涢�夎剳姝讳骸鍜屽績姝讳骸鍘熷洜
+ return (
+ item.deathreason === this.queryParams.deathreason ||
+ item.heartdeathreason === this.queryParams.deathreason
+ );
+ });
}
// 姝讳骸鏃堕棿鑼冨洿绛涢��
@@ -404,11 +514,24 @@
) {
const [startDate, endDate] = this.queryParams.deathTimeRange;
filteredData = filteredData.filter(item => {
- if (!item.deathtime) return false;
- const deathTime = new Date(item.deathtime).getTime();
+ // 鍚屾椂绛涢�夎剳姝讳骸鏃堕棿鍜屽績姝讳骸鏃堕棿
+ const brainDeathTime = item.deathtime
+ ? new Date(item.deathtime).getTime()
+ : null;
+ const heartDeathTime = item.heartdeathtime
+ ? new Date(item.heartdeathtime).getTime()
+ : null;
const startTime = new Date(startDate).getTime();
const endTime = new Date(endDate + " 23:59:59").getTime();
- return deathTime >= startTime && deathTime <= endTime;
+
+ return (
+ (brainDeathTime &&
+ brainDeathTime >= startTime &&
+ brainDeathTime <= endTime) ||
+ (heartDeathTime &&
+ heartDeathTime >= startTime &&
+ heartDeathTime <= endTime)
+ );
});
}
@@ -439,25 +562,71 @@
handleView(row) {
this.$router.push({
path: "/case/DecideInfo",
- query: { id: row.id,infoid:row.infoid }
+ query: {
+ id: row.id,
+ infoid: row.infoid,
+ type: this.getDeathType(row) // 浼犻�掓浜$被鍨�
+ }
});
},
- // 鏂板鎸夐挳鎿嶄綔
- handleCreate() {
- this.$router.push("/case/DecideInfo");
+ // 鑾峰彇姝讳骸绫诲瀷
+ getDeathType(row) {
+ if (row.deathreason && row.deathreason.includes("brain")) {
+ return "brain";
+ } else if (row.heartdeathreason) {
+ return "heart";
+ }
+ return "brain"; // 榛樿鑴戞浜�
},
- // 淇敼鎸夐挳鎿嶄綔
- handleUpdate(row) {
- const id = row.id || this.ids[0];
+ // 鏂板鑴戞浜″垽瀹�
+ handleCreate() {
this.$router.push({
path: "/case/DecideInfo",
- query: { id: id,infoid:row.infoid, isEdit: true }
+ query: { type: "brain" }
});
},
- // 瀵煎嚭鎸夐挳鎿嶄綔锛堟ā鎷熻皟鐢級
+ // 鏂板蹇冩浜″垽瀹�
+ handleCreateHeartDeath() {
+ this.$router.push({
+ path: "/case/DecideInfo",
+ query: { type: "heart" }
+ });
+ },
+
+ // 淇敼鎸夐挳鎿嶄綔锛堜笅鎷夎彍鍗曪級
+ handleUpdateDropdown(row, command) {
+ const id = row.id;
+ const infoid = row.infoid;
+
+ if (command === "brainDeath") {
+ // 淇敼鑴戞浜″垽瀹�
+ this.$router.push({
+ path: "/case/DecideInfo",
+ query: {
+ id: id,
+ infoid: infoid,
+ type: "brain",
+ isEdit: true
+ }
+ });
+ } else if (command === "heartDeath") {
+ // 淇敼蹇冩浜″垽瀹�
+ this.$router.push({
+ path: "/case/DecideInfo",
+ query: {
+ id: id,
+ infoid: infoid,
+ type: "heart",
+ isEdit: true
+ }
+ });
+ }
+ },
+
+ // 瀵煎嚭鎸夐挳鎿嶄綔
handleExport() {
this.$confirm("鏄惁纭瀵煎嚭鎵�鏈夋浜″垽瀹氭暟鎹紵", "璀﹀憡", {
confirmButtonText: "纭畾",
@@ -466,19 +635,13 @@
})
.then(() => {
this.loading = true;
- // 妯℃嫙瀵煎嚭鎿嶄綔
- return new Promise(resolve => {
- setTimeout(() => {
- resolve({ code: 200 });
- }, 1000);
- });
+ // 杩欓噷璋冪敤瀵煎嚭鎺ュ彛
+ return this.exportData();
})
.then(response => {
if (response.code === 200) {
this.$message.success("瀵煎嚭鎴愬姛");
- // 瀹為檯椤圭洰涓繖閲屽鐞嗘枃浠朵笅杞�
- // 鍙互娣诲姞浠ヤ笅浠g爜鏉ヨЕ鍙戞枃浠朵笅杞�
- // this.downloadFile();
+ this.downloadExportFile(response);
}
this.loading = false;
})
@@ -487,18 +650,34 @@
});
},
- // 鏂囦欢涓嬭浇鏂规硶锛堥鐣欙級
- downloadFile() {
- // 瀹為檯椤圭洰涓殑鏂囦欢涓嬭浇閫昏緫
- const link = document.createElement("a");
- link.style.display = "none";
- link.href = "/api/export/death-judgment"; // 鏇挎崲涓哄疄闄呭鍑烘帴鍙�
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
+ // 瀵煎嚭鏁版嵁
+ async exportData() {
+ try {
+ // 璋冪敤瀵煎嚭鎺ュ彛
+ const response = await exportDeathJudgment(this.queryParams);
+ return response;
+ } catch (error) {
+ console.error("瀵煎嚭澶辫触:", error);
+ this.$message.error("瀵煎嚭澶辫触");
+ throw error;
+ }
},
- // 鏃堕棿鏍煎紡鍖�
+ // 涓嬭浇瀵煎嚭鏂囦欢
+ downloadExportFile(response) {
+ // 鍋囪鎺ュ彛杩斿洖鏂囦欢涓嬭浇鍦板潃
+ if (response.data && response.data.fileUrl) {
+ const link = document.createElement("a");
+ link.style.display = "none";
+ link.href = response.data.fileUrl;
+ link.download = "姝讳骸鍒ゅ畾鏁版嵁.xlsx";
+ document.body.appendChild(link);
+ link.click();
+ document.body.removeChild(link);
+ }
+ },
+
+ // 鏃堕棿鏍煎紡鍖栧伐鍏峰嚱鏁�
parseTime(time, pattern) {
if (!time) return "";
const format = pattern || "{y}-{m}-{d} {h}:{i}:{s}";
@@ -553,16 +732,73 @@
}
.fixed-width .el-button {
- margin: 0 5px;
+ margin: 0 2px;
}
/* 琛ㄦ牸鏍峰紡浼樺寲 */
-::v-deep .el-table .cell {
- padding: 8px 4px;
+::v-deep .el-table {
+ border: 1px solid #ebeef5;
+ border-radius: 4px;
}
::v-deep .el-table th {
background-color: #f5f7fa;
font-weight: bold;
+ color: #333;
+}
+
+::v-deep .el-table .cell {
+ padding: 8px 4px;
+ line-height: 1.5;
+}
+
+::v-deep .el-table--border td,
+::v-deep .el-table--border th {
+ border-right: 1px solid #ebeef5;
+}
+
+::v-deep .el-table--border {
+ border: 1px solid #ebeef5;
+ border-bottom: none;
+}
+
+/* 澶氱骇琛ㄥご鏍峰紡 */
+::v-deep .el-table .el-table__header-wrapper tr:first-child th {
+ background-color: #f8f9fa;
+ border-bottom: 2px solid #409eff;
+}
+
+::v-deep .el-table .el-table__header-wrapper tr:nth-child(2) th {
+ background-color: #f0f7ff;
+}
+
+/* 鎿嶄綔鍒楁寜閽牱寮� */
+.el-dropdown-link {
+ cursor: pointer;
+ color: #409eff;
+}
+
+.el-dropdown-link:hover {
+ color: #66b1ff;
+}
+
+/* 鏍囩鏍峰紡浼樺寲 */
+::v-deep .el-tag {
+ margin: 2px;
+ border-radius: 12px;
+ font-size: 12px;
+ padding: 0 8px;
+ height: 24px;
+ line-height: 22px;
+}
+
+/* 鍒嗛〉鏍峰紡 */
+.pagination-container {
+ margin-top: 20px;
+ padding: 10px 0;
+ background: #fff;
+ border: 1px solid #ebeef5;
+ border-top: none;
+ border-radius: 0 0 4px 4px;
}
</style>
--
Gitblit v1.9.3