三级页面修改

This commit is contained in:
2025-11-11 09:40:40 +08:00
parent 04ab46b44b
commit bcf0881bd5

View File

@@ -314,16 +314,40 @@
confirmText: '确认',
title: '确定要将钢卷号为:' + coilRes.data.currentCoilNo + '发货吗?',
showCancel: true,
success() {
updateMaterialCoilSimple({
...coilRes.data,
status: 1,
}).then(_ => {
success: async () => {
try {
// 1. 更新钢卷状态为已发货
await updateMaterialCoilSimple({
...coilRes.data,
status: 1,
});
// 2. 插入一条已完成的待操作记录
await addPendingAction({
coilId: coilRes.data.coilId,
currentCoilNo: coilRes.data.currentCoilNo,
actionType: 4, // 4=发货
actionStatus: 2, // 2=已完成
scanTime: new Date(),
scanDevice: this.getDeviceInfo(),
priority: 0, // 0=普通
sourceType: 'scan',
warehouseId: coilRes.data.warehouseId,
processTime: new Date(),
completeTime: new Date()
});
uni.showToast({
title: '发货成功',
icon: 'none'
})
})
});
} catch (error) {
console.error('发货失败:', error);
uni.showToast({
title: error.message || '发货失败',
icon: 'none'
});
}
},
fail() {
uni.showToast({
@@ -331,7 +355,8 @@
icon: 'none'
})
}
})
});
uni.hideLoading();
} catch (err) {
console.error('=== 扫码处理失败 ===');
console.error('错误信息:', err);
@@ -448,14 +473,38 @@
});
},
handleConfirm() {
updateMaterialCoilSimple(this.form).then(_ => {
async handleConfirm() {
try {
// 1. 更新钢卷信息(移库)
await updateMaterialCoilSimple(this.form);
// 2. 插入一条已完成的待操作记录
await addPendingAction({
coilId: this.form.coilId,
currentCoilNo: this.form.currentCoilNo,
actionType: 5, // 5=移库
actionStatus: 2, // 2=已完成
scanTime: new Date(),
scanDevice: this.getDeviceInfo(),
priority: 0, // 0=普通
sourceType: 'scan',
warehouseId: this.form.warehouseId,
processTime: new Date(),
completeTime: new Date()
});
uni.showToast({
title: '移库成功',
icon: 'none'
});
this.$refs.tranferPopup.close()
})
this.$refs.tranferPopup.close();
} catch (error) {
console.error('移库失败:', error);
uni.showToast({
title: error.message || '移库失败',
icon: 'none'
});
}
},
// 获取设备信息
getDeviceInfo() {