From c4f2875b50f07e6f375cd9c9ec4d8fbc2494d35d Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期二, 27 八月 2024 16:55:54 +0800
Subject: [PATCH] 测试完成

---
 src/views/patient/patient/profile/index.vue |  341 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 258 insertions(+), 83 deletions(-)

diff --git a/src/views/patient/patient/profile/index.vue b/src/views/patient/patient/profile/index.vue
index 2be9058..3c3304d 100644
--- a/src/views/patient/patient/profile/index.vue
+++ b/src/views/patient/patient/profile/index.vue
@@ -42,7 +42,7 @@
         <span class="mulsz" slot="label"
           ><i class="el-icon-s-management"></i> 鍖荤枟妗f</span
         >
-        <el-tabs v-model="sonactiveName" @tab-click="handleClick">
+        <el-tabs v-model="sonactiveName" @tab-click="handleClickson">
           <el-tab-pane name="outpatient"
             ><span class="mulsz" slot="label"
               >闂ㄨ瘖({{ mznumber }})</span
@@ -50,12 +50,12 @@
           >
           <el-tab-pane name="inhospital"
             ><span class="mulsz" slot="label"
-              >浣忛櫌({{ zynumber }})
+              >鍦ㄩ櫌({{ zynumber }})
             </span></el-tab-pane
           >
           <el-tab-pane name="checkout"
             ><span class="mulsz" slot="label"
-              >浣撴({{ jynumber }})
+              >鍑洪櫌({{ jynumber }})
             </span></el-tab-pane
           >
         </el-tabs>
@@ -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"
                   >
@@ -296,7 +296,7 @@
       <!-- 鑱旂郴鐢佃瘽 -->
       <div class="bottom-message">
         <div class="headline">
-          鍙风爜缁存姢<span style="margin-right: 60px">&nbsp;&nbsp;</span>
+          浜插睘鍙风爜缁存姢<span style="margin-right: 60px">&nbsp;&nbsp;</span>
           <el-button type="primary" @click="addcompiletb">+鏂板</el-button>
         </div>
         <div class="Table-screen">
@@ -346,22 +346,71 @@
       <!-- 闂ㄨ瘖 -->
       <div v-if="sonactiveName == 'outpatient'">
         <el-table :data="serviceData" style="width: 100%">
-          <el-table-column prop="daya" label="灏辫瘖鏃ユ湡" width="180">
+          <el-table-column
+            label="灏辫瘖鏃堕棿"
+            align="center"
+            key="createTime"
+            prop="createTime"
+            width="160"
+          >
+            <template slot-scope="scope">
+              <span>{{ parseTime(scope.row.createTime) }}</span>
+            </template>
           </el-table-column>
-          <el-table-column prop="administrative" label="灏辫瘖绉戝" width="180">
+
+          <el-table-column
+            label="闂ㄨ瘖鍙�"
+            align="center"
+            key="patid"
+            prop="patid"
+          />
+          <el-table-column
+            label="濮撳悕"
+            align="center"
+            key="patname"
+            prop="patname"
+          />
+          <el-table-column label="鎬у埆" align="center" key="sex" prop="sex">
+            <template slot-scope="scope">
+              <span>{{ scope.row.sex == 1 ? "鐢�" : "濂�" }}</span>
+            </template>
           </el-table-column>
-          <el-table-column prop="doctor" label="鍖荤敓"> </el-table-column>
-          <el-table-column prop="result" label="鐤剧梾璇婃柇"> </el-table-column>
-          <el-table-column prop="administrative" label="妫�楠�">
-          </el-table-column>
-          <el-table-column prop="administrative" label="妫�鏌�">
-          </el-table-column>
-          <el-table-column prop="administrative" label="鎵嬫湳">
-          </el-table-column>
-          <el-table-column prop="administrative" label="鐢ㄨ嵂">
-          </el-table-column>
-          <el-table-column prop="columcz" label="鍖诲槺" width="200">
-          </el-table-column>
+          <el-table-column
+            label="骞撮緞"
+            align="center"
+            key="age"
+            prop="age"
+            width="120"
+          />
+          <el-table-column
+            label="鑱旂郴鐢佃瘽"
+            align="center"
+            key="telephone"
+            prop="telephone"
+            width="120"
+          />
+          <el-table-column
+            label="璇婃柇"
+            align="center"
+            key="diagname"
+            prop="diagname"
+            width="190"
+          />
+
+          <el-table-column
+            label="灏辫瘖绉戝"
+            align="center"
+            key="deptname"
+            prop="deptname"
+            width="120"
+          />
+          <el-table-column
+            label="鎺ヨ瘖鍖荤敓"
+            align="center"
+            key="drname"
+            prop="drname"
+            width="120"
+          />
         </el-table>
 
         <pagination
@@ -374,30 +423,80 @@
       </div>
       <!-- 浣忛櫌 -->
       <div v-if="sonactiveName == 'inhospital'">
-        <el-table :data="serviceData" style="width: 100%">
-          <el-table-column prop="godaya" label="鍏ラ櫌鏃ユ湡"> </el-table-column>
-          <el-table-column prop="hospitalname" label="鍑洪櫌鏃堕棿">
+        <el-table :data="serviceDatary" style="width: 100%">
+          <el-table-column
+            label="浣忛櫌鍙�"
+            align="center"
+            key="patid"
+            prop="patid"
+          />
+          <el-table-column
+            label="濮撳悕"
+            align="center"
+            key="patname"
+            prop="patname"
+          />
+          <el-table-column label="鎬у埆" align="center" key="sex" prop="sex">
+            <template slot-scope="scope">
+              <span>{{ scope.row.sex == 1 ? "鐢�" : "濂�" }}</span>
+            </template>
           </el-table-column>
-          <el-table-column prop="administrative" label="鐥呭尯">
-          </el-table-column>
-          <el-table-column prop="result" label="涓绘不鍖诲笀"> </el-table-column>
-          <el-table-column prop="bed" label="绠″簥鎶ゅ+"> </el-table-column>
-          <el-table-column prop="doctor" label="鍑洪櫌鐤剧梾璇婃柇">
-          </el-table-column>
-          <el-table-column prop="today" label="妫�楠�"> </el-table-column>
-          <el-table-column prop="administrative" label="妫�鏌�">
-          </el-table-column>
-          <el-table-column prop="administrative" label="鎵嬫湳">
-          </el-table-column>
-          <el-table-column prop="administrative" label="鐢ㄨ嵂">
-          </el-table-column>
-          <el-table-column prop="columcz" label="鍑洪櫌灏忕粨" width="200">
-          </el-table-column>
+          <el-table-column
+            label="骞撮緞"
+            align="center"
+            key="age"
+            prop="age"
+            width="120"
+          />
+          <el-table-column
+            label="鑱旂郴鐢佃瘽"
+            align="center"
+            key="telephone"
+            prop="telephone"
+            width="120"
+          />
+
+          <el-table-column
+            label="鍏ラ櫌璇婃柇"
+            align="center"
+            key="diagname"
+            prop="diagname"
+            width="190"
+          />
+
+          <el-table-column
+            label="鐥呭尯"
+            align="center"
+            key="deptname"
+            prop="deptname"
+            width="120"
+          />
+          <el-table-column
+            label="搴婁綅鍙�"
+            align="center"
+            key="bedNo"
+            prop="bedNo"
+            width="120"
+          />
+          <el-table-column
+            label="涓绘不鍖荤敓"
+            align="center"
+            key="drname"
+            prop="drname"
+            width="120"
+          />
+          <el-table-column
+            label="璐d换鎶ゅ+"
+            align="center"
+            key="Sister"
+            prop="Sister"
+            width="120"
+          />
         </el-table>
       </div>
-      <!-- 浣撴 -->
+      <!-- 鍑洪櫌 -->
       <div v-if="sonactiveName == 'checkout'">
-        <el-table :data="serviceData" style="width: 100%">
+        <el-table :data="serviceDatacy" style="width: 100%">
           <el-table-column prop="godaya" label="浣撴绫诲瀷"> </el-table-column>
           <el-table-column prop="hospitalname" label="浣撴濂楅鍚嶇О">
           </el-table-column>
@@ -433,15 +532,19 @@
           </div>
           <el-divider></el-divider>
           <div style="margin-top: 10px">
-            闅忚鐘舵�侊細宸茬粓姝�<span style="color: #2775b6"
+            {{ item.name }}鐘舵�侊細宸茬粓姝�<span style="color: #2775b6"
               >锛堢粓姝㈠師鍥狅細鎮h�呯棅鎰堝洖璁跨粨鏉燂紝缁堟鏃堕棿锛�2023-12-18 12:00锛�</span
             >
           </div>
           <div style="margin-top: 10px">
-            闅忚鍙戦�佹椂闂达細<span style="color: #2775b6">2023-11-23 12:00</span>
+            {{ item.name }}鍙戦�佹椂闂达細<span style="color: #2775b6"
+              >2023-11-23 12:00</span
+            >
           </div>
           <div style="margin-top: 10px">
-            闅忚瀹屾垚鏃堕棿锛�<span style="color: #2775b6">2023-12-18 12:00</span>
+            {{ item.name }}瀹屾垚鏃堕棿锛�<span style="color: #2775b6"
+              >2023-12-18 12:00</span
+            >
           </div>
           <div style="margin-top: 10px">
             鐤肩棝绋嬪害锛�<span style="color: #2775b6">涓害</span>
@@ -454,16 +557,17 @@
               border-left: 4px solid rgb(65, 161, 190);
             "
           >
-            浜哄伐闅忚璁板綍
+            浜哄伐{{ item.name }}璁板綍
           </div>
           <div style="margin-top: 10px">
             <el-row :gutter="20">
               <el-col :span="6"
-                >闅忚鏃ユ湡锛�
+                >{{ item.name }}鏃ユ湡锛�
                 <span style="color: #2775b6">2023-11-22 11:22</span></el-col
               >
               <el-col :span="6"
-                >闅忚浜猴細 <span style="color: #2775b6">鍚村皬榫�</span></el-col
+                >{{ item.name }}浜猴細
+                <span style="color: #2775b6">鍚村皬榫�</span></el-col
               >
               <el-col :span="6"
                 >鎮h�呴厤鍚堝害锛� <span style="color: #2775b6">楂�</span></el-col
@@ -471,10 +575,12 @@
             </el-row>
           </div>
           <div style="margin-top: 10px">
-            闅忚缁撴灉锛� <span style="color: #2775b6">鎮h�呯棅鎰堬紝韬綋鍊嶆</span>
+            {{ item.name }}缁撴灉锛�
+            <span style="color: #2775b6">鎮h�呯棅鎰堬紝韬綋鍊嶆</span>
           </div>
           <div style="margin-top: 10px">
-            闅忚澶囨敞锛� <span style="color: #2775b6">鎻愰啋娉ㄦ剰楗鍋ュ悍</span>
+            {{ item.name }}澶囨敞锛�
+            <span style="color: #2775b6">鎻愰啋娉ㄦ剰楗鍋ュ悍</span>
           </div>
         </el-card>
       </div>
@@ -629,7 +735,10 @@
   delcontactinformation,
   listcontactinformation,
   alterpatient,
+  Patientclinic,
 } from "@/api/patient/homepage";
+import { listPatouthosp } from "@/api/smartor/patouthosp";
+import { listpatient } from "@/api/patient/record";
 
 export default {
   name: "Profile",
@@ -650,6 +759,7 @@
       titletb: "鏂板鑱旂郴鏂瑰紡",
       activeTab: "userinfo",
       id: "",
+      loading: false,
       activeName: "health", //涓�绫诲鑸�
       sonactiveName: "outpatient", //鍋ュ悍鐩戞祴瀵艰埅
       sontwoactiveName: "blood", //鍖荤枟妗f瀵艰埅
@@ -701,15 +811,9 @@
           address: "89",
         },
       ],
-      serviceData: [
-        {
-          daya: "2023-12-12",
-          hospitalname: "鍗忓拰",
-          result: "闊у甫鎷変激",
-          administrative: "楠ㄧ",
-          doctor: "鍚村ぇ榫�",
-        },
-      ],
+      serviceData: [],
+      serviceDatary: [],
+      serviceDatacy: [],
       options: [
         {
           value: "1",
@@ -759,6 +863,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,20 +881,40 @@
       this.xueyangechartsInit();
       this.twechartsInit();
     });
-    this.id = this.$route.query.id;
-    this.getuserinfo();
-    this.gettabList();
   },
 
   methods: {
-    // 鏌ヨ妗f鍒楄〃淇℃伅
-    getList() {
+    // 鏌ヨ鍖荤枟妗f鍚勫垪琛ㄤ俊鎭�
+    getList(type) {
       this.loading = true;
+      if (type == 0) {
+        // 闂ㄨ瘖璁板綍
+        listPatouthosp({ patid: this.id }).then((response) => {
+          if (response.code == 200) {
+            this.serviceData = response.rows;
+          }
+        });
+      } else if (type == 1) {
+        listpatient({ patid: this.id }).then((response) => {
+          if (response.code == 200) {
+            this.serviceDatary = response.rows;
+          }
+        });
+      } else if (type == 2) {
+        listpatient({ patid: this.id }).then((response) => {
+          if (response.code == 200) {
+            this.serviceDatacy = response.rows;
+          }
+        });
+      }
     },
     getcontactlist() {
       listcontactinformation({ patid: this.id }).then((response) => {
         this.tableData = response.rows;
       });
+    },
+    processElement(element) {
+      return { ...element, isoperation: null };
     },
     // 鑾峰彇鍩虹淇℃伅
     getuserinfo() {
@@ -799,18 +926,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,46 +1052,89 @@
         .catch(() => {});
     },
     tableRowClassName({ row, rowIndex }) {
-      console.log(row);
       if (row.isdefault == "1") {
         return "warning-row";
       }
       return "";
     },
+    // tab鍒囨崲
+    handleClick(tab, event) {
+      if (tab.index == "1") {
+        this.getList(0);
+      }
+    },
+    handleClickson(tab, event) {
+      console.log(tab.index, "son");
+      this.getList(tab.index);
+    },
+    // 鑱旂郴鏂瑰紡鏂板
+    Addanumber() {},
+    // 鏍囩--------------------------
     /** 鏌ヨ鏍囩鍒楄〃 */
     gettabList() {
       const tagqueryParams = {
         pageNum: 1,
-        pageSize: 1000,
+        pageSize: 10000,
         tagcategoryid: "0",
       };
       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 +1627,7 @@
 }
 .xinz-inf {
   font-size: 18px;
-  white-space: nowrap;
+  // white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
 

--
Gitblit v1.9.3