From 76af820e2e11366b322705b51c351ace3d40608a Mon Sep 17 00:00:00 2001 From: qx <1084500556@qq.com> Date: 星期二, 01 七月 2025 16:46:04 +0800 Subject: [PATCH] Merge branch 'master' of http://101.42.27.146:5001/r/ltkj_peisweb_region --- src/views/hosp/biaoben/index.vue | 253 +++++++++++++++++++++++++++++++++++++------------- 1 files changed, 185 insertions(+), 68 deletions(-) diff --git a/src/views/hosp/biaoben/index.vue b/src/views/hosp/biaoben/index.vue index f0afc9b..4b0f0f1 100644 --- a/src/views/hosp/biaoben/index.vue +++ b/src/views/hosp/biaoben/index.vue @@ -2,41 +2,22 @@ <div class="app-container"> <el-row :gutter="24"> <!-- 绗竴鍒楋細鍗曢�夋爣鏈� --> - <el-col :span="8" :xs="24"> - <el-form - :model="queryParams" - ref="queryForm" - size="small" - :inline="true" - label-width="68px" - style="height: 45px" - @submit.native.prevent - > + <el-col :span="6" :xs="24"> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px" + style="height: 45px" @submit.native.prevent> <el-form-item label="椤圭洰鍚嶇О" prop="tjh"> - <el-input - v-model="queryParams.tjh" - placeholder="璇疯緭鍏ラ」鐩悕绉�" - clearable - @keyup.enter.native="handleManual" - /> + <el-input style="width: 140px" v-model="queryParams.tjh" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable + @keyup.enter.native="handleManual" /> </el-form-item> <el-form-item> <el-button type="primary" size="mini" @click="handleManual">鏌ヨ</el-button> - <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + <el-button type="primary" size="mini" @click="handleAdd">鏂板</el-button> </el-form-item> </el-form> <!-- 鏍囨湰鍗曢�夎〃鏍硷紙甯﹀閫夋鏍峰紡锛� --> - <el-table - border - v-loading="loading" - :data="filteredSpecimenData" - height="478" - style="width: 100%" - ref="specimenTable" - :row-key="row => row.value" - @select="handleSpecimenSelect" - > + <el-table border v-loading="loading" :data="filteredSpecimenData" height="478" style="width: 100%" + ref="specimenTable" :row-key="row => row.value" @select="handleSpecimenSelect"> <el-table-column type="selection" width="40px" align="center" /> <el-table-column label="搴忓彿" align="center" type="index" width="50px" /> <el-table-column label="鏍囨湰鍚嶇О" align="center" prop="label" show-overflow-tooltip /> @@ -44,15 +25,18 @@ </el-col> <!-- 绗簩鍒楋細涓棿閫変腑椤圭洰鍒楄〃 --> - <el-col :span="8" :xs="24"> - <el-form :model="form" size="small" :inline="true" label-width="68px" style="height: 45px" @submit.native.prevent /> - <el-table - border - v-loading="loading" - :data="OnenewpacName" - height="478" - style="width: 100%" - > + <el-col :span="9" :xs="24"> + <el-form :model="queryParams2" ref="queryForm" size="small" :inline="true" v-show="showSearch" + label-width="68px" style="height: 45px" @submit.native.prevent> + <el-form-item label="椤圭洰鍚嶇О" prop="proName"> + <el-input ref="inputName" v-model="queryParams2.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable + @keyup.enter.native="handleyixuan" style="width: 140px" /> + </el-form-item> + <el-form-item> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleyixuan">鎼滅储</el-button> + </el-form-item> + </el-form> + <el-table border v-loading="loading" :data="OnenewpacName" height="478" ref="tres" style="width: 100%"> <el-table-column label="宸查�夐」鐩垪琛�" align="center" prop="proName" /> <el-table-column label="鎿嶄綔" align="center" width="85"> <template slot-scope="scope"> @@ -67,60 +51,94 @@ </el-col> <!-- 绗笁鍒楋細鎼滅储 + 椤圭洰閫夋嫨 --> - <el-col :span="8" :xs="24"> - <el-form - :model="queryParams1" - ref="queryForm" - size="small" - :inline="true" - v-show="showSearch" - label-width="68px" - style="height: 45px" - @submit.native.prevent - > + <el-col :span="9" :xs="24"> + <el-form :model="queryParams1" ref="queryForm" size="small" :inline="true" v-show="showSearch" + label-width="68px" style="height: 45px" @submit.native.prevent> <el-form-item label="椤圭洰鍚嶇О" prop="proName"> - <el-input - ref="inputName" - v-model="queryParams1.proName" - placeholder="璇疯緭鍏ラ」鐩悕绉�" - clearable - @keyup.enter.native="handleSearchFor" - style="width: 140px" - /> + <el-input ref="inputName" v-model="queryParams1.proName" placeholder="璇疯緭鍏ラ」鐩悕绉�" clearable + @keyup.enter.native="handleSearchFor" style="width: 140px" /> </el-form-item> <el-form-item> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleSearchFor">鎼滅储</el-button> </el-form-item> </el-form> - <el-table - border - v-loading="loading" - ref="tre" - :data="Treedata" - @selection-change="handleChangesingle" - height="478" - style="width: 100%" - > + <el-table border v-loading="loading" ref="tre" :data="Treedata" @selection-change="handleChangesingle" + height="478" style="width: 100%"> <el-table-column type="selection" width="40px" align="center" /> <el-table-column label="椤圭洰鍚嶇О" align="center" prop="proName" show-overflow-tooltip /> </el-table> </el-col> + + + <!-- 娣诲姞鎴栦慨鏀瑰弬鏁伴厤缃璇濇 --> + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="瀛楀吀绫诲瀷"> + <el-input v-model="form.dictType" :disabled="true" /> + </el-form-item> + <el-form-item label="鏁版嵁鍚嶇О" prop="dictLabel"> + <el-input v-model="form.dictLabel" placeholder="璇疯緭鍏ユ暟鎹悕绉�" /> + </el-form-item> + <el-form-item label="鏁版嵁閿��" prop="dictValue"> + <el-input v-model="form.dictValue" placeholder="璇疯緭鍏ユ暟鎹敭鍊�" /> + </el-form-item> + <el-form-item label="鏍峰紡灞炴��" prop="cssClass"> + <el-input v-model="form.cssClass" placeholder="璇疯緭鍏ユ牱寮忓睘鎬�" /> + </el-form-item> + <el-form-item label="鏄剧ず鎺掑簭" prop="dictSort"> + <el-input-number v-model="form.dictSort" controls-position="right" :min="0" /> + </el-form-item> + <el-form-item label="鍥炴樉鏍峰紡" prop="listClass"> + <el-select v-model="form.listClass"> + <el-option v-for="item in listClassOptions" :key="item.value" :label="item.label + '(' + item.value + ')'" + :value="item.value"></el-option> + </el-select> + </el-form-item> + <el-form-item label="鐘舵��" prop="status"> + <el-radio-group v-model="form.status"> + <el-radio v-for="dict in dict.type.sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label + }}</el-radio> + </el-radio-group> + </el-form-item> + <el-form-item label="澶囨敞" prop="remark"> + <el-input v-model="form.remark" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�"></el-input> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> </el-row> </div> </template> <script> import { searchBiaoben, delBiaoben, editBiaoben } from "@/api/hosp/biaoben"; +import { getDicts, addData, updateData } from "@/api/system/dict/data"; import { debounce } from 'lodash'; export default { name: "Part", 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: false, + open: false, OnenewpacName: [], Treedata: [], originalTreedata: [], + Treedatas: [], queryParams: { tjh: '', tjCategory: null, @@ -128,15 +146,57 @@ queryParams1: { proName: '', }, - form: { - price: '', + queryParams2: { + proName: '', + }, + // 琛ㄥ崟鍙傛暟 + form: {}, + title: "", + // 鏁版嵁鏍囩鍥炴樉鏍峰紡 + listClassOptions: [ + { + value: "default", + label: "榛樿" + }, + { + value: "primary", + label: "涓昏" + }, + { + value: "success", + label: "鎴愬姛" + }, + { + value: "info", + label: "淇℃伅" + }, + { + value: "warning", + label: "璀﹀憡" + }, + { + value: "danger", + label: "鍗遍櫓" + } + ], + // 琛ㄥ崟鏍¢獙 + rules: { + dictLabel: [ + { required: true, validator: checkPhoneNum, trigger: "blur" } + ], + dictValue: [ + { required: true, validator: checkPhoneNum, trigger: "blur" } + ], + dictSort: [ + { required: true, validator: checkPhoneNum, trigger: "blur" } + ] }, showSearch: true, filteredSpecimenData: [], originalSpecimenData: [], }; }, - dicts: ["sys_dict_specimen"], + dicts: ["sys_dict_specimen", "sys_normal_disable"], created() { this.fetchInitialBiaobenData(); this.initializeSpecimenData(); @@ -168,6 +228,22 @@ this.originalSpecimenData = []; this.filteredSpecimenData = []; } + }, + handleyixuan() { + + const searchText = this.queryParams2.proName?.trim().toLowerCase() || ''; + if (searchText) { + this.OnenewpacName = this.Treedatas.filter(item => + item.proName.toLowerCase().includes(searchText) + ); + this.OnenewpacName.length + ? this.$message.success('鏌ヨ鎴愬姛') + : this.$message.warning('鏈壘鍒板尮閰嶇殑椤圭洰'); + } else { + this.OnenewpacName = [...this.Treedatas]; + this.$message.info('宸叉樉绀烘墍鏈夐」鐩�'); + } + this.$refs.tres.clearSelection(); }, handleSearchFor() { const searchText = this.queryParams1.proName?.trim().toLowerCase() || ''; @@ -233,6 +309,13 @@ this.$refs.tre.clearSelection(); } }, + + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.open = true; + this.title = "娣诲姞瀛楀吀鏁版嵁"; + this.form.dictType = "sys_dict_specimen"; + }, cancell() { this.openOne = false; }, @@ -281,7 +364,8 @@ this.loading = true; searchBiaoben({ bblx }) .then(response => { - this.OnenewpacName = response.data || []; + this.Treedatas = response.data || []; + this.OnenewpacName = [...this.Treedatas]; this.loading = false; }) .catch(error => { @@ -305,6 +389,38 @@ this.loading = false; }); }, + + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + + /** 鎻愪氦鎸夐挳 */ + submitForm: function () { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.dictCode != undefined) { + updateData(this.form).then(response => { + this.$store.dispatch('dict/removeDict', this.queryParams.dictType); + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addData(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + let dictType = "sys_dict_specimen" + getDicts(dictType).then(response => { + this.originalSpecimenData= response.rows ||[] + this.filteredSpecimenData =[...this.originalSpecimenData]; + }); + }); + } + } + }); + }, }, }; </script> @@ -313,6 +429,7 @@ .app-container { padding: 20px; } + .dialog-footer1 { margin-top: 60px; text-align: center; -- Gitblit v1.8.0