From f590983c4a9ee48f1d76ec8750a3e1aa0913cb5b Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期三, 16 七月 2025 14:42:16 +0800 Subject: [PATCH] 1 --- src/views/hosp/commonAdvice/index.vue | 141 +++++++++++++++------------------------------- 1 files changed, 47 insertions(+), 94 deletions(-) diff --git a/src/views/hosp/commonAdvice/index.vue b/src/views/hosp/commonAdvice/index.vue index 76f673f..e5769c8 100644 --- a/src/views/hosp/commonAdvice/index.vue +++ b/src/views/hosp/commonAdvice/index.vue @@ -1,113 +1,55 @@ <template> <div class="app-container"> - <el-form - :model="queryParams" - ref="queryForm" - size="small" - :inline="true" - v-show="showSearch" - label-width="68px" - > + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form-item label="鏍囬" prop="bt"> - <el-input - v-model="queryParams.bt" - placeholder="璇疯緭鍏ユ爣棰�" - clearable - @keyup.enter.native="handleQuery" - /> + <el-input v-model="queryParams.bt" placeholder="璇疯緭鍏ユ爣棰�" clearable @keyup.enter.native="handleQuery" /> </el-form-item> <el-form-item label="寤鸿" prop="nr"> - <el-input - v-model="queryParams.nr" - placeholder="璇疯緭鍏ユ鏌ラ」鐩�" - clearable - @keyup.enter.native="handleQuery" - /> + <el-input v-model="queryParams.nr" placeholder="璇疯緭鍏ユ鏌ラ」鐩�" clearable @keyup.enter.native="handleQuery" /> </el-form-item> <el-form-item> - <el-button - type="primary" - icon="el-icon-search" - size="mini" - @click="handleQuery" - >鎼滅储</el-button - > - <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" - >閲嶇疆</el-button - > + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> </el-form-item> </el-form> - <el-table - :data="dataList" - ref="elTable" - v-loading="loading" - @selection-change="handleSelectionChange" - border - height="580px" - > + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button type="primary" size="mini" @click="proposalChange">鏂板</el-button> + </el-col> + <el-col :span="1.5"> + <el-button type="primary" size="mini" @click="handleDelete">鎵归噺鍒犻櫎</el-button> + </el-col> + + </el-row> + + <el-table :data="dataList" ref="elTable" v-loading="loading" @selection-change="handleSelectionChange" border + height="580px"> <el-table-column type="selection" width="40" align="center" /> <el-table-column label="搴忓彿" width="70" align="center" prop="newID" /> <el-table-column label="鏍囬" width="120" align="center" prop="title" /> <el-table-column label="寤鸿鍐呭" align="left" prop="advice" /> - <el-table-column - label="鎿嶄綔" - align="center" - fixed="right" - class-name="small-padding fixed-width" - width="100px" - > + <el-table-column label="鎿嶄綔" align="center" fixed="right" class-name="small-padding fixed-width" width="100px"> <template slot-scope="scope"> - <el-button - size="mini" - type="text" - icon="el-icon-edit" - @click="handleEdit(scope.row)" - title="淇敼" - ></el-button> - <el-button - size="mini" - type="text" - icon="el-icon-delete" - @click="handleDelete(scope.row)" - title="鍒犻櫎" - ></el-button> + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEdit(scope.row)" title="淇敼"></el-button> + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" + title="鍒犻櫎"></el-button> </template> </el-table-column> </el-table> - <pagination - v-show="total > 0" - :total="total" - :page.sync="queryParams.page" - :limit.sync="queryParams.pageSize" - @pagination="getList" - /> + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.page" :limit.sync="queryParams.pageSize" + @pagination="getList" /> <!-- 淇敼蹇�熷缓璁爣棰樺拰鍐呭 --> - <el-dialog - :title="title" - :visible.sync="open" - width="1000px" - append-to-body - :close-on-click-modal="false" - > + <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body :close-on-click-modal="false"> <el-form ref="form" :model="form" label-width="80px" :inline="true"> <el-form-item label="鏍囬" prop="title"> - <el-input - v-model="form.title" - placeholder="璇疯緭鍏ユ爣棰�" - style="width: 200px" - /> + <el-input v-model="form.title" placeholder="璇疯緭鍏ユ爣棰�" style="width: 200px" /> </el-form-item> <el-form-item label="鍐呭" prop="advice"> - <el-input - v-model="form.advice" - type="textarea" - placeholder="璇疯緭鍏ヤ富瑕佸唴瀹�" - style="width: 780px" - /> + <el-input v-model="form.advice" type="textarea" placeholder="璇疯緭鍏ヤ富瑕佸唴瀹�" style="width: 780px" /> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> @@ -117,14 +59,18 @@ </el-dialog> </div> </template> - - <script> + +<script> import { updateAdvice, addAdvice, getAdvice, - delAdvice + delAdvice, + delCyremove } from "@/api/advice/advice"; +import { + addCyTjAdvice, +} from "@/api/system/biaoqianzidian"; import { getKjTjAdviceKjbqBySex, getCyTjAdviceKjbqBySex, @@ -198,6 +144,10 @@ this.open = false; this.reset(); }, + proposalChange() { + this.reset(); + this.open = true; + }, // 琛ㄥ崟閲嶇疆 reset() { this.form = { @@ -238,7 +188,12 @@ this.getList(); }); } else { - addAdvice(this.form).then((response) => { + // addAdvice(this.form).then((response) => { + // this.$modal.msgSuccess("鏂板鎴愬姛"); + // this.open = false; + // this.getList(); + // }); + addCyTjAdvice(this.form).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); @@ -252,7 +207,6 @@ const id = row.id || this.ids; this.kjbq = []; getAdvice(id).then((response) => { - console.log(response, 55566); this.form = response.data; this.open = true; // this.form.deptId = this.queryParams.deptId; @@ -260,11 +214,12 @@ }); }, handleDelete(row) { - const ids = row.id || this.ids; // 鑾峰彇涓婚敭鍊硷紝濡傛灉row涓病鏈変富閿�硷紝鍒欎娇鐢╰his.ids + let idss = this.ids + '' + const ids = row.id || idss; // 鑾峰彇涓婚敭鍊硷紝濡傛灉row涓病鏈変富閿�硷紝鍒欎娇鐢╰his.ids this.$modal .confirm(`鏄惁纭鍒犻櫎"${ids}"鐨勬暟鎹」锛焋) .then(() => { - return delAdvice(ids); // 璋冪敤鍒犻櫎鎺ュ彛锛屼紶鍏ヤ富閿�� + return delCyremove(ids); // 璋冪敤鍒犻櫎鎺ュ彛锛屼紶鍏ヤ富閿�� }) .then(() => { this.getList(); // 鍒犻櫎鎴愬姛鍚庡埛鏂板垪琛� @@ -276,6 +231,4 @@ }, }, }; -</script> - - \ No newline at end of file +</script> \ No newline at end of file -- Gitblit v1.8.0