From 80678ee8f5e84f943a09a406b65108225861ff94 Mon Sep 17 00:00:00 2001
From: lkk <364857242@qq.com>
Date: 星期五, 11 四月 2025 10:45:25 +0800
Subject: [PATCH] 1

---
 src/views/doctor/check/index.vue |  188 +++++++++++++++++++++++++++++++++-------------
 1 files changed, 133 insertions(+), 55 deletions(-)

diff --git a/src/views/doctor/check/index.vue b/src/views/doctor/check/index.vue
index 5d67907..ce79bbc 100644
--- a/src/views/doctor/check/index.vue
+++ b/src/views/doctor/check/index.vue
@@ -274,23 +274,19 @@
         <el-col v-show="baogaoqian">
           <template>
             <el-tabs v-model="radio" type="border-card" @tab-click="handleTabClick" style="margin-left: 10px">
-              <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index">
+              <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index"
+                :lazy="false">
                 <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">
                   </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($event, scope.row)" :disabled="scope.row.project.proName === 'BMI'"
-                        ></el-input> -->
-                        <template slot-scope="{ row, $index }">
-                      <el-input type="textarea" autosize size="mini" v-model="row.proResult" :ref="`input-${$index}`"
-                        @keyup.enter.native="keyInputConfirm($event, $index)" @focus="handleFocus(row)"
+                    <template slot-scope="{ row, $index }">
+                      <el-input type="textarea" autosize size="mini" v-model="row.proResult"
+                        :ref="`input-item${index}-row${$index}`"
+                        @keydown.enter.native="keyInputConfirm($event, index, $index)" @focus="handleFocus(row)"
                         @blur="handleInputConfirm(row)" @input="vale($event, row)"
-                        :disabled="row.project.proName === 'BMI'"
-                        ></el-input>
+                        :disabled="row.project.proName === 'BMI'"></el-input>
                     </template>
                   </el-table-column>
                   <el-table-column prop="exceptionDesc" label="寮傚父" width="55px" align="center">
@@ -420,22 +416,19 @@
         <el-col :span="18" v-show="baogaohou">
           <template>
             <el-tabs v-model="radio" type="border-card" @tab-click="handleTabClick" style="margin-left: 10px">
-              <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index">
+              <el-tab-pane :label="item.proName" :name="item.proId" v-for="(item, index) in Parent" :key="index"
+                :lazy="false">
                 <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">
                   </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> -->
-                        <template slot-scope="{ row, $index }">
-                      <el-input type="textarea" autosize size="mini" v-model="row.proResult" :ref="`input-${$index}`"
-                        @keyup.enter.native="keyInputConfirm($event, $index)" @focus="handleFocus(row)"
+                    <template slot-scope="{ row, $index }">
+                      <el-input type="textarea" autosize size="mini" v-model="row.proResult"
+                        :ref="`input-item${index}-row${$index}`"
+                        @keydown.enter.native="keyInputConfirm($event, index, $index)" @focus="handleFocus(row)"
                         @blur="handleInputConfirm(row)" @input="vale($event, row)"
-                        :disabled="row.project.proName === 'BMI'"
-                        ></el-input>
+                        :disabled="row.project.proName === 'BMI'"></el-input>
                     </template>
                   </el-table-column>
                   <el-table-column label="瑙勫垯" width="70">
@@ -1005,7 +998,18 @@
     },
 
     // 杈撳叆纭鏃舵洿鏂� BMI
-    handleInputConfirm(row) {
+    handleInputConfirm(row, params) {
+      // 濡傛灉鏈� params 涓斾负绌猴紝鍙栨秷寮傚父鐘舵�佸苟娓呯┖鐩稿叧瀛楁
+      if (params && params.length === 0) {
+        row.exceptionDesc = false;
+        row.proResult = "";
+        row.conclusion = "";
+        row.proAdvice = "";
+        row.rulesList = [];
+        return;
+      }
+
+      // 鐜版湁 BMI 璁$畻閫昏緫
       if (row.proResult) {
         if (row.project.proName === '韬珮' || row.project.proName === '浣撻噸') {
           const heightRow = this.proParentList.sons.find(
@@ -1025,7 +1029,73 @@
             bmiRow.proResult = bmi || '';
           }
         }
+
+        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 (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 (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);
+
       }
     },
 
@@ -1093,25 +1163,43 @@
       });
     },
 
-    // 浠ヤ笅涓哄叾浠栨柟娉曪紝鏈仛淇敼锛屼粎淇濈暀蹇呰閮ㄥ垎锛屽叾浣欑渷鐣ヤ互淇濇寔绠�娲�
     handleFocus(row) {
       this.autorule = [];
-      if (!row.resultType || row.resultType == 2) return;
-      this.curindex = row;
-      selectZT({ proId: row.proId }).then((res) => {
-        if (res.data.length > 0) {
-          this.$refs.bbb.title = "閫夋嫨妫�娴嬬粨鏋�";
-          this.$refs.bbb.open = true;
-          this.$refs.bbb.getList(this.curindex);
-        } else {
-          this.$refs.bbb.open = false;
-        }
-      });
+      if (!row.resultType || row.resultType == 2) {
+        return;
+      } else {
+        this.curindex = row;
+        selectZT({
+          proId: row.proId,
+        }).then((res) => {
+          if (res.data.length > 0) {
+            this.$refs.bbb.title = "閫夋嫨妫�娴嬬粨鏋�";
+            // this.$refs.bbb.proId = row.proId;
+            this.$refs.bbb.open = true;
+            this.$refs.bbb.getList(this.curindex);
+          } else {
+            this.$refs.bbb.open = false;
+          }
+        });
+
+      }
     },
 
     handleChangesZt(params) {
       this.curindex.proResult = params.map((item) => item.ruleStr).join(",");
       this.handleInputConfirm(this.curindex, params);
+    },
+
+    handleChanges(param1, param2) {
+      this.row.conclusion = param1;
+      this.row.rulesList = param2;
+    },
+
+    handleguize(row) {
+      this.row = row;
+      this.$refs.aaa.open = true;
+      this.$refs.aaa.title = "璇婃柇缁撴灉缁撹";
+      this.$refs.aaa.getList(this.row);
     },
 
     tableRowClassName({ row }) {
@@ -1255,7 +1343,7 @@
     },
 
     handleClose() {
-      this.$tab.refreshPage();
+      this.drawer = false;  // 鍙叧闂娊灞夛紝涓嶅埛鏂伴〉闈㈡垨閲嶇疆鏁版嵁
     },
 
     handleClose1() {
@@ -1267,6 +1355,8 @@
     },
 
     changDesc(item) {
+      console.log(item);
+
       item.conclusion = item.exceptionDesc ? "寮傚父" : "姝e父";
     },
 
@@ -1303,38 +1393,24 @@
       this.inputDoms = inputDoms;
     },
 
-    keyInputConfirm(event, currentRowIndex) {
-      event.preventDefault();
-      event.stopPropagation();
-      const nextRowIndex = currentRowIndex + 1;
-      if (nextRowIndex < this.proParentList.sons.length) {
-        this.$nextTick(() => {
-          const nextInputRef = `input-${nextRowIndex}`;
-          const nextInput = this.$refs[nextInputRef];
-          if (nextInput) {
-            const target = Array.isArray(nextInput) ? nextInput[0] : nextInput;
-            target.focus();
-          }
-        });
-      }
-    },
 
 
-    keyInputConfirm(event, currentRowIndex) {
+
+    keyInputConfirm(event, index, currentRowIndex) {
       // 闃绘榛樿鍥炶溅琛屼负锛屾瘮濡傛彁浜よ〃鍗�
       event.preventDefault();
+      event.stopPropagation()
       const nextRowIndex = currentRowIndex + 1; // 璁$畻涓嬩竴琛岀储寮�
-
       // 濡傛灉涓嬩竴琛屽瓨鍦紝鍒欒仛鐒﹁琛岀殑杈撳叆妗�
       if (nextRowIndex < this.proParentList.sons.length) {
         this.$nextTick(() => {
-          const nextInputRef = `input-${nextRowIndex}`;
+          const nextInputRef = `input-item${index}-row${nextRowIndex}`;
           const nextInput = this.$refs[nextInputRef];
           if (nextInput) {
             // 澶勭悊 ref 鍙兘涓烘暟缁勭殑鎯呭喌锛堝鍔ㄦ�佹覆鏌擄級
             const target = Array.isArray(nextInput) ? nextInput[0] : nextInput;
             target.focus(); // 鑱氱劍杈撳叆妗�
-            target.select(); // 鍙�夛細閫変腑鏂囨湰
+            // target.select(); // 鍙�夛細閫変腑鏂囨湰
           }
         });
       }
@@ -1371,7 +1447,7 @@
       });
     },
 
-    hb() {},
+    hb() { },
 
     propoChange() {
       this.cusobj = { sex: this.tableAll.cusSex, isZj: 1 };
@@ -1763,6 +1839,7 @@
     },
 
     determine() {
+      this.tjOrderDetail = [];
       let tjNumber = this.tableAll.tjNumber;
       this.userList.forEach((item) => {
         if (this.doctorName == item.nickName) this.doctorName = item.userId;
@@ -1799,6 +1876,7 @@
       }];
       getaddRemark(data).then((res) => {
         this.$modal.msgSuccess("鎻愪氦鎴愬姛");
+        this.rows = []; // 鎻愪氦鎴愬姛鍚庢竻绌� this.rows
         this.drawer = false;
       });
       this.handleClose();

--
Gitblit v1.8.0