| | |
| | | <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" :lazy="false"> |
| | | <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-item${index}-row${$index}`" |
| | | @keydown.enter.native="keyInputConfirm($event,index,$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"> |
| | | <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-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" :lazy="false"> |
| | | <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-item${index}-row${$index}`" |
| | | @keydown.enter.native="keyInputConfirm($event,index,$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"> |
| | |
| | | |
| | | <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) { |
| | |
| | | const weight = weightRow.proResult; |
| | | const bmi = this.calculateBMI(height, weight); |
| | | bmiRow.proResult = bmi || ''; |
| | | this.getBMIStatus(bmiRow); // 检查BMI状态并更新异常复选框 |
| | | } |
| | | } |
| | | this.rows.push(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; |
| | | 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 }) { |
| | |
| | | }, |
| | | |
| | | handleClose() { |
| | | this.$tab.refreshPage(); |
| | | this.drawer = false; // 只关闭抽屉,不刷新页面或重置数据 |
| | | }, |
| | | |
| | | handleClose1() { |
| | |
| | | }, |
| | | |
| | | changDesc(item) { |
| | | |
| | | |
| | | item.conclusion = item.exceptionDesc ? "异常" : "正常"; |
| | | }, |
| | | |
| | |
| | | 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,index, currentRowIndex) { |
| | | |
| | | keyInputConfirm(event, index, currentRowIndex) { |
| | | // 阻止默认回车行为,比如提交表单 |
| | | event.preventDefault(); |
| | | event.stopPropagation() |
| | | event.stopPropagation() |
| | | const nextRowIndex = currentRowIndex + 1; // 计算下一行索引 |
| | | // 如果下一行存在,则聚焦该行的输入框 |
| | | if (nextRowIndex < this.proParentList.sons.length) { |
| | |
| | | }); |
| | | }, |
| | | |
| | | hb() {}, |
| | | hb() { }, |
| | | |
| | | propoChange() { |
| | | this.cusobj = { sex: this.tableAll.cusSex, isZj: 1 }; |
| | |
| | | }, |
| | | |
| | | determine() { |
| | | this.tjOrderDetail = []; |
| | | let tjNumber = this.tableAll.tjNumber; |
| | | this.userList.forEach((item) => { |
| | | if (this.doctorName == item.nickName) this.doctorName = item.userId; |
| | |
| | | }]; |
| | | getaddRemark(data).then((res) => { |
| | | this.$modal.msgSuccess("提交成功"); |
| | | this.rows = []; // 提交成功后清空 this.rows |
| | | this.drawer = false; |
| | | }); |
| | | this.handleClose(); |