|
|
@@ -249,19 +249,19 @@
|
|
|
>
|
|
|
<el-table-column label="序号" type="index" width="50">
|
|
|
</el-table-column>
|
|
|
- <!-- <el-table-column :label="`编码`" prop="categoryCode"></el-table-column> -->
|
|
|
- <el-table-column :label="`编码`" prop="assetCode"></el-table-column>
|
|
|
- <!-- <el-table-column :label="`名称`" prop="name"></el-table-column> -->
|
|
|
- <el-table-column :label="`名称`" prop="assetName"></el-table-column>
|
|
|
+ <!-- <el-table-column :label="`编码`" prop="assetCode"></el-table-column> -->
|
|
|
+ <el-table-column :label="`编码`" prop="categoryCode"></el-table-column>
|
|
|
+ <!-- <el-table-column :label="`名称`" prop="assetName"></el-table-column> -->
|
|
|
+ <el-table-column :label="`名称`" prop="name"></el-table-column>
|
|
|
<el-table-column label="批次号" prop="batchNo"></el-table-column>
|
|
|
<!-- <el-table-column
|
|
|
label="包装编码"
|
|
|
- prop="code"
|
|
|
+ prop="onlyCode"
|
|
|
width="80"
|
|
|
></el-table-column> -->
|
|
|
<el-table-column
|
|
|
label="包装编码"
|
|
|
- prop="onlyCode"
|
|
|
+ prop="code"
|
|
|
width="80"
|
|
|
></el-table-column>
|
|
|
<el-table-column label="包装数量" prop="packingCount" width="80">
|
|
|
@@ -626,40 +626,42 @@
|
|
|
calcSumTotal(packingCount, outInNum, univalence) {
|
|
|
//最小包装单元,包装数量,单价
|
|
|
const total = {
|
|
|
- PackingCount: Number(packingCount),
|
|
|
- outInNum: Number(outInNum),
|
|
|
- univalence: Number(univalence == undefined ? 0 : univalence)
|
|
|
+ PackingCount: Number(packingCount > 0? packingCount : 0),
|
|
|
+ outInNum: Number(outInNum > 0 ? outInNum : 0),
|
|
|
+ univalence: Number(univalence > 0 ? univalence : 0)
|
|
|
};
|
|
|
return total.PackingCount * total.outInNum * total.univalence;
|
|
|
},
|
|
|
// 获取出库单详情
|
|
|
- initialize() {
|
|
|
- // returnHandleNo 有单据来源说明已入库(被驳回状态)
|
|
|
- getOutInBySourceBizNoOrError(this.returnDetailsForm.returnHandleNo).then((data) => {
|
|
|
- console.log(data)
|
|
|
- console.log('有订单来源')
|
|
|
- this.isEdit = false
|
|
|
- this.infoData = deepClone(data)
|
|
|
- // 增加是否已经入库字段
|
|
|
- this.infoData.isStorage = true
|
|
|
- // 填充遍历数据
|
|
|
- if (this.infoData.outInDetailVOList?.length > 0) {
|
|
|
- this.warehousingMaterialList = []; // 物品列表
|
|
|
- this.materialCodeReqList = []; // 包装列表
|
|
|
- this.metaList = []; // 物料列表
|
|
|
- this.infoData.outInDetailVOList.forEach((goodsiItem) => {
|
|
|
- this.warehousingMaterialList.push(goodsiItem);
|
|
|
- goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
|
|
|
- wrapItem.count =
|
|
|
- wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
|
|
|
- this.materialCodeReqList.push(wrapItem);
|
|
|
- wrapItem.outInDetailRecordMaterialDetailVOList.forEach((materialItem) => {
|
|
|
- this.metaList.push(materialItem);
|
|
|
+ async initialize() {
|
|
|
+ // returnInReceiptId退货入库单id(有说明已入库)
|
|
|
+ if (this.returnDetailsForm.returnInReceiptId) {
|
|
|
+ getOutInByIdAPI(this.returnDetailsForm.returnInReceiptId).then((data) => {
|
|
|
+ console.log(data)
|
|
|
+ console.log('有订单来源')
|
|
|
+ this.isEdit = false
|
|
|
+ this.infoData = deepClone(data)
|
|
|
+ // 增加是否已经入库字段
|
|
|
+ this.infoData.isStorage = true
|
|
|
+ // 填充遍历数据
|
|
|
+ if (this.infoData.outInDetailVOList?.length > 0) {
|
|
|
+ this.warehousingMaterialList = []; // 物品列表
|
|
|
+ this.materialCodeReqList = []; // 包装列表
|
|
|
+ this.metaList = []; // 物料列表
|
|
|
+ this.infoData.outInDetailVOList.forEach((goodsiItem) => {
|
|
|
+ this.warehousingMaterialList.push(goodsiItem);
|
|
|
+ goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
|
|
|
+ wrapItem.count =
|
|
|
+ wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
|
|
|
+ this.materialCodeReqList.push(wrapItem);
|
|
|
+ wrapItem.outInDetailRecordMaterialDetailVOList.forEach((materialItem) => {
|
|
|
+ this.metaList.push(materialItem);
|
|
|
+ });
|
|
|
});
|
|
|
});
|
|
|
- });
|
|
|
- }
|
|
|
- }).catch(async() => {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
console.log('没有订单来源')
|
|
|
this.isEdit = true
|
|
|
// outboundType 1包装 2物料
|
|
|
@@ -700,6 +702,7 @@
|
|
|
(item) => item.outboundDetailId === materialItem.id
|
|
|
);
|
|
|
if (hasMaterialItem) {
|
|
|
+ console.log(materialItem)
|
|
|
return materialItem;
|
|
|
}
|
|
|
}
|
|
|
@@ -740,8 +743,138 @@
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
+ // 处理过滤map为空的数组
|
|
|
+ this.infoData.outInDetailVOList = this.infoData.outInDetailVOList.filter((item) => !!item)
|
|
|
+ this.infoData.outInDetailVOList.forEach((goodsItem) => {
|
|
|
+ goodsItem.outInDetailRecordVOList = goodsItem.outInDetailRecordVOList.filter((wrapItem) => !!wrapItem)
|
|
|
+ });
|
|
|
+ this.infoData.outInDetailVOList.forEach((goodsItem) => {
|
|
|
+ goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
|
|
|
+ wrapItem.outInDetailRecordMaterialDetailVOList = wrapItem.outInDetailRecordMaterialDetailVOList.filter((metail) => !!metail)
|
|
|
+ })
|
|
|
+ })
|
|
|
this.initData();
|
|
|
- })
|
|
|
+ }
|
|
|
+ // returnHandleNo 有单据来源说明已入库(被驳回状态)
|
|
|
+ // getOutInBySourceBizNoOrError(this.returnDetailsForm.returnHandleNo).then((data) => {
|
|
|
+ // console.log(data)
|
|
|
+ // console.log('有订单来源')
|
|
|
+ // this.isEdit = false
|
|
|
+ // this.infoData = deepClone(data)
|
|
|
+ // // 增加是否已经入库字段
|
|
|
+ // this.infoData.isStorage = true
|
|
|
+ // // 填充遍历数据
|
|
|
+ // if (this.infoData.outInDetailVOList?.length > 0) {
|
|
|
+ // this.warehousingMaterialList = []; // 物品列表
|
|
|
+ // this.materialCodeReqList = []; // 包装列表
|
|
|
+ // this.metaList = []; // 物料列表
|
|
|
+ // this.infoData.outInDetailVOList.forEach((goodsiItem) => {
|
|
|
+ // this.warehousingMaterialList.push(goodsiItem);
|
|
|
+ // goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
|
|
|
+ // wrapItem.count =
|
|
|
+ // wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
|
|
|
+ // this.materialCodeReqList.push(wrapItem);
|
|
|
+ // wrapItem.outInDetailRecordMaterialDetailVOList.forEach((materialItem) => {
|
|
|
+ // this.metaList.push(materialItem);
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }).catch(async() => {
|
|
|
+ // console.log('没有订单来源')
|
|
|
+ // this.isEdit = true
|
|
|
+ // // outboundType 1包装 2物料
|
|
|
+ // let sendNo = this.returnDetailsForm.detailList[0]?.outInId;
|
|
|
+ // // 将退货物品明细划分为包装和物料(从物料往上反推形成tree)
|
|
|
+ // // 包装清单
|
|
|
+ // let wrapList =
|
|
|
+ // this.returnDetailsForm.detailList?.length > 0
|
|
|
+ // ? this.returnDetailsForm.detailList.filter(
|
|
|
+ // (item) => item.outboundType === 1
|
|
|
+ // )
|
|
|
+ // : [];
|
|
|
+ // // 物料清单
|
|
|
+ // let material =
|
|
|
+ // this.returnDetailsForm.detailList?.length > 0
|
|
|
+ // ? this.returnDetailsForm.detailList.filter(
|
|
|
+ // (item) => item.outboundType === 2
|
|
|
+ // )
|
|
|
+ // : [];
|
|
|
+ // // 获取出库单详情
|
|
|
+ // const data = await getOutInByIdAPI(sendNo);
|
|
|
+ // // 复制出库单详情
|
|
|
+ // this.infoData = deepClone(data);
|
|
|
+ // // 添加单据来源
|
|
|
+ // this.infoData.sourceBizNo = this.returnDetailsForm.returnHandleNo
|
|
|
+ // // 增加是否已经入库字段
|
|
|
+ // this.infoData.isStorage = false
|
|
|
+ // // 将出库状态改成入库状态 2出库 1入库
|
|
|
+ // this.infoData.type = 1;
|
|
|
+ // // 通过物料过滤出库单详情树
|
|
|
+ // this.infoData.outInDetailVOList.forEach((goodsItem) => {
|
|
|
+ // // 过滤物料维度
|
|
|
+ // goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
|
|
|
+ // wrapItem.outInDetailRecordMaterialDetailVOList =
|
|
|
+ // wrapItem.outInDetailRecordMaterialDetailVOList.map(
|
|
|
+ // (materialItem) => {
|
|
|
+ // let hasMaterialItem = material.some(
|
|
|
+ // (item) => item.outboundDetailId === materialItem.id
|
|
|
+ // );
|
|
|
+ // if (hasMaterialItem) {
|
|
|
+ // console.log(materialItem)
|
|
|
+ // return materialItem;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // // 通过包装过滤出库单详情树
|
|
|
+ // this.infoData.outInDetailVOList.forEach((goodsItem) => {
|
|
|
+ // // 过滤包装维度
|
|
|
+ // goodsItem.outInDetailRecordVOList =
|
|
|
+ // goodsItem.outInDetailRecordVOList.map((wrapItem) => {
|
|
|
+ // // 过滤在包装清单内或者存在过滤物料的包装
|
|
|
+ // if (wrapList.length > 0) {
|
|
|
+ // let hasWrapItem = wrapList.some((item) => {
|
|
|
+ // return (
|
|
|
+ // item.outboundDetailId === wrapItem.id ||
|
|
|
+ // wrapItem.outInDetailRecordMaterialDetailVOList?.length > 0
|
|
|
+ // );
|
|
|
+ // });
|
|
|
+ // if (hasWrapItem) {
|
|
|
+ // return wrapItem;
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // // 返回存在物料维度的包装维度
|
|
|
+ // if (
|
|
|
+ // wrapItem.outInDetailRecordMaterialDetailVOList?.length > 0
|
|
|
+ // ) {
|
|
|
+ // return wrapItem;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // // 过滤没有包装的物品维度
|
|
|
+ // this.infoData.outInDetailVOList = this.infoData.outInDetailVOList.map(
|
|
|
+ // (goodsItem) => {
|
|
|
+ // if (goodsItem.outInDetailRecordVOList?.length > 0) {
|
|
|
+ // return goodsItem;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // // 处理过滤map为空的数组
|
|
|
+ // this.infoData.outInDetailVOList = this.infoData.outInDetailVOList.filter((item) => !!item)
|
|
|
+ // this.infoData.outInDetailVOList.forEach((goodsItem) => {
|
|
|
+ // goodsItem.outInDetailRecordVOList = goodsItem.outInDetailRecordVOList.filter((wrapItem) => !!wrapItem)
|
|
|
+ // });
|
|
|
+ // this.infoData.outInDetailVOList.forEach((goodsItem) => {
|
|
|
+ // goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
|
|
|
+ // wrapItem.outInDetailRecordMaterialDetailVOList = wrapItem.outInDetailRecordMaterialDetailVOList.filter((metail) => !!metail)
|
|
|
+ // })
|
|
|
+ // })
|
|
|
+ // console.log(this.infoData)
|
|
|
+ // this.initData();
|
|
|
+ // })
|
|
|
},
|
|
|
// 初始化显示数据
|
|
|
async initData() {
|
|
|
@@ -754,10 +887,12 @@
|
|
|
this.metaList = []; // 物料列表
|
|
|
this.infoData.outInDetailAddPOList.forEach((goodsiItem) => {
|
|
|
goodsiItem.houseList = []
|
|
|
+ goodsiItem.count = goodsiItem.outInDetailRecordVOList.length
|
|
|
goodsiItem.outInDetailRecordAddPOList =
|
|
|
goodsiItem.outInDetailRecordVOList;
|
|
|
delete goodsiItem.outInDetailRecordVOList;
|
|
|
console.log(goodsiItem);
|
|
|
+
|
|
|
this.warehousingMaterialList.push(goodsiItem);
|
|
|
goodsiItem.outInDetailRecordAddPOList.forEach((wrapItem) => {
|
|
|
wrapItem.minUnit = wrapItem.minPackingCount;
|