From 319cf42af7648e99693f6eabfec4f842a40ed340 Mon Sep 17 00:00:00 2001
From: wwl <xchao828@163.com>
Date: 星期四, 13 三月 2025 16:16:27 +0800
Subject: [PATCH] 1

---
 src/views/doctor/check/index.vue |  351 +++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 249 insertions(+), 102 deletions(-)

diff --git a/src/views/doctor/check/index.vue b/src/views/doctor/check/index.vue
index 8428970..71cafef 100644
--- a/src/views/doctor/check/index.vue
+++ b/src/views/doctor/check/index.vue
@@ -152,7 +152,6 @@
           </div>
         </el-col>
       </el-row>
-
     </el-dialog>
 
     <el-dialog title="濉啓鏄惁閲嶅ぇ闃虫��" :visible.sync="checkval" width="800px" append-to-body>
@@ -279,20 +278,18 @@
                 <el-table class="bgc" v-loading="loading" :data="proParentList.sons" border height="460px"
                   style="width: 96%; margin: 10px 10px" :row-class-name="tableRowClassName">
                   <el-table-column prop="project.proName" label="妫�娴嬮」鐩�" width="150">
-                    <!-- <template slot-scope="scope">
-            {{ scope.row.project.proName }}
-          </template> -->
                   </el-table-column>
                   <el-table-column prop="proResult" label="妫�娴嬬粨鏋�" width="150">
                     <template slot-scope="scope">
                       <el-input type="textarea" autosize size="mini" v-model="scope.row.proResult" autocomplete="off"
                         placeholder="璇疯緭鍏ユ娴嬬粨鏋�" @focus="handleFocus(scope.row)" @blur="handleInputConfirm(scope.row)"
-                        @input="vale"></el-input>
+                        @input="vale($event, scope.row)" :disabled="scope.row.project.proName === 'BMI'"
+                        ></el-input>
                     </template>
                   </el-table-column>
                   <el-table-column prop="exceptionDesc" label="寮傚父" width="55px" align="center">
                     <template slot-scope="scope">
-                      <el-checkbox v-model="scope.row.exceptionDesc"></el-checkbox>
+                      <el-checkbox v-model="scope.row.exceptionDesc" @change="changDesc(scope.row)"></el-checkbox>
                     </template>
                   </el-table-column>
                   <el-table-column label="瑙勫垯" width="70">
@@ -301,16 +298,13 @@
                     </template>
                   </el-table-column>
                   <el-table-column prop="project.proMetering" label="鍗曚綅" width="55">
-                    <!-- <template slot-scope="scope">
-            {{ scope.row.standard.company }}
-          </template> -->
                   </el-table-column>
                   <el-table-column prop="project.proScope" label="鍙傝�冭寖鍥�" width="70">
                   </el-table-column>
                   <el-table-column prop="conclusion" label="缁撴灉缁撹" width="200">
                     <template slot-scope="scope">
                       <el-input size="mini" type="textarea" autosize v-model="scope.row.conclusion" autocomplete="off"
-                        placeholder="璇疯緭鍏ユ娴嬬粨鏋�" disabled></el-input>
+                        placeholder="璇疯緭鍏ョ粨鏋滅粨璁�" disabled></el-input>
                     </template>
                   </el-table-column>
 
@@ -364,23 +358,6 @@
                         ">
                         <el-input type="textarea" placeholder="璇烽�夋嫨鍐呭" v-model="titles" rows="2">
                         </el-input>
-                        <!-- <el-select
-                          v-model="value"
-                          multiple
-                          placeholder="璇烽�夋嫨"
-                          style="width: 100%; height: 45px"
-                          v-if="deptAdviceList"
-                          @change="sel"
-                          filterable
-                        >
-                          <el-option
-                            v-for="item in deptAdviceList"
-                            :key="item.id"
-                            :label="item.title"
-                            :value="item.id"
-                          >
-                          </el-option>
-                        </el-select> -->
                       </td>
                       <td style="
                           border: 1px solid #dfe6ec;
@@ -441,9 +418,6 @@
                 <el-table class="bgc" v-loading="loading" :data="proParentList.sons" border height="460px"
                   style="width: 96%; margin: 10px 10px" :row-class-name="tableRowClassName">
                   <el-table-column prop="project.proName" label="妫�娴嬮」鐩�" width="100">
-                    <!-- <template slot-scope="scope">
-            {{ scope.row.project.proName }}
-          </template> -->
                   </el-table-column>
                   <el-table-column prop="proResult" label="妫�娴嬬粨鏋�" width="150">
                     <template slot-scope="scope">
@@ -458,9 +432,6 @@
                     </template>
                   </el-table-column>
                   <el-table-column prop="project.proMetering" label="鍗曚綅" width="55">
-                    <!-- <template slot-scope="scope">
-            {{ scope.row.standard.company }}
-          </template> -->
                   </el-table-column>
                   <el-table-column prop="project.proScope" label="鍙傝�冭寖鍥�" width="80">
                   </el-table-column>
@@ -608,14 +579,14 @@
 
     <!-- 妫�鏌ユ楠岀粨鏋滄寜閽殑寮规 -->
     <el-dialog title="妫�鏌ユ楠岀粨鏋�" :visible.sync="openOne" width="80%">
-      <div style="width: 100%; margin-left: 10px; display: flex">
-        <div style="width: 40%">
-          <el-table v-loading="loading" border height="520" ref="tab1">
-            <!-- 
-          :row-class-name="tableRowClassName"
-          :data="xiangmuList"
-          highlight-current-row
-          @row-click="handleRowClick" -->
+      <div style="
+          width: 100%;
+          margin-left: 10px;
+          display: flex;
+          justify-content: space-around;
+        ">
+        <div style="width: 44%">
+          <el-table v-loading="loading" border :data="xiangmuList" height="520" ref="tab1" highlight-current-row>
             <el-table-column label="绉戝" align="center" prop="deptName" width="100" :show-overflow-tooltip="true" />
             <el-table-column label="椤圭洰" align="center" prop="proName" width="150" :show-overflow-tooltip="true" />
             <el-table-column label="鐘舵��" align="center" prop="type" :show-overflow-tooltip="true" width="100">
@@ -630,54 +601,61 @@
             </el-table-column>
 
             <el-table-column label="妫�鏌ユ椂闂�" align="center" prop="bcupdateTime" width="160" />
+
             <el-table-column label="鎿嶄綔" align="center" width="120px">
               <template slot-scope="scope">
                 <!-- <el-button
-                size="mini"
-                type="text"
-                :disabled="scope.row.type === 1"
-                @click="qijian(scope.row)"
-                >寮冩</el-button
-              > -->
-                <el-button size="mini" type="text" :disabled="scope.row.type === 0"
+                  size="mini"
+                  type="text"
+                  :disabled="scope.row.type === 1"
+                  @click="qijian(scope.row)"
+                  >{{ scope.row.type === 0 ? "寮冩" : "鎭㈠" }}</el-button
+                > -->
+
+                <el-button size="mini" type="text" :disabled="scope.row.type === 0 || scope.row.type === 2"
                   @click="queryResultone(scope.row)">缁撴灉鏌ヨ</el-button>
               </template>
             </el-table-column>
           </el-table>
         </div>
-        <!-- 
-          :row-class-name="tableRowClassName"
-          :data="xiangmuList"
-          highlight-current-row
-          @row-click="handleRowClick" -->
-        <!-- <div style="width: 40%; margin-left: 20px;">
-        <el-table
-          v-loading="loading"
-          border
-         
-          height="520"
-          ref="tab1"
-          
-        >
-       
-          <el-table-column
-            label="缁撴灉"
-            align="center"
-            prop="deptName"
-            width="100"
-            :show-overflow-tooltip="true"
-          />
-          <el-table-column
-            label="椤圭洰"
-            align="center"
-            prop="proName"
-            width="150"
-            :show-overflow-tooltip="true"
-          />
-        </el-table>
-      </div> -->
-      </div>
+        <div style="width: 44%; margin-left: 20px">
+          <div style="text-align: center; background-color: #aad8df">
+            {{ name || "" }}
+          </div>
+          <div class="a">
+            <div v-if="jyjc == 0">
+              <el-table :data="jieguoList" border :row-style="changRed" height="520" highlight-current-row
+                style="width: 100%" :header-cell-style="{ background: '#AAD8DF' }">
+                <el-table-column label="妫�娴嬮」鐩�" prop="pro_name">
+                </el-table-column>
+                <el-table-column label="妫�娴嬬粨鏋�" prop="pro_result">
+                </el-table-column>
+                <el-table-column label="鍙傝�冭寖鍥�" prop="ckfw">
+                </el-table-column>
+              </el-table>
+            </div>
 
+            <div v-if="jyjc == 1">
+              <div style="text-align: center; background-color: #aad8df"></div>
+              <div class="check-result-container">
+                <div class="check-item">
+                  <div class="check-title">妫�鏌ユ墍瑙侊細</div>
+                  <div class="check-description" :style="{ color: isRed ? 'red' : '' }">
+                    {{ jieguoList[0].pro_result }}
+                  </div>
+                </div>
+
+                <div class="check-item">
+                  <div class="check-title">妫�鏌ョ粨璁猴細</div>
+                  <div class="check-description" :style="{ color: isRed ? 'red' : '' }">
+                    {{ jieguoList[0].yxzd || "鏆傛棤缁撹" }}
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
     </el-dialog>
 
     <el-dialog title="閫夋嫨鐥呯" :visible.sync="taocan" width="80%" height="700px" :close-on-click-modal="false">
@@ -686,18 +664,48 @@
         <el-tab-pane label="鐥呯" name="first">
           <div class="tab8">
             <div class="tab3">
-              <el-form :model="queryParam1" ref="tableList" :inline="true" label-width="76px" style="margin-top: 10px">
+              <el-form
+              @submit.native.prevent
+                :model="queryParam1"
+                ref="tableList"
+                :inline="true"
+                label-width="76px"
+                style="margin-top: 10px"
+              >
                 <el-form-item>
-                  <el-input placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�" v-model="queryParam1.nr" clearable>
+                  <el-input
+                    placeholder="杈撳叆鍏抽敭瀛楄繘琛岃繃婊�"
+                    v-model="queryParam1.nr"
+                    clearable
+                  >
                   </el-input>
                 </el-form-item>
 
                 <el-form-item>
+<<<<<<< HEAD
+                  <el-button
+                    type="primary"
+                    icon="el-icon-search"
+                    size="mini"
+                    @click="handleQuerys"
+                    >鎼滅储</el-button
+                  >
+                </el-form-item>
+              </el-form>
+              <el-table
+                ref="multipleTable"
+                border
+                :data="deptAdviceList"
+                height="430px"
+                @selection-change="handleSelectionChanges"
+              >
+=======
                   <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuerys">鎼滅储</el-button>
                 </el-form-item>
               </el-form>
               <el-table ref="multipleTable" border :data="deptAdviceList" height="430px"
                 @selection-change="handleSelectionChanges">
+>>>>>>> 2f0aa78 (1)
                 <el-table-column type="selection" width="40"> </el-table-column>
                 <el-table-column prop="title" label="鐥呯鍚嶇О" align="center" width="130px"></el-table-column>
                 <el-table-column prop="advice" label="寤鸿" align="center" :show-overflow-tooltip="true">
@@ -814,12 +822,15 @@
   getDeptAdvice,
   reportHistory,
   getAdviceByTjNumAndPro,
+  getXm,
 } from "@/api/doctor/check";
 import { addBigPositive } from "@/api/doctor/bigPositive";
 import { addReplylog, hzHasDept } from "@/api/hosp/replylog";
 import { listHzlog, addHzlog, delHzlog, updateHzlog } from "@/api/hosp/hzlog";
 import { getlistUser } from "@/api/system/user";
 import { getChildList } from "@/api/system/dept";
+import { resultList } from "@/api/doctor/examination";
+import { get } from "sortablejs";
 export default {
   dicts: ["sys_user_sex", "sys_yes_no", "tj_result_type", "lj_positive"],
   name: "check",
@@ -835,6 +846,7 @@
     return {
       remakes: "",
       titles: "",
+      type: null,
       advice: "",
       idss: [],
       vaids: [],
@@ -893,6 +905,8 @@
       // 鑾峰彇淇℃伅闆嗗悎
       tableList: [],
       deptList: [],
+      jieguoList: [],
+      jyjc: null,
       tableAll: {},
       row: {},
       info: {},
@@ -910,6 +924,8 @@
       proId: "",
       company: "",
       tjStandardGtValue: "",
+      xiangmuList: [],
+      name: "",
       // 鐢ㄦ埛琛ㄦ牸鏁版嵁
       userList: null,
       // 鐖堕」鐩垪琛�
@@ -987,24 +1003,31 @@
   },
 
   methods: {
+    calculateBMI(height, weight) {
+      if (height && weight) {
+        const heightInMeters = parseFloat(height) / 100; // cm杞崲涓簃
+        const weightInKg = parseFloat(weight);
+        const bmi = weightInKg / (heightInMeters * heightInMeters);
+        return bmi.toFixed(1); // 淇濈暀涓�浣嶅皬鏁�
+      }
+      return '';
+    },
     handleFocus(row) {
-      this.autorule = []
+      this.autorule = [];
 
       if (!row.resultType || row.resultType == 2) {
         return;
       } else {
         this.curindex = row;
         this.$refs.bbb.title = "閫夋嫨妫�娴嬬粨鏋�";
-        this.$refs.bbb.proId = row.proId;
-        this.$refs.bbb.getList();
+        // this.$refs.bbb.proId = row.proId;
+        this.$refs.bbb.open = true;
+        this.$refs.bbb.getList(this.curindex);
       }
     },
     handleChangesZt(params) {
-
-          this.curindex.proResult = params.map((item) => item.ruleStr).join(",");
-          this.handleInputConfirm(this.curindex, params);
-
-    
+      this.curindex.proResult = params.map((item) => item.ruleStr).join(",");
+      this.handleInputConfirm(this.curindex, params);
     },
     tableRowClassName({ row }) {
       if (row.exceptionDesc) {
@@ -1013,8 +1036,14 @@
       return "";
     },
     getbzlist() {
+      this.loading = true;
       getDeptAdvice(this.queryParam1).then((response) => {
-        this.deptAdviceList = response.data.list;
+
+        if (response.data.list) {
+          this.deptAdviceList = response.data.list;
+          this.loading = false
+        }
+
         this.total1 = response.data.total;
       });
     },
@@ -1045,7 +1074,51 @@
     },
     // 妫�鏌ユ楠岀粨鏋滄寜閽�
     result() {
-      this.openOne = true
+      let tjNumber = this.tableAll.tjNumber;
+      console.log(this.tableAll.tjNumber, 666);
+
+
+      getXm(tjNumber).then((res) => {
+        this.xiangmuList = res.data;
+        if (this.xiangmuList.length > 0) {
+          this.openOne = true;
+        }
+        else {
+          this.openOne = false;
+          this.$modal.msgWarning("鏆傛棤椤圭洰涓庢鏌ユ楠岀粨鏋�")
+        }
+      });
+    },
+    queryResultone(row) {
+      const tjNum = this.tableAll.tjNumber;
+      const proId = row.proId;
+      resultList(tjNum, proId).then((res) => {
+        this.jieguoList = res.data;
+        console.log(this.jieguoList, 998877);
+
+        this.jyjc = this.jieguoList[0].jyjc;
+        const ycbz = this.jieguoList[0].ycbz;
+        // 璁剧疆鏄惁闇�瑕佹敼鍙橀鑹�
+        if (ycbz === "1") {
+          this.isRed = true; // 璁剧疆鏍囪瘑锛屾敼鍙樺瓧浣撻鑹�
+        } else {
+          this.isRed = false; // 鎭㈠榛樿棰滆壊
+        }
+
+        if (res.data.length > 0) {
+          this.drawer = true;
+        } else {
+          this.$message.warning("璇ラ」鐩病鏈夌粨鏋�");
+        }
+      });
+    },
+    changRed({ row }) {
+      if (row.ycbz != "" && row.ycbz != null && row.ycbz === "1") {
+        // 鍙橀鑹茬殑鏉′欢
+        return {
+          color: "red", // 杩欎釜return鐨勫氨鏄牱寮� 鍙互鏄痗olor 涔熷彲浠ユ槸backgroundColor
+        };
+      }
     },
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
     handleDelete(row) {
@@ -1167,6 +1240,15 @@
       // })
     },
 
+    changDesc(item) {
+      console.log(item)
+      if (item.exceptionDesc == true) {
+        item.conclusion = "寮傚父"
+      } else {
+        item.conclusion = "姝e父"
+      }
+    },
+
     myclass(row, column, rowIndex, columnIndex) {
       if (row.row.isPositive == 1) {
         return "setclass";
@@ -1215,15 +1297,15 @@
       console.log("杈撳叆鍐呭:", value);
     },
     handleInputConfirm(datas, params) {
+  // 鐜版湁閫昏緫淇濇寔涓嶅彉
   if (params && params.length === 0) {
-    // 濡傛灉娌℃湁閫変腑浠讳綍椤圭洰锛屽彇娑堝紓甯稿閫夋鐨勯�変腑鐘舵��
     this.curindex.exceptionDesc = false;
-    this.curindex.proResult = '';
-    this.curindex.conclusion = '';
-    this.curindex.proAdvice = '';
+    this.curindex.proResult = "";
+    this.curindex.conclusion = "";
+    this.curindex.proAdvice = "";
     this.curindex.rulesList = [];
-    console.log('鍑哄彂浜�');
-    return; // 杩欓噷鐨� return 浼氭彁鍓嶇粨鏉熷嚱鏁版墽琛�
+    console.log("瑙﹀彂浜嗗彇娑堥�夋嫨");
+    return;
   }
 
   if (datas.proResult) {
@@ -1289,11 +1371,39 @@
               this.focusrow.conclusion += item.bz;
             }
           });
-          // this.rows.push(this.focusrow);
         }
       });
     }
     this.rows.push(datas);
+  }
+
+  // 鏂板 BMI 璁$畻閫昏緫
+  let height = null;
+  let weight = null;
+  let bmiRow = null;
+
+  // 閬嶅巻 proParentList.sons 鏌ユ壘韬珮銆佷綋閲嶅拰BMI椤圭洰
+  this.proParentList.sons.forEach((item) => {
+    const proName = item.project.proName.toLowerCase(); // 涓嶅尯鍒嗗ぇ灏忓啓姣旇緝
+    if (proName === "height" || proName === "韬珮") {
+      height = item.proResult;
+    } else if (proName === "weight" || proName === "浣撻噸") {
+      weight = item.proResult;
+    } else if (proName === "bmi") {
+      bmiRow = item; // 鎵惧埌 BMI 椤圭洰琛�
+    }
+  });
+
+  // 濡傛灉韬珮鍜屼綋閲嶉兘鏈夊�硷紝鍒欒绠� BMI
+  if (height && weight && bmiRow) {
+    const parsedHeight = parseFloat(height.replace(/[^0-9.]/g, "")); // 鎻愬彇鏁板瓧锛屽幓闄ゅ崟浣�
+    const parsedWeight = parseFloat(weight.replace(/[^0-9.]/g, ""));
+    if (!isNaN(parsedHeight) && !isNaN(parsedWeight) && parsedHeight > 0) {
+      const heightInMeters = parsedHeight / 100; // 鍘樼背杞崲涓虹背
+      const bmi = parsedWeight / (heightInMeters * heightInMeters);
+      bmiRow.proResult = bmi.toFixed(1); // 淇濈暀涓�浣嶅皬鏁板苟璧嬪�肩粰 BMI 鐨� proResult
+      console.log(`璁$畻BMI: 韬珮=${parsedHeight}cm, 浣撻噸=${parsedWeight}kg, BMI=${bmiRow.proResult}`);
+    }
   }
 },
 
@@ -1346,9 +1456,9 @@
       });
     },
     hb() {
-      if (this.queryParams.tjNumber != "") {
-        this.submitForm();
-      }
+      /*  if (this.queryParams.tjNumber != "") {
+         // this.submitForm(); 
+       } */
     },
     propoChange() {
       this.cusobj = { sex: this.tableAll.cusSex, isZj: 1 };
@@ -1381,6 +1491,7 @@
       this.loading = true;
       this.queryParams.type = this.tjStatus;
       getProList(this.queryParams).then((response) => {
+        console.log(response, 333);
         if (response.code == 200) {
           this.loading = false;
           if (response.data) {
@@ -1909,6 +2020,7 @@
             tjNumber: this.tjNumber,
             proParentId: this.nums,
           };
+          this.loading = true;
           getParentId(data).then((response) => {
             this.proParentList = response.data;
             this.value = [];
@@ -2394,4 +2506,39 @@
 .dialog-footers1 .el-button {
   margin: 0 5px;
 }
+
+.check-result-container {
+  // background-color: #fafafa;
+  padding: 20px;
+  border-radius: 8px;
+  // box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+  margin: 0 auto;
+  max-width: 700px;
+}
+
+.check-item {
+  margin-bottom: 20px;
+}
+
+.check-title {
+  font-size: 16px;
+  font-weight: bold;
+  color: #333;
+  // margin-bottom: 8px;
+}
+
+.check-description {
+  font-size: 14px;
+  color: #555;
+  /* 涓伆鑹叉枃瀛� */
+  line-height: 1.6;
+  /* 琛岄珮锛屽鍔犲彲璇绘�� */
+  padding: 8px 0;
+  /* 涓婁笅鍐呰竟璺� */
+}
+
+.check-description.no-result {
+  color: #bbb;
+  /* 濡傛灉娌℃湁缁撹锛屾枃瀛椾负娣$伆鑹� */
+}
 </style>

--
Gitblit v1.8.0