From c26281ff05585d8f3f337b290831803fe766748b Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期二, 02 一月 2024 18:31:44 +0800
Subject: [PATCH] su

---
 src/components/jianqianwenzhen/index.vue |  176 +++++++++++++++++++++++++++++-----------------------------
 1 files changed, 87 insertions(+), 89 deletions(-)

diff --git a/src/components/jianqianwenzhen/index.vue b/src/components/jianqianwenzhen/index.vue
index 380f83e..5e27f62 100644
--- a/src/components/jianqianwenzhen/index.vue
+++ b/src/components/jianqianwenzhen/index.vue
@@ -262,7 +262,6 @@
                     filterable
                     placeholder="璇烽�夋嫨鐤剧梾绫诲瀷"
                     clearable
-                    @change="jibing"
                   >
                     <el-option
                       v-for="item in options"
@@ -291,9 +290,9 @@
                   >
                     <el-option
                       v-for="dict in rulesList"
-                      :key="dict.aid"
-                      :label="dict.bingzhong"
-                      :value="dict.bingzhong"
+                      :key="dict.id"
+                      :label="dict.icdname"
+                      :value="dict.icdname"
                     />
                   </el-select>
                 </template>
@@ -496,7 +495,7 @@
 
 <script>
 import { updateHistory, getInfoById, getZhengZhuang } from "@/api/hosp/history";
-import { listRules } from "@/api/hosp/rules";
+import { list } from "@/api/hosp/rules";
 import { listIcd } from "@/api/system/icd";
 export default {
   dicts: ["tj_smoking_pinlv", "sys_yes_no", "tj_work_status", "tj_work"],
@@ -504,10 +503,6 @@
   props: {
     jianqianwenzhendata: {
       type: Array, //鏁扮粍绫诲瀷
-      default: null,
-    },
-     jianqianwenzhendatas: {
-      type: Array, //瀛楃涓茬被鍨�
       default: null,
     },
   },
@@ -523,6 +518,7 @@
       }
     };
     return {
+      diseaseNames: "",
       zhenghuzangList: [],
       options: [
         {
@@ -534,11 +530,11 @@
           label: "鑱屼笟鐥�",
         },
       ],
-      icd: "",
+      icdId: "",
       zhiye: true,
       queryParams: {
         pageNum: 1,
-        pageSize: 10,
+        pageSize: 100,
       },
       dataList: [],
       pickerOptions: {
@@ -644,70 +640,61 @@
         });
         this.loading = false;
       }
-
-      // if (this.fList) {
-      //     this.getList()
-      // }
-    },
-    jianqianwenzhendatas(valse, newVla) {
-      console.log(valse);
-      if (valse) {
-        console.log(valse);
-          let tjNumber = valse.tjNum;
-          console.log(tjNumber,111);
-          getInfoById(tjNumber).then((response) => {
-            this.form = response.data;
-            if (this.form.cusSex === "1") {
-              this.sex = true;
-            } else {
-              this.sex = false;
-            }
-            if (this.form.tjLx === "02") {
-              this.zhiye = true;
-            } else {
-              this.zhiye = false;
-            }
-            if (this.form.xiyan == null) {
-              this.form.xiyan = "1";
-            }
-            if (this.form.yjsfyc == null) {
-              this.form.yjsfyc = "N";
-            }
-            if (this.form.xiyanpinlv == null) {
-              this.form.xiyanpinlv = "0";
-            }
-            if (this.form.xiyanyear == null) {
-              this.form.xiyanyear = "0";
-            }
-            if (this.form.yinjiu == null) {
-              this.form.yinjiu = "1";
-            }
-            if (this.form.yinjiupinlv == null) {
-              this.form.yinjiupinlv = "0";
-            }
-            if (this.form.yinjiuyear == null) {
-              this.form.yinjiuyear = "0";
-            }
-            this.form.tjAskHistorysList = response.data.tjAskHistorysList;
-            // this.isdisabled= true
-          });
-        this.loading = false;
-      }
-
-      // if (this.fList) {
-      //     this.getList()
-      // }
     },
   },
   created() {
     this.getList();
     this.getzhenzhuangList();
+    console.log("鎺ユ敹", this.jianqianwenzhendata);
+    if (this.jianqianwenzhendata.length == 1) {
+      this.jianqianwenzhendata.forEach((item) => {
+        let tjNumber = item;
+        getInfoById(tjNumber).then((response) => {
+          this.form = response.data;
+          if (this.form.cusSex === "1") {
+            this.sex = true;
+          } else {
+            this.sex = false;
+          }
+          if (this.form.tjLx === "02") {
+            this.zhiye = true;
+          } else {
+            this.zhiye = false;
+          }
+          if (this.form.xiyan == null) {
+            this.form.xiyan = "1";
+          }
+          if (this.form.yjsfyc == null) {
+            this.form.yjsfyc = "N";
+          }
+          if (this.form.xiyanpinlv == null) {
+            this.form.xiyanpinlv = "0";
+          }
+          if (this.form.xiyanyear == null) {
+            this.form.xiyanyear = "0";
+          }
+          if (this.form.yinjiu == null) {
+            this.form.yinjiu = "1";
+          }
+          if (this.form.yinjiupinlv == null) {
+            this.form.yinjiupinlv = "0";
+          }
+          if (this.form.yinjiuyear == null) {
+            this.form.yinjiuyear = "0";
+          }
+          this.form.tjAskHistorysList = response.data.tjAskHistorysList;
+          // this.isdisabled= true
+        });
+      });
+      this.loading = false;
+    }
   },
   methods: {
     /** 鏌ヨ鐤剧梾瀛楀吀鍒楄〃 */
     getList() {
-      listRules(this.queryParams).then((response) => {
+      list(this.queryParams).then((response) => {
         this.rulesList = response.rows;
+        console.log(this.rulesList);
       });
     },
 
@@ -716,28 +703,6 @@
         this.zhenghuzangList = response.data;
       });
     },
-
-    jibing(sel) {
-      console.log(sel);
-      this.rulesList.forEach((item) => {
-        console.log(item);
-        if (sel == item.bingzhong) {
-          this.icd = item.aid;
-        }
-      });
-    },
-    // 鎼滅储
-    getRemoteData(query) {
-      if (query) {
-        let data = {
-          bingzhong: query,
-        };
-        listRules(data).then((response) => {
-          this.rulesList = response.rows;
-        });
-      }
-    },
-
     // 鏂板琛�
     addmembers() {
       if (this.form.cusName) {
@@ -805,6 +770,31 @@
       }
       this.$forceUpdate();
     },
+
+    jibing(sel) {
+      console.log(sel);
+      this.diseaseNames = sel;
+      this.rulesList.forEach((item) => {
+        if (sel == item.icdname) {
+          this.icdId = item.id;
+          console.log(this.icdId);
+        }
+      });
+    },
+    // 鎼滅储
+    getRemoteData(query) {
+      if (query) {
+        let data = {
+          icdname: query,
+           pageNum: 1,
+        pageSize: 200,
+        };
+        list(data).then((response) => {
+          this.rulesList = response.rows;
+        });
+      }
+    },
+
     delememberss() {
       let that = this;
       if (that.form.workLogs.length == that.chageall.length) {
@@ -843,8 +833,16 @@
     },
     /** 鎻愪氦鎸夐挳 */
     submitForm() {
-      // this.form.tjNum = this.jianqianwenzhendata.tjNum;
-      // this.form.tjAskHistorysList.icdId = this.icd;
+      this.form.tjAskHistorysList.forEach(element=>{
+        // console.log(element,111);
+        this.rulesList.forEach((item) => {
+          // console.log(item,222);
+        if(element.diseaseName == item.icdname){
+          element.icdId = item.id;
+        }
+      });
+        
+      })
       updateHistory(this.form).then((response) => {
         this.$modal.msgSuccess("淇敼鎴愬姛");
       });

--
Gitblit v1.8.0