|
|
@@ -46,7 +46,7 @@
|
|
|
<div class="mt20">
|
|
|
<div class="mt10">
|
|
|
<el-table
|
|
|
- v-if="showTable"
|
|
|
+ v-if="showTable"
|
|
|
ref="multipleTable"
|
|
|
:data="warehousingMaterialList"
|
|
|
tooltip-effect="dark"
|
|
|
@@ -160,38 +160,34 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- label="货位"
|
|
|
- prop="houseList"
|
|
|
- :show-overflow-tooltip="true"
|
|
|
- width="250"
|
|
|
- required
|
|
|
- >
|
|
|
- <template slot-scope="{ row, $index }">
|
|
|
- <div v-if="isEdit" @click="handleWareHouse(row, $index)">
|
|
|
- <div
|
|
|
- style="color: #ff4949"
|
|
|
- v-if="row.houseList.length === 0"
|
|
|
+ label="货位"
|
|
|
+ prop="houseList"
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
+ width="250"
|
|
|
+ required
|
|
|
+ >
|
|
|
+ <template slot-scope="{ row, $index }">
|
|
|
+ <div v-if="isEdit" @click="handleWareHouse(row, $index)">
|
|
|
+ <div style="color: #ff4949" v-if="row.houseList.length === 0">
|
|
|
+ ---(必填)
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <div
|
|
|
+ class="fontOmitted"
|
|
|
+ v-for="(item, index) in row.houseList"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ {{ item.warehouseName }}- {{ item.areaName }}-
|
|
|
+ {{ item.shelfCode }}- {{ item.cargoSpaceCode
|
|
|
+ }}<span style="color: #ff4949" v-if="item.num">
|
|
|
+ - {{ item.num }}(数)</span
|
|
|
>
|
|
|
- ---(必填)
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- <div
|
|
|
- class="fontOmitted"
|
|
|
- v-for="(item, index) in row.houseList"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- {{ item.warehouseName }}- {{ item.areaName }}-
|
|
|
- {{ item.shelfCode }}- {{ item.cargoSpaceCode
|
|
|
- }}<span style="color: #ff4949" v-if="item.num">
|
|
|
- - {{ item.num }}(数)</span
|
|
|
- >
|
|
|
- <br />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <br />
|
|
|
</div>
|
|
|
- <div v-else>{{ row.position }}</div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-else>{{ row.position }}</div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<!-- <el-table-column
|
|
|
label="质检单"
|
|
|
@@ -387,10 +383,10 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <WareHouseDailog
|
|
|
- ref="wareHouseDailogRef"
|
|
|
- @houseData="houseData"
|
|
|
- ></WareHouseDailog>
|
|
|
+ <WareHouseDailog
|
|
|
+ ref="wareHouseDailogRef"
|
|
|
+ @houseData="houseData"
|
|
|
+ ></WareHouseDailog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -398,9 +394,9 @@
|
|
|
// import { getInfo } from '@/api/stockManagement/outgoingManagement' '@/components/PageHeader'
|
|
|
// import PageHeader from '@/components/PageHeader';
|
|
|
// import { tableHeader } from '../common';
|
|
|
- import WareHouseDailog from '@/components/WareHouseDailog/index.vue'
|
|
|
+ import WareHouseDailog from '@/components/WareHouseDailog/index.vue';
|
|
|
import { mapGetters, mapActions } from 'vuex';
|
|
|
- import { getOutInBySourceBizNoOrError } from '@/api/classifyManage/index'
|
|
|
+ import { getOutInBySourceBizNoOrError } from '@/api/classifyManage/index';
|
|
|
//import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
|
|
|
|
|
|
// import {
|
|
|
@@ -425,14 +421,14 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- components: {
|
|
|
- WareHouseDailog
|
|
|
- },
|
|
|
+ components: {
|
|
|
+ WareHouseDailog
|
|
|
+ },
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
- isEdit: true, // 是否可以编辑(货位和质检状态)
|
|
|
- showTable: true, // 解决set数组Table不刷新问题
|
|
|
+ isEdit: true, // 是否可以编辑(货位和质检状态)
|
|
|
+ showTable: true, // 解决set数组Table不刷新问题
|
|
|
title: '信息',
|
|
|
qualityStatus: {
|
|
|
0: '未检',
|
|
|
@@ -447,49 +443,52 @@
|
|
|
infoData: {}, // 上传入库信息
|
|
|
warehousingMaterialList: [], // 物品列表
|
|
|
materialCodeReqList: [], // 包装列表
|
|
|
- metaList: [], // 物料列表
|
|
|
+ metaList: [] // 物料列表
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['getDictValue'])
|
|
|
},
|
|
|
methods: {
|
|
|
- // 仓库选择
|
|
|
- houseData(argum, idx) {
|
|
|
- console.log(argum)
|
|
|
- console.log(idx)
|
|
|
- this.showTable = false
|
|
|
+ // 仓库选择
|
|
|
+ houseData(argum, idx) {
|
|
|
+ console.log(argum);
|
|
|
+ console.log(idx);
|
|
|
+ this.showTable = false;
|
|
|
this.$set(this.warehousingMaterialList[idx], 'houseList', argum);
|
|
|
- this.$set(this.infoData.outInDetailAddPOList[idx], 'houseList', argum);
|
|
|
- this.$nextTick(() => {
|
|
|
- this.showTable = true
|
|
|
- // 添加货位字段
|
|
|
- for (let key in this.infoData.outInDetailAddPOList) {
|
|
|
- for (let k in this.infoData.outInDetailAddPOList[key].houseList) {
|
|
|
- let house = this.infoData.outInDetailAddPOList[key].houseList[k];
|
|
|
- this.infoData.outInDetailAddPOList[key].pathName = `${house.warehouseName},${house.areaName},${house.shelfCode},${house.cargoSpaceCode}`,
|
|
|
- this.infoData.outInDetailAddPOList[key].pathIds = `${house.warehouseId},${house.areaId},${house.shelfId},${house.cargoSpaceId}`
|
|
|
- this.infoData.outInDetailAddPOList[key].num = 1 // 有问题
|
|
|
- // this.infoData.outInDetailAddPOList[key].warehouseName =
|
|
|
- // house.warehouseName;
|
|
|
- // this.infoData.outInDetailAddPOList[key].areaName = house.areaName;
|
|
|
- // this.infoData.outInDetailAddPOList[key].shelfCode = house.shelfCode;
|
|
|
- // this.infoData.outInDetailAddPOList[key].cargoSpaceCode =
|
|
|
- // house.cargoSpaceCode;
|
|
|
- // this.infoData.outInDetailAddPOList[key].warehouseId = house.warehouseId;
|
|
|
- // this.infoData.outInDetailAddPOList[key].areaId = house.areaId;
|
|
|
- // this.infoData.outInDetailAddPOList[key].shelfId = house.shelfId;
|
|
|
- // this.infoData.outInDetailAddPOList[key].cargoSpaceId = house.cargoSpaceId;
|
|
|
- // this.infoData.outInDetailAddPOList[key].num = house.num;
|
|
|
+ this.$set(this.infoData.outInDetailAddPOList[idx], 'houseList', argum);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.showTable = true;
|
|
|
+ // 添加货位字段
|
|
|
+ for (let key in this.infoData.outInDetailAddPOList) {
|
|
|
+ for (let k in this.infoData.outInDetailAddPOList[key].houseList) {
|
|
|
+ let house = this.infoData.outInDetailAddPOList[key].houseList[k];
|
|
|
+ (this.infoData.outInDetailAddPOList[
|
|
|
+ key
|
|
|
+ ].pathName = `${house.warehouseName},${house.areaName},${house.shelfCode},${house.cargoSpaceCode}`),
|
|
|
+ (this.infoData.outInDetailAddPOList[
|
|
|
+ key
|
|
|
+ ].pathIds = `${house.warehouseId},${house.areaId},${house.shelfId},${house.cargoSpaceId}`);
|
|
|
+ this.infoData.outInDetailAddPOList[key].num = 1; // 有问题
|
|
|
+ // this.infoData.outInDetailAddPOList[key].warehouseName =
|
|
|
+ // house.warehouseName;
|
|
|
+ // this.infoData.outInDetailAddPOList[key].areaName = house.areaName;
|
|
|
+ // this.infoData.outInDetailAddPOList[key].shelfCode = house.shelfCode;
|
|
|
+ // this.infoData.outInDetailAddPOList[key].cargoSpaceCode =
|
|
|
+ // house.cargoSpaceCode;
|
|
|
+ // this.infoData.outInDetailAddPOList[key].warehouseId = house.warehouseId;
|
|
|
+ // this.infoData.outInDetailAddPOList[key].areaId = house.areaId;
|
|
|
+ // this.infoData.outInDetailAddPOList[key].shelfId = house.shelfId;
|
|
|
+ // this.infoData.outInDetailAddPOList[key].cargoSpaceId = house.cargoSpaceId;
|
|
|
+ // this.infoData.outInDetailAddPOList[key].num = house.num;
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- console.log(this.infoData.outInDetailAddPOList)
|
|
|
- })
|
|
|
-
|
|
|
+ console.log(this.infoData.outInDetailAddPOList);
|
|
|
+ });
|
|
|
},
|
|
|
- // 仓库编辑
|
|
|
+ // 仓库编辑
|
|
|
handleWareHouse(row, idx) {
|
|
|
- this.$refs.wareHouseDailogRef.open(row, idx);
|
|
|
+ this.$refs.wareHouseDailogRef.open(row, idx);
|
|
|
},
|
|
|
// 包装维度修改质检改变物料维度质检(结果和状态)
|
|
|
changeMaterialResult() {
|
|
|
@@ -617,8 +616,8 @@
|
|
|
});
|
|
|
} else {
|
|
|
this.$nextTick(() => {
|
|
|
- this.changeMaterialResult()
|
|
|
- })
|
|
|
+ this.changeMaterialResult();
|
|
|
+ });
|
|
|
}
|
|
|
// 缺少包装明细让步接收物料如何选择结果
|
|
|
},
|
|
|
@@ -626,7 +625,7 @@
|
|
|
calcSumTotal(packingCount, outInNum, univalence) {
|
|
|
//最小包装单元,包装数量,单价
|
|
|
const total = {
|
|
|
- PackingCount: Number(packingCount > 0? packingCount : 0),
|
|
|
+ PackingCount: Number(packingCount > 0 ? packingCount : 0),
|
|
|
outInNum: Number(outInNum > 0 ? outInNum : 0),
|
|
|
univalence: Number(univalence > 0 ? univalence : 0)
|
|
|
};
|
|
|
@@ -636,135 +635,146 @@
|
|
|
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);
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ );
|
|
|
});
|
|
|
});
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
+ );
|
|
|
} else {
|
|
|
- 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;
|
|
|
- }
|
|
|
- }
|
|
|
- );
|
|
|
+ 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 =
|
|
|
+ this.infoData.outInDetailVOList.filter((item) => !!item);
|
|
|
this.infoData.outInDetailVOList.forEach((goodsItem) => {
|
|
|
- goodsItem.outInDetailRecordVOList = goodsItem.outInDetailRecordVOList.filter((wrapItem) => !!wrapItem)
|
|
|
- });
|
|
|
+ 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();
|
|
|
+ wrapItem.outInDetailRecordMaterialDetailVOList =
|
|
|
+ wrapItem.outInDetailRecordMaterialDetailVOList.filter(
|
|
|
+ (metail) => !!metail
|
|
|
+ );
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.initData();
|
|
|
}
|
|
|
// returnHandleNo 有单据来源说明已入库(被驳回状态)
|
|
|
- // getOutInBySourceBizNoOrError(this.returnDetailsForm.returnHandleNo).then((data) => {
|
|
|
+ // 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.infoData = deepClone(data)
|
|
|
+ // // 增加是否已经入库字段
|
|
|
+ // this.infoData.isStorage = true
|
|
|
+ // // 填充遍历数据
|
|
|
+ // if (this.infoData.outInDetailVOList?.length > 0) {
|
|
|
// this.warehousingMaterialList = []; // 物品列表
|
|
|
// this.materialCodeReqList = []; // 包装列表
|
|
|
// this.metaList = []; // 物料列表
|
|
|
@@ -783,97 +793,97 @@
|
|
|
// }).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) {
|
|
|
+ // // 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;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // );
|
|
|
+ // 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();
|
|
|
+ // this.initData();
|
|
|
// })
|
|
|
},
|
|
|
// 初始化显示数据
|
|
|
@@ -886,13 +896,13 @@
|
|
|
this.materialCodeReqList = []; // 包装列表
|
|
|
this.metaList = []; // 物料列表
|
|
|
this.infoData.outInDetailAddPOList.forEach((goodsiItem) => {
|
|
|
- goodsiItem.houseList = []
|
|
|
- goodsiItem.count = goodsiItem.outInDetailRecordVOList.length
|
|
|
+ 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;
|