feat(wms): 在完成操作时传递新钢卷ID参数

修改completeAction接口以接收新钢卷ID参数,并在多个视图中调用时传递该参数
This commit is contained in:
砂糖
2026-04-15 15:28:28 +08:00
parent ec5da2a7ca
commit 5e80208d61
5 changed files with 10 additions and 60 deletions

View File

@@ -292,7 +292,7 @@
<script>
import { getMaterialCoil, mergeMaterialCoil } from '@/api/wms/coil';
import { listPendingAction, completeAction, addPendingAction, getPendingAction } from '@/api/wms/pendingAction';
import { listPendingAction, getPendingAction } from '@/api/wms/pendingAction';
import CoilSelector from '@/components/CoilSelector';
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
import RawMaterialSelector from "@/components/KLPService/RawMaterialSelect";
@@ -700,12 +700,6 @@ export default {
// 保存合卷
async handleSave() {
// 验证源卷数量
// if (this.sourceCoils.length < 2) {
// this.$message.error('至少需要2个源卷才能合卷');
// return;
// }
// 验证源卷信息
for (let i = 0; i < this.sourceCoils.length; i++) {
const item = this.sourceCoils[i];
@@ -758,7 +752,6 @@ export default {
text: '正在合卷,请稍后...',
background: 'rgba(0, 0, 0, 0.7)'
});
// this.completeAllRelatedActions();
await mergeMaterialCoil(mergeData);
this.$message.success('合卷保存成功');
@@ -802,49 +795,6 @@ export default {
});
},
// 完成所有相关的待操作记录
async completeAllRelatedActions() {
try {
// 收集所有待操作ID
const actionIds = [];
const ncs = [];
// 当前页面的actionId从路由参数获取
// if (this.actionId) {
// actionIds.push(this.actionId);
// }
// 从待合卷列表中选择的钢卷的actionId
this.sourceCoils.forEach(item => {
if (item.actionId) {
actionIds.push(item.actionId);
}
// 或许所有需要直接完成的
if (item.nc) {
ncs.push(item);
}
});
// 批量完成所有待操作
const promises1 = actionIds.map(id => completeAction(id));
const promises2 = ncs.map(item => {
addPendingAction({
actionType: this.actionTypeCode, // 合卷操作
actionStatus: '2', // 2表示已完成
coilId: item.coilId,
currentCoilNo: item.currentCoilNo || '',
priority: 0,
sourceType: 'manual',
completeTime: new Date()
})
});
await Promise.all(promises1.concat(promises2));
} catch (error) {
console.error('完成待操作失败:', error);
// 不影响主流程,只记录错误
}
},
// 取消操作
handleCancel() {
console.log('取消合卷操作', this.$tab);