From 38a40fefc0c7c6afb17958f6827304dbefda9873 Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期二, 24 六月 2025 08:58:28 +0800 Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb_region --- src/views/index.vue | 540 ++++++------ src/views/doctor/pacsCheck/index.vue | 541 ++++-------- src/api/system/user.js | 9 src/views/hosp/order/index.vue | 4 src/views/login.vue | 9 src/views/doctor/inspectCheck/index.vue | 605 +++++++------- src/views/system/notice/index.vue | 535 +++++++++--- src/api/system/notice.js | 7 src/views/system/zhiye/index.vue | 164 ++- 9 files changed, 1,264 insertions(+), 1,150 deletions(-) diff --git a/src/api/system/notice.js b/src/api/system/notice.js index c274ea5..4aea2e6 100644 --- a/src/api/system/notice.js +++ b/src/api/system/notice.js @@ -8,7 +8,12 @@ params: query }) } - +export function noticeToday() { + return request({ + url: '/system/notice/noticeToday', + method: 'get', + }) +} // 鏌ヨ鍏憡璇︾粏 export function getNotice(noticeId) { return request({ diff --git a/src/api/system/user.js b/src/api/system/user.js index 6a38491..9022ba4 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -11,7 +11,14 @@ params: query }) } - +// 鏌ヨ鐢ㄦ埛鍒楄〃 +export function listUser1(query) { + return request({ + url: '/system/user/userListByDeptId', + method: 'get', + params: query + }) +} export function getlistUser() { return request({ url: '/system/user/getList', diff --git a/src/views/doctor/inspectCheck/index.vue b/src/views/doctor/inspectCheck/index.vue index 97cb2d6..653baea 100644 --- a/src/views/doctor/inspectCheck/index.vue +++ b/src/views/doctor/inspectCheck/index.vue @@ -1,160 +1,67 @@ <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" - :disabled="!selectedFirstTable" - >鍚屾</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 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-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 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 - style="width: 100%" - height="350" - @selection-change="handleCurrentChange" - :header-cell-style="{ background: '#aad8df' }" - > - <!-- @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" - :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="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> - </div> - <el-table - border - max-height="280" - ref="tab1" - :data="checkList" - v-loading="loading" + <h3> + 浣撴璁板綍锛� + <span class="highlight">濮撳悕锛歿{ infoList.tjCustomerName || "鏆傛棤" }}</span> + <span class="highlight">鎬у埆锛歿{ infoList.tjCustomerSex == 0 ? "鐢�" : infoList.tjCustomerSex == 1 ? "濂�" : "鏆傛棤" }}</span> + <span class="highlight">骞撮緞锛歿{ infoList.tjCustomerAge || "鏆傛棤" }}</span> + </h3> +</div> + <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> @@ -162,76 +69,44 @@ <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 { getOrderList } from "@/api/hosp/order"; import moment from "moment"; export default { dicts: ["dict_tj_status"], data() { return { + isProcessing: false, // 闃叉姝诲惊鐜� + isDeselection: false, // 鏍囪鏄惁涓哄彇娑堥�変腑 + infoList: {}, dis: false, code: null, createTimeList: "", total: 0, loading: false, isSyncing: false, - // 鏌ヨ鍙傛暟 + isFetchingRightTableData: false, queryParams: { - // page: 1, - // pageSize: 20, name: null, start: null, end: null, tjNum: null, }, - // 缁戝畾鍗曢�夋寜閽� checkStatus: "0", exaLists: [], - selectedFirstTable: null, // 绗竴涓〃鏍奸�変腑琛� - selectedSecondTable: [], // 绗簩涓〃鏍奸�変腑琛� - // 琛ㄥ崟鍙傛暟 + selectedFirstTable: null, + selectedSecondTable: [], form: {}, clearTimeSet: null, tjNumbers: "", @@ -280,123 +155,199 @@ this.$refs.inputName.focus(); }); }, + methods: { handleDateChange(val) { if (val && val.length === 2) { - this.queryParams.start = val[0]; // 璁剧疆寮�濮嬫椂闂� - this.queryParams.end = val[1]; // 璁剧疆缁撴潫鏃堕棿 + 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); }, - // isSelectable(row) { - // return !!row.mzh; - // }, + tableRowClassName({ row }) { - return !row.mzh ? "row-disabled" : ""; + return !row.brid ? "row-disabled" : ""; }, - handleSelectionChange(val) { - console.log(val); - /* if (val.length > 1) { - let del_row = val.shift(); - this.$refs.tb.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑 +handleSelectionChange(val) { + // 闃叉閲嶅瑙﹀彂 + if (this.isProcessingSelection) { + return; + } + this.isProcessingSelection = true; + + // 濡傛灉娌℃湁閫変腑琛岋紝娓呯┖鎵�鏈夐�夋嫨骞惰烦杩囨帴鍙h皟鐢� + if (val.length === 0) { + this.$refs.firstTable.clearSelection(); + this.selectedFirstTable = null; + this.checkList = []; + this.isDeselection = true; + this.$nextTick(() => { + this.isProcessingSelection = false; + this.$refs.firstTable.$forceUpdate(); // 寮哄埗鍒锋柊琛ㄦ牸 + }); + return; + } + + // 妫�鏌ユ槸鍚︾偣鍑讳簡鍏ㄩ�夋寜閽紙val 闀垮害绛変簬琛ㄦ牸鎬昏鏁帮級 + if (val.length === this.exaLists.length) { + this.selectedFirstTable = [...this.exaLists]; // 閫変腑鎵�鏈夎 + this.$refs.firstTable.clearSelection(); + this.exaLists.forEach(row => { + if (!row.brid) { + return; } - console.log(val, 999); */ + this.$refs.firstTable.toggleRowSelection(row, true, false); + }); + } else { + // 鑾峰彇鏈�鏂伴�変腑鐨勮 + const latestSelectedRow = val[val.length - 1]; - 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 = []; - } - }, - - 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 = selectedRow; - console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedFirstTable); - this.fetchRightTableData(selectedRow); - } else { - this.selectedFirstTable = null; - this.checkList = []; - } - }, - // 鏍规嵁閫変腑鐨勮鏁版嵁璇锋眰鍙宠竟琛ㄦ牸鏁版嵁 - fetchRightTableData(selectedRow) { - const code = selectedRow.mzh; - if (!code) return; - this.loading = true; - getJyTjList(code).then((response) => { - this.checkList = response.data; - this.loading = false; + // 妫�鏌ユ槸鍚︾偣鍑讳簡宸查�変腑鐨勮锛堝彇娑堟墍鏈夐�変腑锛� + const isTogglingSelectedRow = this.selectedFirstTable && this.selectedFirstTable.some(row => row.tempId === latestSelectedRow.tempId); + if (isTogglingSelectedRow) { + this.$refs.firstTable.clearSelection(); + this.selectedFirstTable = null; + this.checkList = []; + this.isDeselection = true; + this.$nextTick(() => { + this.isProcessingSelection = false; + this.$refs.firstTable.$forceUpdate(); // 寮哄埗鍒锋柊琛ㄦ牸 }); - }, + return; + } - formatDate(row) { - if (!row.examinationDate) return ""; + // 姝e父閫変腑閫昏緫锛氭牴鎹� brid 绛涢�� + const filterKey = 'brid'; + const filterValue = latestSelectedRow.brid; - // 浣跨敤 moment 瑙f瀽鎸囧畾鏍煎紡鐨勬棩鏈熷瓧绗︿覆 - const date = moment(row.examinationDate, "MM DD YYYY hh:mmA"); + // 娓呯┖鎵�鏈夐�変腑鐘舵�� + this.$refs.firstTable.clearSelection(); - if (!date.isValid()) return "鏃犳晥鏃ユ湡"; + // 閫変腑涓� brid 鍖归厤鐨勮 + const rowsToSelect = this.exaLists.filter(row => row.brid === filterValue); + rowsToSelect.forEach(row => { + if (!row.brid) { + console.warn(`鍚嶇О涓� ${row.name} 鐨勮娌℃湁鐢宠鍗曞彿锛岃烦杩囬�夋嫨`); + return; + } + this.$refs.firstTable.toggleRowSelection(row, true, false); + }); - // 鏍煎紡鍖栦负鎵�闇�鏍煎紡 - return date.format("YYYY-MM-DD HH:mm"); + // 鏇存柊 selectedFirstTable 涓� brid 鍖归厤鐨勮 + this.selectedFirstTable = rowsToSelect; + } + + // 璋冪敤鍙充晶琛ㄦ牸鏁版嵁 + if (!this.isFetchingRightTableData && this.selectedFirstTable.length > 0) { + this.isFetchingRightTableData = true; + this.fetchRightTableData().finally(() => { + this.isFetchingRightTableData = false; + this.$nextTick(() => { + // 浠呮洿鏂版牱寮忥紝涓嶈Е鍙戞柊浜嬩欢 + this.$refs.firstTable.$forceUpdate(); + this.isProcessingSelection = false; + }); + }); + } else { + this.isProcessingSelection = false; + } + + // 閲嶇疆 isDeselection 鐘舵�� + this.isDeselection = false; +}, + fetchRightTableData() { + const code = this.queryParams.tjNum; + if (!code) { + console.warn('鏈彁渚涗綋妫�鍙凤紝璺宠繃 fetchRightTableData'); + this.checkList = []; + this.loading = false; + return Promise.resolve(); + } + this.loading = true; + return getJyTjList(code) + .then((response) => { + this.checkList = response.data || []; + this.loading = false; + }) + .catch((error) => { + console.error('鑾峰彇 checkList 澶辫触:', error); + this.checkList = []; + this.loading = false; + throw error; + }); }, handleSelectionChangeSecond(selectedRows) { this.selectedSecondTable = selectedRows; - console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedSecondTable); + if (selectedRows.length > 1) { + let del_row = selectedRows.shift(); + this.$refs.tab1.toggleRowSelection(del_row, false); + } }, - getList() { + + async handleQuery() { + if (!this.queryParams.tjNum) { + this.$message.error("浣撴鍙蜂笉鑳戒负绌�"); + return; + } + + this.loading = true; + try { + // 骞惰鎵ц涓や釜鏌ヨ + const [orderResponse, lisResponse] = await Promise.all([ + getOrderList(this.queryParams).catch((error) => { + console.error('鑾峰彇 orderList 澶辫触:', error); + return { data: { list: [] } }; // 杩斿洖绌烘暟鎹互缁х画鎵ц + }), + getlisList(this.queryParams), + ]); + + // 澶勭悊 getOrderList 缁撴灉 + if (orderResponse.data?.list?.length > 0) { + this.infoList = orderResponse.data.list[0]; + } else { + this.infoList = {}; + console.warn('getOrderList 杩斿洖绌哄垪琛�'); + } + + // 澶勭悊 getlisList 缁撴灉 + if (lisResponse.code === 200) { + this.exaLists = lisResponse.data.map((item, index) => ({ + ...item, + brid: item.brid?.trim(), // 娓呯悊绌烘牸 + mzh: item.mzh?.trim(), + tempId: index, + })); + + // 鑾峰彇鍙充晶琛ㄦ牸鏁版嵁 + await this.fetchRightTableData(); + } else { + this.exaLists = []; + this.$message.error(lisResponse.msg || "鏌ヨ妫�楠岃褰曞け璐�"); + } + } catch (error) { + console.error('鏌ヨ澶辫触:', error); + this.$message.error(error?.msg || "鏌ヨ澶辫触锛岃绋嶅悗閲嶈瘯"); + this.exaLists = []; + this.checkList = []; + this.infoList = {}; + } finally { + this.loading = false; + } + + // 澶勭悊鏃堕棿鑼冨洿 if (this.createTimeList) { this.queryParams.start = this.createTimeList[0]; this.queryParams.end = this.createTimeList[1]; - } else if (this.createTimeList == null) { + } else { this.queryParams.start = null; this.queryParams.end = null; } }, - /** 鎼滅储鎸夐挳鎿嶄綔 */ - handleQuery() { - // this.queryParams.page = 1; - this.loading = true; - getlisList(this.queryParams) - .then((res) => { - console.log(res, 1111); - if (res.code == 200) { - this.loading = false; - this.exaLists = res.data; - this.code = this.exaLists.mzh; - } - }) - .catch((error) => { - this.loading = false; - this.$message.error(res.msg || "鏌ヨ澶辫触锛岃绋嶅悗閲嶈瘯"); - }); - this.getList(); - }, - - /** 閲嶇疆鎸夐挳鎿嶄綔 */ resetQuery() { this.createTimeList = []; this.resetForm("queryForm"); @@ -406,40 +357,37 @@ end: null, tjNum: null, }; - - // 娓呯┖鍏朵粬渚濊禆鏁版嵁 this.checkList = []; this.exaLists = []; + this.infoList = {}; }, handleCurrentChange(row) { this.currentRow = row; - // console.log('褰撳墠閫変腑鐨勮:', row); }, setTime() { - //璁剧疆瀹氭椂鍣� this.clearTimeSet = setInterval(() => { this.$modal.closeLoading(); }, 300000); }, - tongbu(row) { + + tongbu() { this.$modal.loading("姝e湪鍚屾锛岃绋嶅��..."); this.setTime(); const requestData = { - pacs: this.selectedFirstTable, // 宸︿晶琛ㄦ牸閫変腑鏁版嵁 - tj: this.selectedSecondTable[0], // 鍙充晶琛ㄦ牸閫変腑鏁版嵁 + 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], }; - - 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(); @@ -455,38 +403,61 @@ }); }, }, -}; -</script> - - <style lang="scss" scoped> -#ta .el-table__header-wrapper .el-checkbox { - display: none; +};</script> +<style lang="scss" scoped> +.app-container { + padding: 20px; + background: #f5f7fa; +} + +.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: left; + margin: 20px 0; + padding: 10px 0; +} + +.table-title h3 { + font-size: 16px; + color: #333; + margin: 0; + line-height: 1.5; + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 20px; +} + +.table-title .highlight { + font-weight: bold; + color: #2c3e50; +} + +.el-table { + border-radius: 4px; + font-size: 14px; } .el-table .warning-row { background: #e5f3ff !important; } + ::v-deep .el-table__body tr.current-row > td { background: #edf2fa !important; } -.table-title { - text-align: center; - margin-bottom: 15px; -} .row-disabled { - color: #ccc; /* 璁剧疆绂佺敤琛岀殑瀛椾綋棰滆壊 */ - pointer-events: none; /* 绂佹榧犳爣鎿嶄綔 */ - background-color: #f5f5f5; /* 璁剧疆绂佺敤琛岀殑鑳屾櫙鑹� */ -} - -.pag { - width: 100%; - display: flex; - justify-content: center; -} - -.pag1 { - width: 30%; + color: #999; + background-color: #f5f5f5; } </style> \ No newline at end of file diff --git a/src/views/doctor/pacsCheck/index.vue b/src/views/doctor/pacsCheck/index.vue index dc7a31c..bd4bf76 100644 --- a/src/views/doctor/pacsCheck/index.vue +++ b/src/views/doctor/pacsCheck/index.vue @@ -1,195 +1,60 @@ <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" - @input="onInput" - /> + <el-input ref="inputName" v-model="queryParams.tjNum" placeholder="璇疯緭鍏ヤ綋妫�鍙�" clearable + @keyup.enter.native="handleQuery" @input="onInput" style="width: 170px" /> </el-form-item> - <!-- <el-form-item label="濮撳悕" prop="name"> - <el-input - v-model="queryParams.name" - placeholder="璇疯緭鍏ュ鍚�" - clearable - @keyup.enter.native="handleQuery" - style="width: 110px" - /> - </el-form-item> - <el-form-item label="鐧昏鏃堕棿" prop="createTimeList"> - <el-date-picker - v-model="createTimeList" - type="datetimerange" - align="right" - :picker-options="pickerOptions" - style="width: 310px" - start-placeholder="寮�濮嬫棩鏈�" - end-placeholder="缁撴潫鏃ユ湡" - format="yyyy.MM.dd" - value-format="yyyy.MM.dd " - @change="handleDateChange" - > - </el-date-picker> - </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 size="mini" @click="tongbu(scope.row)" - >鍚屾</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" - :disabled="!selectedFirstTable" - >鍚屾</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" + :disabled="!selectedFirstTable"> + 鍚屾 + </el-button> </el-form-item> </el-form> - <!-- <el-radio-group - v-model="checkStatus" - @input="radioChange" - style="margin: 10px 15px" - > - </el-radio-group> --> - <div class="table-title"> - <h3>妫�鏌ヨ褰�</h3> + <div class="table-title table-header"> + <div style="text-align: center;">妫�鏌ヨ褰�</div> </div> - <!-- v-loading="loading" :row-class-name="tableRowClassName" @current-change="handleCurrentChange" --> - <el-table - id="ta" - ref="tb" - :data="exaLists" - v-loading="loading" - border - height="350" - @current-change="handleCurrentChange" - @selection-change="handleSelectionChange" + <el-table ref="tb" :data="exaLists" v-loading="loading" border style="width: 100%" 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" - /> - <!-- :formatter="formatDate" --> - <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" - /> - <!-- :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" - /> + :header-cell-style="{ background: '#aad8df', fontSize: '14px', color: '#333' }"> + <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="150" /> + <el-table-column label="鎶ュ憡鏃堕棿" align="center" prop="examinationDate" width="153" :formatter="formatDate" /> + <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="diagnosis" width="150" :show-overflow-tooltip="true" /> + <el-table-column label="鎶ュ憡鍖诲笀" align="center" prop="reportDoctorName" width="120" /> + <el-table-column label="妫�鏌ュ尰甯堝悕" align="center" prop="checkDoctorName" width="120" /> + <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> + </h3> </div> - <el-table - border - max-height="280" - ref="tab1" - :data="checkList" - v-loading="loading" + <el-table border max-height="280" 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> @@ -197,92 +62,42 @@ <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 class="pag"> - <div class="pag1"> - <!-- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :pager-count="5" :current-page.sync="currentPage1" :current-page="page" - :page-sizes="pageSize" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="total"> - </el-pagination> --> - <!-- <pagination - v-show="total > 0" - :total="total" - :pager-count="5" - :page.sync="queryParams.page" - :limit.sync="queryParams.pageSize" - @pagination="getList" - /> --> - </div> - </div> </div> </template> - - <script> +<script> import { getLeftList, getRightList, asyncPacs } from "@/api/doctor/pacsCheck"; +import { getOrderList } from "@/api/hosp/order"; import moment from "moment"; export default { dicts: ["dict_tj_status"], data() { return { + infoList: {}, dis: false, code: null, createTimeList: "", total: 0, loading: false, isSyncing: false, - // 鏌ヨ鍙傛暟 + isFetchingRightTableData: false, queryParams: { - // page: 1, - // pageSize: 20, name: null, start: null, end: null, tjNum: null, }, - // 缁戝畾鍗曢�夋寜閽� checkStatus: "0", exaLists: [], - selectedFirstTable: null, // 绗竴涓〃鏍奸�変腑琛� - selectedSecondTable: [], // 绗簩涓〃鏍奸�変腑琛� - // 琛ㄥ崟鍙傛暟 + selectedFirstTable: null, + selectedSecondTable: [], form: {}, clearTimeSet: null, tjNumbers: "", @@ -331,78 +146,59 @@ this.$refs.inputName.focus(); }); }, + methods: { onInput(val) { - this.inputVal = val.replace(/\s+/g, ""); // 娓呴櫎鎵�鏈夌┖鏍� + this.queryParams.tjNum = val.replace(/\s+/g, ""); }, + handleDateChange(val) { if (val && val.length === 2) { - this.queryParams.start = val[0]; // 璁剧疆寮�濮嬫椂闂� - this.queryParams.end = val[1]; // 璁剧疆缁撴潫鏃堕棿 + 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); }, - // isSelectable(row) { - // return !!row.mzh; - // }, + tableRowClassName({ row }) { - return !row.mzh ? "row-disabled" : ""; + return !row.brid ? "row-disabled" : ""; }, + 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"); + const date = moment(row.examinationDate, "YYYY-MM-DD HH:mm:ss"); + return date.isValid() ? date.format("YYYY-MM-DD HH:mm") : "鏃犳晥鏃ユ湡"; }, 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); - /* if (!selectedRow.mzh) { - this.$refs.tb.toggleRowSelection(selectedRow, false); - this.$message.warning("褰撳墠琛屾棤鏈夋晥闂ㄨ瘖鍙凤紝涓嶈兘閫変腑"); - return; - } */ - this.selectedFirstTable = selectedRow; - console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedFirstTable); + + this.selectedFirstTable = val; + const code = this.queryParams.tjNum; if (!code) { this.$message.warning("浣撴鍙蜂笉鑳戒负绌�!"); - return; // 鐩存帴杩斿洖锛岄伩鍏嶇户缁墽琛岃姹� + return; } this.loading = true; getRightList(code).then((response) => { this.checkList = response.data; this.loading = false; }); - // this.fetchRightTableData(selectedRow); } else { this.selectedFirstTable = null; this.checkList = []; } }, - // 鏍规嵁閫変腑鐨勮鏁版嵁璇锋眰鍙宠竟琛ㄦ牸鏁版嵁 + fetchRightTableData(selectedRow) { const code = this.queryParams.tjNum; - // const code = selectedRow.mzh; - // if (!code) return; + this.loading = true; getRightList(code).then((response) => { this.checkList = response.data; @@ -410,45 +206,92 @@ }); }, + fetchRightTableData() { + const code = this.queryParams.tjNum; + if (!code) { + console.warn('鏈彁渚涗綋妫�鍙凤紝璺宠繃 fetchRightTableData'); + this.checkList = []; + this.loading = false; + return Promise.resolve(); + } + this.loading = true; + return getRightList(code) + .then((response) => { + this.checkList = response.data || []; + this.loading = false; + }) + .catch((error) => { + console.error('鑾峰彇 checkList 澶辫触:', error); + this.checkList = []; + this.loading = false; + throw error; + }); + }, + handleSelectionChangeSecond(selectedRows) { this.selectedSecondTable = selectedRows; if (selectedRows.length > 1) { let del_row = selectedRows.shift(); - this.$refs.tab1.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑 + this.$refs.tab1.toggleRowSelection(del_row, false); } - console.log("褰撳墠閫変腑鐨勮鏁版嵁:", this.selectedSecondTable); + }, - getList() { + + async handleQuery() { + if (!this.queryParams.tjNum) { + this.$message.error("浣撴鍙蜂笉鑳戒负绌�"); + return; + } + + this.loading = true; + try { + const [orderResponse, leftResponse] = await Promise.all([ + getOrderList(this.queryParams).catch((error) => { + console.error('鑾峰彇 orderList 澶辫触:', error); + return { data: { list: [] } }; + }), + getLeftList(this.queryParams), + ]); + + if (orderResponse.data?.list?.length > 0) { + this.infoList = orderResponse.data.list[0]; + } else { + this.infoList = {}; + console.warn('getOrderList 杩斿洖绌哄垪琛�'); + } + + if (leftResponse.code === 200) { + this.exaLists = leftResponse.data.map((item, index) => ({ + ...item, + brid: item.brid?.trim(), + mzh: item.mzh?.trim(), + tempId: index, + })); + + await this.fetchRightTableData(); + } else { + this.exaLists = []; + this.$message.error(leftResponse.msg || "鏌ヨ妫�鏌ヨ褰曞け璐�"); + } + } catch (error) { + console.error('鏌ヨ澶辫触:', error); + this.$message.error(error?.msg || "鏌ヨ澶辫触锛岃绋嶅悗閲嶈瘯"); + this.exaLists = []; + this.checkList = []; + this.infoList = {}; + } finally { + this.loading = false; + } + if (this.createTimeList) { this.queryParams.start = this.createTimeList[0]; this.queryParams.end = this.createTimeList[1]; - } else if (this.createTimeList == null) { + } else { this.queryParams.start = null; this.queryParams.end = null; } }, - /** 鎼滅储鎸夐挳鎿嶄綔 */ - handleQuery() { - // this.queryParams.page = 1; - this.loading = true; - getLeftList(this.queryParams) - .then((res) => { - console.log(res, 1111); - if (res.code == 200) { - this.loading = false; - this.exaLists = res.data; - // this.code = this.exaLists.mzh; - } - }) - .catch((error) => { - this.loading = false; - this.$message.error(res.msg || "鏌ヨ澶辫触锛岃绋嶅悗閲嶈瘯"); - }); - this.getList(); - }, - - /** 閲嶇疆鎸夐挳鎿嶄綔 */ resetQuery() { this.createTimeList = []; this.resetForm("queryForm"); @@ -458,19 +301,16 @@ end: null, tjNum: null, }; - - // 娓呯┖鍏朵粬渚濊禆鏁版嵁 this.checkList = []; this.exaLists = []; + this.infoList = {}; }, handleCurrentChange(row) { this.currentRow = row; - // console.log('褰撳墠閫変腑鐨勮:', row); }, setTime() { - //璁剧疆瀹氭椂鍣� this.clearTimeSet = setInterval(() => { this.$modal.closeLoading(); }, 300000); @@ -478,22 +318,19 @@ tongbu(row) { this.$modal.loading("姝e湪鍚屾锛岃绋嶅��..."); this.setTime(); - // console.log(val, 66); this.selectedFirstTable.tjnum = this.queryParams.tjNum; + const requestData = { - pacs: this.selectedFirstTable, // 宸︿晶琛ㄦ牸閫変腑鏁版嵁 + pacs: this.selectedFirstTable.map((item) => ({ + ...item, + tjNum: this.queryParams.tjNum, + })),// 宸︿晶琛ㄦ牸閫変腑鏁版嵁 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(); @@ -506,42 +343,72 @@ clearInterval(this.clearTimeSet); this.clearTimeSet = null; this.$modal.closeLoading(); - // this.$modal.error("鎿嶄綔澶辫触锛岃绋嶅悗閲嶈瘯"); + this.$message.error("鍚屾澶辫触锛岃绋嶅悗閲嶈瘯"); }); }, }, }; </script> - - <style lang="scss" scoped> -#ta .el-table__header-wrapper .el-checkbox { - display: none; +<style lang="scss" scoped> +.app-container { + padding: 20px; + background: #f5f7fa; +} + +.table-header { + text-align: center; + background-color: #aad8df; + padding: 10px; + font-size: 16px; + font-weight: bold; + color: #333; + border-radius: 4px 4px 0 0; + margin: 10px 0 0 0; + /* 椤堕儴闂磋窛淇濈暀锛屽簳閮ㄩ棿璺濈Щ闄� */ +} + +.table-title { + text-align: center; + padding: 10px 0; +} + +.table-title.table-header h3 { + margin: 0; + font-weight: bold; + color: #333; +} + +.table-title h3 { + font-size: 16px; + color: #333; + margin: 0; + line-height: 1.5; + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 20px; +} + +.table-title .highlight { + font-weight: bold; + color: #2c3e50; +} + +.el-table { + border-radius: 4px; + font-size: 14px; } .el-table .warning-row { background: #e5f3ff !important; } -::v-deep .el-table__body tr.current-row > td { + +::v-deep .el-table__body tr.current-row>td { background: #edf2fa !important; } -.table-title { - text-align: center; - margin-bottom: 15px; -} .row-disabled { - color: #ccc; /* 璁剧疆绂佺敤琛岀殑瀛椾綋棰滆壊 */ - pointer-events: none; /* 绂佹榧犳爣鎿嶄綔 */ - background-color: #f5f5f5; /* 璁剧疆绂佺敤琛岀殑鑳屾櫙鑹� */ -} - -.pag { - width: 100%; - display: flex; - justify-content: center; -} - -.pag1 { - width: 30%; + color: #999; + background-color: #f5f5f5; } </style> \ No newline at end of file diff --git a/src/views/hosp/order/index.vue b/src/views/hosp/order/index.vue index e883655..0068a69 100644 --- a/src/views/hosp/order/index.vue +++ b/src/views/hosp/order/index.vue @@ -2014,6 +2014,8 @@ this.DataList3 = []; this.Datalists = []; this.TotalPrice1 = 0; + this.filterText = "", + this.filterage = "", this.orderId = row.orderId; this.cusId = row.tjCusIdCard; this.userId = row.userId; @@ -2094,6 +2096,8 @@ this.DataList = []; this.DataList3 = []; this.Datalists = []; + this.filterText = "", + this.filterage = "", this.TotalPrice1 = 0; this.orderId = this.ids; this.cusId = this.cusIds; diff --git a/src/views/index.vue b/src/views/index.vue index d925659..1ea2590 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,6 +1,30 @@ <template> <div class="centre"> - <div style="display:flex;justify-content: center;align-items: center;"> + <!-- 浠婃棩閫氱煡 --> + <div style="display: flex; justify-content: center; align-items: center;"> + <h4>浠婃棩閫氱煡</h4> + </div> + <div class="notice-area"> + <el-carousel :interval="2000" direction="vertical" :autoplay="true" :loop="true" height="120px" + v-if="groupedNoticeList.length > 0" class="carousel"> + <el-carousel-item v-for="(group, index) in groupedNoticeList" :key="index"> + <div class="notice-group"> + <div class="notice-item" v-for="notice in group" :key="notice.noticeId" + @click="goToNotice(notice.noticeId)"> + <el-tag size="small" :type="notice.noticeType === '1' ? 'info' : 'warning'"> + {{ notice.noticeType === '1' ? '閫氱煡' : '鍏憡' }} + </el-tag> + <span class="notice-title">{{ notice.noticeTitle || '鏃犳爣棰�' }}</span> + <span class="notice-time">{{ parseTime(notice.createTime, '{y}-{m}-{d}') || '鏃犳椂闂�' }}</span> + </div> + </div> + </el-carousel-item> + </el-carousel> + <div v-else class="no-notice">鏆傛棤閫氱煡</div> + </div> + + <!-- 浠婃棩缁熻 --> + <div style="display: flex; justify-content: center; align-items: center;"> <h4>浠婃棩缁熻</h4> </div> <div class="top"> @@ -37,11 +61,13 @@ </div> </div> </div> - <div style="display:flex;justify-content: center;align-items: center;"> + + <!-- 杩戜竴鏈堢粺璁� --> + <div style="display: flex; justify-content: center; align-items: center;"> <h4>杩戜竴鏈堢粺璁�</h4> </div> <div class="data-view"> - <div id="main"></div> + <div id="main" style="width: 95%; height: 330px"></div> </div> <div class="view"> <div id="main2"></div> @@ -52,11 +78,13 @@ <script> import { getCustomer, getOrder, getReportToday, getTobeToday, getPieChart, getChart } from "@/api/home"; +import { noticeToday } from "@/api/system/notice"; const echarts = require('echarts/lib/echarts'); require('echarts/lib/component/title'); require('echarts/lib/component/tooltip'); require('echarts/lib/component/legend'); require('echarts/lib/chart/pie'); +require('echarts/lib/chart/line'); export default { data() { @@ -73,323 +101,304 @@ teamYYNum: [], PieChart: [], PieChart2: [], - } + noticeList: [], + groupedNoticeList: [], // 鍒嗙粍鍚庣殑閫氱煡鍒楄〃 + loading: false + }; }, created() { this.getList(); - }, + watch: { - $route(to, from) { - window.location.reload(); //鐩戞祴鍒拌矾鐢卞彂鐢熻烦杞椂鍒锋柊涓�娆¢〉闈� - // this.$router.go(0); - }, + $route(to, from) { + window.location.reload(); }, - + noticeList: { + handler(newList) { + // 灏嗛�氱煡鎸夋瘡缁勪笁鏉″垎缁� + this.groupedNoticeList = this.chunkArray(newList, 3); + console.log('groupedNoticeList:', this.groupedNoticeList); // 璋冭瘯 + }, + deep: true + } + }, methods: { - + goToNotice(noticeId) { + this.$router.push({ + path: '/notice', + query: { noticeId } + }); + }, getList() { this.loading = true; - - // 淇敼API璋冪敤鐨勯敊璇鐞� - getCustomer().then((response) => { - this.Customer = response || 0; // 娣诲姞榛樿鍊� + + // 鏌ヨ鎵�鏈夊叕鍛� + noticeToday().then(response => { + console.log('Notice API response:', response); + this.noticeList = response.rows || response.data || []; + console.log('noticeList:', this.noticeList); + this.loading = false; + this.$nextTick(() => { + console.log('Carousel updated'); + }); }).catch(error => { - console.error('鑾峰彇浠婃棩鐧昏鏁版嵁澶辫触:', error); - this.Customer = 0; + console.error('Notice API error:', error); + this.$message.error("鑾峰彇閫氱煡澶辫触锛�" + error.message); + this.loading = false; }); - getOrder().then((response) => { - this.Order = response || 0; - }).catch(error => { - console.error('鑾峰彇浠婃棩宸叉鏁版嵁澶辫触:', error); - this.Order = 0; + // 鏌ヨ浠婃棩鐧昏 + getCustomer().then(response => { + this.Customer = response.data || response; + this.loading = false; }); - getReportToday().then((response) => { - this.ReportToday = response || 0; - }).catch(error => { - console.error('鑾峰彇浠婃棩鎶ュ憡鏁版嵁澶辫触:', error); - this.ReportToday = 0; + // 鏌ヨ浠婃棩宸叉 + getOrder().then(response => { + this.Order = response.data || response; + this.loading = false; }); - getTobeToday().then((response) => { - this.TobeToday = response || 0; - }).catch(error => { - console.error('鑾峰彇浠婃棩寰呮鏁版嵁澶辫触:', error); - this.TobeToday = 0; + // 鏌ヨ浠婃棩鎶ュ憡 + getReportToday().then(response => { + this.ReportToday = response.data || response; + this.loading = false; }); - // 淇敼鎶樼嚎鍥炬暟鎹鐞� - getChart().then((response) => { - if (response && response.data) { - this.LineChart = []; - this.reportNum = []; - this.personYYNum = []; - this.teamYYNum = []; - - response.data.forEach(item => { - this.LineChart.push(item.date); - this.reportNum.push(item.tdcoun || 0); - this.personYYNum.push(item.grcoun || 0); - this.teamYYNum.push(item.bgcoun || 0); - }); - let myChart = this.$echarts.init(document.getElementById('main')); + // 鏌ヨ浠婃棩寰呮 + getTobeToday().then(response => { + this.TobeToday = response.data || response; + this.loading = false; + }); - myChart.setOption({ - tooltip: { - trigger: 'axis' - }, - legend: { - data: ['姣忔棩浣撴鐧昏鏁�', '姣忔棩鍥綋鐧昏鏁�', '姣忔棩鍙戝竷鎶ュ憡鏁�'] - }, - grid: { - left: '3%', - right: '4%', - bottom: '3%', - containLabel: true - }, - toolbox: { - feature: { - saveAsImage: {} - } - }, - xAxis: { - type: 'category', - boundaryGap: false, - axisLine: { - show: true, - lineStyle: { - color: "blue", - size: 12, - width: 0, - tyle: "solid" - } - }, - data: this.LineChart - }, - yAxis: { - type: 'value', - min: 0, - max: 100, - interval: 5 - }, - series: [ - { - name: '姣忔棩浣撴鐧昏鏁�', - type: 'line', - stack: 'Total', - data: this.personYYNum - }, - { - name: '姣忔棩鍥綋鐧昏鏁�', - type: 'line', - stack: 'Total', - data: this.reportNum - }, - { - name: '姣忔棩鍙戝竷鎶ュ憡鏁�', - type: 'line', - stack: 'Total', - data: this.teamYYNum - }, - ] + // 鎶樼嚎鍥� + getChart().then(response => { + response.data.forEach(item => { + this.LineChart.push(item.date); + this.reportNum.push(item.tdcoun); + this.personYYNum.push(item.grcoun); + this.teamYYNum.push(item.bgcoun); + }); - }) - let sizeFun = ()=> { - myChart.resize() - } - window.addEventListener("resize", sizeFun) + let myChart = this.$echarts.init(document.getElementById('main')); + myChart.setOption({ + tooltip: { trigger: 'axis' }, + legend: { data: ['姣忔棩浣撴鐧昏鏁�', '姣忔棩鍥綋鐧昏鏁�', '姣忔棩鍙戝竷鎶ュ憡鏁�'] }, + grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true }, + toolbox: { feature: { saveAsImage: {} } }, + xAxis: { + type: 'category', + boundaryGap: false, + axisLine: { + show: true, + lineStyle: { width: 0, color: 'blue', type: 'solid' } + }, + data: this.LineChart + }, + yAxis: { type: 'value', min: 0, max: 400, interval: 20 }, + series: [ + { name: '姣忔棩浣撴鐧昏鏁�', type: 'line', stack: 'Total', data: this.personYYNum }, + { name: '姣忔棩鍥綋鐧昏鏁�', type: 'line', stack: 'Total', data: this.reportNum }, + { name: '姣忔棩鍙戝竷鎶ュ憡鏁�', type: 'line', stack: 'Total', data: this.teamYYNum } + ] + }); - this.loading = false; - } - }).catch(error => { - console.error('鑾峰彇鍥捐〃鏁版嵁澶辫触:', error); + const sizeFun = () => myChart.resize(); + window.addEventListener('resize', sizeFun); + this.loading = false; }); // 楗肩姸鍥� - getPieChart().then((response) => { + getPieChart().then(response => { if (response.data) { - - if(response.data.tjdj == 0){ - this.PieChart = [] - this.PieChart = [ - { - "name": "浣撴鐧昏浜烘暟鍒嗗竷", - "count": 1, - "value": 10 - }, - - ] - }else if (response.data.tjdj.length === 0) { - - this.PieChart = [] - this.PieChart = [ - { - "name": "浣撴鐧昏浜烘暟鍒嗗竷", - "count": 1, - "value": 10 - }, - - ] + if (response.data.tjdj == 0 || !response.data.tjdj?.length) { + this.PieChart = [{ name: '浣撴鐧昏浜烘暟鍒嗗竷', count: 1, value: 10 }]; } else { - this.PieChart = response.data.tjdj - this.PieChart.forEach(item => { - item.value = item.count - }) - this.PieChart.reverse() - this.PieChart.push(this.PieChart[0]) - this.PieChart.splice(0, 1) - + this.PieChart = response.data.tjdj; + this.PieChart.forEach(item => { item.value = item.count; }); + this.PieChart.reverse(); + this.PieChart.push(this.PieChart[0]); + this.PieChart.splice(0, 1); } let myChart2 = this.$echarts.init(document.getElementById('main2')); myChart2.setOption({ - title: { - text: '浣撴鐧昏浜烘暟鍒嗗竷', - top: '5' + title: { text: '浣撴鐧昏浜烘暟鍒嗗竷', top: '5' }, + tooltip: { trigger: 'item' }, + legend: { top: '80%', left: 'center' }, + series: [{ + type: 'pie', + radius: ['16%', '54%'], + center: ['50%', '43%'], + avoidLabelOverlap: false, + startAngle: 180, + minAngle: 10, + data: this.PieChart, + emphasis: { + itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } + } + }] + }); - }, - - tooltip: { - trigger: 'item' - }, - legend: { - top: '80%', - left: 'center' - }, - series: [ - { - // name: 'Access From', - type: 'pie', - radius: ['16%', '54%'], - center: ["50%", "43%"], - avoidLabelOveralap:false, - startAngle:180, - minAngle:10, - data: this.PieChart, - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - } - }] - }) - - if(response.data.tjyc == 0){ - this.PieChart2 = [] - this.PieChart2 = [ - { - "name": "浣撴缁撴灉寮傚父浜烘暟鍒嗗竷", - "count": 1, - "value": 0 - }, - - ] - }else if (response.data.tjyc.length === 0) { - this.PieChart2 = [] - this.PieChart2 = [ - { - "name": "浣撴缁撴灉寮傚父浜烘暟鍒嗗竷", - "count": 1, - "value": 0 - }, - - ] + if (response.data.tjyc == 0 || !response.data.tjyc?.length) { + this.PieChart2 = [{ name: '浣撴缁撴灉寮傚父浜烘暟鍒嗗竷', count: 1, value: 0 }]; } else { - this.PieChart2 = response.data.tjyc - this.PieChart2.reverse() - this.PieChart2.push(this.PieChart2[0]) - this.PieChart2.splice(0, 1) - this.PieChart2.forEach(item => { - item.value = item.count - }) - // this.TobeToday = response + this.PieChart2 = response.data.tjyc; + this.PieChart2.reverse(); + this.PieChart2.push(this.PieChart2[0]); + this.PieChart2.splice(0, 1); + this.PieChart2.forEach(item => { item.value = item.count; }); } + let myChart3 = this.$echarts.init(document.getElementById('main3')); - myChart3.setOption({ - title: { - text: '浣撴缁撴灉寮傚父浜烘暟鍒嗗竷', - top: '5' + title: { text: '浣撴缁撴灉寮傚父浜烘暟鍒嗗竷', top: '5' }, + tooltip: { trigger: 'item' }, + legend: { top: '80%', left: 'center' }, + series: [{ + type: 'pie', + radius: ['16%', '54%'], + center: ['50%', '43%'], + avoidLabelOverlap: false, + startAngle: 180, + minAngle: 10, + data: this.PieChart2, + emphasis: { + itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } + } + }] + }); - }, - tooltip: { - trigger: 'item' - }, - legend: { - top: '80%', - left: 'center' - }, - series: [ - { - // name: 'Access From', - type: 'pie', - radius: ['16%', '54%'], - center: ["50%", "43%"], - avoidLabelOveralap:false, - startAngle:180, - minAngle:10, - data: this.PieChart2, - emphasis: { - itemStyle: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - } - }] - }) - window.onresize = () =>{ - myChart2.resize() - myChart3.resize() + window.onresize = () => { + myChart2.resize(); + myChart3.resize(); + }; } - } - - - this.loading = false; }); + }, + // 鏁扮粍鍒嗙粍鏂规硶 + chunkArray(array, size) { + if (!array || array.length === 0) return []; + const result = []; + for (let i = 0; i < array.length; i += size) { + result.push(array.slice(i, i + size)); + } + // 纭繚寰幆婊氬姩骞虫粦锛岃嫢涓嶈冻 size 鏉★紝琛ラ綈 + if (array.length % size !== 0 && array.length > size) { + const lastGroup = result[result.length - 1]; + while (lastGroup.length < size) { + lastGroup.push(array[lastGroup.length % array.length]); + } + } + return result; + }, + + parseTime(time, cFormat) { + if (!time) return ''; + try { + const date = new Date(time); + if (isNaN(date.getTime())) return ''; + const formatObj = { + y: date.getFullYear(), + m: String(date.getMonth() + 1).padStart(2, '0'), + d: String(date.getDate()).padStart(2, '0'), + h: String(date.getHours()).padStart(2, '0'), + i: String(date.getMinutes()).padStart(2, '0'), + s: String(date.getSeconds()).padStart(2, '0') + }; + return cFormat.replace(/{([ymdhis]+)}/g, (result, key) => formatObj[key] || ''); + } catch (error) { + console.error('parseTime error:', error, 'time:', time); + return ''; + } } - }, - - - mounted() { - } -} - - +}; </script> <style> .centre { min-height: 820px; - margin: 15px 15px; + margin: 15px; background-color: #f3f3f3; - padding: 10px 10px 10px 10px; + padding: 10px; +} + +.notice-area { + width: 100%; + min-height: 120px; + /* 璋冩暣涓轰笁鏉¢�氱煡楂樺害 */ + background-color: #fff; + margin: 10px 0; + padding: 0 20px; +} + +.carousel { + width: 100% !important; +} + +.notice-group { + display: flex; + flex-direction: column; + height: 120px; + /* 纭繚鍖呭惈涓夋潯閫氱煡 */ +} + +.notice-item { + display: flex; + align-items: center; + width: 100%; + height: 40px; + line-height: 40px; + font-size: 14px; + cursor: pointer; +} + +.notice-title { + margin-left: 10px; + font-size: 14px; + color: #333; + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.notice-time { + font-size: 12px; + color: #999; + margin-left: 20px; +} + +.no-notice { + width: 100%; + height: 120px; + /* 涓庤疆鎾珮搴︿竴鑷� */ + line-height: 120px; + text-align: center; + color: #999; + font-size: 14px; } .top { width: 100%; display: flex; height: 120px; - } .add { - width: 380px; + width: 320px; height: 75px; - margin-top: 30px; + margin-top: 20px; margin-left: 20px; margin-right: 20px; background-color: #fff; - display: flex + display: flex; } .img { @@ -403,7 +412,6 @@ .image { width: 60px; height: 60px; - } .txt { @@ -414,34 +422,26 @@ .day { height: 40px; line-height: 40px; - font-size: 14px; + font-size: 12px; } .data-view { margin: 0 15px; - height: 323px !important + height: 323px !important; } #main { padding: 10px; - width:95%; - height:330px } .view { - margin: 0px 15px; + margin: 0 15px; padding-top: 15px; min-height: 350px; display: flex; } -#main2 { - width: 820px; - height: 350px; - background-color: #fff; - margin-right: 20px; -} - +#main2, #main3 { width: 820px; height: 350px; diff --git a/src/views/login.vue b/src/views/login.vue index c477418..a4e01dc 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -64,7 +64,7 @@ </div> </template> -<script> +<script> import { getCodeImg, getconfigKey } from "@/api/login"; import Cookies from "js-cookie"; @@ -176,8 +176,11 @@ case '8097': this.loginForm.hospId = "wbzxyy"; break; - case '8098': + case '8098': this.loginForm.hospId = "bjxjyy"; + break; + case '8099': + this.loginForm.hospId = "bjfhyy"; break; } Cookies.set("hospId", this.loginForm.hospId); @@ -199,7 +202,7 @@ case '9016': this.loginForm.hospId = "wbzxyy"; break; - case '9017': + case '9017': this.loginForm.hospId = "bjxjyy"; break; } diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue index 71d6425..a338adf 100644 --- a/src/views/system/notice/index.vue +++ b/src/views/system/notice/index.vue @@ -2,29 +2,15 @@ <div class="app-container"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form-item label="鍏憡鏍囬" prop="noticeTitle"> - <el-input - v-model="queryParams.noticeTitle" - placeholder="璇疯緭鍏ュ叕鍛婃爣棰�" - clearable - @keyup.enter.native="handleQuery" - /> + <el-input v-model="queryParams.noticeTitle" placeholder="璇疯緭鍏ュ叕鍛婃爣棰�" clearable @keyup.enter.native="handleQuery" /> </el-form-item> <el-form-item label="鎿嶄綔浜哄憳" prop="createBy"> - <el-input - v-model="queryParams.createBy" - placeholder="璇疯緭鍏ユ搷浣滀汉鍛�" - clearable - @keyup.enter.native="handleQuery" - /> + <el-input v-model="queryParams.createBy" placeholder="璇疯緭鍏ユ搷浣滀汉鍛�" clearable @keyup.enter.native="handleQuery" /> </el-form-item> <el-form-item label="绫诲瀷" prop="noticeType"> <el-select v-model="queryParams.noticeType" placeholder="鍏憡绫诲瀷" clearable> - <el-option - v-for="dict in dict.type.sys_notice_type" - :key="dict.value" - :label="dict.label" - :value="dict.value" - /> + <el-option v-for="dict in dict.type.sys_notice_type" :key="dict.value" :label="dict.label" + :value="dict.value" /> </el-select> </el-form-item> <el-form-item> @@ -35,51 +21,48 @@ <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> - <el-button type="primary" - icon="el-icon-plus" - size="mini" - @click="handleAdd" - v-hasPermi="['system:notice:add']" - >鏂板</el-button> + <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" + v-hasPermi="['system:notice:add']">鏂板</el-button> </el-col> <el-col :span="1.5"> - <el-button type="primary" - icon="el-icon-edit" - size="mini" - :disabled="single" - @click="handleUpdate" - v-hasPermi="['system:notice:edit']" - >淇敼</el-button> + <el-button type="primary" icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" + v-hasPermi="['system:notice:edit']">淇敼</el-button> </el-col> <el-col :span="1.5"> - <el-button type="primary" - icon="el-icon-delete" - size="mini" - :disabled="multiple" - @click="handleDelete" - v-hasPermi="['system:notice:remove']" - >鍒犻櫎</el-button> + <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" + v-hasPermi="['system:notice:remove']">鍒犻櫎</el-button> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-row> - <el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange"> + <el-table + v-loading="loading" + :data="noticeList" + @selection-change="handleSelectionChange" + :row-class-name="tableRowClassName" + ref="table" + > <el-table-column type="selection" width="55" align="center" /> <el-table-column label="搴忓彿" align="center" prop="noticeId" width="100" /> - <el-table-column - label="鍏憡鏍囬" - align="center" - prop="noticeTitle" - :show-overflow-tooltip="true" - /> + <el-table-column label="鍏憡鏍囬" align="center" prop="noticeTitle" :show-overflow-tooltip="true" /> <el-table-column label="鍏憡绫诲瀷" align="center" prop="noticeType" width="100"> <template slot-scope="scope"> - <dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType"/> + <dict-tag :options="dict.type.sys_notice_type" :value="scope.row.noticeType" /> </template> </el-table-column> <el-table-column label="鐘舵��" align="center" prop="status" width="100"> <template slot-scope="scope"> - <dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status"/> + <dict-tag :options="dict.type.sys_notice_status" :value="scope.row.status" /> + </template> + </el-table-column> + <el-table-column label="鎺ユ敹绉戝" align="center" prop="deptId" width="150"> + <template slot-scope="scope"> + <span>{{ getDeptNames(scope.row.deptId) }}</span> + </template> + </el-table-column> + <el-table-column label="鎺ユ敹鐢ㄦ埛" align="center" prop="userIds" width="200" :show-overflow-tooltip="true"> + <template slot-scope="scope"> + <span>{{ getUserNames(scope.row.userIds) }}</span> </template> </el-table-column> <el-table-column label="鍒涘缓鑰�" align="center" prop="createBy" width="100" /> @@ -90,37 +73,20 @@ </el-table-column> <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> - <el-button - size="mini" - type="text" - icon="el-icon-edit" - @click="handleUpdate(scope.row)" - v-hasPermi="['system:notice:edit']" - >淇敼</el-button> - <el-button - size="mini" - type="text" - icon="el-icon-delete" - @click="handleDelete(scope.row)" - v-hasPermi="['system:notice:remove']" - >鍒犻櫎</el-button> - <el-button - size="mini" - type="text" - icon="el-icon-share" - @click="handledetails(scope.row)" - v-hasPermi="['system:notice:remove']" - >璇︽儏</el-button> + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" + v-hasPermi="['system:notice:edit']">淇敼</el-button> + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" + v-hasPermi="['system:notice:remove']">鍒犻櫎</el-button> + <el-button size="mini" type="text" icon="el-icon-share" @click="handledetails(scope.row)" + v-hasPermi="['system:notice:query']">璇︽儏</el-button> </template> </el-table-column> </el-table> - <div class="pag"> - <div class="pag1"> - <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" - :limit.sync="queryParams.pageSize" @pagination="getList" /> - </div> - </div> + <div class="pagination-container"> + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" @pagination="getList" /> + </div> <!-- 娣诲姞鎴栦慨鏀瑰叕鍛婂璇濇 --> <el-dialog :title="title" :visible.sync="open" width="780px" append-to-body> @@ -134,34 +100,37 @@ <el-col :span="12"> <el-form-item label="鍏憡绫诲瀷" prop="noticeType"> <el-select v-model="form.noticeType" placeholder="璇烽�夋嫨鍏憡绫诲瀷"> - <el-option - v-for="dict in dict.type.sys_notice_type" - :key="dict.value" - :label="dict.label" - :value="dict.value" - ></el-option> + <el-option v-for="dict in dict.type.sys_notice_type" :key="dict.value" :label="dict.label" + :value="dict.value"></el-option> </el-select> </el-form-item> </el-col> - <el-col :span="12" v-if="form.noticeType == 1"> - <el-form-item label="閫氱煡浜哄憳" prop="noticeType"> - <el-input v-model="form.noticeTitle" placeholder="璇疯緭鍏ラ�氱煡浜哄憳" /> + <el-col :span="12"> + <el-form-item label="鎺ユ敹绉戝" prop="deptId"> + <el-select v-model="form.deptId" filterable placeholder="璇烽�夋嫨鎺ユ敹绉戝" @change="handleDeptChange"> + <el-option v-for="dept in deptList" :key="dept.id" :label="dept.label" :value="dept.id"></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鎺ユ敹鐢ㄦ埛" prop="userIds"> + <el-select v-model="form.userIds" multiple filterable placeholder="璇烽�夋嫨鎺ユ敹鐢ㄦ埛"> + <el-option v-for="user in editUserList" :key="user.userId" :label="user.nickName || user.userName" + :value="user.userId"></el-option> + </el-select> </el-form-item> </el-col> <el-col :span="12"> <el-form-item label="鐘舵��"> <el-radio-group v-model="form.status"> - <el-radio - v-for="dict in dict.type.sys_notice_status" - :key="dict.value" - :label="dict.value" - >{{dict.label}}</el-radio> + <el-radio v-for="dict in dict.type.sys_notice_status" :key="dict.value" + :label="dict.value">{{ dict.label }}</el-radio> </el-radio-group> </el-form-item> </el-col> <el-col :span="24"> <el-form-item label="鍐呭"> - <editor v-model="form.noticeContent" :min-height="192"/> + <editor v-model="form.noticeContent" :min-height="192" /> </el-form-item> </el-col> </el-row> @@ -172,46 +141,44 @@ </div> </el-dialog> - <!--閫氱煡鍏憡璇︽儏 --> + <!-- 閫氱煡鍏憡璇︽儏 --> <el-dialog :title="formIn.noticeTitle" :visible.sync="openDetail" width="800px" append-to-body> - <div style="margin-top:-20px;margin-bottom:10px;"> - <el-tag size="mini" effect="dark" type="warning" v-if="form.noticeType==2">鍏憡</el-tag> + <div class="detail-header"> + <el-tag size="mini" effect="dark" type="warning" v-if="formIn.noticeType === '2'">鍏憡</el-tag> <el-tag size="mini" effect="dark" v-else>閫氱煡</el-tag> - <span style="margin-left:20px;">{{formIn.createTime}}</span> + <span class="time">{{ parseTime(formIn.createTime, '{y}-{m}-{d} {h}:{i}:{s}') || '鏃�' }}</span> </div> - <div class="content"> - <div v-html="formIn.noticeContent" style="margin-left:0px;margin-right:76px" class="ql-editor"></div> + <div class="detail-item"> + <span class="label">鎺ユ敹绉戝锛�</span> + <span>{{ getDeptNames(formIn.deptId) }}</span> + </div> + <div class="detail-item"> + <span class="label">鎺ユ敹鐢ㄦ埛锛�</span> + <span>{{ getUserNames(formIn.userIds) }}</span> + </div> + <div class="detail-content"> + <div v-html="formIn.noticeContent" class="ql-editor"></div> </div> <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="cancel"> 鍏� 闂� </el-button> + <el-button type="primary" @click="cancel">鍏抽棴</el-button> </div> </el-dialog> - </div> </template> <script> import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice"; +import { deptTreeSelect } from "@/api/system/dept"; +import { listUser1 } from "@/api/system/user"; export default { name: "Notice", - dicts: ['sys_notice_status', 'sys_notice_type'], + dicts: ["sys_notice_status", "sys_notice_type"], data() { - let checkPhoneNum = (rule, value, callback) => { - console.log( value) - let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/); - if (value == "" && value == undefined && !value) { - return callback(''); - } else if(value != undefined && value != ""){ - return callback(); - }else if (!patter.test(value)) { - return callback(''); - } - }; return { // 閬僵灞� loading: true, - openDetail:false, + openDetail: false, // 閫変腑鏁扮粍 ids: [], // 闈炲崟涓鐢� @@ -224,49 +191,190 @@ total: 0, // 鍏憡琛ㄦ牸鏁版嵁 noticeList: [], + // 绉戝鍒楄〃 + deptList: [], + // 鐢ㄦ埛鍒楄〃锛堝叏灞�锛岀敤浜庤〃鏍煎拰璇︽儏锛� + userList: [], + // 鐢ㄦ埛鍒楄〃锛堢敤浜庣紪杈戝璇濇锛� + editUserList: [], // 寮瑰嚭灞傛爣棰� title: "", // 鏄惁鏄剧ず寮瑰嚭灞� open: false, + // 鏄惁涓哄垵娆″姞杞� + isInitialLoad: true, // 鏌ヨ鍙傛暟 queryParams: { pageNum: 1, pageSize: 10, noticeTitle: undefined, createBy: undefined, - status: undefined + noticeType: undefined, }, - formIn:{}, + formIn: {}, // 琛ㄥ崟鍙傛暟 - form: {}, + form: { + noticeId: undefined, + noticeTitle: undefined, + noticeType: undefined, + noticeContent: undefined, + status: "0", + deptId: undefined, + userIds: [], + }, // 琛ㄥ崟鏍¢獙 rules: { - noticeTitle: [ - { required: true, validator: checkPhoneNum, trigger: "blur" } + noticeTitle: [{ required: true, message: "鍏憡鏍囬涓嶈兘涓虹┖", trigger: "blur" }], + noticeType: [{ required: true, message: "鍏憡绫诲瀷涓嶈兘涓虹┖", trigger: "change" }], + deptId: [ + { + required: false, + message: "璇烽�夋嫨鎺ユ敹绉戝", + trigger: "change", + validator: (rule, value, callback) => { + callback(); // 闈炲繀濉� + }, + }, ], - noticeType: [ - { required: true, validator: checkPhoneNum, trigger: "change" } - ] - } + userIds: [ + { + required: false, + message: "璇烽�夋嫨鎺ユ敹鐢ㄦ埛", + trigger: "change", + validator: (rule, value, callback) => { + callback(); // 闈炲繀濉� + }, + }, + ], + }, }; }, created() { this.getList(); + // 鑾峰彇绉戝鍒楄〃 + deptTreeSelect() + .then((response) => { + this.deptList = response.data || []; + this.deptList = this.flattenDeptList(this.deptList); + console.log("Flattened deptList:", this.deptList); + }) + .catch((error) => { + this.$modal.msgError("鑾峰彇绉戝鍒楄〃澶辫触锛�" + error.message); + }); + // 棰勫姞杞芥墍鏈夌敤鎴峰垪琛紙鐢ㄤ簬琛ㄦ牸鍜岃鎯咃級 + listUser1({}) + .then((response) => { + this.userList = (response.rows || response.data || []).map(user => ({ + ...user, + userId: String(user.userId), + })); + this.editUserList = [...this.userList]; // 鍒濆鍖栫紪杈戠敤鎴峰垪琛� + console.log("Preloaded userList:", this.userList); + }) + .catch((error) => { + this.$modal.msgError("鑾峰彇鐢ㄦ埛鍒楄〃澶辫触锛�" + error.message); + }); + // 澶勭悊璺宠浆鍙傛暟 + this.handleRouteParams(); }, methods: { /** 鏌ヨ鍏憡鍒楄〃 */ getList() { this.loading = true; - listNotice(this.queryParams).then(response => { + listNotice(this.queryParams).then((response) => { this.noticeList = response.rows; this.total = response.total; this.loading = false; + // 楂樹寒鎴栨墦寮�璇︽儏锛堜粎鍒濇鍔犺浇鏃惰Е鍙戣鎯咃級 + this.$nextTick(() => { + this.highlightNotice(this.isInitialLoad); + this.isInitialLoad = false; // 鏍囪涓洪潪鍒濇鍔犺浇 + }); + }).catch((error) => { + console.error("listNotice error:", error); + this.$modal.msgError("鑾峰彇鍏憡鍒楄〃澶辫触锛�" + error.message); + this.loading = false; }); + }, + /** 澶勭悊璺敱鍙傛暟 */ + handleRouteParams() { + const { noticeId } = this.$route.query; + if (noticeId) { + this.queryParams.noticeId = noticeId; + this.getList(); + } + }, + /** 楂樹寒鎴栨墦寮�鍏憡璇︽儏 */ + highlightNotice(isInitialLoad) { + const { noticeId } = this.$route.query; + if (noticeId) { + const notice = this.noticeList.find(item => item.noticeId === noticeId); + if (notice) { + this.$refs.table.setCurrentRow(notice); + if (isInitialLoad) { + this.handledetails(notice); // 浠呭垵娆″姞杞芥椂鎵撳紑璇︽儏 + } + } + } + }, + /** 琛ㄦ牸琛岀被鍚� */ + tableRowClassName({ row }) { + const { noticeId } = this.$route.query; + return noticeId && row.noticeId === noticeId ? 'highlight-row' : ''; + }, + /** 灏嗙瀹D杞崲涓虹瀹ゅ悕绉� */ + getDeptNames(deptId) { + if (!deptId) return "鏃�"; + const dept = this.deptList.find((dept) => dept.id === deptId); + return dept ? dept.label : "鏈煡绉戝"; + }, + /** 灏嗙敤鎴稩D杞崲涓虹敤鎴峰悕 */ + getUserNames(userIds) { + if (!userIds) return "鏃�"; + const ids = typeof userIds === "string" ? userIds.split(",") : userIds; + const names = this.userList + .filter((user) => ids.includes(user.userId)) + .map((user) => user.nickName || user.userName) + .join(", "); + return names || ids.join(", "); + }, + /** 灞曞钩閮ㄩ棬鏍戝舰缁撴瀯 */ + flattenDeptList(depts, result = []) { + depts.forEach((dept) => { + result.push({ id: String(dept.id), label: dept.label }); + if (dept.children && dept.children.length) { + this.flattenDeptList(dept.children, result); + } + }); + return result; + }, + /** 绉戝閫夋嫨鍙樺寲鏃惰皟鐢� */ + handleDeptChange(deptId) { + if (deptId) { + this.editUserList = []; + return listUser1({ deptId }) + .then((response) => { + this.editUserList = (response.rows || response.data || []).map(user => ({ + ...user, + userId: String(user.userId), + })); + console.log("Fetched editUserList for deptId", deptId, ":", this.editUserList); + }) + .catch((error) => { + this.$modal.msgError("鑾峰彇鐢ㄦ埛鍒楄〃澶辫触锛�" + error.message); + this.editUserList = [...this.userList]; // 鍥為��鍒板叏灞�鐢ㄦ埛鍒楄〃 + }); + } else { + console.log("No deptId, retained form.userIds:", this.form.userIds); + this.editUserList = [...this.userList]; // 鎭㈠涓哄叏灞�鐢ㄦ埛鍒楄〃 + return Promise.resolve(); + } }, // 鍙栨秷鎸夐挳 cancel() { + console.log("Cancel triggered, resetting form and closing dialogs"); this.open = false; - this.openDetail = false, + this.openDetail = false; this.reset(); }, // 琛ㄥ崟閲嶇疆 @@ -276,8 +384,11 @@ noticeTitle: undefined, noticeType: undefined, noticeContent: undefined, - status: "0" + status: "0", + deptId: undefined, + userIds: [], }; + this.editUserList = [...this.userList]; // 閲嶇疆涓哄叏灞�鐢ㄦ埛鍒楄〃 this.resetForm("form"); }, /** 鎼滅储鎸夐挳鎿嶄綔 */ @@ -292,46 +403,90 @@ }, // 澶氶�夋閫変腑鏁版嵁 handleSelectionChange(selection) { - this.ids = selection.map(item => item.noticeId) - this.single = selection.length!=1 - this.multiple = !selection.length + this.ids = selection.map((item) => item.noticeId); + this.single = selection.length !== 1; + this.multiple = !selection.length; }, /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { + console.log("handleAdd triggered"); this.reset(); this.open = true; this.title = "娣诲姞鍏憡"; }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { + console.log("handleUpdate triggered for noticeId:", row.noticeId); this.reset(); - const noticeId = row.noticeId || this.ids - getNotice(noticeId).then(response => { - this.form = response.data; - this.open = true; - this.title = "淇敼鍏憡"; - }); + const noticeId = row.noticeId || this.ids; + getNotice(noticeId) + .then((response) => { + console.log("getNotice response:", response.data); + const data = response.data; + this.form = { + noticeId: data.noticeId, + noticeTitle: data.noticeTitle, + noticeType: data.noticeType, + noticeContent: data.noticeContent, + status: data.status, + deptId: data.deptId ? String(data.deptId) : undefined, + userIds: data.userIds ? (typeof data.userIds === 'string' ? data.userIds.split(',') : data.userIds) : [], + }; + if (this.form.deptId) { + return this.handleDeptChange(this.form.deptId).then(() => { + this.open = true; + this.title = "淇敼鍏憡"; + console.log("Modification dialog opened, form:", this.form, "editUserList:", this.editUserList); + }); + } else { + this.editUserList = [...this.userList]; + console.log("No deptId, retained form.userIds:", this.form.userIds, "editUserList:", this.editUserList); + this.open = true; + this.title = "淇敼鍏憡"; + console.log("Modification dialog opened, form:", this.form); + return Promise.resolve(); + } + }) + .catch((error) => { + console.error("getNotice error:", error); + this.$modal.msgError("鑾峰彇鍏憡璇︽儏澶辫触锛�" + error.message); + }); }, - - handledetails(row){ + /** 璇︽儏鎸夐挳鎿嶄綔 */ + handledetails(row) { + console.log("handledetails triggered for noticeId:", row.noticeId); this.formIn = row; this.openDetail = true; + console.log("Detail dialog opened, formIn:", this.formIn); }, /** 鎻愪氦鎸夐挳 */ - submitForm: function() { - this.$refs["form"].validate(valid => { + submitForm() { + console.log("submitForm triggered, form:", this.form); + this.$refs["form"].validate((valid) => { if (valid) { - if (this.form.noticeId != undefined) { - updateNotice(this.form).then(response => { + const formData = { + ...this.form, + deptId: this.form.deptId ? String(this.form.deptId) : "", + userIds: this.form.userIds || [], + }; + console.log("Submitting formData:", formData); + if (formData.noticeId != undefined) { + updateNotice(formData).then((response) => { this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); + }).catch((error) => { + console.error("updateNotice error:", error); + this.$modal.msgError("淇敼澶辫触锛�" + error.message); }); } else { - addNotice(this.form).then(response => { + addNotice(formData).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); + }).catch((error) => { + console.error("addNotice error:", error); + this.$modal.msgError("鏂板澶辫触锛�" + error.message); }); } } @@ -339,24 +494,102 @@ }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { - const noticeIds = row.noticeId || this.ids - this.$modal.confirm('鏄惁纭鍒犻櫎鍏憡缂栧彿涓�"' + noticeIds + '"鐨勬暟鎹」锛�').then(function() { - return delNotice(noticeIds); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + console.log("handleDelete triggered for noticeId:", row.noticeId); + const noticeIds = row.noticeId || this.ids; + this.$modal + .confirm('鏄惁纭鍒犻櫎鍏憡缂栧彿涓�"' + noticeIds + '"鐨勬暟鎹」锛�') + .then(() => delNotice(noticeIds)) + .then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }) + .catch(() => {}); + }, + /** 鏃堕棿鏍煎紡鍖� */ + parseTime(time, cFormat = '{y}-{m}-{d} {h}:{i}:{s}') { + if (!time) return ''; + try { + const date = new Date(time); + if (isNaN(date.getTime())) return ''; + const formatObj = { + y: date.getFullYear(), + m: String(date.getMonth() + 1).padStart(2, '0'), + d: String(date.getDate()).padStart(2, '0'), + h: String(date.getHours()).padStart(2, '0'), + i: String(date.getMinutes()).padStart(2, '0'), + s: String(date.getSeconds()).padStart(2, '0') + }; + return cFormat.replace(/{([ymdhis]+)}/g, (result, key) => formatObj[key] || ''); + } catch (error) { + console.error('parseTime error:', error, 'time:', time); + return ''; + } } - } + }, }; </script> + <style scoped> -.pag { - width: 100%; +/* 瀹瑰櫒鏍峰紡锛岀‘淇濆唴瀹规湁閫傚綋鍐呰竟璺� */ +.app-container { + padding: 20px; +} + +/* 鍒嗛〉瀹瑰櫒锛屾浛鎹㈠師 .pag 鍜� .pag1锛屽眳涓樉绀� */ +.pagination-container { display: flex; justify-content: center; + margin-top: 20px; } -.pag1{ - width: 30%; + +/* 楂樹寒琛屾牱寮忥紝绐佸嚭鏄剧ず璺敱鎸囧畾鐨勫叕鍛� */ +.highlight-row { + background-color: #e6f7ff; } -</style> + +/* 瀵硅瘽妗嗗簳閮ㄦ寜閽眳涓� */ +.dialog-footer { + text-align: center; + padding: 10px 0; +} + +/* 璇︽儏瀵硅瘽妗嗗ご閮紙绫诲瀷鏍囩鍜屾椂闂达級 */ +.detail-header { + margin: -20px 0 10px; + display: flex; + align-items: center; +} + +.detail-header .time { + margin-left: 20px; + color: #606266; +} + +/* 璇︽儏瀵硅瘽妗嗕俊鎭」锛堟帴鏀剁瀹ゃ�佹帴鏀剁敤鎴凤級 */ +.detail-item { + margin-bottom: 10px; +} + +.detail-item .label { + font-weight: bold; + color: #303133; +} + +/* 璇︽儏瀵硅瘽妗嗗唴瀹瑰尯鍩燂紝闄愬埗瀵屾枃鏈珮搴� */ +.detail-content .ql-editor { + max-height: 300px; + overflow-y: auto; + padding: 10px; + color: #303133; +} + +/* 琛ㄦ牸鎿嶄綔鍒楋紝浼樺寲鎸夐挳闂磋窛 */ +.small-padding { + padding: 0 10px; +} + +/* 鎼滅储琛ㄥ崟椤堕儴闂磋窛 */ +.mb8 { + margin-bottom: 8px; +} +</style> \ No newline at end of file diff --git a/src/views/system/zhiye/index.vue b/src/views/system/zhiye/index.vue index 1ae360c..9459fcc 100644 --- a/src/views/system/zhiye/index.vue +++ b/src/views/system/zhiye/index.vue @@ -758,7 +758,7 @@ tuantiSelect, deptTreeSelect, projectGetList, - getOrderzhiye, + getOrder, getProParentIdDxList, getProSonDxList, getCusIdcard, @@ -2380,8 +2380,7 @@ } }); }, - - Package() { +Package() { this.activeNames = "first"; if (this.form.cusSex == "鐢�") { this.form.cusSex = 0; @@ -2391,33 +2390,93 @@ let cusSex = this.form.cusSex; this.datekey = Date.now(); //鍏ㄩ儴濂楅 - this.taocan = true; - this.loading = true; - deptTreeSelect(cusSex).then((response) => { - this.newpacName = response.rows; - try { - if (this.tableData1.length >= 1) { - this.newpacName.forEach((item3) => { - this.tableData1.forEach((item4) => { - item4.list.forEach((item6) => { - if (item6.pacName === item3.pacName) { - this.$nextTick(() => { - this.$refs.tb.toggleRowSelection(item3, true); + + let param = { + sex: cusSex, + dwId: this.form.firmId || "", + }; + if (this.form.tjType == 6) { + if (!this.form.firmId && !this.form.firmName) { + this.$message({ + type: "warning", + message: "璇峰厛缁存姢鍗曚綅锛�", + }); + } else if (!this.form.firmId && this.form.firmName) { + this.taocan = true; + this.loading = true; + deptTreeSelect(cusSex).then((response) => { + this.newpacName = response.rows; + try { + if (this.tableData1.length >= 1) { + this.newpacName.forEach((item3) => { + this.tableData1.forEach((item4) => { + item4.list.forEach((item6) => { + if (item6.pacName === item3.pacName) { + this.$nextTick(() => { + this.$refs.tb.toggleRowSelection(item3, true); + }); + throw Error(); + } }); - throw Error(); - } + }); + }); + } + } catch (error) { } + this.loading = false; + }); + } else { + this.taocan = true; + this.loading = true; + tuantiSelect(param).then((res) => { + this.newpacName = res.data; + try { + if (this.tableData1.length >= 1) { + this.newpacName.forEach((item3) => { + this.tableData1.forEach((item4) => { + item4.list.forEach((item6) => { + if (item6.pacName === item3.pacName) { + this.$nextTick(() => { + this.$refs.tb.toggleRowSelection(item3, true); + }); + throw Error(); + } + }); + }); + }); + } + } catch (error) { } + this.loading = false; + }); + } + } else { + this.taocan = true; + this.loading = true; + deptTreeSelect(cusSex).then((response) => { + this.newpacName = response.rows; + try { + if (this.tableData1.length >= 1) { + this.newpacName.forEach((item3) => { + this.tableData1.forEach((item4) => { + item4.list.forEach((item6) => { + if (item6.pacName === item3.pacName) { + this.$nextTick(() => { + this.$refs.tb.toggleRowSelection(item3, true); + }); + throw Error(); + } + }); }); }); - }); - } - } catch (error) { } - this.loading = false; - }); - + } + } catch (error) { } + this.loading = false; + }); + } }, // 鐐瑰嚮澶氶�夋鑾峰彇閫変腑鏁版嵁 handleSelectionChange(selection, row) { + console.log(selection) this.tableData = selection; if (selection.length > 1) { let del_row = selection.shift(); @@ -2462,37 +2521,6 @@ }); } if (selection[0]) { - // this.DataList = []; - // this.data = JSON.parse(JSON.stringify(this.dXData)); - // selection[0].tjProjectList.forEach((selectionitem) => { - // this.Treedata.forEach((item) => { - // if (selectionitem.proName == item.proName) { - // item.disabled = true; - // item.tjProjectList = []; - // } - // if (item.tjProjectList) { - // item.tjProjectList.forEach((item1) => { - // if (selectionitem.proName == item1.proName) { - // item1.disabled = true; - // item1.tjProjectList = []; - // } - // if (item1.tjProjectList) { - // item1.tjProjectList.forEach((item2) => { - // if (selectionitem.proName == item2.proName) { - // item2.disabled = true; - // item2.tjProjectList = []; - // } - // }); - // } - // }); - // } - // }); - // this.TreedataList.forEach((item3) => { - // if (item3.proParentId == selectionitem.proId) { - // item.disabled = true; - // } - // }); - // }); } else { this.treedataList = JSON.parse(JSON.stringify(this.dXData)); return; @@ -2841,6 +2869,7 @@ // 椤圭洰鎻愪氦 submit() { + if (this.form.cusIdcard) { var cusId = this.form.cusIdcard; } else { @@ -3041,7 +3070,7 @@ }; } - getOrderzhiye(data).then((res) => { + getOrder(data).then((res) => { this.$modal.msgSuccess("鎻愪氦鎴愬姛"); this.tjNumbers = res.msg; this.charge = true; @@ -3214,7 +3243,14 @@ }, listgetOrder(data) { - getOrderzhiye(data).then((res) => { + const loading = this.$loading({ + lock: true, + text: '姝e湪鍔犺浇涓紝璇风◢绛夛紒', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + getOrder(data).then((res) => { + loading.close(); this.$modal.msgSuccess("鎻愪氦鎴愬姛"); //璋冩帴鍙f樉绀哄妫�鍗� const tjNumber = res.msg; @@ -3226,8 +3262,7 @@ this.$tab.refreshPage(); }, - // 鏈�鍚庢彁浜ゆ寜閽� - submitPrice() { + submitPrice() { let _this = this; this.loadingSubmit = true; if (_this.tjCategory !== "") { @@ -3278,12 +3313,11 @@ discount: item.discount, parentProId: item.parentProId, cusIdCard: item.cusId, - yhj: item.nowPrice + yhj: item.nowPrice, })); // 鍒涘缓鏂扮殑瀵硅薄锛屽寘鍚� discount 鍜� id gaibianzhekou(newArray).then((res) => { this.loadingSubmit = false; if (res.code === 200) { - let data; if (pacId || this.tjOrderList.length > 0) { @@ -3298,10 +3332,6 @@ firmId: this.form.firmId, firmName: this.form.firmName, firmDeptName: this.form.firmDeptName, - zhiyeJhgly: this.form.zhiyeJhgly, - zhiyeKsjhrq: this.form.zhiyeKsjhrq, - zhiyeGh: this.form.zhiyeGh, - zhiyeCj: this.form.zhiyeCj }; this.listgetOrder(data); @@ -3316,12 +3346,6 @@ firmId: this.form.firmId, firmName: this.form.firmName, firmDeptName: this.form.firmDeptName, - zhiyeJhgly: this.form.zhiyeJhgly, - zhiyeKsjhrq: this.form.zhiyeKsjhrq, - zhiyeGh: this.form.zhiyeGh, - zhiyeCj: this.form.zhiyeCj - - }; this.listgetOrder(data); } else { -- Gitblit v1.8.0