|
|
@@ -1914,41 +1914,8 @@
|
|
|
return this.$message.error('请保存入库明细!');
|
|
|
}
|
|
|
|
|
|
- const params = {
|
|
|
- outInWarehouse: { ...this.formData, type: 1 },
|
|
|
- warehouseLedgerInfos: this.warehousingMaterialList
|
|
|
- };
|
|
|
-
|
|
|
- for (let key in this.warehousingMaterialList) {
|
|
|
- for (let k in this.warehousingMaterialList[key].houseList) {
|
|
|
- this.warehousingMaterialList[key].warehouseName =
|
|
|
- this.warehousingMaterialList[key].houseList[k].warehouseName;
|
|
|
-
|
|
|
- this.warehousingMaterialList[key].areaName =
|
|
|
- this.warehousingMaterialList[key].houseList[k].areaName;
|
|
|
-
|
|
|
- this.warehousingMaterialList[key].shelfCode =
|
|
|
- this.warehousingMaterialList[key].houseList[k].shelfCode;
|
|
|
-
|
|
|
- this.warehousingMaterialList[key].cargoSpaceCode =
|
|
|
- this.warehousingMaterialList[key].houseList[k].cargoSpaceCode;
|
|
|
-
|
|
|
- this.warehousingMaterialList[key].warehouseId =
|
|
|
- this.warehousingMaterialList[key].houseList[k].warehouseId;
|
|
|
+ this.formatWarehouseMaterialList();
|
|
|
|
|
|
- this.warehousingMaterialList[key].areaId =
|
|
|
- this.warehousingMaterialList[key].houseList[k].areaId;
|
|
|
-
|
|
|
- this.warehousingMaterialList[key].shelfId =
|
|
|
- this.warehousingMaterialList[key].houseList[k].shelfId;
|
|
|
-
|
|
|
- this.warehousingMaterialList[key].cargoSpaceId =
|
|
|
- this.warehousingMaterialList[key].houseList[k].cargoSpaceId;
|
|
|
- this.warehousingMaterialList[key].num =
|
|
|
- this.warehousingMaterialList[key].houseList[k].num;
|
|
|
- }
|
|
|
- }
|
|
|
- console.log('1122', this.warehousingMaterialList);
|
|
|
let arr = this.warehousingMaterialList.map((item) => {
|
|
|
return {
|
|
|
netWeight: item.netWeight,
|
|
|
@@ -1966,7 +1933,6 @@
|
|
|
price: item.univalence,
|
|
|
outInDetailRecordAddPOList: item.warehouseLedgerDetails,
|
|
|
position: `${item.warehouseName}-${item.areaName}-${item.shelfCode}-${item.cargoSpaceCode}`,
|
|
|
- // pathIds: item.categoryLevelPathId.toString(),
|
|
|
remark: '',
|
|
|
pathIds: `${item.warehouseId},${item.areaId},${item.shelfId},${item.cargoSpaceId}`,
|
|
|
pathName: `${item.warehouseName},${item.areaName},${item.shelfCode},${item.cargoSpaceCode}`,
|
|
|
@@ -1978,29 +1944,11 @@
|
|
|
weight: item.weight
|
|
|
};
|
|
|
});
|
|
|
+
|
|
|
arr.forEach((item) => {
|
|
|
if (item.outInDetailRecordAddPOList.length > 0) {
|
|
|
let list = item.outInDetailRecordAddPOList.map((it) => {
|
|
|
- return {
|
|
|
- code: it.onlyCode,
|
|
|
- dateType: this.curDateType === 'manufactureTime' ? 2 : 1,
|
|
|
- dateValue: it[this.curDateType],
|
|
|
- minUnit: it.minPackingCount,
|
|
|
- minPositionId: it.cargoSpaceId,
|
|
|
- name: it.assetName,
|
|
|
- pathIds: item.pathIds,
|
|
|
- unit: it.unit,
|
|
|
- packageNo: it.num,
|
|
|
- clientCode: it.clientCode,
|
|
|
- materielCode: it.materielCode,
|
|
|
- weight: it.weight,
|
|
|
- weightUtil: it.weightUtil,
|
|
|
- engrave: it.engrave,
|
|
|
- materialDetails: this.materialDetails(it.onlyCode),
|
|
|
- packingCount: it.packingCount,
|
|
|
- status: it.status,
|
|
|
- result: it.result
|
|
|
- };
|
|
|
+ return this.formatOutInDetailRecordAddPO(it, item);
|
|
|
});
|
|
|
item.outInDetailRecordAddPOList = list;
|
|
|
}
|
|
|
@@ -2009,20 +1957,63 @@
|
|
|
let obj = { ...this.formData, type: 1 };
|
|
|
obj.outInDetailAddPOList = arr;
|
|
|
|
|
|
- console.log('====>>', obj);
|
|
|
-
|
|
|
this.saveLoading = true;
|
|
|
try {
|
|
|
const res = await outin.save(obj);
|
|
|
if (res.code == 0) {
|
|
|
+ await outin.outApproves({ outInId: res.data });
|
|
|
this.$message.success('保存成功!');
|
|
|
}
|
|
|
- } catch (error) {}
|
|
|
+ } catch (error) {
|
|
|
+ console.error('保存失败:', error);
|
|
|
+ }
|
|
|
this.saveLoading = false;
|
|
|
this.$router.push('/warehouseManagement/stockManagement');
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ formatWarehouseMaterialList() {
|
|
|
+ for (let key in this.warehousingMaterialList) {
|
|
|
+ for (let k in this.warehousingMaterialList[key].houseList) {
|
|
|
+ let house = this.warehousingMaterialList[key].houseList[k];
|
|
|
+ this.warehousingMaterialList[key].warehouseName =
|
|
|
+ house.warehouseName;
|
|
|
+ this.warehousingMaterialList[key].areaName = house.areaName;
|
|
|
+ this.warehousingMaterialList[key].shelfCode = house.shelfCode;
|
|
|
+ this.warehousingMaterialList[key].cargoSpaceCode =
|
|
|
+ house.cargoSpaceCode;
|
|
|
+ this.warehousingMaterialList[key].warehouseId = house.warehouseId;
|
|
|
+ this.warehousingMaterialList[key].areaId = house.areaId;
|
|
|
+ this.warehousingMaterialList[key].shelfId = house.shelfId;
|
|
|
+ this.warehousingMaterialList[key].cargoSpaceId = house.cargoSpaceId;
|
|
|
+ this.warehousingMaterialList[key].num = house.num;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ formatOutInDetailRecordAddPO(it, item) {
|
|
|
+ return {
|
|
|
+ code: it.onlyCode,
|
|
|
+ dateType: this.curDateType === 'manufactureTime' ? 2 : 1,
|
|
|
+ dateValue: it[this.curDateType],
|
|
|
+ minUnit: it.minPackingCount,
|
|
|
+ minPositionId: it.cargoSpaceId,
|
|
|
+ name: it.assetName,
|
|
|
+ pathIds: item.pathIds,
|
|
|
+ unit: it.unit,
|
|
|
+ packageNo: it.num,
|
|
|
+ clientCode: it.clientCode,
|
|
|
+ materielCode: it.materielCode,
|
|
|
+ weight: it.weight,
|
|
|
+ weightUtil: it.weightUtil,
|
|
|
+ engrave: it.engrave,
|
|
|
+ materialDetails: this.materialDetails(it.onlyCode),
|
|
|
+ packingCount: it.packingCount,
|
|
|
+ status: it.status,
|
|
|
+ result: it.result
|
|
|
+ };
|
|
|
+ },
|
|
|
materialDetails(onlyCode) {
|
|
|
return this.resultArray.filter((item) => item.onlyCode === onlyCode);
|
|
|
},
|