From 1e4a70437b5e2f7bd027ebc4081c22b315da3025 Mon Sep 17 00:00:00 2001 From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com> Date: 星期五, 26 四月 2024 16:13:58 +0800 Subject: [PATCH] qxtj --- src/views/advice/advice/index.vue | 149 +++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 130 insertions(+), 19 deletions(-) diff --git a/src/views/advice/advice/index.vue b/src/views/advice/advice/index.vue index 64e844e..19507b8 100644 --- a/src/views/advice/advice/index.vue +++ b/src/views/advice/advice/index.vue @@ -33,7 +33,7 @@ <el-row :gutter="10" class="mb8"> <el-col :span="1.5"> <el-button - type="primary" + type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" @@ -43,7 +43,7 @@ </el-col> <el-col :span="1.5"> <el-button - type="primary" + type="primary" icon="el-icon-edit" size="mini" :disabled="single" @@ -54,7 +54,7 @@ </el-col> <el-col :span="1.5"> <el-button - type="primary" + type="primary" icon="el-icon-delete" size="mini" :disabled="multiple" @@ -65,7 +65,7 @@ </el-col> <el-col :span="1.5"> <el-button - type="primary" + type="primary" icon="el-icon-download" size="mini" @click="handleExport" @@ -84,12 +84,29 @@ :data="adviceList" @selection-change="handleSelectionChange" border - > <el-table-column type="selection" width="55" align="center" fixed /> - <el-table-column label="搴忓彿" align="center" prop="newID" width="55px" fixed /> - <el-table-column label="鎵�閫夐」鐩�" align="center" prop="proName" width="120px" :show-overflow-tooltip="true" /> - <el-table-column label="鏍囬" align="center" prop="title" width="120px" :show-overflow-tooltip="true" /> + <el-table-column + label="搴忓彿" + align="center" + prop="newID" + width="55px" + fixed + /> + <el-table-column + label="鎵�閫夐」鐩�" + align="center" + prop="proName" + width="120px" + :show-overflow-tooltip="true" + /> + <el-table-column + label="鏍囬" + align="center" + prop="title" + width="120px" + :show-overflow-tooltip="true" + /> <el-table-column label="寤鸿" align="center" @@ -149,8 +166,8 @@ clearable > <el-option - v-for="dict in projectList" - :key="dict.proName" + v-for="(dict,index) in projectList" + :key="index" :label="dict.proName" :value="dict.proId" /> @@ -159,7 +176,23 @@ <el-form-item label="寤鸿鏍囬" prop="title"> <el-input v-model="form.title" placeholder="璇疯緭鍏ュ悕绉版爣棰�" /> </el-form-item> - + <el-form-item label="蹇嵎鏍囩" prop="kjbq"> + <span + slot="label" + style="display: inline-block; border-bottom: 2px solid blue" + @click="handlekjbq" + > + 蹇嵎鏍囩 + </span> + <el-checkbox-group v-model="kjbq" @change="handleCheckedCitiesChange"> + <el-checkbox + v-for="(item,index) in dataList" + :key="index" + :label="item.id" + >{{ item.kjbq }}</el-checkbox + > + </el-checkbox-group> + </el-form-item> <el-form-item label="寤鸿鍐呭" prop="advice"> <el-input type="textarea" @@ -171,6 +204,17 @@ </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-dialog title="娣诲姞蹇嵎鏍囩" :visible.sync="kjbqopen" width="500px" append-to-body> + <el-form ref="form" :model="form" label-width="80px"> + <el-form-item label="鍚嶇О" prop="kjbq"> + <el-input v-model="formss.kjbq" placeholder="璇疯緭鍏ュ悕绉�" /> + </el-form-item> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitFormbgq">纭� 瀹�</el-button> <el-button @click="cancel">鍙� 娑�</el-button> </div> </el-dialog> @@ -186,10 +230,23 @@ updateAdvice, } from "@/api/advice/advice"; import { listProject } from "@/api/hosp/project"; +import { getTjAdviceKjbqByFl,addTjAdviceKjbq } from "@/api/system/biaoqianzidian"; +import { getInfo } from "@/api/login"; export default { name: "Advice", 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 { projectList: [], // 閬僵灞� @@ -206,10 +263,13 @@ total: 0, // advice琛ㄦ牸鏁版嵁 adviceList: [], + dataList: [], + kjbq:[], // 寮瑰嚭灞傛爣棰� title: "", // 鏄惁鏄剧ず寮瑰嚭灞� open: false, + kjbqopen: false, // 鏌ヨ鍙傛暟 queryParams: { page: 1, @@ -217,16 +277,20 @@ proName: null, }, // 琛ㄥ崟鍙傛暟 - form: {}, + form: { + }, + formss:{ + + }, // 琛ㄥ崟鏍¢獙 rules: { - proId: [{ required: true, message: "", trigger: "blur" }], + proId: [{ required: true, validator: checkPhoneNum, trigger: "blur" }], }, }; }, created() { this.getList(); - this.getlistProject(); + }, methods: { /** 鏌ヨadvice鍒楄〃 */ @@ -238,22 +302,40 @@ // pageSize:this.queryParams.pageSize, // } listAdvice(this.queryParams).then((response) => { - response.data.list.forEach((item, index) => {item.newID =(this.queryParams.page - 1) * this.queryParams.pageSize +index +1; + response.data.list.forEach((item, index) => { + item.newID = + (this.queryParams.page - 1) * this.queryParams.pageSize + index + 1; }); this.adviceList = response.data.list; this.total = response.data.total; this.loading = false; }); - }, - getlistProject(){ + getlistProject() { listProject(this.queryParams).then((response) => { - this.projectList = response.data; + if(response.data){ + this.projectList = response.data; + } + }); + getInfo().then((res) => { + this.formss.userId = res.user.userId; + let data = { + pageNum: 1, + pageSize: 10, + userId: res.user.userId, + qyzt: 0, + }; + getTjAdviceKjbqByFl(data).then((res) => { + if (res.data) { + this.dataList = res.data.records; + } + }); }); }, // 鍙栨秷鎸夐挳 cancel() { this.open = false; + this.kjbqopen = false; this.reset(); }, // 琛ㄥ崟閲嶇疆 @@ -290,8 +372,10 @@ /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { this.reset(); - this.open = true; this.title = "浣撴寤鸿淇℃伅缁存姢"; + this.getlistProject(); + this.open = true; + }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { @@ -299,21 +383,44 @@ const id = row.id || this.ids; getAdvice(id).then((response) => { this.form = response.data; + this.getlistProject(); this.open = true; this.title = "浣撴寤鸿淇℃伅缁存姢"; }); }, + submitFormbgq() { + this.$refs["form"].validate((valid) => { + if (valid) { + if (this.form.id != null) { + updateTjAdviceKjbq(this.formss).then((response) => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.kjbqopen = false; + this.getlistProject(); + }); + } else { + addTjAdviceKjbq(this.formss).then((response) => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.kjbqopen = false; + this.getlistProject(); + }); + } + } + }); + }, + handleCheckedCitiesChange(val) {}, /** 鎻愪氦鎸夐挳 */ submitForm() { this.$refs["form"].validate((valid) => { if (valid) { if (this.form.id != null) { + this.form.kjbq = this.kjbq.toString() updateAdvice(this.form).then((response) => { this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { + this.form.kjbq = this.kjbq.toString() addAdvice(this.form).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; @@ -323,6 +430,10 @@ } }); }, + handlekjbq(){ + this.kjbqopen = true; + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const ids = row.id || this.ids; -- Gitblit v1.8.0