From c733f15292736ea539378226af0639f4ff04fe5b Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期一, 09 六月 2025 18:09:35 +0800 Subject: [PATCH] 1 --- src/views/doctor/check/index.vue | 226 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 185 insertions(+), 41 deletions(-) diff --git a/src/views/doctor/check/index.vue b/src/views/doctor/check/index.vue index 055a0fb..1680390 100644 --- a/src/views/doctor/check/index.vue +++ b/src/views/doctor/check/index.vue @@ -280,10 +280,16 @@ ></el-input> </template> </el-table-column> - <el-table-column prop="exceptionDesc" label="寮傚父" width="55px" align="center"> + <!-- <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"> @@ -293,7 +299,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"> + <template slot-scope="scope"> + + {{ scope.row.project.proScope }} + + </template> </el-table-column> <el-table-column prop="conclusion" label="缁撴灉缁撹" width="200"> <template slot-scope="scope"> @@ -880,16 +891,28 @@ return ''; }, - // 瀹炴椂鏇存柊 BMI 骞堕獙璇佽緭鍏� - vale(value, row) { - if (row.project.proName === '韬珮' || row.project.proName === '浣撻噸') { - // 杈撳叆楠岃瘉 - if (!/^\d*\.?\d*$/.test(value) || parseFloat(value) <= 0) { - this.$message.error('璇疯緭鍏ユ湁鏁堢殑姝f暟'); - row.proResult = ''; // 娓呯┖鏃犳晥杈撳叆 - return; - } + 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 骞堕獙璇佽緭鍏� + vale(value, row) { + console.log(3333) + if (row.project.proName === '韬珮' || row.project.proName === '浣撻噸') { const heightRow = this.proParentList.sons.find( item => item.project.proName === '韬珮' ); @@ -900,27 +923,156 @@ item => item.project.proName === 'BMI' ); - if (!heightRow || !weightRow || !bmiRow) { - - return; + if (heightRow && weightRow && bmiRow) { + 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鍊� + this.getBMIStatus(bmiRow); // 妫�鏌MI鐘舵�佸苟鏇存柊寮傚父澶嶉�夋 } + } - const height = row.project.proName === '韬珮' ? value : heightRow.proResult; - const weight = row.project.proName === '浣撻噸' ? value : weightRow.proResult; - - if (!height || !weight) { - this.$message.warning('璇峰~鍐欒韩楂樺拰浣撻噸浠ヨ绠� BMI'); - bmiRow.proResult = ''; - return; - } - - const bmi = this.calculateBMI(height, weight); - bmiRow.proResult = bmi || ''; // 瀹炴椂鏇存柊 BMI + // 鐜版湁鐨勮鍒欐鏌ラ�昏緫淇濇寔涓嶅彉 + this.focusrow = row; + this.proResult = row; + const pattern3 = new RegExp("[0-9]+"); + if (row.proResult) { } + 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; + }); + } + }); } }, + /* vale(value, row) { + if (row.project.proName === '韬珮' || row.project.proName === '浣撻噸') { + // 杈撳叆楠岃瘉 + if (!/^\d*\.?\d*$/.test(value) || parseFloat(value) <= 0) { + this.$message.error('璇疯緭鍏ユ湁鏁堢殑姝f暟'); + row.proResult = ''; // 娓呯┖鏃犳晥杈撳叆 + return; + } + + const heightRow = this.proParentList.sons.find( + item => item.project.proName === '韬珮' + ); + const weightRow = this.proParentList.sons.find( + item => item.project.proName === '浣撻噸' + ); + const bmiRow = this.proParentList.sons.find( + item => item.project.proName === 'BMI' + ); + + if (!heightRow || !weightRow || !bmiRow) { + + return; + } + + const height = row.project.proName === '韬珮' ? value : heightRow.proResult; + const weight = row.project.proName === '浣撻噸' ? value : weightRow.proResult; + + if (!height || !weight) { + this.$message.warning('璇峰~鍐欒韩楂樺拰浣撻噸浠ヨ绠� BMI'); + bmiRow.proResult = ''; + return; + } + + const bmi = this.calculateBMI(height, weight); + bmiRow.proResult = bmi || ''; // 瀹炴椂鏇存柊 BMI + } + }, + */ // 杈撳叆纭鏃舵洿鏂� BMI - handleInputConfirm(row, params) { + handleInputConfirm(row) { + if (row.proResult) { + if (row.project.proName === '韬珮' || row.project.proName === '浣撻噸') { + const heightRow = this.proParentList.sons.find( + item => item.project.proName === '韬珮' + ); + const weightRow = this.proParentList.sons.find( + item => item.project.proName === '浣撻噸' + ); + const bmiRow = this.proParentList.sons.find( + item => item.project.proName === 'BMI' + ); + + if (heightRow && weightRow && bmiRow) { + const height = heightRow.proResult; + 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; + }); + } + }); + } + this.rows.push(row); + }, + /* handleInputConfirm(row, params) { console.log(row, params, 55555); // 濡傛灉鏈� params 涓斾负绌猴紝鍙栨秷寮傚父鐘舵�佸苟娓呯┖鐩稿叧瀛楁 if (params && params.length === 0) { @@ -945,21 +1097,13 @@ item => item.project.proName === 'BMI' ); - if (!heightRow || !weightRow || !bmiRow) { - return; + if (heightRow && weightRow && bmiRow) { + const height = heightRow.proResult; + const weight = weightRow.proResult; + const bmi = this.calculateBMI(height, weight); + bmiRow.proResult = bmi || ''; + this.getBMIStatus(bmiRow); // 妫�鏌MI鐘舵�佸苟鏇存柊寮傚父澶嶉�夋 } - - const height = heightRow.proResult; - const weight = weightRow.proResult; - - if (!height || !weight) { - this.$message.warning('璇峰~鍐欒韩楂樺拰浣撻噸浠ヨ绠� BMI'); - bmiRow.proResult = ''; - return; - } - - const bmi = this.calculateBMI(height, weight); - bmiRow.proResult = bmi || ''; } this.focusrow = row; @@ -1037,7 +1181,7 @@ this.rows.push(row); console.log(this.rows, row); } - }, + }, */ // 鍒濆鍖栨暟鎹椂璁$畻 BMI getParentIdsss() { -- Gitblit v1.8.0