|
|
@@ -1245,76 +1245,11 @@
|
|
|
let obj = { ...this.formData, type: 1 };
|
|
|
obj.outInDetailAddPOList = arr;
|
|
|
|
|
|
- // =========================================================================
|
|
|
- console.log(this.warehousingMaterialList);
|
|
|
+ console.log('====>>', obj);
|
|
|
|
|
|
- let parmasObj = {
|
|
|
- inOutAddPO: {
|
|
|
- ...this.formData,
|
|
|
- ...this.formData.extInfo,
|
|
|
- bizStatus: 1,
|
|
|
- bizNum: await this.getOrderCode(),
|
|
|
- bizScene: this.formData.bizType
|
|
|
- },
|
|
|
- warehouseLedgerInfos: this.warehousingMaterialList
|
|
|
- };
|
|
|
-
|
|
|
- delete parmasObj.inOutAddPO.extInfo;
|
|
|
- for (let i = 0; i < parmasObj.warehouseLedgerInfos.length; i++) {
|
|
|
- parmasObj.warehouseLedgerInfos[i].batchNum =
|
|
|
- parmasObj.warehouseLedgerInfos[i].batchNo;
|
|
|
- let warehouseIdOuter =
|
|
|
- parmasObj.warehouseLedgerInfos[i].warehouseId;
|
|
|
- let houseList = parmasObj.warehouseLedgerInfos[i].houseList;
|
|
|
-
|
|
|
- if (houseList && houseList.length > 0) {
|
|
|
- for (let j = 0; j < houseList.length; j++) {
|
|
|
- let warehouseIdInner = houseList[j].warehouseId;
|
|
|
-
|
|
|
- if (warehouseIdOuter === warehouseIdInner) {
|
|
|
- parmasObj.warehouseLedgerInfos[i] = {
|
|
|
- ...parmasObj.warehouseLedgerInfos[i],
|
|
|
- ...houseList[j],
|
|
|
- rootCategoryLevelId: parmasObj.inOutAddPO.assetType,
|
|
|
-
|
|
|
- categoryLevelId:
|
|
|
- parmasObj.warehouseLedgerInfos[i].categoryLevelId
|
|
|
- };
|
|
|
- delete parmasObj.warehouseLedgerInfos[i].houseList;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- const warehouseLedgerDetails =
|
|
|
- parmasObj.warehouseLedgerInfos[i].warehouseLedgerDetails;
|
|
|
- for (let g = 0; g < warehouseLedgerDetails.length; g++) {
|
|
|
- for (
|
|
|
- let q = 0;
|
|
|
- q < warehouseLedgerDetails[g].houseList.length;
|
|
|
- q++
|
|
|
- ) {
|
|
|
- warehouseLedgerDetails[g] = {
|
|
|
- ...warehouseLedgerDetails[g],
|
|
|
- ...warehouseLedgerDetails[g].houseList[q],
|
|
|
- rootCategoryLevelId: parmasObj.inOutAddPO.assetType,
|
|
|
- categoryLevelId:
|
|
|
- parmasObj.warehouseLedgerInfos[i].categoryLevelId
|
|
|
- };
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 遍历数组
|
|
|
- for (const item of parmasObj.warehouseLedgerInfos) {
|
|
|
- // 遍历 warehouseLedgerDetails 数组
|
|
|
- for (const detail of item.warehouseLedgerDetails) {
|
|
|
- // 在 batchNo 同级添加属性 batchNum,其值为 batchNo 的值
|
|
|
- detail.batchNum = detail.batchNo;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- console.log(parmasObj);
|
|
|
this.saveLoading = true;
|
|
|
try {
|
|
|
- const res = await outin.addInOut(parmasObj);
|
|
|
+ const res = await outin.save(obj);
|
|
|
if (res.code == 0) {
|
|
|
this.$message.success('保存成功!');
|
|
|
}
|