From 93a6f70b8eb631c6c1faab8f9e8a734669e49e6e Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期三, 09 四月 2025 13:42:46 +0800 Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb --- src/views/doctor/pacsCheck/index.vue | 2 src/components/public/index.vue | 420 +++++++++++++++++++------------------ src/views/advice/advice/index.vue | 111 +++++---- src/views/picture/picture/index.vue | 79 ++++++ 4 files changed, 346 insertions(+), 266 deletions(-) diff --git a/src/components/public/index.vue b/src/components/public/index.vue index ae1d682..8c9a710 100644 --- a/src/components/public/index.vue +++ b/src/components/public/index.vue @@ -1,6 +1,11 @@ <template> <div> - <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> + <el-dialog + :title="title" + :visible.sync="open" + width="1000px" + append-to-body + > <h3 v-if="fList.proResult">妫�娴嬮」鐩� :{{ fList.project.proName }}</h3> <h3 v-if="fList.proResult"> 妫�娴嬬粨鏋� :{{ fList.proResult }}{{ fList.project.proMetering }} @@ -39,50 +44,86 @@ >鎼滅储</el-button > </el-form-item> + <el-form-item> + <h3 style="margin-left: 160px;">宸查�夐」鐩�</h3> + </el-form-item> + </el-form> - <el-table - :data="dataList" - ref="multipleTable" - v-loading="loading" - @selection-change="handleSelectionChange" - border - height="320px - " - > - <el-table-column type="selection" width="40" align="center" /> - <el-table-column label="搴忓彿" type="index" width="80px" /> - <!-- <el-table-column label="瑙勫垯" align="center" prop="ruleStr" /> --> - <el-table-column label="妫�鏌ョ粨璁�" align="center" prop="ruleStr" /> - <el-table-column label="妫�鏌ユ墍瑙�" align="center" prop="yxbx" /> - </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 style="display: flex; width: 100%"> + <div style="width: 50%; margin-right: 30px"> + <el-table + :data="dataList" + ref="multipleTable" + v-loading="loading" + @selection-change="handleSelectionChange" + border + height="420px" + > + <el-table-column type="selection" width="40" align="center" /> + <el-table-column + label="搴忓彿" + type="index" + align="center" + width="50px" + /> + <!-- <el-table-column label="瑙勫垯" align="center" prop="ruleStr" /> --> + <el-table-column label="妫�鏌ョ粨璁�" align="center" prop="ruleStr" /> + <el-table-column label="妫�鏌ユ墍瑙�" align="center" prop="yxbx" /> + </el-table> + <div class="pag"> + <div class="pag1" style="margin-left: 600px"> + <pagination + small + v-show="total > 0" + :total="total" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + </div> + </div> + </div> + + <div style="width: 100%; height: 610px"> + <!-- <h3 style="margin-top: -30px;">宸查�夐」鐩�</h3> --> + <el-form + :model="form" + ref="queryForm" + size="small" + + label-width="68px" + > + <!-- :inline="true" --> + <!-- <el-form-item> + <el-input + type="textarea" + v-model="form.desc" + style="width: 560px" + ></el-input> + </el-form-item> --> + <el-form-item label="妫�鏌ユ墍瑙�" prop="jcsj"> + <el-input + v-model="form.jcsj" + clearable + type="textarea" + :autosize="{ minRows: 8}" + style="width: 380px" + /> + </el-form-item> + <el-form-item label="妫�鏌ョ粨璁�" prop="conclusion"> + <el-input + v-model="form.desc" + clearable + type="textarea" + :autosize="{ minRows: 8 }" + style="width: 380px" + /> + </el-form-item> + </el-form> </div> </div> - <h3>宸查�夐」鐩�</h3> - <el-form - :model="form" - ref="queryForm" - size="small" - :inline="true" - label-width="68px" - > - <el-form-item> - <el-input - type="textarea" - v-model="form.desc" - style="width: 560px" - ></el-input> - </el-form-item> - </el-form> - <span slot="footer" class="dialog-footer"> + + <span slot="footer" class="dialog-footer" style="margin-top: -120px"> <el-button @click="open = false">鍙� 娑�</el-button> <el-button type="primary" @click="handleOk">纭� 瀹�</el-button> </span> @@ -92,34 +133,38 @@ <script> import { getlist, getlistByRuleStr } from "@/api/doctor/check"; +import { getYxJcXxJg } from "@/api/picture/picture"; export default { name: "Public", - - /* props: { - row: { - type: Object, - }, - }, */ props: { - lastDesc: { + checkStatus: { type: String, - default: "", + default: "0", + validator: value => ["0", "1"].includes(value) }, + proResult: { + type: String, + default: '' + }, + conclusion: { + type: String, + default: '' + } }, data() { return { open: false, // 寮瑰嚭灞傛爣棰� title: "", - yxbx:"", + yxbx: "", // lastDesc: "", total: 0, dataList: [], // 閬僵灞� loading: false, form: { - // desc: "", - desc: this.lastDesc, + desc: "", + jcsj: "", }, queryParams: { bingzhong: "", @@ -130,181 +175,142 @@ list: [], fList: {}, selectedItems: [], + searchDebounce: null, }; }, watch: { - row(val, newVla) { - // console.log(val,newVla) - // this.fList = val; - // if (this.fList) { - // this.getList() - // } - }, - lastDesc(newVal) { - this.form.desc = newVal; // 鏇存柊 form.desc - console.log(newVal, 666); + checkStatus(newValue) { + console.log( newValue,9988); + if (newValue === "1") { + this.updateData(this.proResult, this.conclusion); + } }, }, mounted() {}, created() {}, methods: { - getList(row, date) { - let data = { - // proId: fList.proId, - // ruleStr: fList.proResult, - }; - getlist(data).then((res) => { + async getList() { + try { + this.loading = true; // 娣诲姞鍔犺浇鐘舵�� + const res = await getlist(this.queryParams); this.dataList = res.rows; - this.$nextTick(() => { - /* this.dataList.forEach((item) => { - this.fList.rulesList.forEach((item1) => { - if (item.aid === item1.aid) { - this.$refs.multipleTable.toggleRowSelection(item, true); - } - }); - }); */ - }); - }); - }, - /* getList(row, date) { - if (row.proId) { - let fList = row; - // if (this.fList.proResult == "") { - let data = { - // proId: fList.proId, - // ruleStr: fList.proResult, - }; - getlist(data).then((res) => { - this.dataList = res.rows; - - this.$nextTick(() => { - this.dataList.forEach((item) => { - this.fList.rulesList.forEach((item1) => { - if (item.aid == item1.aid) { - this.$refs.multipleTable.toggleRowSelection(item, true); - } - }); - }); - }); - }); - // }else{ - // let data = { - // proId: this.fList.proId, - // bingzhong: this.queryParams.bingzhong, - // ruleStr: this.fList.proResult, - // } - // getlistByRuleStr(data).then(res => { - // this.dataList = res.rows - // this.$nextTick(() => { - // this.dataList.forEach(item => { - // this.fList.rulesList.forEach(item1 => { - // if (item.aid == item1.aid) { - // this.$refs.multipleTable.toggleRowSelection(item, true); - // } - // }) - // }) - // }) - - // }) - // } - } else { - let data = { - // proId: row, - }; - getlist(data).then((res) => { - this.dataList = res.rows; - console.log(res,888); - - // this.$nextTick(() => { - // this.dataList.forEach(item => { - // this.fList.rulesList.forEach(item1 => { - // if (item.aid == item1.aid) { - // this.$refs.multipleTable.toggleRowSelection(item, true); - // } - // }) - // }) - // }) - }); - } - }, */ - handleQuery() { - let data = { - proId: this.fList.proId, - bingzhong: this.queryParams.bingzhong, - bzPinyin: this.queryParams.bzPinyin, - }; - getlist(data).then((res) => { - this.dataList = res.rows; - this.$nextTick(() => { - this.dataList.forEach((item) => { - this.fList.rulesList.forEach((item1) => { - if (item.aid == item1.aid) { - this.$refs.multipleTable.toggleRowSelection(item, true); - } - }); - }); - }); - }); - }, - handleSelectionChange(selection) { - console.log(selection[0].yxbx,123); + this.total = res.total; - this.list = []; - this.list = selection; - this.yxbx = selection[0].yxbx + // 濡傛灉闇�瑕侀�変腑鎿嶄綔锛屽皢鍏跺皝瑁呬负鐙珛鏂规硶 + await this.handleAutoSelection(); + } catch (error) { + console.error('鑾峰彇鏁版嵁澶辫触:', error); + this.$message.error('鑾峰彇鏁版嵁澶辫触'); + } finally { + this.loading = false; + } + }, - // this.form.desc = ""; - this.list.forEach((element) => { - if (element.bingzhong) { - this.form.desc += element.bingzhong + ","; - } else { - this.form.desc += element.ruleStr + ","; + // 灏佽閫変腑閫昏緫 + async handleAutoSelection() { + if (!this.fList?.rulesList?.length) return; + + await this.$nextTick(); + this.dataList.forEach(item => { + const shouldSelect = this.fList.rulesList.some(rule => rule.aid === item.aid); + if (shouldSelect) { + this.$refs.multipleTable?.toggleRowSelection(item, true); } }); }, - /* handleSelectionChange(selection) { - // 褰撳墠閫変腑鐨勯」 - const newSelection = selection; + handleQuery() { + if (this.searchDebounce) clearTimeout(this.searchDebounce); + + this.searchDebounce = setTimeout(() => { + this.queryParams.pageNum = 1; // 閲嶇疆椤电爜 + this.getList(); + }, 300); + }, - // 1. 澶勭悊鍙栨秷閫変腑鐨勯」 - const removedItems = this.selectedItems.filter( - (item) => !newSelection.includes(item) - ); - - // 浠� form.desc 涓Щ闄ゅ彇娑堥�変腑鐨勬暟鎹� - removedItems.forEach((item) => { - const itemToRemove = item.bingzhong || item.ruleStr; - this.form.desc = this.form.desc.replace( - new RegExp(itemToRemove + ",?", "g"), // 浣跨敤姝e垯纭繚绉婚櫎鎵�鏈夐噸澶嶉」 - "" - ); - }); - - // 2. 鏇存柊宸查�変腑鐨勬暟鎹垪琛� - this.selectedItems = newSelection; - - // 3. 娣诲姞鏂伴�変腑鐨勯」鍒� form.desc - newSelection.forEach((element) => { - const itemToAdd = element.bingzhong || element.ruleStr; - if (!this.form.desc.includes(itemToAdd)) { - this.form.desc += itemToAdd + ","; - } - }); - }, */ - handleOk() { - this.open = false; - if (this.form.desc) { - // this.$emit("add", this.form.desc, this.list); - this.$emit("add", this.form.desc,this.yxbx); - // this.lastDesc = this.form.desc; + updateData(proResult, conclusion) { + if (this.checkStatus === "1") { + this.form.jcsj = proResult; // 鏇存柊妫�鏌ユ墍瑙� + this.form.desc = conclusion; // 鏇存柊妫�鏌ョ粨璁� + // console.log(proResult, conclusion); } - // this.form.desc = ""; + }, + + handleSelectionChange(selection) { + this.list = selection; + this.updateFormContent(selection); + }, + + updateFormContent(selection) { + if (!selection.length) return; + + // 濡傛灉澶勪簬妫�鏌ョ姸鎬侊紝浣跨敤浼犲叆鐨勫�� + if (this.checkStatus === "1") { + this.updateData(this.proResult, this.conclusion); + return; + } + + // 閲嶇疆琛ㄥ崟鍐呭 + this.form.desc = ''; + this.form.jcsj = ''; + + // 浣跨敤map鍜宩oin鏇夸唬forEach鍜屽瓧绗︿覆鎷兼帴 + this.form.desc = selection + .map(item => item.bingzhong || item.ruleStr) + .filter(Boolean) + .join(','); + + this.form.jcsj = selection + .map(item => item.yxbx) + .filter(Boolean) + .join(','); + }, + + handleOk() { + if (!this.form.desc && !this.form.jcsj) { + this.$message.warning('璇烽�夋嫨鏁版嵁'); + return; + } + + try { + this.$emit("add", this.form.desc, this.form.jcsj); + this.resetForm(); + this.open = false; + } catch (error) { + console.error('澶勭悊鏁版嵁澶辫触:', error); + this.$message.error('鎿嶄綔澶辫触'); + } + }, + + resetForm() { + this.form.desc = ''; + this.form.jcsj = ''; + this.list = []; + if (this.$refs.multipleTable) { + this.$refs.multipleTable.clearSelection(); + } }, }, + computed: { + isCheckMode() { + return this.checkStatus === "1"; + }, + + hasSelectedItems() { + return this.list.length > 0; + } + } }; </script> -<style scoped></style> +<style scoped> +.el-dialog__body{ + padding: 10px 20px; +} +::v-deep .el-dialog__footer { + padding: 0 !important; + padding-bottom: 40px !important; +} +</style> \ No newline at end of file diff --git a/src/views/advice/advice/index.vue b/src/views/advice/advice/index.vue index cac724a..7bb29aa 100644 --- a/src/views/advice/advice/index.vue +++ b/src/views/advice/advice/index.vue @@ -78,18 +78,20 @@ <el-row :gutter="20"> <el-col :span="3" :xs="24"> <div class="head-container"> - <el-tree - :data="deptOptions" - :props="defaultProps" - :expand-on-click-node="false" - :filter-node-method="filterNode" - ref="tree" - node-key="id" - default-expand-all - :default-expanded-keys="treeId" - highlight-current - @node-click="handleNodeClick" - /> + <div class="content"> + <el-tree + :data="deptOptions" + :props="defaultProps" + :expand-on-click-node="false" + :filter-node-method="filterNode" + ref="tree" + node-key="id" + default-expand-all + :default-expanded-keys="treeId" + highlight-current + @node-click="handleNodeClick" + /> + </div> </div> </el-col> @@ -163,20 +165,18 @@ </el-table-column> </el-table> <div class="pag"> - <div class="pag1"> - <pagination - v-show="total > 0" - :total="total" - :page.sync="queryParams.page" - :limit.sync="queryParams.pageSize" - @pagination="getList" - /> - </div> - </div> + <div class="pag1"> + <pagination + v-show="total > 0" + :total="total" + :page.sync="queryParams.page" + :limit.sync="queryParams.pageSize" + @pagination="getList" + /> + </div> + </div> </el-col> </el-row> - - <!-- 娣诲姞鎴栦慨鏀筧dvice瀵硅瘽妗� --> <el-dialog @@ -187,24 +187,24 @@ > <el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form-item label="褰掑睘绉戝" prop="deptId"> - <!-- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="璇烽�夋嫨褰掑睘绉戝" + <!-- <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="璇烽�夋嫨褰掑睘绉戝" style="width: 200px" /> --> - <el-select - v-if="DepartmentList.length > 0" - v-model="form.deptId" - placeholder="璇烽�夋嫨褰掑睘绉戝" - clearable - style="width: 200px" - filterable - > - <el-option - v-for="dict in DepartmentList" - :key="dict.deptId" - :label="dict.deptName || ''" - :value="dict.deptId" - /> - </el-select> - </el-form-item> + <el-select + v-if="DepartmentList.length > 0" + v-model="form.deptId" + placeholder="璇烽�夋嫨褰掑睘绉戝" + clearable + style="width: 200px" + filterable + > + <el-option + v-for="dict in DepartmentList" + :key="dict.deptId" + :label="dict.deptName || ''" + :value="dict.deptId" + /> + </el-select> + </el-form-item> <el-form-item label="妫�鏌ラ」鐩�" prop="proName"> <el-select v-model="form.proId" @@ -221,7 +221,7 @@ /> </el-select> </el-form-item> - + <el-form-item label="寤鸿鏍囬" prop="title"> <el-input v-model="form.title" placeholder="璇疯緭鍏ュ悕绉版爣棰�" /> </el-form-item> @@ -276,7 +276,7 @@ </template> <script> -import { deptTreeSelect ,getDeptListByDictHospId} from "@/api/system/user"; +import { deptTreeSelect, getDeptListByDictHospId } from "@/api/system/user"; import { listAdvice, getAdvice, @@ -353,7 +353,7 @@ }; }, created() { - this.sendhospName() + this.sendhospName(); this.getDeptTree(); }, watch: { @@ -371,9 +371,8 @@ }, methods: { sendhospName() { - getDeptListByDictHospId({ - id: 2000 + id: 2000, }).then((res) => { this.DepartmentList = res.data; this.form.deptId = String(this.form.deptId); @@ -381,7 +380,8 @@ }, // 鑺傜偣鍗曞嚮浜嬩欢 handleNodeClick(data) { - this.queryParams.deptId = data.id; + // this.queryParams.deptId = data.id; + this.queryParams.deptId = null;; this.handleQuery(); }, @@ -392,7 +392,6 @@ }, getDeptTree() { deptTreeSelect().then((response) => { - this.deptOptions = response.data; this.treeId.push(this.deptOptions[0].id); this.queryParams.deptId = this.deptOptions[0].id; @@ -474,7 +473,7 @@ this.reset(); this.title = "浣撴寤鸿淇℃伅缁存姢"; this.getlistProject(); - this.form.deptId = this.queryParams.deptId + this.form.deptId = this.queryParams.deptId; this.open = true; }, /** 淇敼鎸夐挳鎿嶄綔 */ @@ -489,7 +488,7 @@ } this.getlistProject(); this.open = true; - this.form.deptId = this.queryParams.deptId + this.form.deptId = this.queryParams.deptId; this.title = "浣撴寤鸿淇℃伅缁存姢"; }); }, @@ -575,4 +574,16 @@ .pag1 { width: 30%; } +.content { + width: 1000px; + height: 1000px; +} +.head-container { + width: 200px; + height: 629px; + overflow: auto; + border: 1px solid #ccc; + position: relative; +} + </style> diff --git a/src/views/doctor/pacsCheck/index.vue b/src/views/doctor/pacsCheck/index.vue index e3975ef..2d370f4 100644 --- a/src/views/doctor/pacsCheck/index.vue +++ b/src/views/doctor/pacsCheck/index.vue @@ -89,7 +89,7 @@ :data="exaLists" v-loading="loading" border - max-height="350" + height="350" @current-change="handleCurrentChange" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" diff --git a/src/views/picture/picture/index.vue b/src/views/picture/picture/index.vue index 91c4462..e24dc28 100644 --- a/src/views/picture/picture/index.vue +++ b/src/views/picture/picture/index.vue @@ -280,7 +280,12 @@ label-width="68px" > <el-form-item label="妫�鏌ユ墍瑙�" prop="proResult"> - <el-input v-model="form.proResult" clearable type="textarea" /> + <el-input + v-model="form.proResult" + clearable + type="textarea" + @focus="submiepilog" + /> </el-form-item> <el-form-item label="妫�鏌ョ粨璁�" prop="conclusion"> <el-input @@ -335,7 +340,8 @@ /> </div> - <Public ref="aaa" :last-desc="form.conclusion" @add="handleChanges" /> + <Public ref="aaa" :check-status="checkStatus" :pro-result="form.proResult" :conclusion="form.conclusion" @add="handleChanges" /> + <!-- :last-desc="form.conclusion" --> </div> </template> @@ -750,6 +756,13 @@ console.log(res, 222); this.tableList = res.data; this.loading = false; + this.$nextTick(() => { + if (this.tableList.length > 0) { + const firstRow = this.tableList[0]; + this.$refs.mu.toggleRowSelection(firstRow, true); + this.handleChange([firstRow]); + } + }); }); }, @@ -807,7 +820,7 @@ }, // 澶氶�夋閫変腑鏁版嵁 - handleSelectionChange(selection) { + /* handleSelectionChange(selection) { this.imgsrc = selection[0].picturePath; this.tjNumber = selection[0].customer.tjNumber; this.ids = selection.map((item) => item.id); @@ -834,9 +847,60 @@ } this.single = selection.length !== 1; this.multiple = !selection.length; + }, */ + handleSelectionChange(selection) { + this.imgsrc = selection[0].picturePath; + this.tjNumber = selection[0].customer.tjNumber; + this.ids = selection.map((item) => item.id); + + if (selection.length > 1) { + let del_row = selection.shift(); + this.$refs.tb.toggleRowSelection(del_row, false); + } + + this.single = selection.length !== 1; + this.multiple = !selection.length; + + selection.forEach((element) => { + this.tableList = element.list; + + if (this.tableList.length !== 0) { + // 鉁� 鎻愬墠璧嬪�� selectedRow锛岄伩鍏� handleChange 鏃舵湭璧嬪�� + this.selectedRow = this.tableList[0]; + this.form.proResult = this.tableList[0].proResult; + this.form.conclusion = this.tableList[0].conclusion; + + this.$nextTick(() => { + this.$refs.mu.toggleRowSelection(this.tableList[0], true); + }); + } else { + this.selectedRow = null; + this.$refs.mu.clearSelection(); + } + }); + }, + handleChange(selection) { + if (selection && selection.length > 0) { + const proId = selection[0].proId; + + // 鉁� 纭繚 selectedRow 瀛樺湪涓旀湁 tjNumber + if (this.selectedRow && this.selectedRow.tjNumber) { + const tjNumber = this.selectedRow.tjNumber; + getYxJcXxJg(tjNumber, proId).then((res) => { + this.form.proResult = res.data.jcsj; + this.form.conclusion = res.data.jcjl; + this.$refs.aaa.updateData(res.data.jcsj, res.data.jcjl); + }); + } else { + console.warn("selectedRow 鏈噯澶囧ソ锛岃烦杩囨帴鍙h皟鐢�"); + } + + // 鉁� 鍚屾椂鏇存柊 selectedRow + this.selectedRow = selection[0]; + } }, - handleChange(selection) { + /* handleChange(selection) { // console.log(selection, 123); if (selection && selection.length > 0) { const proId = selection[0].proId; @@ -848,9 +912,9 @@ this.form.conclusion = res.data.jcjl; }); } - }, + }, */ - handleChanges(value,yxbx) { + handleChanges(value, yxbx) { this.form.conclusion = value; this.form.proResult = yxbx; }, @@ -858,9 +922,8 @@ submiepilog() { this.$refs.aaa.open = true; let proId = "1633660948860522585"; - // let proId = null + // let proId = null this.$refs.aaa.getList(proId); - }, tupian() { this.dialogVisible = true; -- Gitblit v1.8.0