From d4be39fedaed04b0f1f34808dc55369ed5b94e21 Mon Sep 17 00:00:00 2001
From: wwl <xchao828@163.com>
Date: 星期五, 16 五月 2025 17:59:09 +0800
Subject: [PATCH] BMI

---
 src/views/doctor/check/index.vue |  176 +++++++++++++++++++++++++---------------------------------
 1 files changed, 77 insertions(+), 99 deletions(-)

diff --git a/src/views/doctor/check/index.vue b/src/views/doctor/check/index.vue
index af5ab3f..c0e33a4 100644
--- a/src/views/doctor/check/index.vue
+++ b/src/views/doctor/check/index.vue
@@ -289,12 +289,15 @@
                         :disabled="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" @change="changDesc(scope.row)"
-                        :disabled="scope.row.project.sfcyyc === 1"></el-checkbox>
-                    </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"
+      @change="changDesc(scope.row)"
+      :disabled="scope.row.project.sfcyyc === 1 || scope.row.project.proName === 'BMI'"
+    ></el-checkbox>
+  </template>
+</el-table-column>
                   <el-table-column label="瑙勫垯" width="70">
                     <template slot-scope="scope">
                       <el-button class="blue-button" @click="handleguize(scope.row)">...</el-button>
@@ -302,7 +305,12 @@
                   </el-table-column>
                   <el-table-column prop="project.proMetering" label="鍗曚綅" width="55">
                   </el-table-column>
-                  <el-table-column prop="project.proScope" label="鍙傝�冭寖鍥�" width="70">
+                  <el-table-column label="鍙傝�冭寖鍥�" width="70" align="center">
+                    <template slot-scope="scope">
+
+                      {{ scope.row.project.proScope }}
+
+                    </template>
                   </el-table-column>
                   <el-table-column prop="conclusion" label="缁撴灉缁撹" width="200">
                     <template slot-scope="scope">
@@ -966,10 +974,27 @@
   },
 
   methods: {
+    getBMIStatus(row) {
+      const bmi = parseFloat(row.proResult);
+      if (isNaN(bmi) || !row.proResult) return ''; // 澶勭悊鏃犳晥鎴栫┖鐨凚MI鍊�
+      if (bmi > 28) {
+        row.exceptionDesc = true; // 鑷姩鍕鹃�夊紓甯稿閫夋
+        row.conclusion = '鍋忛珮'; // 璁剧疆缁撹
+        return '鍋忛珮';
+      }
+      if (bmi < 12) {
+        row.exceptionDesc = true; // 鑷姩鍕鹃�夊紓甯稿閫夋
+        row.conclusion = '鍋忎綆'; // 璁剧疆缁撹
+        return '鍋忎綆';
+      }
+      row.exceptionDesc = false; // 姝e父鑼冨洿鍐呭彇娑堝嬀閫�
+      row.conclusion = '姝e父'; // 璁剧疆缁撹
+      return '姝e父';
+    },
     // 璁$畻 BMI
     calculateBMI(height, weight) {
       if (height && weight) {
-        const heightInMeters = parseFloat(height) / 100; // cm 杞崲涓� m
+        const heightInMeters = parseFloat(height) / 100; // 鍘樼背杞崲涓虹背
         const weightInKg = parseFloat(weight);
         const bmi = weightInKg / (heightInMeters * heightInMeters);
         return bmi.toFixed(1); // 淇濈暀涓�浣嶅皬鏁�
@@ -994,25 +1019,15 @@
           const height = row.project.proName === '韬珮' ? value : heightRow.proResult;
           const weight = row.project.proName === '浣撻噸' ? value : weightRow.proResult;
           const bmi = this.calculateBMI(height, weight);
-          bmiRow.proResult = bmi || ''; // 瀹炴椂鏇存柊 BMI
+          bmiRow.proResult = bmi || ''; // 瀹炴椂鏇存柊BMI鍊�
+          this.getBMIStatus(bmiRow); // 妫�鏌MI鐘舵�佸苟鏇存柊寮傚父澶嶉�夋
         }
       }
     },
 
-    // 杈撳叆纭鏃舵洿鏂� BMI
-    handleInputConfirm(row, params) {
-      console.log(row, params, 55555)
-      // 濡傛灉鏈� params 涓斾负绌猴紝鍙栨秷寮傚父鐘舵�佸苟娓呯┖鐩稿叧瀛楁
-      if (params && params.length === 0) {
-        row.exceptionDesc = false;
-        row.proResult = "";
-        row.conclusion = "";
-        row.proAdvice = "";
-        row.rulesList = [];
-        return;
-      }
 
-      // 鐜版湁 BMI 璁$畻閫昏緫
+    // 杈撳叆纭鏃舵洿鏂� BMI
+    handleInputConfirm(row) {
       if (row.proResult) {
         if (row.project.proName === '韬珮' || row.project.proName === '浣撻噸') {
           const heightRow = this.proParentList.sons.find(
@@ -1030,85 +1045,48 @@
             const weight = weightRow.proResult;
             const bmi = this.calculateBMI(height, weight);
             bmiRow.proResult = bmi || '';
+            this.getBMIStatus(bmiRow); // 妫�鏌MI鐘舵�佸苟鏇存柊寮傚父澶嶉�夋
           }
         }
-
-        this.focusrow = row;
-        this.proResult = row;
-        const pattern3 = new RegExp("[0-9]+");
-        if (pattern3.test(row.proResult)) {
-          let data = {
-            proId: this.focusrow.proId,
-            cusId: this.tableAll.cusId,
-            tjNum: this.tableAll.tjNumber,
-            keyNum: this.proResult.proResult,
-          };
-          AutoGetRule(data).then((res) => {
-            this.focusrow.conclusion = "";
-            if (res.data) {
-              this.autorule = res.data;
-              this.focusrow.rulesList = res.data;
-              if (row.project.sfcyyc == 1) {
-                return
-              } else {
-                if (res.data.length > 0) {
-                  const conditions = ["姝e父", "鏈寮傚父", "闃存��", "鏈鏄庢樉寮傚父"];
-                  this.focusrow.exceptionDesc = !conditions.some((condition) =>
-                    this.autorule[0].bz.includes(condition)
-                  );
-                } else {
-                  this.focusrow.exceptionDesc = false;
-                }
-              }
-
-              if (this.autorule.length !== 0 && (this.autorule[0] || this.autorule[0].nr)) {
-                this.focusrow.proAdvice = this.autorule[0].nr;
-              }
-              this.autorule.forEach((item) => {
-                this.focusrow.conclusion += this.focusrow.conclusion ? item.bz : item.bz;
-              });
-            }
-          });
-        } else {
-          let data = {
-            proId: this.focusrow.proId,
-            cusId: this.tableAll.cusId,
-            keyWord: this.proResult.proResult, // 淇敼涓� proResult.proResult
-            tjNum: this.tableAll.tjNumber,
-            keyNum: this.proResult.proResult,
-          };
-          AutoGetRule(data).then((res) => {
-            this.focusrow.conclusion = "";
-            if (res.data) {
-              this.autorule = res.data;
-              this.focusrow.rulesList = res.data;
-              if (row.project.sfcyyc == 1) {
-                return
-              } else {
-                if (res.data.length > 0) {
-                  const conditions = ["姝e父", "鏈寮傚父", "闃存��", "鏈鏄庢樉寮傚父"];
-                  this.focusrow.exceptionDesc = !conditions.some((condition) =>
-                    this.autorule[0].bz.includes(condition)
-                  );
-                } else {
-                  this.focusrow.exceptionDesc = false;
-                }
-              }
-              if (this.autorule.length !== 0 && (this.autorule[0] || this.autorule[0].nr)) {
-                this.focusrow.proAdvice = this.autorule[0].nr;
-              }
-              this.autorule.forEach((item) => {
-                this.focusrow.conclusion += this.focusrow.conclusion ? item.bz : item.bz;
-              });
-            }
-          });
-        }
-
-        // 灏嗗綋鍓嶈娣诲姞鍒� rows 涓�
-        this.rows.push(row);
-        console.log(this.rows, row);
-
       }
+      // 鐜版湁鐨勮鍒欐鏌ラ�昏緫淇濇寔涓嶅彉
+      this.focusrow = row;
+      this.proResult = row;
+      const pattern3 = new RegExp("[0-9]+");
+      if (pattern3.test(row.proResult)) {
+        let data = {
+          proId: this.focusrow.proId,
+          cusId: this.tableAll.cusId,
+          tjNum: this.tableAll.tjNumber,
+          keyNum: this.proResult.proResult,
+        };
+        AutoGetRule(data).then((res) => {
+          this.focusrow.conclusion = "";
+          if (res.data) {
+            this.autorule = res.data;
+            this.focusrow.rulesList = res.data;
+            if (row.project.sfcyyc == 1) {
+              return;
+            } else {
+              if (res.data.length > 0) {
+                const conditions = ["姝e父", "鏈寮傚父", "闃存��", "鏈鏄庢樉寮傚父"];
+                this.focusrow.exceptionDesc = !conditions.some((condition) =>
+                  this.autorule[0].bz.includes(condition)
+                );
+              } else {
+                this.focusrow.exceptionDesc = false;
+              }
+            }
+            if (this.autorule.length !== 0 && (this.autorule[0] || this.autorule[0].nr)) {
+              this.focusrow.proAdvice = this.autorule[0].nr;
+            }
+            this.autorule.forEach((item) => {
+              this.focusrow.conclusion += this.focusrow.conclusion ? item.bz : item.bz;
+            });
+          }
+        });
+      }
+      this.rows.push(row);
     },
 
     // 鍒濆鍖栨暟鎹椂璁$畻 BMI
@@ -1178,7 +1156,7 @@
 
     handleFocus(row) {
       this.autorule = [];
-      if (!row.resultType || row.resultType == 2 ) {
+      if (!row.resultType || row.resultType == 2) {
         return;
       } else {
         this.curindex = row;

--
Gitblit v1.8.0