From 18f35fe78de41a1b240758c91e05380decb48978 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期五, 25 七月 2025 17:39:59 +0800 Subject: [PATCH] 1 --- src/views/doctor/inspectCheck/index.vue | 729 +++++++++++++++----------------------------------------- 1 files changed, 195 insertions(+), 534 deletions(-) diff --git a/src/views/doctor/inspectCheck/index.vue b/src/views/doctor/inspectCheck/index.vue index 4733eb7..943887e 100644 --- a/src/views/doctor/inspectCheck/index.vue +++ b/src/views/doctor/inspectCheck/index.vue @@ -1,304 +1,78 @@ <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 - > - <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 - > + <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> + <el-button icon="el-icon-check" type="primary" size="mini" style="margin-right: 15px" @click="tongbu"> + 鍚屾 + </el-button> </el-form-item> </el-form> - <!-- <div class="table-title"> - <h3>妫�楠岃褰�</h3> - </div> --> <div class="box"> - <div - style="text-align: center; background-color: #aad8df; margin-top: 10px" - > - 妫�楠岃褰� - <!-- {{ item.parent || "" }} --> - </div> + <div class="table-header">妫�楠岃褰�</div> <div> - <el-table - :data="exaLists" - border - style="width: 100%" - @selection-change="handleSelectionChange" - :header-cell-style="{ background: '#aad8df' }" - height="350" - > - <el-table-column - fixed - type="selection" - align="center" - label="閫夋嫨" - width="40" - > - </el-table-column> - <el-table-column - label="濮撳悕" - align="center" - prop="name" - width="80px" - /> - <el-table-column - label="鎬у埆" - align="center" - prop="gender" - width="80px" - /> - <el-table-column - label="骞撮緞" - align="center" - prop="patientAge" - width="80px" - > - </el-table-column> - <el-table-column - label="閫佹绉戝" - align="center" - prop="deptName" - width="100px" - /> - - <el-table-column - label="妫�楠岄」鐩�" - align="center" - prop="checkParts" - width="350px" - :show-overflow-tooltip="true" - /> - <el-table-column - label="椤圭洰缂栧彿" - align="center" - prop="jcxmid" - width="150px" - /> - <el-table-column - label="瀹℃牳鍖诲笀" - align="center" - prop="shys" - width="150px" - /> - <el-table-column - label="鎶ュ憡鏃堕棿" - align="center" - prop="examinationDate" - width="150px" - :formatter="formatDate" - /> - - <el-table-column - label="闂ㄨ瘖鍙�" - align="center" - prop="mzh" - width="140px" - /> - <el-table-column - label="鐢宠鍗曞彿" - align="center" - prop="brid" - width="145px" - /> - <el-table-column - label="鎶ュ憡鍖诲笀" - align="center" - prop="reportDoctorName" - width="120px" - /> - <el-table-column - label="妫�楠屽尰甯堝悕" - align="center" - prop="checkDoctorName" - width="120px" - /> - <el-table-column align="center" label="妫�娴嬮」鐩�" width="100px "> + <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="jcxmid" width="150" /> + <el-table-column label="瀹℃牳鍖诲笀" align="center" prop="shys" width="150" /> + <el-table-column label="鎶ュ憡鏃堕棿" align="center" prop="examinationDate" width="150" /> + <el-table-column label="闂ㄨ瘖鍙�" align="center" prop="mzh" width="140" /> + <el-table-column label="鐢宠鍗曞彿" align="center" prop="brid" width="145" /> + <el-table-column label="鎶ュ憡鍖诲笀" align="center" prop="reportDoctorName" width="120" /> + <el-table-column label="妫�楠屽尰甯堝悕" align="center" prop="checkDoctorName" width="120" /> + <el-table-column align="center" label="妫�娴嬮」鐩�" width="100"> <template slot-scope="scope"> <div>{{ scope.row.proName }}</div> </template> </el-table-column> - <el-table-column - align="center" - prop="proResult" - label="妫�娴嬬粨鏋�" - width="180" - > - </el-table-column> - <el-table-column align="center" prop="company" label="鍗曚綅"> - <!-- <template slot-scope="scope"> - <div v-if="scope.row.project != null"> - {{ scope.row.standard.company || "" }} - </div> - <div v-else>{{ scope.row.proAdvice }}</div> - </template> --> - </el-table-column> - <el-table-column - align="center" - prop="conclusion" - label="寮傚父" - width="180" - ></el-table-column> - <el-table-column - align="center" - prop="tjStandardGtValue" - label=" 鍙傝�冭寖鍥�" - > - <!-- <template slot-scope="scope"> - <div v-if="scope.row.project != null"> - {{ - scope.row.standard.tjStandardGtValue || - "/" + "-" + scope.row.standard.tjStandardLtValue || - "/" - }} - </div> - </template> --> - </el-table-column> + <el-table-column align="center" prop="proResult" label="妫�娴嬬粨鏋�" width="180" /> + <el-table-column align="center" prop="company" label="鍗曚綅" width="80" /> + <el-table-column align="center" prop="conclusion" label="寮傚父" width="180" /> + <el-table-column align="center" prop="tjStandardGtValue" label="鍙傝�冭寖鍥�" width="120" /> </el-table> </div> </div> - <!-- <el-table - id="ta" - ref="tb" - :data="exaLists" - v-loading="loading" - border - max-height="350" - @current-change="handleCurrentChange" - @selection-change="handleSelectionChange" - :row-class-name="tableRowClassName" - > - <el-table-column - fixed - type="selection" - align="center" - label="閫夋嫨" - width="40" - :selectable="isSelectable" - > - </el-table-column> - - <el-table-column label="濮撳悕" align="center" prop="name" width="80px" /> - <el-table-column label="鎬у埆" align="center" prop="gender" width="80px" /> - <el-table-column - label="骞撮緞" - align="center" - prop="patientAge" - width="80px" - > - </el-table-column> - <el-table-column - label="閫佹绉戝" - align="center" - prop="deptName" - width="100px" - /> - - <el-table-column - label="妫�鏌ラ」鐩�" - align="center" - prop="checkParts" - width="150px" - /> - <el-table-column - label="鎶ュ憡鏃堕棿" - align="center" - prop="examinationDate" - width="150px" - /> - - <el-table-column label="闂ㄨ瘖鍙�" align="center" prop="mzh" width="140px" /> - <el-table-column - label="鐢宠鍗曞彿" - align="center" - prop="brid" - width="145px" - /> - <el-table-column - label="缁撴灉鐘舵��" - align="center" - prop="diagnosis" - width="150" - :show-overflow-tooltip="true" - /> - <el-table-column - label="鎶ュ憡鍖诲笀" - align="center" - prop="reportDoctorName" - width="120px" - /> - <el-table-column - label="妫�鏌ュ尰甯堝悕" - align="center" - prop="checkDoctorName" - width="120px" - /> - - <el-table-column - label="缁撴灉琛ㄧ幇" - align="center" - prop="examination" - :show-overflow-tooltip="true" - /> - </el-table> --> - <div class="table-title"> - <h3>浣撴璁板綍</h3> + <h3> + 浣撴璁板綍锛� + <span class="highlight">濮撳悕锛歿{ infoList.tjCustomerName || "鏆傛棤" }}</span> + <span class="highlight"> + 鎬у埆锛� + {{ + infoList.tjCustomerSex == 0 + ? "鐢�" + : infoList.tjCustomerSex == 1 + ? "濂�" + : "鏆傛棤" + }} + </span> + <span class="highlight">骞撮緞锛歿{ infoList.tjCustomerAge || "鏆傛棤" }}</span> + <span class="highlight">闂ㄨ瘖鍙凤細{{ infoList.cardId || "鏆傛棤" }}</span> + </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" - > - <el-table-column type="selection" width="55"> </el-table-column> - <el-table-column - label="鐘舵��" - align="center" - prop="type" - :show-overflow-tooltip="true" - min-width="60" - > + :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"> <template slot-scope="scope"> <span v-if="scope.row.type == '0'">鏈</span> <span v-if="scope.row.type == '1'">宸叉</span> @@ -306,278 +80,153 @@ <span v-if="scope.row.type == '3'">寤舵湡</span> </template> </el-table-column> - <el-table-column - label="绉戝" - align="center" - prop="deptName" - min-width="115" - /> - <el-table-column - label="椤圭洰" - align="center" - prop="proName" - min-width="160" - /> - <el-table-column - label="鏀惰垂鏂瑰紡" - align="center" - prop="sffs" - min-width="80" - /> - <el-table-column - label="鏄惁鏀惰垂" - align="center" - prop="isPay" - min-width="80" - /> - <el-table-column - label="妫�楠屾椂闂�" - align="center" - prop="bcupdateTime" - min-width="160" - /> - - <el-table-column - label="鏈�鍚庝慨鏀规椂闂�" - align="center" - prop="zhupdateTime" - min-width="160" - /> + <el-table-column label="绉戝" align="center" prop="deptName" min-width="115" /> + <el-table-column label="椤圭洰" align="center" prop="proName" min-width="160" /> + <el-table-column label="鏀惰垂鏂瑰紡" align="center" prop="sffs" min-width="80" /> + <el-table-column label="鏄惁鏀惰垂" align="center" prop="isPay" min-width="80" /> + <el-table-column label="妫�楠屾椂闂�" align="center" prop="bcupdateTime" min-width="160" /> + <el-table-column label="鏈�鍚庝慨鏀规椂闂�" align="center" prop="zhupdateTime" min-width="160" /> </el-table> </div> </template> - - <script> + +<script> import { getlisList, getJyTjList, asyncPacs } from "@/api/doctor/pacsCheck"; -import moment from "moment"; +import { getOrderList } from "@/api/hosp/order"; export default { - dicts: ["dict_tj_status"], data() { return { - dis: false, - code: null, - createTimeList: "", - total: 0, - loading: false, - isSyncing: false, - // 鏌ヨ鍙傛暟 queryParams: { - // page: 1, - // pageSize: 20, - name: null, - start: null, - end: null, tjNum: null, }, - // 缁戝畾鍗曢�夋寜閽� - checkStatus: "0", exaLists: [], - selectedFirstTable: null, // 绗竴涓〃鏍奸�変腑琛� - selectedSecondTable: [], // 绗簩涓〃鏍奸�変腑琛� - // 琛ㄥ崟鍙傛暟 - form: {}, - clearTimeSet: null, - tjNumbers: "", - multipleSelection: "", - tjnum: "", - xiangmuList: [], checkList: [], - tg: true, - bh: true, - pickerOptions: { - shortcuts: [ - { - text: "鏈�杩戜竴鍛�", - onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); - picker.$emit("pick", [start, end]); - }, - }, - { - text: "鏈�杩戜竴涓湀", - onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); - picker.$emit("pick", [start, end]); - }, - }, - { - text: "鏈�杩戜笁涓湀", - onClick(picker) { - const end = new Date(); - const start = new Date(); - start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); - picker.$emit("pick", [start, end]); - }, - }, - ], - }, + infoList: {}, + selectedFirstTable: [], + selectedSecondTable: [], + loading: false, + isProcessingSelection: false, }; }, - mounted() { this.$nextTick(() => { this.$refs.inputName.focus(); }); }, methods: { - handleDateChange(val) { - if (val && val.length === 2) { - this.queryParams.start = val[0]; // 璁剧疆寮�濮嬫椂闂� - this.queryParams.end = val[1]; // 璁剧疆缁撴潫鏃堕棿 - } else { - this.queryParams.start = null; - this.queryParams.end = null; - } - console.log("Query Params:", this.queryParams); - }, - formatDate(row) { - if (!row.examinationDate) return ""; - - // 浣跨敤 moment 瑙f瀽鎸囧畾鏍煎紡鐨勬棩鏈熷瓧绗︿覆 - const date = moment(row.examinationDate, "MM DD YYYY hh:mmA"); - - if (!date.isValid()) return "鏃犳晥鏃ユ湡"; - - // 鏍煎紡鍖栦负鎵�闇�鏍煎紡 - return date.format("YYYY-MM-DD HH:mm"); - }, - // isSelectable(row) { - // return !!row.mzh; - // }, - tableRowClassName({ row }) { - return !row.mzh ? "row-disabled" : ""; - }, - - handleSelectionChange(val) { - console.log(val); - /* if (val.length > 1) { - let del_row = val.shift(); - this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑 - } - console.log(val, 999); */ - - if (val.length > 0) { - // const selectedRow = val[0]; - // console.log(val[0], 555); - - this.selectedFirstTable = val; - console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedFirstTable); - // this.fetchRightTableData(selectedRow); - } else { - this.selectedFirstTable = null; - this.checkList = []; - } - }, - // 鏍规嵁閫変腑鐨勮鏁版嵁璇锋眰鍙宠竟琛ㄦ牸鏁版嵁 - fetchRightTableData() { - const code = queryParams.tjNum; - // if (!code) return; - getJyTjList(code).then((response) => { - this.checkList = response.data; - this.loading = false; - }); - }, - - handleSelectionChangeSecond(selectedRows) { - this.selectedSecondTable = selectedRows; - if (selectedRows.length > 1) { - let del_row = selectedRows.shift(); - this.$refs.tab1.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑 - } - console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedSecondTable); - }, - getList() { - if (this.createTimeList) { - this.queryParams.start = this.createTimeList[0]; - this.queryParams.end = this.createTimeList[1]; - } else if (this.createTimeList == null) { - this.queryParams.start = null; - this.queryParams.end = null; - } - }, - - /** 鎼滅储鎸夐挳鎿嶄綔 */ - handleQuery() { - // this.queryParams.page = 1; - this.loading = true; + async handleQuery() { if (!this.queryParams.tjNum) { - this.loading = false; this.$message.error("浣撴鍙蜂笉鑳戒负绌�"); - return; // 缁堟璇锋眰 + return; } - getlisList(this.queryParams) - .then((res) => { - if (res.code == 200) { - this.loading = false; - this.exaLists = res.data; - // const code = this.exaLists[0].mzh; - const code = this.queryParams.tjNum; - getJyTjList(code).then((response) => { - this.checkList = response.data; - }); - } - }) - .catch((error) => { - this.loading = false; - this.$message.error(res.msg || "鏌ヨ澶辫触锛岃绋嶅悗閲嶈瘯"); - }); - this.getList(); + this.loading = true; + try { + const [orderResponse, lisResponse] = await Promise.all([ + getOrderList(this.queryParams).catch(() => ({ data: { list: [] } })), + getlisList(this.queryParams), + ]); + this.infoList = orderResponse.data.list?.[0] || {}; + this.exaLists = lisResponse.data.map((item, index) => ({ + ...item, + brid: item.brid?.trim(), + tempId: index, + })); + await this.fetchRightTableData(); + } catch (e) { + console.error(e); + } finally { + this.loading = false; + } }, - /** 閲嶇疆鎸夐挳鎿嶄綔 */ resetQuery() { - this.createTimeList = []; - this.resetForm("queryForm"); - this.queryParams = { - name: null, - start: null, - end: null, - tjNum: null, - }; - - // 娓呯┖鍏朵粬渚濊禆鏁版嵁 - this.checkList = []; + this.queryParams.tjNum = null; this.exaLists = []; + this.checkList = []; + this.infoList = {}; + }, + handleSelectionChange(selected) { + if (this.isProcessingSelection) return; + this.isProcessingSelection = true; + + // 鎵惧埌鐢ㄦ埛鍒氭搷浣滅殑閭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 (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.fetchRightTableData(); + this.isProcessingSelection = false; }, - handleCurrentChange(row) { - this.currentRow = row; - // console.log('褰撳墠閫変腑鐨勮:', row); + + handleSelectionChangeSecond(selected) { + this.selectedSecondTable = selected.slice(0, 1); }, - setTime() { - //璁剧疆瀹氭椂鍣� - this.clearTimeSet = setInterval(() => { - this.$modal.closeLoading(); - }, 300000); + fetchRightTableData() { + if (!this.queryParams.tjNum) return; + this.loading = true; + return getJyTjList(this.queryParams.tjNum) + .then(res => { + this.checkList = res.data || []; + }) + .finally(() => { + this.loading = false; + }); }, - tongbu(row) { + + tongbu() { this.$modal.loading("姝e湪鍚屾锛岃绋嶅��..."); - this.setTime(); const requestData = { - lis: this.selectedFirstTable.map((item) => ({ + lis: this.selectedFirstTable ? this.selectedFirstTable.map((item) => ({ ...item, tjNum: this.queryParams.tjNum, - })), - jcxmid: this.selectedFirstTable.jcxmid, - shys: this.selectedFirstTable.shys, - tj: this.selectedSecondTable[0], // 鍙充晶琛ㄦ牸閫変腑鏁版嵁 + })) : [], + 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], }; - - /* if (!this.selectedSecondTable || this.selectedSecondTable.length === 0) { - this.$message.error("鑷冲皯閫変竴鏉℃暟鎹紒"); - return; - } */ - asyncPacs(requestData) .then((res) => { - if (res.code == 200) { - this.fetchRightTableData(this.selectedFirstTable); + if (res.code === 200) { + this.fetchRightTableData(); clearInterval(this.clearTimeSet); this.clearTimeSet = null; this.$modal.closeLoading(); @@ -595,36 +244,48 @@ }, }; </script> - - <style lang="scss" scoped> -#ta .el-table__header-wrapper .el-checkbox { - display: none; + +<style lang="scss" scoped> +.app-container { + padding: 20px; + background: #f5f7fa; } -.el-table .warning-row { - background: #e5f3ff !important; -} -::v-deep .el-table__body tr.current-row > td { - background: #edf2fa !important; +.table-header { + text-align: center; + background-color: #aad8df; + padding: 10px; + font-size: 16px; + font-weight: bold; + color: #333; + margin-top: 10px; + border-radius: 4px 4px 0 0; } .table-title { - text-align: center; - margin-bottom: 10px; -} -.row-disabled { - color: #ccc; /* 璁剧疆绂佺敤琛岀殑瀛椾綋棰滆壊 */ - pointer-events: none; /* 绂佹榧犳爣鎿嶄綔 */ - background-color: #f5f5f5; /* 璁剧疆绂佺敤琛岀殑鑳屾櫙鑹� */ + text-align: left; + margin: 20px 0; + padding: 10px 0; } -.pag { - width: 100%; +.table-title h3 { + font-size: 16px; + color: #333; + margin: 0; + line-height: 1.5; display: flex; - justify-content: center; + align-items: center; + flex-wrap: wrap; + gap: 20px; } -.pag1 { - width: 30%; +.table-title .highlight { + font-weight: bold; + color: #2c3e50; } -</style> \ No newline at end of file + +.el-table { + border-radius: 4px; + font-size: 14px; +} +</style> -- Gitblit v1.8.0