From c7b33db117fd2893d7d1c93bf5d46e87d33e44d0 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期一, 16 十二月 2024 16:08:51 +0800
Subject: [PATCH] 初审结果查询

---
 src/components/createproposal/index.vue |  193 ++++++++++++++++++++++++++++++++----------------
 1 files changed, 128 insertions(+), 65 deletions(-)

diff --git a/src/components/createproposal/index.vue b/src/components/createproposal/index.vue
index a7c09be..5d9490a 100644
--- a/src/components/createproposal/index.vue
+++ b/src/components/createproposal/index.vue
@@ -6,12 +6,29 @@
       width="1200px"
       append-to-body
     >
-    <el-form ref="form" :model="propform" label-width="80px">
+      <el-form ref="form" :model="propform" label-width="80px">
         <el-form-item label="寤鸿鏍囬" prop="title">
           <el-input v-model="propform.title" placeholder="璇疯緭鍏ュ悕绉版爣棰�" />
         </el-form-item>
-        <el-form-item label="蹇嵎鏍囩" prop="title">
-          <el-input v-model="propform.title" placeholder="璇疯緭鍏ュ悕绉版爣棰�" />
+        <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"
+          >
+            <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
@@ -22,118 +39,164 @@
           />
         </el-form-item>
       </el-form>
-     
+
       <span slot="footer" class="dialog-footer">
         <el-button @click="open = false">鍙� 娑�</el-button>
         <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 {
-  getKjTjAdviceKjbqBySex,
-  getCyTjAdviceKjbqBySex,
-} from "@/api/hosp/project";
+  getTjAdviceKjbqByFl,
+  addCyTjAdvice,
+  addTjAdviceKjbq,
+} from "@/api/system/biaoqianzidian";
 import { getInfo } from "@/api/login";
 export default {
-  name: "Packagese",
+  name: "createproposal",
   props: {
-    cusobj: Object,
+    creatobj: Object,
   },
   data() {
     return {
-      tjproposal: "0",
+      deptId:"",
+      isZjs: 0,
+      propform: {
+        advice: "",
+        kjbq: [],
+      },
+      form: {},
+      kjbqopen: false,
       open: false,
       openone: false,
       // 寮瑰嚭灞傛爣棰�
       title: "",
-      total: 0,
       dataList: [],
       // 閬僵灞�
       loading: false,
       queryParams: {
-        sex: "",
-        isZj: "",
-        userId: "",
-        page: 1,
+        pageNum: 1,
         pageSize: 10,
+        userId: null,
+        qyzt: 0,
       },
       list: [],
-      fList: {},
+      fList: [],
+      id: "",
     };
   },
   watch: {
-    cusobj(val, newVla) {
-      // console.log(val,newVla,1111)
-      this.fList= val
-      this.queryParams.sex = val.sex;
-      this.queryParams.isZj = val.isZj;
-      if (this.queryParams.sex) {
+    creatobj(val, newVla) {
+      console.log(val, 111);
+      this.propform.advice = val.proParentList;
+      this.isZjs = val.isZj;
+      if(val.proParentList){
         this.getList();
       }
+      
     },
   },
   mounted() {
-    // this.getList()
+    this.propform.kjbq = [];
+    // this.getList();
   },
 
   created() {
-    // if( this.queryParams){
-    //     this.getList()
-    // }
+    // this.getList();
   },
   methods: {
-    getAllList() {
-      this.loading = true;
-      this.openone = true;
-      getTjHyBgList(this.queryParams).then((res) => {
-        this.dataList = res.data.records;
-        this.loading = false;
-      });
-    },
     getList() {
       this.loading = true;
-      getKjTjAdviceKjbqBySex(this.queryParams).then((res) => {
-        this.dataList = res.data.records;
-        this.total = res.data.total;
-        this.loading = false;
+      getInfo().then((res) => {
+        this.form.userId = res.user.userId;
+        this.queryParams.userId = res.user.userId;
+        this.deptId = res.user.deptId;
+        console.log(this.deptId);
+        getTjAdviceKjbqByFl(this.queryParams).then((res) => {
+          if (res.data) {
+            this.dataList = res.data.records;
+          }
+
+          this.loading = false;
+        });
       });
     },
     handleQuery() {
-      this.getAllList();
+      this.kjbqopen = true;
     },
-    handleSelectionChange(selection) {
-    //   if (selection.length > 1) {
-    //     this.$refs.elTable.clearSelection(); // 娓呯┖鎵�鏈夐�夋嫨
-    //     this.$refs.elTable.toggleRowSelection(selection.pop()); // 璁剧疆閫夋嫨椤�
-    //   }
-      this.list = selection;
-      console.log( this.list)
+    cancel() {
+      this.kjbqopen = false;
     },
-    radiotjproposalChange() {
-      if (this.tjproposal == "0") {
-        this.queryParams.isZj = this.fList.isZj;
-        this.getList();
+    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() {
+      if (this.isZjs == 0) {
+        let data = {
+          title: this.propform.title,
+          isZj: this.isZjs,
+          kjbq: this.propform.kjbq.toString(),
+          advice: this.propform.advice,
+        };
+        addCyTjAdvice(data).then((res) => {
+          if (res.code == 200) {
+            this.open = false;
+          }
+        });
       } else {
-        this.loading = true;
-        getInfo().then((res) => {
-          this.queryParams.userId = res.user.userId;
-          this.queryParams.isZj = null;
-          getCyTjAdviceKjbqBySex(this.queryParams).then((res) => {
-            this.dataList = res.data.records;
-            this.total = res.data.total;
-            this.loading = false;
-          });
+        let data = {
+          deptId:this.deptId,
+          title: this.propform.title,
+          isZj: this.isZjs,
+          kjbq: this.propform.kjbq.toString(),
+          advice: this.propform.advice,
+        };
+        addCyTjAdvice(data).then((res) => {
+          if (res.code == 200) {
+            this.open = false;
+          }
         });
       }
-    },
-    handleOk() {
-      this.open = false;
-      if (this.list.length != 0) {
-        this.$emit("event1", this.list);
-      }
+
+      // if (this.list.length != 0) {
+      //   this.$emit("event1", this.list);
+      // }
     },
   },
 };

--
Gitblit v1.8.0