|
|
@@ -1374,6 +1374,11 @@
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
+ 'formData.bizType'(newValue) {
|
|
|
+ if (String(newValue) !== '2') {
|
|
|
+ this.clearInboundRequestId();
|
|
|
+ }
|
|
|
+ },
|
|
|
packingList: {
|
|
|
handler(newVal) {
|
|
|
console.log('包装列表', newVal);
|
|
|
@@ -1444,6 +1449,7 @@
|
|
|
categoryModel: item.modelType, // 物品型号
|
|
|
specification: item.specification, // 规格
|
|
|
brandNum: item.brandNum, // 牌号
|
|
|
+ sourceReceiveProductId: item.sourceReceiveProductId,
|
|
|
batchNo: item.batchNo || batchNo, // 批次号
|
|
|
systemBatchNo: item.systemBatchNo || '', // 系统内部批次号
|
|
|
minPackingQuantity: item.quantity, // 最小包装单元数量
|
|
|
@@ -1817,9 +1823,22 @@
|
|
|
console.log('query-----------', query);
|
|
|
console.log(this.formData.bizType, 'bbbbbtype');
|
|
|
if (this.formData.bizType != 10) {
|
|
|
+ const sourceChanged =
|
|
|
+ this.formData.sourceBizNo !== query.sourceBizNo ||
|
|
|
+ String(this.formData.bizType) !== String(query.bizType);
|
|
|
this.formData.sourceBizNo = query.sourceBizNo;
|
|
|
this.formData.bizType = query.bizType;
|
|
|
this.formData.extInfo.assetType = query.assetType.split(',');
|
|
|
+ if (String(query.bizType) === '2' && sourceChanged) {
|
|
|
+ this.clearInboundRequestId();
|
|
|
+ this.$set(
|
|
|
+ this.formData.extInfo,
|
|
|
+ 'inboundRequestId',
|
|
|
+ this.createInboundRequestId()
|
|
|
+ );
|
|
|
+ } else if (String(query.bizType) !== '2') {
|
|
|
+ this.clearInboundRequestId();
|
|
|
+ }
|
|
|
const batchNo = await getCode('lot_number_code');
|
|
|
// 获取包装规格
|
|
|
let packingSpecification =
|
|
|
@@ -2055,9 +2074,32 @@
|
|
|
// 清除单据来源
|
|
|
clearSourceBizNo() {
|
|
|
this.$set(this.formData, 'sourceBizNo', '');
|
|
|
+ this.clearInboundRequestId();
|
|
|
this.productList = [];
|
|
|
this.packingList = [];
|
|
|
},
|
|
|
+ // 生成采购入库请求标识,失败重试时复用同一个标识。
|
|
|
+ createInboundRequestId() {
|
|
|
+ const crypto = window.crypto || window.msCrypto;
|
|
|
+ if (crypto?.randomUUID) {
|
|
|
+ return crypto.randomUUID();
|
|
|
+ }
|
|
|
+ const random = Math.random().toString(36).slice(2);
|
|
|
+ return `inbound-${Date.now()}-${random}`;
|
|
|
+ },
|
|
|
+ ensureInboundRequestId() {
|
|
|
+ if (!this.formData.extInfo.inboundRequestId) {
|
|
|
+ this.$set(
|
|
|
+ this.formData.extInfo,
|
|
|
+ 'inboundRequestId',
|
|
|
+ this.createInboundRequestId()
|
|
|
+ );
|
|
|
+ }
|
|
|
+ return this.formData.extInfo.inboundRequestId;
|
|
|
+ },
|
|
|
+ clearInboundRequestId() {
|
|
|
+ this.$delete(this.formData.extInfo, 'inboundRequestId');
|
|
|
+ },
|
|
|
// 返回
|
|
|
back() {
|
|
|
this.$router.go(-1);
|
|
|
@@ -2465,6 +2507,9 @@
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
+ if (!obj.id && String(obj.bizType) === '2') {
|
|
|
+ obj.extInfo.inboundRequestId = this.ensureInboundRequestId();
|
|
|
+ }
|
|
|
let api = obj.id ? storageApi.update : storageApi.storage;
|
|
|
api(obj)
|
|
|
.then(async (res) => {
|
|
|
@@ -2484,6 +2529,9 @@
|
|
|
} else {
|
|
|
this.$message.success('操作成功');
|
|
|
}
|
|
|
+ if (!obj.id && String(obj.bizType) === '2') {
|
|
|
+ this.clearInboundRequestId();
|
|
|
+ }
|
|
|
// 委外入库(非采购)
|
|
|
|
|
|
this.saveLoading = false;
|
|
|
@@ -2491,9 +2539,9 @@
|
|
|
this.back();
|
|
|
} catch (error) {
|
|
|
this.saveLoading = false;
|
|
|
+ console.log('提交流程失败', error);
|
|
|
// this.$router.push('/warehouseManagement/stockManagement');
|
|
|
this.back();
|
|
|
- console.log('提交流程失败', error);
|
|
|
}
|
|
|
}
|
|
|
})
|