| | |
| | | </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)"></el-checkbox> |
| | | <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"> |
| | |
| | | </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"> |
| | |
| | | |
| | | <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" |
| | | :disabled="scope.row.project.sfcyyc === 1"></el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="isReturn" label="复诊" width="55px" align="center"> |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | getBMIStatus(row) { |
| | | const bmi = parseFloat(row.proResult); |
| | | if (isNaN(bmi) || !row.proResult) return ''; // 处理无效或空的BMI值 |
| | | if (bmi > 28) { |
| | | row.exceptionDesc = true; // 自动勾选异常复选框 |
| | | row.conclusion = '偏高'; // 设置结论 |
| | | return '偏高'; |
| | | } |
| | | if (bmi < 12) { |
| | | row.exceptionDesc = true; // 自动勾选异常复选框 |
| | | row.conclusion = '偏低'; // 设置结论 |
| | | return '偏低'; |
| | | } |
| | | row.exceptionDesc = false; // 正常范围内取消勾选 |
| | | row.conclusion = '正常'; // 设置结论 |
| | | return '正常'; |
| | | }, |
| | | // 计算 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); // 保留一位小数 |
| | |
| | | |
| | | // 实时更新 BMI |
| | | vale(value, row) { |
| | | console.log(3333) |
| | | if (row.project.proName === '身高' || row.project.proName === '体重') { |
| | | const heightRow = this.proParentList.sons.find( |
| | | item => item.project.proName === '身高' |
| | |
| | | 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); // 检查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 = ["正常", "未见异常", "阴性", "未见明显异常"]; |
| | | 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; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 输入确认时更新 BMI |
| | | handleInputConfirm(row, params) { |
| | | // 如果有 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( |
| | |
| | | const weight = weightRow.proResult; |
| | | const bmi = this.calculateBMI(height, weight); |
| | | bmiRow.proResult = bmi || ''; |
| | | this.getBMIStatus(bmiRow); // 检查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 = ["正常", "未见异常", "阴性", "未见明显异常"]; |
| | | 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 = ["正常", "未见异常", "阴性", "未见明显异常"]; |
| | | 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 = ["正常", "未见异常", "阴性", "未见明显异常"]; |
| | | 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 |
| | |
| | | } |
| | | this.proParentList.sons.forEach((item) => { |
| | | this.doctorName = item.doctorName; |
| | | |
| | | if (this.doctorName == null) { |
| | | this.userList.forEach((element) => { |
| | | const userName = this.$store.state.user.name; |
| | |
| | | if (item.isReturn == 1) item.isReturn = true; |
| | | if (item.isReturn == 0) item.isReturn = false; |
| | | if (item.exceptionDesc == "1") item.exceptionDesc = true; |
| | | if (item.exceptionDesc == "0") item.exceptionDesc = false; |
| | | if (item.exceptionDesc == "0" || item.project.sfcyyc == 1) item.exceptionDesc = false; |
| | | }); |
| | | if (this.proParentList.xiaoJie && this.proParentList.xiaoJie.length != 0) { |
| | | this.Parent.forEach((item3) => { |
| | |
| | | }, |
| | | |
| | | handleFocus(row) { |
| | | console.log(11111) |
| | | this.autorule = []; |
| | | if (!row.resultType || row.resultType == 2) { |
| | | return; |
| | |
| | | }, |
| | | |
| | | changDesc(item) { |
| | | console.log(item); |
| | | |
| | | |
| | | item.conclusion = item.exceptionDesc ? "异常" : "正常"; |
| | | }, |
| | |
| | | }, |
| | | |
| | | determine() { |
| | | this.tjOrderDetail = []; |
| | | let tjNumber = this.tableAll.tjNumber; |
| | | this.userList.forEach((item) => { |
| | | if (this.doctorName == item.nickName) this.doctorName = item.userId; |