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 | 63 ++++++++++++++++++------------- 1 files changed, 37 insertions(+), 26 deletions(-) diff --git a/src/views/advice/advice/index.vue b/src/views/advice/advice/index.vue index 3b9dd6e..19507b8 100644 --- a/src/views/advice/advice/index.vue +++ b/src/views/advice/advice/index.vue @@ -166,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" /> @@ -184,9 +184,9 @@ > 蹇嵎鏍囩 </span> - <el-checkbox-group v-model="form.kjbq"> + <el-checkbox-group v-model="kjbq" @change="handleCheckedCitiesChange"> <el-checkbox - v-for="(item, index) in dataList" + v-for="(item,index) in dataList" :key="index" :label="item.id" >{{ item.kjbq }}</el-checkbox @@ -210,7 +210,7 @@ <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="form.kjbq" placeholder="璇疯緭鍏ュ悕绉�" /> + <el-input v-model="formss.kjbq" placeholder="璇疯緭鍏ュ悕绉�" /> </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> @@ -264,6 +264,7 @@ // advice琛ㄦ牸鏁版嵁 adviceList: [], dataList: [], + kjbq:[], // 寮瑰嚭灞傛爣棰� title: "", // 鏄惁鏄剧ず寮瑰嚭灞� @@ -277,7 +278,9 @@ }, // 琛ㄥ崟鍙傛暟 form: { - kjbq:[], + }, + formss:{ + }, // 琛ㄥ崟鏍¢獙 rules: { @@ -287,7 +290,7 @@ }, created() { this.getList(); - this.getlistProject(); + }, methods: { /** 鏌ヨadvice鍒楄〃 */ @@ -310,7 +313,23 @@ }, 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; + } + }); }); }, // 鍙栨秷鎸夐挳 @@ -354,21 +373,9 @@ handleAdd() { this.reset(); this.title = "浣撴寤鸿淇℃伅缁存姢"; - getInfo().then((res) => { - let data = { - pageNum: 1, - pageSize: 10, - userId: res.user.userId, - qyzt: 0, - }; - getTjAdviceKjbqByFl(data).then((res) => { - if (res.data) { - this.dataList = res.data.records; + this.getlistProject(); this.open = true; - console.log(this.dataList ) - } - }); - }); + }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { @@ -376,6 +383,7 @@ const id = row.id || this.ids; getAdvice(id).then((response) => { this.form = response.data; + this.getlistProject(); this.open = true; this.title = "浣撴寤鸿淇℃伅缁存姢"; }); @@ -384,32 +392,35 @@ this.$refs["form"].validate((valid) => { if (valid) { if (this.form.id != null) { - updateTjAdviceKjbq(this.form).then((response) => { + updateTjAdviceKjbq(this.formss).then((response) => { this.$modal.msgSuccess("淇敼鎴愬姛"); this.kjbqopen = false; - this.getList(); + this.getlistProject(); }); } else { - addTjAdviceKjbq(this.form).then((response) => { + addTjAdviceKjbq(this.formss).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); this.kjbqopen = false; - this.getList(); + 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; -- Gitblit v1.8.0