fix: 半成品 Batch 模式序列号界面留空,提交时补回 Track 身份证
- Batch 模式序列号输入框不再显示 16 位身份证,避免误导 - 提交 payload 时若为 Batch 且扫过码,补回身份证供 Webhook 通知 Track
This commit is contained in:
@ -1498,12 +1498,16 @@ const handleScannerConfirm = (result: string) => {
|
||||
ElMessage.success('序列号已提取')
|
||||
}
|
||||
|
||||
// 扫码获取的 Track 16 位身份证:SN 模式展示、Batch 模式随提交载荷供 Webhook 通知
|
||||
let scannedTrackSerial = ''
|
||||
|
||||
// Track 扫码入库:扫码面板扫到身份证后,自动带出物料基础信息 + 序列号
|
||||
const handleTrackScanFill = async (data: { track: any; material: any }) => {
|
||||
const { track, material } = data
|
||||
// 选择物料:触发原生联动(基础信息/历史库位/历史模式与批号自增)
|
||||
await onMaterialSelected(material)
|
||||
|
||||
scannedTrackSerial = track.serial_number || ''
|
||||
if (track.external_serial) {
|
||||
// 序列号管理产品:切 SN,填真实外部业务序列号
|
||||
entryMode.value = 'serial'
|
||||
@ -1516,8 +1520,8 @@ const handleTrackScanFill = async (data: { track: any; material: any }) => {
|
||||
modeLocked.value = false
|
||||
// 批号兜底:无历史/历史为 SN 时确保有默认批号,避免阻断校验
|
||||
if (!form.batch_number) form.batch_number = '000001'
|
||||
// 16 位身份证回填序列号字段(Batch 下该字段禁用,随提交载荷供 Webhook 精准通知 Track)
|
||||
form.serial_number = track.serial_number || ''
|
||||
// Batch 界面序列号留空(不显示身份证),身份证随提交载荷供 Webhook 精准通知 Track
|
||||
form.serial_number = ''
|
||||
}
|
||||
ElMessage.success('扫码入库信息已自动填充,请核对后补充库位/数量等')
|
||||
}
|
||||
@ -1556,6 +1560,10 @@ const submitForm = async () => {
|
||||
production_end_time: form.production_time_range?.[1] || null
|
||||
}
|
||||
delete payload.production_time_range
|
||||
// Batch 模式下序列号界面为空,补回 Track 身份证供 Webhook 精准通知 Track
|
||||
if (entryMode.value === 'batch' && scannedTrackSerial && !payload.serial_number) {
|
||||
payload.serial_number = scannedTrackSerial
|
||||
}
|
||||
// Update 模式:无成本权限则剥离成本字段,防止库管修改已入库的成本数据
|
||||
// Create 模式:保留成本字段,确保 BOM 自动计算的值能正确提交
|
||||
if (dialogStatus.value === 'update') {
|
||||
|
||||
Reference in New Issue
Block a user