From 47a7c6d2458ebd3c4722cbd1938d3f28a99e78ad Mon Sep 17 00:00:00 2001
From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com>
Date: 星期五, 26 四月 2024 15:03:42 +0800
Subject: [PATCH] qxtj

---
 src/views/advice/advice/index.vue |  129 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 109 insertions(+), 20 deletions(-)

diff --git a/src/views/advice/advice/index.vue b/src/views/advice/advice/index.vue
index c21a291..3b9dd6e 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"
@@ -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="form.kjbq">
+            <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="form.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,19 +230,21 @@
   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)
+      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 (value != undefined && value != "") {
         return callback();
-      }else if (!patter.test(value)) {
-        return callback('');
+      } else if (!patter.test(value)) {
+        return callback("");
       }
     };
     return {
@@ -217,10 +263,12 @@
       total: 0,
       // advice琛ㄦ牸鏁版嵁
       adviceList: [],
+      dataList: [],
       // 寮瑰嚭灞傛爣棰�
       title: "",
       // 鏄惁鏄剧ず寮瑰嚭灞�
       open: false,
+      kjbqopen: false,
       // 鏌ヨ鍙傛暟
       queryParams: {
         page: 1,
@@ -228,10 +276,12 @@
         proName: null,
       },
       // 琛ㄥ崟鍙傛暟
-      form: {},
+      form: {
+        kjbq:[],
+      },
       // 琛ㄥ崟鏍¢獙
       rules: {
-        proId: [{ required: true, validator: checkPhoneNum,  trigger: "blur" }],
+        proId: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
       },
     };
   },
@@ -249,15 +299,16 @@
       //   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;
       });
@@ -265,6 +316,7 @@
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false;
+      this.kjbqopen = false;
       this.reset();
     },
     // 琛ㄥ崟閲嶇疆
@@ -301,8 +353,22 @@
     /** 鏂板鎸夐挳鎿嶄綔 */
     handleAdd() {
       this.reset();
-      this.open = true;
       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.open = true;
+            console.log(this.dataList )
+          }
+        });
+      });
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
@@ -312,6 +378,25 @@
         this.form = response.data;
         this.open = true;
         this.title = "浣撴寤鸿淇℃伅缁存姢";
+      });
+    },
+    submitFormbgq() {
+      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();
+            });
+          }
+        }
       });
     },
     /** 鎻愪氦鎸夐挳 */
@@ -334,6 +419,10 @@
         }
       });
     },
+    handlekjbq(){
+      this.kjbqopen = true;
+    },
+
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
       const ids = row.id || this.ids;

--
Gitblit v1.8.0