物料流程整合

This commit is contained in:
zc
2026-04-03 17:29:42 +08:00
parent 3eb98be172
commit 7238aabd0a
4 changed files with 14 additions and 20 deletions

View File

@@ -285,6 +285,7 @@ const formData = reactive({
encoding: '', // 物料编码
materialName: '', // 物料名称
materialSpec: '', // 物料规格
materialProcess: '', // 物料流程
unitWeight: 0, // 重量
photoUrl: '', // 样图URL
weightRange: '', // 物料重量范围
@@ -579,6 +580,7 @@ const fetchMaterialData = async (code: string) => {
formData.encoding = res.data?.encoding || ''
formData.materialName = res.data?.materialName || ''
formData.materialSpec = res.data?.materialSpec || ''
formData.materialProcess = res.data?.materialProcess || ''
formData.unitWeight = res.data?.unitWeight || 0
formData.photoUrl = res.data?.photoUrl || ''
formData.weightRange = (res.data?.downFloatRatio || '-') + '% ~ ' + (res.data?.upFloatRatio || '-') + '%'
@@ -634,16 +636,19 @@ const handleNext = async () => {
} else if (activeStep.value === 1 && compareMatchResult.value !== 'success') {
// 当在扫码核验页面点击开始比对时,调用后端接口获取比对结果
try {
// 这里应该调用后端的比对接口暂时使用fetchMaterialData模拟
// 实际项目中应该替换为专门的比对接口
const materialCode = formData.inputMaterialCode?.trim()
if (!materialCode) {
Message.error('请先扫描物料编码')
}
if (!formData.materialProcess || formData.materialProcess === '') {
Message.error('未找到物料流程,无法对比')
return
}
// 调用后端接口获取比对结果 // todo
const res = await vmSend(materialCode);
const res = await vmSend(formData.materialProcess);
if (res.data && res.data == materialCode) {
compareMatchResult.value === 'success';
Message.success('比对成功')