| | |
| | | <view class="info-label">检验数</view> |
| | | <view class="info-value">{{ formData.levelNum }}</view> |
| | | </view> |
| | | <view v-if="formData.minValue" class="info-item"> |
| | | <!-- 修复:使用更准确的判断条件,避免0被误判为falsy --> |
| | | <view v-if="formData.minValue != null" class="info-item"> |
| | | <view class="info-label">下限</view> |
| | | <view class="info-value">{{ formData.minValue }}</view> |
| | | </view> |
| | | <view v-if="formData.standardValue" class="info-item"> |
| | | <view v-if="formData.standardValue != null" class="info-item"> |
| | | <view class="info-label">标准值</view> |
| | | <view class="info-value">{{ formData.standardValue }}</view> |
| | | </view> |
| | | <view v-if="formData.maxValue" class="info-item"> |
| | | <view v-if="formData.maxValue != null" class="info-item"> |
| | | <view class="info-label">上限</view> |
| | | <view class="info-value">{{ formData.maxValue }}</view> |
| | | </view> |
| | |
| | | <view class="section-header">检验结果</view> |
| | | <view class="section-body"> |
| | | <view class="info-grid"> |
| | | <view v-if="formData.result" class="info-item"> |
| | | <view v-if="formData.result != null" class="info-item"> |
| | | <view class="info-label">预览结果</view> |
| | | <view class="info-value">{{ formData.result }}</view> |
| | | </view> |
| | | <view v-if="formData.remarks" class="info-item"> |
| | | <view v-if="formData.remarks != null" class="info-item"> |
| | | <view class="info-label">备注</view> |
| | | <view class="info-value danger">{{ formData.remarks }}</view> |
| | | </view> |
| | |
| | | <view class="section"> |
| | | <view class="section-header">检验结果录入</view> |
| | | <view class="section-body"> |
| | | <view v-if="!formData.maxValue && !formData.minValue" class="info-item edit"> |
| | | <!-- 修复:使用更准确的判断条件,避免0被误判为falsy --> |
| | | <view v-if="formData.maxValue == null && formData.minValue == null" class="info-item edit"> |
| | | <view class="info-label" style="color: #F56C6C">提示</view> |
| | | <view class="info-value" style="color: #F56C6C">没有最大值和最小值时填写0(未通过检验)或1(通过检验)</view> |
| | | </view> |
| | |
| | | return 0; |
| | | } |
| | | }); |
| | | |
| | | // 排序后自动跳转到第一个标签 |
| | | this.currentTab = 0; |
| | | if (this.tabs.length > 0) { |
| | | this.id = this.tabs[0].id; |
| | | this.refreshResult(); |
| | | } |
| | | } else { |
| | | // 没有项目时至少添加当前项目到标签 |
| | | this.tabs = [{id: this.id, projName: this.formData.projName || '当前项目'}]; |
| | |
| | | let count = this.formData.levelNum; |
| | | let fstand = "√"; |
| | | |
| | | //有最大值和最小值就根据是否符合标准值更新判定结果,没有最大值和最小值就根据是否通过检验判定结果 |
| | | if (this.formData.maxValue && this.formData.minValue) { |
| | | // 修复:使用更准确的判断条件,避免0被误判为falsy |
| | | if (this.formData.maxValue != null && this.formData.minValue != null) { |
| | | |
| | | if (!this.formData.fcheckResu) { |
| | | this.$showMessage("请输入检验值"); |
| | |
| | | this.isShowImg = true; |
| | | this.base64Image = 'data:image/jpeg;base64,' + this.formData.imageData; |
| | | } |
| | | if (this.formData.maxValue && this.formData.minValue && this.formData.standardValue) { |
| | | // 修复:使用更准确的判断条件,避免0被误判为falsy |
| | | if (this.formData.maxValue != null && this.formData.minValue != null && this.formData.standardValue != null) { |
| | | this.isNumber = true; |
| | | } |
| | | }) |
| | |
| | | |
| | | let fstand = "√"; |
| | | |
| | | if (this.formData.maxValue && this.formData.minValue) { |
| | | // 修复:使用更准确的判断条件,避免0被误判为falsy |
| | | if (this.formData.maxValue != null && this.formData.minValue != null) { |
| | | |
| | | if (!this.editData.fcheckResu) { |
| | | this.$showMessage("请输入检验值"); |
| | |
| | | this.editData.fcheckResu = 1 |
| | | } |
| | | |
| | | // 改进后的逻辑:根据检验结果值来判断合格与否 |
| | | if (this.editData.fcheckResu == 0 || this.editData.fcheckResu == 1) { |
| | | // 0表示不合格,1表示合格 |
| | | if (this.editData.fcheckResu == 0) { |
| | | fstand = "×"; |
| | | } else { |
| | | fstand = "√"; |
| | | } |
| | | } else { |
| | | this.$showMessage("无标准值时,检验结果只能为0或1!"); |
| | |
| | | }, |
| | | // 判断数字是否在范围内 |
| | | isInRange(value) { |
| | | if (!this.formData.maxValue || !this.formData.minValue) return true; |
| | | // 修复:使用更准确的判断条件,避免0被误判为falsy |
| | | if (this.formData.maxValue == null || this.formData.minValue == null) return true; |
| | | const numValue = parseFloat(value); |
| | | return numValue >= parseFloat(this.formData.minValue) && |
| | | numValue <= parseFloat(this.formData.maxValue); |
| | | }, |
| | | // 获取数字结果的样式类 |
| | | getNumberResultClass(value) { |
| | | if (!this.formData.maxValue || !this.formData.minValue) return 'number-normal'; |
| | | // 修复:使用更准确的判断条件,避免0被误判为falsy |
| | | if (this.formData.maxValue == null || this.formData.minValue == null) return 'number-normal'; |
| | | return this.isInRange(value) ? 'number-pass' : 'number-fail'; |
| | | }, |
| | | // 获取状态结果的样式类 |