|
|
@@ -10,25 +10,25 @@
|
|
|
@clickLeft="back"
|
|
|
></uni-nav-bar>
|
|
|
|
|
|
- <view class="list_box">
|
|
|
+ <view class="list_box" v-for="(item, idx) in dataList" :key="idx">
|
|
|
<view class="card_box cx-sc">
|
|
|
<view class="content_table">
|
|
|
<view class="item">
|
|
|
<view class="lable rx-cc" style="color: #157a2c">领料单号</view>
|
|
|
<view class="content rx-bc" style="color: #157a2c">
|
|
|
- {{ dataList.code }}
|
|
|
+ {{ item.code }}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<view class="lable rx-cc" style="color: #157a2c">领料时间</view>
|
|
|
<view class="content rx-bc" style="color: #157a2c">
|
|
|
- {{ dataList.createTime }}
|
|
|
+ {{ item.createTime }}
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<view class="lable rx-cc" style="color: #157a2c">领料人</view>
|
|
|
<view class="content rx-bc" style="color: #157a2c">
|
|
|
- {{ dataList.executorName }}
|
|
|
+ {{ item.executorName }}
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -37,21 +37,21 @@
|
|
|
<view
|
|
|
class="content rx-bc"
|
|
|
style="color: #157a2c"
|
|
|
- v-if="dataList.type == 1"
|
|
|
+ v-if="item.type == 1"
|
|
|
>
|
|
|
自建领料
|
|
|
</view>
|
|
|
<view
|
|
|
class="content rx-bc"
|
|
|
style="color: #157a2c"
|
|
|
- v-if="dataList.type == 2"
|
|
|
+ v-if="item.type == 2"
|
|
|
>
|
|
|
工单领料
|
|
|
</view>
|
|
|
<view
|
|
|
class="content rx-bc"
|
|
|
style="color: #157a2c"
|
|
|
- v-if="dataList.type == 3"
|
|
|
+ v-if="item.type == 3"
|
|
|
>
|
|
|
委外领料
|
|
|
</view>
|
|
|
@@ -60,38 +60,38 @@
|
|
|
</view>
|
|
|
<u-list
|
|
|
@scrolltolower="scrolltolower"
|
|
|
- key="dataList"
|
|
|
+ key="dataList-catch"
|
|
|
v-if="status == 1"
|
|
|
style="padding-bottom: 300rpx"
|
|
|
>
|
|
|
- <view v-if="dataList.type == 2">
|
|
|
+ <view v-if="item.type == 2">
|
|
|
<view
|
|
|
class="card_box cx-sc"
|
|
|
- v-for="(item, index) in dataList.orderInfoList"
|
|
|
+ v-for="(it, index) in orderInfoListSafe(item)"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <instanceBom :item="item" :isDetails="true"></instanceBom>
|
|
|
+ <instanceBom :item="it" :isDetails="true"></instanceBom>
|
|
|
</view>
|
|
|
|
|
|
<u-list-item
|
|
|
- v-if="dataList.orderInfoList.length === 0"
|
|
|
+ v-if="orderInfoListSafe(item).length == 0"
|
|
|
style="margin-top: 20vh"
|
|
|
>
|
|
|
<u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
|
|
|
</u-list-item>
|
|
|
</view>
|
|
|
|
|
|
- <view v-if="dataList.type == 1">
|
|
|
+ <view v-if="item.type == 1">
|
|
|
<view
|
|
|
class="card_box cx-sc"
|
|
|
- v-for="(item, index) in dataList.detailList"
|
|
|
+ v-for="(it, index) in detailListSafe(item)"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <instanceBomTwo :item="item" :isDetails="true"></instanceBomTwo>
|
|
|
+ <instanceBomTwo :item="it" :isDetails="true"></instanceBomTwo>
|
|
|
</view>
|
|
|
|
|
|
<u-list-item
|
|
|
- v-if="dataList.detailList.length === 0"
|
|
|
+ v-if="detailListSafe(item).length == 0"
|
|
|
style="margin-top: 20vh"
|
|
|
>
|
|
|
<u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
|
|
|
@@ -105,34 +105,34 @@
|
|
|
v-if="status == 2"
|
|
|
style="padding-bottom: 300rpx"
|
|
|
>
|
|
|
- <view v-if="dataList.type == 1">
|
|
|
+ <view v-if="item.type == 1">
|
|
|
<view
|
|
|
class="card_box cx-sc"
|
|
|
- v-for="(item, index) in dataList.detailList"
|
|
|
+ v-for="(it, index) in detailListSafe(item)"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <outInstanceBom :item="item" :isDetails="true"></outInstanceBom>
|
|
|
+ <outInstanceBom :item="it" :isDetails="true"></outInstanceBom>
|
|
|
</view>
|
|
|
|
|
|
<u-list-item
|
|
|
- v-if="dataList.detailList.length === 0"
|
|
|
+ v-if="detailListSafe(item).length == 0"
|
|
|
style="margin-top: 20vh"
|
|
|
>
|
|
|
<u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
|
|
|
</u-list-item>
|
|
|
</view>
|
|
|
|
|
|
- <view v-if="dataList.type == 2">
|
|
|
+ <view v-if="item.type == 2">
|
|
|
<view
|
|
|
class="card_box cx-sc"
|
|
|
- v-for="(item, index) in dataList.orderInfoList"
|
|
|
+ v-for="(it, index) in orderInfoListSafe(item)"
|
|
|
:key="index"
|
|
|
>
|
|
|
- <outInstanceBom :item="item" :isDetails="true"></outInstanceBom>
|
|
|
+ <outInstanceBom :item="it" :isDetails="true"></outInstanceBom>
|
|
|
</view>
|
|
|
|
|
|
<u-list-item
|
|
|
- v-if="dataList.orderInfoList.length === 0"
|
|
|
+ v-if="orderInfoListSafe(item).length == 0"
|
|
|
style="margin-top: 20vh"
|
|
|
>
|
|
|
<u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
|
|
|
@@ -177,7 +177,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
ids: [],
|
|
|
- dataList: null,
|
|
|
+ dataList: [],
|
|
|
title: null,
|
|
|
status: 1,
|
|
|
item: null,
|
|
|
@@ -186,9 +186,21 @@ export default {
|
|
|
|
|
|
onLoad(option) {
|
|
|
this.status = option.status || 1;
|
|
|
- this.title =
|
|
|
- option.status == 1 ? "领料详情" : option.status == 2 ? " 出库详情" : "";
|
|
|
- this.dataList = JSON.parse(option.item);
|
|
|
+ console.log(option.id, "optionoptionoption");
|
|
|
+ if (option.item) {
|
|
|
+ this.title =
|
|
|
+ option.status == 1 ? "领料详情" : option.status == 2 ? " 出库详情" : "";
|
|
|
+ const parsed = JSON.parse(option.item);
|
|
|
+
|
|
|
+ this.dataList = Array.isArray(parsed)
|
|
|
+ ? parsed.filter(Boolean)
|
|
|
+ : parsed
|
|
|
+ ? [parsed]
|
|
|
+ : [];
|
|
|
+ } else {
|
|
|
+ this.ids = [option.id];
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
@@ -199,15 +211,30 @@ export default {
|
|
|
const res = await pickDetails(this.ids);
|
|
|
list = res;
|
|
|
|
|
|
+ // list.forEach((m) => {
|
|
|
+ // if (m.orderInfoList.length > 0) {
|
|
|
+ // m.orderInfoList.forEach((o) => {
|
|
|
+ // let _arr = [];
|
|
|
+ // _arr = [...o.bomDetailDTOS, ...o.instanceList];
|
|
|
+ // _arr = _arr.sort(
|
|
|
+ // (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId,
|
|
|
+ // );
|
|
|
+ // o["arr"] = _arr;
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
list.forEach((m) => {
|
|
|
- if (m.orderInfoList.length > 0) {
|
|
|
+ if (Array.isArray(m.orderInfoList) && m.orderInfoList.length > 0) {
|
|
|
m.orderInfoList.forEach((o) => {
|
|
|
let _arr = [];
|
|
|
- _arr = [...o.bomDetailDTOS, ...o.instanceList];
|
|
|
- _arr = _arr.sort(
|
|
|
- (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId
|
|
|
+ _arr = [
|
|
|
+ ...(Array.isArray(o.bomDetailDTOS) ? o.bomDetailDTOS : []),
|
|
|
+ ...(Array.isArray(o.instanceList) ? o.instanceList : []),
|
|
|
+ ];
|
|
|
+ _arr.sort(
|
|
|
+ (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId,
|
|
|
);
|
|
|
- o["arr"] = _arr;
|
|
|
+ o.arr = _arr;
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
@@ -227,6 +254,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ orderInfoListSafe(item) {
|
|
|
+ console.log(item, "itemitemitem");
|
|
|
+ return Array.isArray(item?.orderInfoList) ? item.orderInfoList : [];
|
|
|
+ },
|
|
|
+ detailListSafe(item) {
|
|
|
+ console.log(item, "itemitemitem");
|
|
|
+ return Array.isArray(item?.detailList) ? item.detailList : [];
|
|
|
+ },
|
|
|
+
|
|
|
scrolltolower() {},
|
|
|
|
|
|
tableH(type) {
|