Compare commits
2 Commits
05f0933514
...
ee275d3ea5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee275d3ea5 | ||
|
|
5e80208d61 |
@@ -122,10 +122,13 @@ export function startProcess(actionId) {
|
||||
}
|
||||
|
||||
// 完成操作
|
||||
export function completeAction(actionId) {
|
||||
export function completeAction(actionId, newCoilIds) {
|
||||
return request({
|
||||
url: `/wms/coilPendingAction/complete/${actionId}`,
|
||||
method: 'put'
|
||||
method: 'put',
|
||||
params: {
|
||||
newCoilIds: newCoilIds
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -721,7 +721,7 @@ export default {
|
||||
}
|
||||
|
||||
// 2. 完成待办动作(根据业务逻辑调整)
|
||||
const actionRes = await completeAction(this.actionId)
|
||||
const actionRes = await completeAction(this.actionId, splitRes.data.childCoilIds.join(','))
|
||||
if (actionRes.code !== 200) {
|
||||
this.$message.error('完成待办动作失败:' + actionRes.msg)
|
||||
return
|
||||
|
||||
@@ -676,7 +676,7 @@ export default {
|
||||
|
||||
// 如果是从待操作列表进来的,标记操作为完成
|
||||
if (this.actionId) {
|
||||
await completeAction(this.actionId);
|
||||
await completeAction(this.actionId, response.msg);
|
||||
}
|
||||
|
||||
// 延迟返回,让用户看到成功提示
|
||||
|
||||
@@ -324,11 +324,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMaterialCoil, updateMaterialCoil, getMaterialCoilTrace, checkCoilNo } from '@/api/wms/coil';
|
||||
import { getMaterialCoil, updateMaterialCoil, getMaterialCoilTrace } from '@/api/wms/coil';
|
||||
import { completeAction, getPendingAction } from '@/api/wms/pendingAction';
|
||||
import { listWarehouse } from '@/api/wms/warehouse';
|
||||
import { listRawMaterialWithBom } from '@/api/wms/rawMaterial';
|
||||
import { listProductWithBom } from '@/api/wms/product';
|
||||
import { getAcidTypingPrefill } from '@/api/pocket/acidTyping';
|
||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||
@@ -870,7 +868,6 @@ export default {
|
||||
enterCoilNo: this.currentInfo.enterCoilNo,
|
||||
supplierCoilNo: this.currentInfo.supplierCoilNo,
|
||||
abnormals: this.abnormals,
|
||||
// 注意:不要传newCoils,否则会走批量更新逻辑
|
||||
};
|
||||
|
||||
const response = await updateMaterialCoil(updateData);
|
||||
@@ -880,7 +877,7 @@ export default {
|
||||
|
||||
// 如果是从待操作列表进来的,标记操作为完成
|
||||
if (this.actionId) {
|
||||
await completeAction(this.actionId);
|
||||
await completeAction(this.actionId, response.msg);
|
||||
}
|
||||
|
||||
// 延迟返回
|
||||
|
||||
Reference in New Issue
Block a user