From 8cef8ec64d4301b5d46299e42d98c59426b61673 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期三, 25 十二月 2024 08:48:03 +0800 Subject: [PATCH] 1 --- src/components/Packagese/index.vue | 316 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 194 insertions(+), 122 deletions(-) diff --git a/src/components/Packagese/index.vue b/src/components/Packagese/index.vue index ec449b8..298bcc9 100644 --- a/src/components/Packagese/index.vue +++ b/src/components/Packagese/index.vue @@ -1,135 +1,207 @@ <template> - <div> - <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"> - <el-form-item label="缂栫爜" prop="pacCode"> - <el-input v-model="queryParams.pacCode" placeholder="璇疯緭鍏ョ紪鐮�" clearable - @keyup.enter.native="handleQuery" style="width: 120px;" /> - </el-form-item> - <el-form-item label="鍚嶇О" prop="pacName"> - <el-input v-model="queryParams.pacName" placeholder="璇疯緭鍏ュ悕绉�" clearable - @keyup.enter.native="handleQuery" style="width: 130px;" /> - </el-form-item> - <el-form-item label="鍐呭" prop="pacRemark"> - <el-input v-model="queryParams.pacRemark" placeholder="璇疯緭鍏ュ唴瀹�" clearable - @keyup.enter.native="handleQuery" style="width: 130px;" /> - </el-form-item> - <el-form-item> - <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> - </el-form-item> - </el-form> - <el-table :data="dataList" ref="elTable" v-loading="loading" @selection-change="handleSelectionChange" border - height="320px"> - <el-table-column type="selection" width="40" align="center" /> - <el-table-column label="搴忓彿" prop="xh" align="center" /> - <el-table-column label="缂栫爜" align="center" prop="pacCode" /> - <el-table-column label="鍚嶇О" align="center" prop="pacName" width="100px" /> - <el-table-column label="鎷奸煶鐮�" align="center" prop="detail" width="100px" /> - <el-table-column label="鍐呭" align="center" prop="pacRemark" /> - <el-table-column label="澶囨敞" align="center" prop="price" /> - </el-table> - <span slot="footer" class="dialog-footer"> - <el-button @click="open = false">鍙� 娑�</el-button> - <el-button type="primary" @click="handleOk">纭� 瀹�</el-button> - </span> - </el-dialog> - - </div> + <div> + <el-dialog + :title="title" + :visible.sync="open" + width="1200px" + append-to-body + > + <el-form + :model="queryParams" + ref="queryForm" + size="small" + :inline="true" + label-width="68px" + > + <el-form-item label="缂栫爜" prop="pid"> + <el-input + v-model="queryParams.pid" + placeholder="璇疯緭鍏ョ紪鐮�" + clearable + @keyup.enter.native="handleQuery" + style="width: 120px" + /> + </el-form-item> + <el-form-item label="鍚嶇О" prop="pname"> + <el-input + v-model="queryParams.pname" + placeholder="璇疯緭鍏ュ悕绉�" + clearable + @keyup.enter.native="handleQuery" + style="width: 130px" + /> + </el-form-item> + <el-form-item label="鍐呭" prop="pym"> + <el-input + v-model="queryParams.pym" + placeholder="璇疯緭鍏ュ唴瀹�" + clearable + @keyup.enter.native="handleQuery" + style="width: 130px" + /> + </el-form-item> + <el-form-item> + <el-button + type="primary" + icon="el-icon-search" + size="mini" + @click="handleQuery" + >鎼滅储</el-button + > + </el-form-item> + </el-form> + <el-table + :data="dataList" + ref="elTable" + v-loading="loading" + @selection-change="handleSelectionChange" + border + height="320px" + > + <el-table-column type="selection" width="40" align="center" /> + <el-table-column label="搴忓彿" prop="xh" align="center" /> + <el-table-column label="缂栫爜" align="center" prop="pacCode" /> + <el-table-column + label="鍚嶇О" + align="center" + prop="pacName" + width="100px" + /> + <el-table-column + label="鎷奸煶鐮�" + align="center" + prop="detail" + width="100px" + /> + <el-table-column label="鍐呭" align="center" prop="pacRemark" /> + <el-table-column label="澶囨敞" align="center" prop="price" /> + </el-table> + <div class="pag"> + <div class="pag1"> + <pagination + v-show="total > 0" + :total="total" + :page.sync="queryParams.page" + :limit.sync="queryParams.pageSize" + @pagination="getAllList" + /> + </div> + </div> + <span slot="footer" class="dialog-footer"> + <el-button @click="open = false">鍙� 娑�</el-button> + <el-button type="primary" @click="handleOk">纭� 瀹�</el-button> + </span> + </el-dialog> + </div> </template> <script> -import { - getTjHyBgList, -} from "@/api/hosp/project"; +import { getTjHyBgList } from "@/api/hosp/project"; export default { - name: 'Packagese', - // props: { - // row: { - // type: Object, - // } + name: "Packagese", + // props: { + // pacCode: { + // type: String, + + // } + // }, + data() { + return { + open: false, + openone: false, + // 寮瑰嚭灞傛爣棰� + title: "", + dataList: [], + // 閬僵灞� + loading: false, + form: { + desc: "", + }, + queryParams: { + pid: "", + pname: "", + pym: "", + checktype: "deptdict", + page: 1, + pageSize: 10, + }, + list: [], + fList: {}, + }; + }, + watch: { + // 'row'(val, newVla) { + // console.log(val,newVla) + // this.fList = val + // console.log(this.fList); + // } + }, + mounted() { + // this.getList() + }, + + created() { + // this.getList() + }, + methods: { + getAllList() { + this.loading = true; + this.openone = true; + getTjHyBgList(this.queryParams).then((res) => { + this.dataList = res.data.list; + this.loading = false; + }); + }, + // getList() { + // this.loading = true; + // this.openone = false; + // Packagestlist(this.queryParams).then((res) => { + // this.dataList = res.rows; + // this.loading = false; + // }); // }, - data() { - return { - open: false, - openone:false, - // 寮瑰嚭灞傛爣棰� - title: "", - dataList: [], - // 閬僵灞� - loading: false, - form: { - desc: "" - }, - queryParams: { - pacCode: "", - pacName: "", - pacRemark: "", - }, - list: [], - fList: {} - }; + handleQuery() { + + this.getAllList(); + }, - watch: { - // 'row'(val, newVla) { - // console.log(val,newVla) - // this.fList = val - // console.log(this.fList); - - // } - + handleSelectionChange(selection) { + if (selection.length > 1) { + this.$refs.elTable.clearSelection(); // 娓呯┖鎵�鏈夐�夋嫨 + this.$refs.elTable.toggleRowSelection(selection.pop()); // 璁剧疆閫夋嫨椤� + } + this.list = selection; + console.log(this.list); }, - mounted() { - // this.getList() + handleOk() { + this.open = false; + + if (this.list.length === 1) { + const pac = [ + { + pacCode: this.list[0].pacCode, + pacName: this.list[0].pacName + } + ]; + this.$emit("add", pac); + } else { + this.$message.warning("璇烽�夋嫨涓�涓」鐩�"); + } }, - - created() { - // this.getList() - }, - methods: { - getAllList(){ - this.loading = true; - this.openone = true - getTjHyBgList(this.queryParams).then(res => { - this.dataList = res.data - this.loading = false; - }) - - }, - getList() { - this.loading = true; - this.openone = false - Packagestlist(this.queryParams).then(res => { - this.dataList = res.rows - this.loading = false; - }) - - }, - handleQuery() { - // if(this.openone == false){ - // this.getList() - // }else if(this.openone == true){ - 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) - - }, - handleOk() { - this.open = false - if (this.list.length == 1) { - this.$emit('add',this.list); - } - } - } -} + }, +}; </script> -<style scoped></style> +<style scoped> +.pag { + width: 100%; + display: flex; + justify-content: center; +} + +.pag1 { + width: 30%; +} +</style> \ No newline at end of file -- Gitblit v1.8.0