From 5da871a9345d1b80767623cdbe74a45e3ff5532b Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期四, 03 四月 2025 13:56:06 +0800 Subject: [PATCH] 1 --- src/components/proposal/index.vue | 150 ++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 120 insertions(+), 30 deletions(-) diff --git a/src/components/proposal/index.vue b/src/components/proposal/index.vue index e9a676f..5dbfd55 100644 --- a/src/components/proposal/index.vue +++ b/src/components/proposal/index.vue @@ -15,24 +15,73 @@ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> </el-form-item> </el-form> --> - <div style="margin-bottom: 10px"> - <el-radio-group v-model="tjproposal" @input="radiotjproposalChange"> - <el-radio-button label="0">蹇嵎寤鸿</el-radio-button> - <el-radio-button label="1">甯哥敤寤鸿</el-radio-button> - </el-radio-group> - </div> + + <el-form inline @submit.native.prevent="search"> + <el-form-item> + <el-radio-group v-model="tjproposal" @input="radiotjproposalChange"> + <el-radio-button label="0">蹇嵎寤鸿</el-radio-button> + <el-radio-button label="1">甯哥敤寤鸿</el-radio-button> + </el-radio-group> + </el-form-item> + <el-form-item v-show="tjproposal == 0"> + <el-input + v-model="searchAdv" + style="width: 180px" + placeholder="璇疯緭鍏ユ悳绱㈠唴瀹�" + clearable + @clear="search" + ></el-input> + </el-form-item> + <el-button type="primary" @click="search" v-show="tjproposal == 0" + >鎼滅储</el-button + > + </el-form> + <el-table + v-if="tjproposal == '0'" + :data="advicerulesList" + ref="elTable" + v-loading="loading" + @selection-change="handleSelectionChange" + border + height="500px" + > + <el-table-column type="selection" width="40" align="center" /> + <el-table-column label="绉戝" width="70" align="center" prop="ks" /> + <el-table-column + label="寤鸿鍚嶇О" + width="120" + align="center" + prop="jymc" + /> + <el-table-column label="寤鸿鍐呭" align="left" prop="jynr" /> + </el-table> + <div class="pag" v-if="tjproposal == '0'"> + <div class="pag1"> + <pagination + v-show="total > 0" + :total="total1" + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="radiotjproposalChange" + /> + </div> + </div> + + <el-table + v-if="tjproposal == '1'" :data="dataList" ref="elTable" v-loading="loading" @selection-change="handleSelectionChange" border - height="320px" + height="500px" > <el-table-column type="selection" width="40" align="center" /> <el-table-column label="缂栫爜" width="70" align="center" prop="id" /> - <el-table-column label="寤鸿鍐呭" align="center" prop="advice" /> - <el-table-column + <el-table-column label="鏍囬" width="120" align="center" prop="title" /> + <el-table-column label="寤鸿鍐呭" align="left" prop="advice" /> + <!-- <el-table-column label="鍒涘缓浜�" align="center" prop="createBy" @@ -43,16 +92,16 @@ width="160px" align="center" prop="createTime" - /> + /> --> </el-table> - <div class="pag"> + <div class="pag" v-if="tjproposal == '1'"> <div class="pag1"> <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.pageSize" - @pagination="getList" + @pagination="radiotjproposalChange" /> </div> </div> @@ -69,6 +118,7 @@ getKjTjAdviceKjbqBySex, getCyTjAdviceKjbqBySex, } from "@/api/hosp/project"; +import { listAdvicerules } from "@/api/hosp/advicerules"; import { getInfo } from "@/api/login"; export default { name: "Packagese", @@ -83,14 +133,24 @@ // 寮瑰嚭灞傛爣棰� title: "", total: 0, + total1:0, dataList: [], + advicerulesList: [], + // 閬僵灞� loading: false, + searchAdv: "", queryParams: { sex: "", isZj: "", userId: "", page: 1, + pageSize: 10, + jynr: "", + jybt: "", + }, + queryParams1: { + pageNum: 1, pageSize: 10, }, list: [], @@ -99,13 +159,12 @@ }, watch: { cusobj(val, newVla) { - // console.log(val,newVla,1111) - this.fList= val + console.log(val, newVla, 1111); + this.fList = val; this.queryParams.sex = val.sex; this.queryParams.isZj = val.isZj; - if (this.queryParams.sex) { - this.getList(); - } + this.tjproposal = "0"; + this.getList(); }, }, mounted() { @@ -128,26 +187,48 @@ }, getList() { this.loading = true; + /* getKjTjAdviceKjbqBySex(this.queryParams).then((res) => { + this.dataList = res.data.records; + this.total = res.data.total; + this.loading = false; + }); */ + listAdvicerules(this.queryParams1) + .then((response) => { + this.advicerulesList = response.rows; + this.total1 = response.total; + this.loading = false; + }) + .catch((error) => { + console.error("绛涢�夊揩鎹峰缓璁け璐�:", error); + this.$message.error("绛涢�夊揩鎹峰缓璁け璐�"); + }); + }, + handleQuery() { + this.getAllList(); + }, + handleSelectionChange(selection) { + // if (selection.length > 1) { + // this.$refs.elTable.clearSelection(); // 娓呯┖鎵�鏈夐�夋嫨 + // this.$refs.elTable.toggleRowSelection(selection.pop()); // 璁剧疆閫夋嫨椤� + // } + this.list = selection; + console.log(this.list); + }, + search() { + this.queryParams.jybt = this.searchAdv; + this.queryParams.page = 1; + this.loading = true; getKjTjAdviceKjbqBySex(this.queryParams).then((res) => { this.dataList = res.data.records; this.total = res.data.total; this.loading = false; }); }, - handleQuery() { - this.getAllList(); - }, - handleSelectionChange(selection) { - // if (selection.length > 1) { - // this.$refs.elTable.clearSelection(); // 娓呯┖鎵�鏈夐�夋嫨 - // this.$refs.elTable.toggleRowSelection(selection.pop()); // 璁剧疆閫夋嫨椤� - // } - this.list = selection; - console.log( this.list) - }, radiotjproposalChange() { if (this.tjproposal == "0") { + this.searchAdv = ""; this.queryParams.isZj = this.fList.isZj; + this.queryParams.userId = null; this.getList(); } else { this.loading = true; @@ -155,8 +236,14 @@ this.queryParams.userId = res.user.userId; this.queryParams.isZj = null; getCyTjAdviceKjbqBySex(this.queryParams).then((res) => { - this.dataList = res.data.records; - this.total = res.data.total; + if (res.data) { + this.dataList = res.data.records; + this.total = res.data.total; + } else { + this.dataList = []; + this.total = 0; + this.$modal.msgError(res.msg); + } this.loading = false; }); }); @@ -182,5 +269,8 @@ .pag1 { width: 30%; } +::v-deep .el-dialog__body { + padding: 7px 20px; +} </style> \ No newline at end of file -- Gitblit v1.8.0