| | |
| | | </view> |
| | | <wd-col :span="24"> |
| | | <wd-form-item label="日期" prop="recordDate"> |
| | | {{ formatDate(recordData.fixedInfo?.recordDate) }} |
| | | {{ formattedRecordDate }} |
| | | </wd-form-item> |
| | | <wd-form-item label="班次" prop="workShift"> |
| | | {{ formatValue(recordData.fixedInfo?.workShift) }} |
| | |
| | | inspectionResult: { |
| | | twistedOuterDiameter: formData.twistedOuterDiameter, |
| | | diameterType: formData.diameterType || "绞合外径(mm)", |
| | | structureFormula: formData.structureFormula, |
| | | structureItems: formData.structureItems, |
| | | inspectStructure: { |
| | | structureFormula: formData.structureFormula, |
| | | structureItems: formData.structureItems, |
| | | }, |
| | | inspectTwist: formData.inspectTwist, |
| | | productAppearance: formData.productAppearance, |
| | | conclusion: formData.conclusion, |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 格式化日期计算属性(用于模板显示,避免编译处理) |
| | | const formattedRecordDate = computed(() => { |
| | | const date = recordData.value.fixedInfo?.recordDate; |
| | | if (!date) return "-"; |
| | | const d = new Date(date); |
| | | const year = d.getFullYear(); |
| | | const month = String(d.getMonth() + 1).padStart(2, "0"); |
| | | const day = String(d.getDate()).padStart(2, "0"); |
| | | return `${year}-${month}-${day}`; |
| | | }); |
| | | |
| | | // 计算节径比 |
| | | const calculatePitchRatio = (pitch: string, dia: string) => { |
| | | // 如果pitch或dia为空,则返回"-" |
| | |
| | | if (!cachedData || !cachedData.uid) { |
| | | console.log("⚠️ 未检测到扫码缓存,用户需要扫描设备二维码"); |
| | | // 在编辑模式下才提示 |
| | | if (isEdit.value) { |
| | | setTimeout(() => { |
| | | uni.showToast({ |
| | | title: "请扫描设备二维码后再保存", |
| | | icon: "none", |
| | | duration: 2000, |
| | | }); |
| | | }, 500); |
| | | } |
| | | // if (isEdit.value) { |
| | | // setTimeout(() => { |
| | | // uni.showToast({ |
| | | // title: "请扫描设备二维码后再保存", |
| | | // icon: "none", |
| | | // duration: 2000, |
| | | // }); |
| | | // }, 500); |
| | | // } |
| | | } |
| | | }); |
| | | </script> |