fix(inventory): 解决发货数据仓库一致性验证问题

- 添加仓库ID一致性检查逻辑
- 验证发货数据仓库与出库单仓库是否匹配
- 不一致时抛出服务异常并提示用户重新确认
- 恢复票据类型选择框功能而非只读标签显示
dev_1.0.2
chenhao 2026-02-28 16:27:07 +08:00
parent 6f072b97c9
commit ddcde9e1da
2 changed files with 13 additions and 9 deletions

View File

@ -114,15 +114,15 @@
<el-col :span="12"> <el-col :span="12">
<el-form :model="uploadForm" ref="uploadForm" :rules="rules" label-width="120px" size="medium" > <el-form :model="uploadForm" ref="uploadForm" :rules="rules" label-width="120px" size="medium" >
<el-form-item label="票据类型" prop="ticketType" required> <el-form-item label="票据类型" prop="ticketType" required>
<dict-tag :options="dict.type.finance_invoice_type" :value="uploadForm.ticketType"/> <!-- <dict-tag :options="dict.type.finance_invoice_type" :value="uploadForm.ticketType"/>-->
<!-- <el-select v-model="uploadForm.ticketType" placeholder="请选择票据类型">--> <el-select v-model="uploadForm.ticketType" placeholder="请选择票据类型">
<!-- <el-option--> <el-option
<!-- v-for="item in dict.type.finance_invoice_type"--> v-for="item in dict.type.finance_invoice_type"
<!-- :key="item.value"--> :key="item.value"
<!-- :label="item.label"--> :label="item.label"
<!-- :value="item.value"--> :value="item.value"
<!-- ></el-option>--> ></el-option>
<!-- </el-select>--> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="收票附件" prop="file" required> <el-form-item label="收票附件" prop="file" required>
<div style="display: flex; flex-direction: column; align-items: flex-start;"> <div style="display: flex; flex-direction: column; align-items: flex-start;">

View File

@ -134,6 +134,10 @@ public class InventoryDeliveryServiceImpl implements IInventoryDeliveryService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
inventoryInfoService.saveBatch(inventoryInfoList); inventoryInfoService.saveBatch(inventoryInfoList);
} else { } else {
Long warehouseId = productSnDataList.get(0).getWarehouseId();
if (warehouseId!=null && !warehouseId.equals(inventoryDelivery.getWarehouseId())){
throw new ServiceException("发货数据仓库与出库单仓库不一致,请确认后重试");
}
for (InventoryInfo inventoryInfo : productSnDataList) { for (InventoryInfo inventoryInfo : productSnDataList) {
inventoryInfo.setInventoryStatus(InventoryInfo.InventoryStatusEnum.OUTER.getCode()); inventoryInfo.setInventoryStatus(InventoryInfo.InventoryStatusEnum.OUTER.getCode());
inventoryInfo.setOuterCode(inventoryDelivery.getOuterCode()); inventoryInfo.setOuterCode(inventoryDelivery.getOuterCode());