| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409 |
- <template>
- <view class="content-box">
- <uni-nav-bar
- fixed="true"
- statusBar="true"
- left-icon="back"
- :title="title"
- background-color="#157A2C"
- color="#fff"
- @clickLeft="back"
- ></uni-nav-bar>
- <!-- <view class="nav-placeholder"></view> -->
- <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">
- {{ pickOrderCodeSafe(item) }}
- </view>
- </view>
- <view class="item">
- <view class="lable rx-cc" style="color: #157a2c">领料时间</view>
- <view class="content rx-bc" style="color: #157a2c">
- {{ item.createTime }}
- </view>
- </view>
- <view class="item">
- <view class="lable rx-cc" style="color: #157a2c">领料人</view>
- <view class="content rx-bc" style="color: #157a2c">
- {{ item.executorName }}
- </view>
- </view>
- <view class="item">
- <view class="lable rx-cc" style="color: #157a2c">类型</view>
- <view
- class="content rx-bc"
- style="color: #157a2c"
- v-if="item.type == 1"
- >
- 自建领料
- </view>
- <view
- class="content rx-bc"
- style="color: #157a2c"
- v-if="item.type == 2"
- >
- 工单领料
- </view>
- <view
- class="content rx-bc"
- style="color: #157a2c"
- v-if="item.type == 3"
- >
- 委外领料
- </view>
- </view>
- </view>
- </view>
- <u-list
- @scrolltolower="scrolltolower"
- key="dataList-catch"
- v-if="status == 1"
- height="auto"
- style="padding-bottom: 10rpx"
- >
- <view v-if="item.type == 2">
- <view
- class="card_box cx-sc"
- v-for="(it, index) in orderInfoListSafe(item)"
- :key="index"
- >
- <instanceBom :item="it" :isDetails="true"></instanceBom>
- </view>
- <u-list-item
- 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="item.type == 1">
- <view
- class="card_box cx-sc"
- v-for="(it, index) in detailListSafe(item)"
- :key="index"
- >
- <instanceBomTwo :item="it" :isDetails="true"></instanceBomTwo>
- </view>
- <u-list-item
- v-if="detailListSafe(item).length == 0"
- style="margin-top: 20vh"
- >
- <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
- </u-list-item>
- </view>
- </u-list>
- <u-list
- @scrolltolower="scrolltolower"
- key="dataList2"
- v-if="status == 2"
- height="auto"
- style="padding-bottom: 10rpx"
- >
- <view v-if="item.type == 1">
- <view
- class="card_box cx-sc"
- v-for="(it, index) in detailListSafe(item)"
- :key="index"
- >
- <outInstanceBom :item="it" :isDetails="true"></outInstanceBom>
- </view>
- <u-list-item
- 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="item.type == 2">
- <view
- class="card_box cx-sc"
- v-for="(it, index) in orderInfoListSafe(item)"
- :key="index"
- >
- <outInstanceBom :item="it" :isDetails="true"></outInstanceBom>
- </view>
- <u-list-item
- v-if="orderInfoListSafe(item).length == 0"
- style="margin-top: 20vh"
- >
- <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
- </u-list-item>
- </view>
- <!-- <view class="card_box cx-sc">
- <outInstanceBom :list="dataList" :isDetails="true"></outInstanceBom>
- </view>
- <u-list-item v-if="dataList.length === 0" style="margin-top: 20vh">
- <u-empty iconSize="150" textSize="32" text="暂无数据"> </u-empty>
- </u-list-item> -->
- </u-list>
- </view>
- <view class="bottom-wrapper">
- <!-- <view class="btn_box" @click="save">一键报工</view> -->
- </view>
- </view>
- </template>
- <script>
- import { tableHeader } from "../../common.js";
- import { workorderPage } from "@/api/pda/workOrder.js";
- import {
- pickDetails,
- pickOutInOrder,
- queryOutWordDetail,
- } from "@/api/pda/picking.js";
- import instanceBom from "./components/instanceBom.vue";
- import instanceBomTwo from "../../selfBuiltPickOrder/components/instanceBom.vue";
- import outInstanceBom from "./components/outInstanceBom.vue";
- export default {
- components: {
- instanceBom,
- instanceBomTwo,
- outInstanceBom,
- },
- data() {
- return {
- ids: [],
- dataList: [],
- title: "",
- status: 1,
- item: null,
- };
- },
- onLoad(option) {
- this.status = option.status || 1;
- console.log(option.status, "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.title = "领料详情";
- this.ids = [option.id];
- this.getList();
- }
- },
- methods: {
- async getList() {
- let list = [];
- if (this.status == 1) {
- 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 (Array.isArray(m.orderInfoList) && m.orderInfoList.length > 0) {
- m.orderInfoList.forEach((o) => {
- let _arr = [];
- _arr = [
- ...(Array.isArray(o.bomDetailDTOS) ? o.bomDetailDTOS : []),
- ...(Array.isArray(o.instanceList) ? o.instanceList : []),
- ];
- _arr.sort(
- (a, b) => a.rootCategoryLevelId - b.rootCategoryLevelId,
- );
- o.arr = _arr;
- });
- }
- });
- this.dataList = list;
- } else if (this.status == 2) {
- console.log(this.ids.join(","));
- const res = await queryOutWordDetail({
- pickOrderId: this.ids.join(","),
- });
- console.log(res, "11111");
- // const res = await pickOutInOrder({
- // workOrderIds: this.ids,
- // });
- // this.dataList = res;
- }
- },
- 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 : [];
- },
- pickOrderCodeSafe(item) {
- return (
- item?.code ||
- item?.pickCode ||
- item?.pickOrderCode ||
- item?.orderCode ||
- "--"
- );
- },
- scrolltolower() {},
- tableH(type) {
- return tableHeader(type);
- },
- save() {},
- },
- };
- </script>
- <style lang="scss" scoped>
- .content-box {
- min-height: 100vh;
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- }
- .nav-placeholder {
- /* 给 fixed 导航栏预留高度,避免真机上首屏第一行被遮住 */
- height: calc(var(--status-bar-height) + 88rpx);
- flex-shrink: 0;
- }
- .list_box {
- padding: 16rpx 0 0;
- }
- .bottom-wrapper {
- .btn_box {
- width: 750rpx;
- height: 88rpx;
- line-height: 88rpx;
- background: $theme-color;
- text-align: center;
- font-size: 36rpx;
- font-style: normal;
- font-weight: 400;
- color: #fff;
- }
- }
- .card_box {
- margin-top: 10rpx;
- .word_order {
- height: 64rpx;
- width: 706rpx;
- background: $theme-color;
- font-size: 28rpx;
- color: #fff;
- line-height: 64rpx;
- padding-left: 40rpx;
- box-sizing: border-box;
- }
- .content_table {
- margin-top: 10rpx;
- width: 702rpx;
- border: 2rpx solid $border-color;
- .item {
- display: flex;
- border-bottom: 2rpx solid $border-color;
- .lable {
- width: 132rpx;
- text-align: center;
- background-color: #f7f9fa;
- font-size: 26rpx;
- border-right: 2rpx solid $border-color;
- flex-shrink: 0;
- }
- .ww80 {
- width: 80rpx;
- }
- .content {
- width: 518rpx;
- min-height: 64rpx;
- font-size: 28rpx;
- line-height: 28rpx;
- font-style: normal;
- font-weight: 400;
- padding: 18rpx 8rpx;
- box-sizing: border-box;
- word-wrap: break-word;
- flex-grow: 1 !important;
- }
- .content_num {
- display: flex;
- align-items: center;
- padding: 0 4rpx;
- /deep/ .uni-input-input {
- width: 480rpx;
- border: 2rpx solid #f0f8f2;
- background: #f0f8f2;
- color: $theme-color;
- }
- .unit {
- padding: 0 4rpx;
- font-size: 24rpx;
- color: #404446;
- }
- }
- .pd4 {
- padding: 4rpx 8rpx;
- }
- &:last-child {
- border-bottom: none;
- }
- }
- .ww55 {
- width: 55%;
- }
- .ww45 {
- width: 45%;
- }
- }
- }
- </style>
|