From 9cdbb01ce10a69fb00d0e9f6dc3b9523d266079b Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期五, 26 四月 2024 11:19:40 +0800
Subject: [PATCH] qxtj

---
 src/components/createproposal/index.vue |   50 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/src/components/createproposal/index.vue b/src/components/createproposal/index.vue
index b904274..be980b8 100644
--- a/src/components/createproposal/index.vue
+++ b/src/components/createproposal/index.vue
@@ -11,6 +11,9 @@
           <el-input v-model="propform.title" placeholder="璇疯緭鍏ュ悕绉版爣棰�" />
         </el-form-item>
         <el-form-item label="蹇嵎鏍囩" prop="kjbq">
+          <span slot="label" style="display:inline-block;border-bottom: 2px solid blue;" @click="handleQuery">
+            蹇嵎鏍囩
+              </span>
           <el-checkbox-group
             v-model="propform.kjbq"
             @change="handleCheckedCitiesChange"
@@ -38,13 +41,24 @@
         <el-button type="primary" @click="handleOk">纭� 瀹�</el-button>
       </span>
     </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="form.kjbq" placeholder="璇疯緭鍏ュ悕绉�" />
+        </el-form-item>
+      </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>
   </div>
 </template>
   
 <script>
 import {
   getTjAdviceKjbqByFl,
-  addCyTjAdvice,
+  addCyTjAdvice,addTjAdviceKjbq
 } from "@/api/system/biaoqianzidian";
 import { getInfo } from "@/api/login";
 export default {
@@ -58,6 +72,10 @@
         advice: "",
         kjbq: [],
       },
+      form:{
+
+      },
+      kjbqopen: false,
       open: false,
       openone: false,
       // 寮瑰嚭灞傛爣棰�
@@ -94,6 +112,7 @@
     getList() {
       this.loading = true;
       getInfo().then((res) => {
+        this.form.userId = res.user.userId;
         this.queryParams.userId = res.user.userId;
         getTjAdviceKjbqByFl(this.queryParams).then((res) => {
           if (res.data) {
@@ -104,11 +123,34 @@
         });
       });
     },
-    handleCheckedCitiesChange(val) {
-      val.forEach((item) => {
-        this.checkbox += item;
+    handleQuery(){
+      this.kjbqopen = true;
+    },
+    cancel(){
+      this.kjbqopen = false;
+    },
+    submitForm() {
+      this.$refs["form"].validate((valid) => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateTjAdviceKjbq(this.form).then((response) => {
+              this.$modal.msgSuccess("淇敼鎴愬姛");
+              this.kjbqopen = false;
+              this.getList();
+            });
+          } else {
+            addTjAdviceKjbq(this.form).then((response) => {
+              this.$modal.msgSuccess("鏂板鎴愬姛");
+              this.kjbqopen = false;
+              this.getList();
+            });
+          }
+        }
       });
     },
+    handleCheckedCitiesChange(val) {
+     
+    },
     handleOk() {
       let data = {
         title: this.propform.title,

--
Gitblit v1.8.0