From a46f2000f85c91b0e118a0af1bc6022a16feadcb Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期四, 04 七月 2024 17:15:57 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/patient/profile/index.vue |   96 +++++++++++++++++++++++++++++++++++------------
 1 files changed, 71 insertions(+), 25 deletions(-)

diff --git a/src/views/patient/patient/profile/index.vue b/src/views/patient/patient/profile/index.vue
index 2be9058..0b947b4 100644
--- a/src/views/patient/patient/profile/index.vue
+++ b/src/views/patient/patient/profile/index.vue
@@ -145,27 +145,27 @@
             <el-col :span="24"
               ><div class="xinz-inf">
                 <el-tag
-                  :key="tag"
+                  :key="tag.tagname"
                   type="success"
                   v-for="tag in dynamicTags"
                   closable
                   :disable-transitions="false"
                   @close="handleClose(tag)"
                 >
-                  {{ tag }}
+                  {{ tag.tagname }}
                 </el-tag>
                 <el-select
-                  v-model="inputValue"
                   v-if="inputVisible"
+                  v-model="inputValue"
                   @change="handleInputConfirm"
                   filterable
                   allow-create
                   default-first-option
-                  placeholder="璇烽�夋嫨"
+                  placeholder="璇烽�夋嫨/鏌ヨ"
                 >
                   <el-option
                     v-for="item in options"
-                    :key="item.tagname"
+                    :key="item.tagid"
                     :label="item.tagname"
                     :value="item.tagname"
                   >
@@ -650,6 +650,7 @@
       titletb: "鏂板鑱旂郴鏂瑰紡",
       activeTab: "userinfo",
       id: "",
+      loading: false,
       activeName: "health", //涓�绫诲鑸�
       sonactiveName: "outpatient", //鍋ュ悍鐩戞祴瀵艰埅
       sontwoactiveName: "blood", //鍖荤枟妗f瀵艰埅
@@ -759,6 +760,9 @@
     };
   },
   created() {
+    this.id = this.$route.query.id;
+    this.getuserinfo();
+    this.gettabList();
     this.$nextTick(function () {
       this.echartdom = document.getElementById("xyeCharts");
       this.xtechartdom = document.getElementById("xteCharts");
@@ -774,9 +778,6 @@
       this.xueyangechartsInit();
       this.twechartsInit();
     });
-    this.id = this.$route.query.id;
-    this.getuserinfo();
-    this.gettabList();
   },
 
   methods: {
@@ -789,6 +790,9 @@
         this.tableData = response.rows;
       });
     },
+    processElement(element) {
+      return { ...element, isoperation: null };
+    },
     // 鑾峰彇鍩虹淇℃伅
     getuserinfo() {
       const queryParams = {
@@ -799,18 +803,23 @@
       // 鎮h�呭熀纭�淇℃伅
       messagelistpatient(queryParams).then((response) => {
         this.userform = response.rows[0];
-        this.dynamicTags = response.rows[0].tagList;
+        // this.dynamicTags = response.rows[0].tagList;
+        this.dynamicTags = response.rows[0].tagList.map(this.processElement);
+        console.log(this.dynamicTags);
       });
       // 鐥呭彶淇℃伅
       getmedicalhistory({ pid: this.id }).then((res) => {
-        this.form = res.rows[0];
+        if (res.code == 200 && res.rows[0]) {
+          this.form = res.rows[0];
+        }
       });
       // 鑱旂郴淇℃伅
       this.getcontactlist();
     },
     // 淇濆瓨鎮h�呮。妗�
     savefile() {
-      this.userform.tagList = this.dynamicTags;
+      // this.userform.tagList = this.dynamicTags;
+      this.userform.isoperation = 2;
       alterpatient(this.userform).then((res) => {
         if (res.code == 200) {
           this.$modal.msgSuccess("鍩虹淇℃伅淇濆瓨鎴愬姛");
@@ -920,12 +929,18 @@
         .catch(() => {});
     },
     tableRowClassName({ row, rowIndex }) {
-      console.log(row);
       if (row.isdefault == "1") {
         return "warning-row";
       }
       return "";
     },
+    // tab鍒囨崲
+    handleClick(tab, event) {
+      console.log(tab, event);
+    },
+    // 鑱旂郴鏂瑰紡鏂板
+    Addanumber() {},
+    // 鏍囩--------------------------
     /** 鏌ヨ鏍囩鍒楄〃 */
     gettabList() {
       const tagqueryParams = {
@@ -935,31 +950,62 @@
       };
       listtag(tagqueryParams).then((response) => {
         this.options = response.rows;
+        console.log(this.options, "鏍囩");
       });
     },
-
-    // tab鍒囨崲
-    handleClick(tab, event) {
-      console.log(tab, event);
+    remoteMethod(value) {
+      const illnessqueryParams = {
+        pageNum: 1,
+        pageSize: 100,
+        tagname: value,
+        tagcategoryid: "0",
+      };
+      this.loading = true;
+      setTimeout(() => {
+        this.loading = false;
+        listtag(illnessqueryParams).then((response) => {
+          this.options = response.rows;
+        });
+      }, 200);
     },
-    // 鑱旂郴鏂瑰紡鏂板
-    Addanumber() {},
     handleClose(tag) {
+      const lindex = this.dynamicTags.indexOf(tag);
       this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
+      this.userform.tagList[lindex].isoperation = 3;
     },
 
     showInput() {
       this.inputVisible = true;
-      this.$nextTick((_) => {
-        this.$refs.saveTagInput.$refs.input.focus();
-      });
+      console.log("灞曠ず");
     },
 
     handleInputConfirm() {
-      let inputValue = this.inputValue;
-      if (inputValue) {
-        this.dynamicTags.push(inputValue);
+      let tagvalue = {};
+      let tagname = this.inputValue;
+      if (tagname) {
+        listtag({
+          pageNum: 1,
+          pageSize: 1000,
+          tagcategoryid: "0",
+          tagname: tagname,
+        }).then((res) => {
+          if (res.rows[0]) {
+            tagvalue = res.rows[0];
+            tagvalue.isoperation = 1;
+          } else {
+            tagvalue = {
+              tagname: tagname,
+              isoperation: 1,
+            };
+          }
+          console.log(tagvalue);
+          this.userform.tagList.push(tagvalue);
+          this.dynamicTags.push(tagvalue);
+          console.log(this.userform.tagList);
+          console.log(this.dynamicTags);
+        });
       }
+      console.log("鍏充簡");
       this.inputVisible = false;
       this.inputValue = "";
     },
@@ -1452,7 +1498,7 @@
 }
 .xinz-inf {
   font-size: 18px;
-  white-space: nowrap;
+  // white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
 

--
Gitblit v1.9.3