|
|
@ -93,6 +93,11 @@ |
|
|
<span>{{ label.qty }} {{ label.unit || '个' }}</span> |
|
|
<span>{{ label.qty }} {{ label.unit || '个' }}</span> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12" v-if="label.expiredDate"> |
|
|
|
|
|
<el-form-item label="过期日期"> |
|
|
|
|
|
<span>{{ formatDate(label.expiredDate) }}</span> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</div> |
|
|
</div> |
|
|
@ -237,6 +242,28 @@ export default { |
|
|
return; |
|
|
return; |
|
|
}*/ |
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
// 校验过期日期一致性 |
|
|
|
|
|
if (this.scannedItems.length > 0) { |
|
|
|
|
|
const firstItemExpiryDate = this.scannedItems[0].expiredDate; |
|
|
|
|
|
const currentExpiryDate = huInfo.expiredDate; |
|
|
|
|
|
|
|
|
|
|
|
// 如果两个日期都存在且不相等,则不允许添加 |
|
|
|
|
|
if (firstItemExpiryDate && currentExpiryDate) { |
|
|
|
|
|
const firstDate = new Date(firstItemExpiryDate).toDateString(); |
|
|
|
|
|
const currentDate = new Date(currentExpiryDate).toDateString(); |
|
|
|
|
|
|
|
|
|
|
|
if (firstDate !== currentDate) { |
|
|
|
|
|
this.$message.error(`HandlingUnit的过期日期不一致,无法一起移库。已扫描的过期日期:${firstDate},当前扫描的过期日期:${currentDate}`); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
// 如果一个有过期日期,另一个没有,也不允许 |
|
|
|
|
|
else if (firstItemExpiryDate || currentExpiryDate) { |
|
|
|
|
|
this.$message.error('HandlingUnit的过期日期不一致,部分有过期日期,部分没有,无法一起移库'); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 添加到列表 |
|
|
// 添加到列表 |
|
|
this.scannedItems.push({ |
|
|
this.scannedItems.push({ |
|
|
id: Date.now(), |
|
|
id: Date.now(), |
|
|
@ -247,7 +274,8 @@ export default { |
|
|
unit: huInfo.unit, |
|
|
unit: huInfo.unit, |
|
|
batchNo: huInfo.batchNo, |
|
|
batchNo: huInfo.batchNo, |
|
|
locationId: huInfo.locationId, |
|
|
locationId: huInfo.locationId, |
|
|
wdr: huInfo.wdr |
|
|
|
|
|
|
|
|
wdr: huInfo.wdr, |
|
|
|
|
|
expiredDate: huInfo.expiredDate |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
this.$message.success('扫描成功'); |
|
|
this.$message.success('扫描成功'); |
|
|
@ -379,6 +407,21 @@ export default { |
|
|
// 初始化表单数据 |
|
|
// 初始化表单数据 |
|
|
initFormData() { |
|
|
initFormData() { |
|
|
// 可以在这里设置其他默认值 |
|
|
// 可以在这里设置其他默认值 |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 格式化日期显示 |
|
|
|
|
|
formatDate(dateString) { |
|
|
|
|
|
if (!dateString) return ''; |
|
|
|
|
|
try { |
|
|
|
|
|
const date = new Date(dateString); |
|
|
|
|
|
return date.toLocaleDateString('zh-CN', { |
|
|
|
|
|
year: 'numeric', |
|
|
|
|
|
month: '2-digit', |
|
|
|
|
|
day: '2-digit' |
|
|
|
|
|
}); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
return dateString; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|