From 05c1bc4570f3a5faf4dad7683bfced0712908aba Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期五, 25 七月 2025 17:36:16 +0800 Subject: [PATCH] 1 --- src/views/doctor/inspectCheck/index.vue | 208 +++++++++++++++++++++------------------------------ 1 files changed, 86 insertions(+), 122 deletions(-) diff --git a/src/views/doctor/inspectCheck/index.vue b/src/views/doctor/inspectCheck/index.vue index baac4c6..943887e 100644 --- a/src/views/doctor/inspectCheck/index.vue +++ b/src/views/doctor/inspectCheck/index.vue @@ -1,48 +1,18 @@ <template> <div class="app-container"> - <el-form - :model="queryParams" - ref="queryForm" - size="small" - :inline="true" - label-width="68px" - @submit.native.prevent - > + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px" @submit.native.prevent> <el-form-item label="浣撴鍙�" prop="reportDoctorCode"> - <el-input - ref="inputName" - v-model="queryParams.tjNum" - placeholder="璇疯緭鍏ヤ綋妫�鍙�" - clearable - @keyup.enter.native="handleQuery" - style="width: 170px" - /> + <el-input ref="inputName" v-model="queryParams.tjNum" placeholder="璇疯緭鍏ヤ綋妫�鍙�" clearable + @keyup.enter.native="handleQuery" style="width: 170px" /> </el-form-item> <el-form-item> - <el-button - type="primary" - icon="el-icon-search" - size="mini" - @click="handleQuery" - style="margin-right: 15px" - > + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery" style="margin-right: 15px"> 鏌ヨ </el-button> - <el-button - icon="el-icon-refresh" - type="primary" - size="mini" - @click="resetQuery" - > + <el-button icon="el-icon-refresh" type="primary" size="mini" @click="resetQuery"> 閲嶇疆 </el-button> - <el-button - icon="el-icon-check" - type="primary" - size="mini" - style="margin-right: 15px" - @click="tongbu" - > + <el-button icon="el-icon-check" type="primary" size="mini" style="margin-right: 15px" @click="tongbu"> 鍚屾 </el-button> </el-form-item> @@ -51,27 +21,14 @@ <div class="box"> <div class="table-header">妫�楠岃褰�</div> <div> - <el-table - :data="exaLists" - border - style="width: 100%" - @selection-change="handleSelectionChange" - :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }" - height="350" - ref="firstTable" - > + <el-table :data="exaLists" border style="width: 100%" @selection-change="handleSelectionChange" + :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }" height="350" ref="firstTable"> <el-table-column fixed type="selection" align="center" label="閫夋嫨" width="50" /> <el-table-column label="濮撳悕" align="center" prop="name" width="80" /> <el-table-column label="鎬у埆" align="center" prop="gender" width="80" /> <el-table-column label="骞撮緞" align="center" prop="patientAge" width="80" /> <el-table-column label="閫佹绉戝" align="center" prop="deptName" width="100" /> - <el-table-column - label="妫�楠岄」鐩�" - align="center" - prop="checkParts" - width="350" - :show-overflow-tooltip="true" - /> + <el-table-column label="妫�楠岄」鐩�" align="center" prop="checkParts" width="350" :show-overflow-tooltip="true" /> <el-table-column label="椤圭洰缂栧彿" align="center" prop="jcxmid" width="150" /> <el-table-column label="瀹℃牳鍖诲笀" align="center" prop="shys" width="150" /> <el-table-column label="鎶ュ憡鏃堕棿" align="center" prop="examinationDate" width="150" /> @@ -102,8 +59,8 @@ infoList.tjCustomerSex == 0 ? "鐢�" : infoList.tjCustomerSex == 1 - ? "濂�" - : "鏆傛棤" + ? "濂�" + : "鏆傛棤" }} </span> <span class="highlight">骞撮緞锛歿{ infoList.tjCustomerAge || "鏆傛棤" }}</span> @@ -111,24 +68,11 @@ </h3> </div> - <el-table - border - height="350" - ref="tab1" - :data="checkList" - v-loading="loading" - style="width: 100%" + <el-table border height="350" ref="tab1" :data="checkList" v-loading="loading" style="width: 100%" @selection-change="handleSelectionChangeSecond" - :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }" - > + :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }"> <el-table-column type="selection" width="60" /> - <el-table-column - label="鐘舵��" - align="center" - prop="type" - :show-overflow-tooltip="true" - min-width="60" - > + <el-table-column label="鐘舵��" align="center" prop="type" :show-overflow-tooltip="true" min-width="60"> <template slot-scope="scope"> <span v-if="scope.row.type == '0'">鏈</span> <span v-if="scope.row.type == '1'">宸叉</span> @@ -202,54 +146,54 @@ this.checkList = []; this.infoList = {}; }, -handleSelectionChange(selected) { - if (this.isProcessingSelection) return; - this.isProcessingSelection = true; + handleSelectionChange(selected) { + if (this.isProcessingSelection) return; + this.isProcessingSelection = true; - // 鎵惧埌鐢ㄦ埛鍒氭搷浣滅殑閭d竴鏉★紙瀵规瘮涔嬪墠鍜岀幇鍦ㄧ殑宸紓锛� - const old = this.selectedFirstTable; - let changedRow = null; + // 鎵惧埌鐢ㄦ埛鍒氭搷浣滅殑閭d竴鏉★紙瀵规瘮涔嬪墠鍜岀幇鍦ㄧ殑宸紓锛� + const old = this.selectedFirstTable; + let changedRow = null; - if (selected.length > old.length) { - // 鏂板锛氭壘鍑烘柊澧炵殑 - changedRow = selected.find(row => !old.includes(row)); - } else { - // 鍒犻櫎锛氭壘鍑哄垹闄ょ殑 - changedRow = old.find(row => !selected.includes(row)); - } + if (selected.length > old.length) { + // 鏂板锛氭壘鍑烘柊澧炵殑 + changedRow = selected.find(row => !old.includes(row)); + } else { + // 鍒犻櫎锛氭壘鍑哄垹闄ょ殑 + changedRow = old.find(row => !selected.includes(row)); + } - if (changedRow) { - const group = this.exaLists.filter(r => r.brid === changedRow.brid); - const isAdding = selected.length > old.length; + if (changedRow) { + const group = this.exaLists.filter(r => r.brid === changedRow.brid); + const isAdding = selected.length > old.length; - this.$refs.firstTable.clearSelection(); - if (isAdding) { - // 娣诲姞锛屾暣涓粍閫変笂 + 鍘熸湁閫夌殑 brid 涔熼�変笂 - const allBrids = new Set(); - selected.forEach(row => allBrids.add(row.brid)); - allBrids.add(changedRow.brid); - const newSelection = this.exaLists.filter(row => allBrids.has(row.brid)); - newSelection.forEach(row => { - this.$refs.firstTable.toggleRowSelection(row, true); - }); - this.selectedFirstTable = newSelection; - } else { - // 鍒犻櫎锛屾暣涓粍鍙栨秷锛屽啀鎶婂墿涓� brid 鍒嗙粍琛ュ洖鍘� - const remaining = old.filter(row => row.brid !== changedRow.brid); - const remainBrids = [...new Set(remaining.map(r => r.brid))]; - const newSelection = this.exaLists.filter(row => remainBrids.includes(row.brid)); - newSelection.forEach(row => { - this.$refs.firstTable.toggleRowSelection(row, true); - }); - this.selectedFirstTable = newSelection; - } - } else { - this.selectedFirstTable = selected; - } + this.$refs.firstTable.clearSelection(); + if (isAdding) { + // 娣诲姞锛屾暣涓粍閫変笂 + 鍘熸湁閫夌殑 brid 涔熼�変笂 + const allBrids = new Set(); + selected.forEach(row => allBrids.add(row.brid)); + allBrids.add(changedRow.brid); + const newSelection = this.exaLists.filter(row => allBrids.has(row.brid)); + newSelection.forEach(row => { + this.$refs.firstTable.toggleRowSelection(row, true); + }); + this.selectedFirstTable = newSelection; + } else { + // 鍒犻櫎锛屾暣涓粍鍙栨秷锛屽啀鎶婂墿涓� brid 鍒嗙粍琛ュ洖鍘� + const remaining = old.filter(row => row.brid !== changedRow.brid); + const remainBrids = [...new Set(remaining.map(r => r.brid))]; + const newSelection = this.exaLists.filter(row => remainBrids.includes(row.brid)); + newSelection.forEach(row => { + this.$refs.firstTable.toggleRowSelection(row, true); + }); + this.selectedFirstTable = newSelection; + } + } else { + this.selectedFirstTable = selected; + } - this.fetchRightTableData(); - this.isProcessingSelection = false; -}, + this.fetchRightTableData(); + this.isProcessingSelection = false; + }, handleSelectionChangeSecond(selected) { @@ -269,18 +213,33 @@ }, tongbu() { + this.$modal.loading("姝e湪鍚屾锛岃绋嶅��..."); const requestData = { - lis: this.selectedFirstTable, + lis: this.selectedFirstTable ? this.selectedFirstTable.map((item) => ({ + ...item, + tjNum: this.queryParams.tjNum, + })) : [], + jcxmid: this.selectedFirstTable && this.selectedFirstTable.length > 0 ? this.selectedFirstTable[0].jcxmid : null, + shys: this.selectedFirstTable && this.selectedFirstTable.length > 0 ? this.selectedFirstTable[0].shys : null, tj: this.selectedSecondTable[0], }; - asyncPacs(requestData).then(res => { - if (res.code === 200) { - this.$message.success("鍚屾鎴愬姛锛�"); - this.fetchRightTableData(); - } else { - this.$message.error(res.message || "鍚屾澶辫触"); - } - }); + asyncPacs(requestData) + .then((res) => { + if (res.code === 200) { + this.fetchRightTableData(); + clearInterval(this.clearTimeSet); + this.clearTimeSet = null; + this.$modal.closeLoading(); + this.$modal.msgSuccess("鍚屾鎴愬姛锛�"); + } else { + this.$message.error(res.message || "鍚屾澶辫触锛岃绋嶅悗閲嶈瘯"); + } + }) + .catch((error) => { + clearInterval(this.clearTimeSet); + this.clearTimeSet = null; + this.$modal.closeLoading(); + }); }, }, }; @@ -291,6 +250,7 @@ padding: 20px; background: #f5f7fa; } + .table-header { text-align: center; background-color: #aad8df; @@ -301,11 +261,13 @@ margin-top: 10px; border-radius: 4px 4px 0 0; } + .table-title { text-align: left; margin: 20px 0; padding: 10px 0; } + .table-title h3 { font-size: 16px; color: #333; @@ -316,10 +278,12 @@ flex-wrap: wrap; gap: 20px; } + .table-title .highlight { font-weight: bold; color: #2c3e50; } + .el-table { border-radius: 4px; font-size: 14px; -- Gitblit v1.8.0