三级页面修改
This commit is contained in:
@@ -314,16 +314,40 @@
|
|||||||
confirmText: '确认',
|
confirmText: '确认',
|
||||||
title: '确定要将钢卷号为:' + coilRes.data.currentCoilNo + '发货吗?',
|
title: '确定要将钢卷号为:' + coilRes.data.currentCoilNo + '发货吗?',
|
||||||
showCancel: true,
|
showCancel: true,
|
||||||
success() {
|
success: async () => {
|
||||||
updateMaterialCoilSimple({
|
try {
|
||||||
|
// 1. 更新钢卷状态为已发货
|
||||||
|
await updateMaterialCoilSimple({
|
||||||
...coilRes.data,
|
...coilRes.data,
|
||||||
status: 1,
|
status: 1,
|
||||||
}).then(_ => {
|
});
|
||||||
|
|
||||||
|
// 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({
|
uni.showToast({
|
||||||
title: '发货成功',
|
title: '发货成功',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
});
|
||||||
})
|
} catch (error) {
|
||||||
|
console.error('发货失败:', error);
|
||||||
|
uni.showToast({
|
||||||
|
title: error.message || '发货失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail() {
|
fail() {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
@@ -331,7 +355,8 @@
|
|||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
uni.hideLoading();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('=== 扫码处理失败 ===');
|
console.error('=== 扫码处理失败 ===');
|
||||||
console.error('错误信息:', err);
|
console.error('错误信息:', err);
|
||||||
@@ -448,14 +473,38 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleConfirm() {
|
async handleConfirm() {
|
||||||
updateMaterialCoilSimple(this.form).then(_ => {
|
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({
|
uni.showToast({
|
||||||
title: '移库成功',
|
title: '移库成功',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
this.$refs.tranferPopup.close()
|
this.$refs.tranferPopup.close();
|
||||||
})
|
} catch (error) {
|
||||||
|
console.error('移库失败:', error);
|
||||||
|
uni.showToast({
|
||||||
|
title: error.message || '移库失败',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 获取设备信息
|
// 获取设备信息
|
||||||
getDeviceInfo() {
|
getDeviceInfo() {
|
||||||
|
|||||||
Reference in New Issue
Block a user