Commit 825128d1 authored by xiaoyan's avatar xiaoyan

feature: 关联单

parent 18f2ad79
......@@ -224,6 +224,13 @@
"enablePullDownRefresh": true
}
},
{
"path": "pages/tally/relatedOrder",
"style": {
"navigationBarTitleText": "关联单",
"enablePullDownRefresh": true
}
},
{
"path": "pages/tallyAir/detail",
"style": {
......
......@@ -37,15 +37,17 @@
</view>
<view :style="{ display: partClass(k) }" class="productsList">
<view class="flex text-center text-black bg-white text-bold padding-sm">
<view class="flex-sub">{{$t('订单号')}}</view>
<view class="flex-sub">{{$t('体积')}}</view>
<view class="flex-sub">{{$t('重量')}}</view>
<view class="flex-sub">{{$t('计划')}}/{{$t('实装')}}</view>
<view class="flex-sub">{{$t('操作')}}</view>
<view style="width:20%;">{{$t('订单号')}}</view>
<view style="width:12%;">{{$t('体积') + "(m³)"}}</view>
<view style="width:12%;">{{$t('重量') + "(kg)"}}</view>
<view style="width:12%;">{{$t('箱数')}}</view>
<view style="width:12%;">{{$t('储位')}}</view>
<view style="width:12%;">{{$t('计划')}}/{{$t('实装')}}</view>
<view style="width:20%;">{{$t('操作')}}</view>
</view>
<view>
<view class="flex text-center padding-sm" :id="'order-' + order.orderNo" :class="'order-' + order.orderNo == heightLightId ? 'bg-yellow' : 'bg-white'" v-for="(order, key) in v.sectionOrderList" :key="key">
<view class="flex-sub text-blue">
<view class="flex-sub text-blue" style="width:20%;">
<view @tap="showOrderDetail(true, order.orderId)">{{ order.orderNo }}</view>
<view style="color:blue;fontWeight:bold;">
{{ order.isExternalWarehouse === 1 ? ('('+$t('外部仓')+')') : ''}}
......@@ -61,16 +63,23 @@
</text>
</view>
<!-- 关联单 -->
<view v-if="order.guanLianOrderStatusVOList&&order.guanLianOrderStatusVOList.length>0" style="color:red;fontWeight:bold;">{{$t('关联单')}}</view>
<view v-if="order.guanLianOrderStatusVOList&&order.guanLianOrderStatusVOList.length>0" style="color:red;fontWeight:bold;" @tap="relatedClick(order.orderId)">{{$t('关联单')}}</view>
<!-- 混箱 -->
<view v-if="order.goodsList&&order.goodsList.length>1" style="color:red;fontWeight:bold;" @tap="showWarehouseLogs(order)">{{$t('混箱')}}</view>
</view>
<view class="flex-sub">{{ order.volume | toFixed }}</view>
<view class="flex-sub">{{ order.weight | toFixed }} kg</view>
<view class="flex-sub" @click="showUnload(true, order.orderId)">
<text>{{ order.num }}</text>/<text :class="actualClass(order.num, order.installNum)">{{ order.installNum }}</text>
<view style="width:12%;">{{ order.volume | toFixed }}</view>
<view style="width:12%;">{{ order.weight | toFixed }}</view>
<view class="text-break" style="width:15%;">
<view class="text-break text-blue" @tap="showGoodsDetail(true, order)">{{ order.num }}</view>
<view style="color:blue;fontWeight:bold;">
{{ order.multiSpecification === true ? ('('+$t('多规格')+')') : ''}}
</view>
<view class="flex-sub flex justify-center">
</view>
<view style="width:12%;">{{ order.positionNo ? order.positionNo.split(',').join(', ') : '' }}</view>
<view style="width:12%;" @click="showUnload(true, order.orderId)">
<text style="width:12%;">{{ order.num }}</text>/<text :class="actualClass(order.num, order.installNum)">{{ order.installNum }}</text>
</view>
<view class="flex justify-center" style="width:20%;">
<view class="text-green text-bold" v-if="order.installNum == 0" @click.stop="moveOut(order)">
{{$t('移出')}}
</view>
......@@ -244,6 +253,59 @@
</view>
</view> -->
<!-- 货物详情弹窗 -->
<view class="cu-modal" :class="goodsModal ? 'show' : ''" style="z-index: 900;">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end bottom-line">
<view class="content title-bolder" style="width:100%;">{{`${$t('货物详情')}-${$t('订单号')}${currRow.orderNo}`}}</view>
</view>
<scroll-view scroll-y="true" style="height: 400px;">
<uni-card v-for="(v, key) in currRow.goodsList" :key="key">
<view class="item-content noPadding">
<view>
<view>{{$t('中文名')}}{{ v.prodTitleZh }}</view>
<view>{{$t('英文名')}}{{ v.prodTitleEn }}</view>
</view>
<view>
<view>{{$t('品牌')}}
{{ v.brandName }}
</view>
<view>
<view class="flex">
{{$t('入仓件数')}}
<view class="text-break text-blue" @tap="showWarehouseLogs(v)">
<view>{{ v.num }}{{ $t('') }}</view>
<view style="color:blue;fontWeight:bold;">
{{ v.multiSpecification === true ? ('('+$t('多规格')+')') : '' }}
</view>
</view>
</view>
</view>
</view>
<view>
<view>{{$t('材质')}}:
<dict-tag :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" :value="v.material" />
</view>
<view>{{$t('体积') + '(m³)'}}{{ v.volume }}</view>
</view>
<view>
<view>{{$t('重量') + '(kg)'}}{{ v.weight }}</view>
<view>{{$t('入仓快递单号')}}{{ JSON.parse(v.warehouseInInfo).expressNo }}</view>
</view>
<view>
<view>{{$t('数量') + '(个)'}}{{ v.quantity }}</view>
<view>{{$t('储位')}}{{v.positionNo || showLocationName(v.orderItemLocationList)}}</view>
</view>
</view>
</uni-card>
</scroll-view>
<view class="cu-bar bg-white justify-end top-line">
<view class="action"><button class="cu-btn bg-grey" @tap="showGoodsDetail(false)">{{$t('关闭')}}</button></view>
</view>
</view>
</view>
<warehouse-list ref="warehouseList" />
<!-- 未装弹窗 -->
......@@ -517,6 +579,10 @@ export default {
isFocus: false,
focusStart: false,
focusError: false,
// 货物详情
goodsModal: false,
// 当前行
currRow: {},
};
},
computed: {
......@@ -548,6 +614,15 @@ export default {
},
},
methods: {
// 从warehouseInInfo中提取储位信息
showLocationName(locationList){
if(!locationList || !locationList.length) return ''
let locations = new Set()
locationList.forEach(item => {
locations.add((item.areaName || '') + (item.locationName || ''))
})
return Array.from(new Set(locations)).join(',')
},
delimage(index) {
this.imageList.splice(index, 1);
},
......@@ -740,6 +815,12 @@ export default {
})
// this.$refs.splitCom.showSplit(show, row);
},
/* 跳转到关联单 */
relatedClick(orderNo) {
uni.navigateTo({
url: `../tally/relatedOrder?orderId=${orderNo}`,
});
},
/* 跳转到补单 */
toPatch() {
const { boxInfo } = this.loadData;
......@@ -804,6 +885,11 @@ export default {
this.orderId = row.orderId;
this.$refs.warehouseList.showDetail(row);
},
// 货物详情
showGoodsDetail(show, row) {
if (show) this.currRow = row;
this.goodsModal = show;
},
/* 显示订单详情 */
showOrderDetail(show, id) {
this.orderDetailModal = show;
......
......@@ -68,24 +68,24 @@
<view class="content">
<text class="text-blue" @tap="showOrderDetail(true, item.orderId)">{{item.orderNo}}</text>
<!-- 调仓 -->
<text v-for="prod in item.orderItemDOS" :key="prod.orderItemId" style="color:blue;fontWeight:bold;margin: 0 3px;">
<text v-if="item.orderItemDOS" v-for="prod in item.orderItemDOS" :key="prod.orderItemId" style="color:blue;fontWeight:bold;margin: 0 3px;">
{{ prod.isExternalWarehouse === 1 ? ('('+$t('外部仓')+')') : ''}}
</text>
<text v-for="prod in item.orderItemDOS" :key="prod.orderItemId" style="color:red;fontWeight:bold;margin: 0 3px;">
<text v-if="item.orderItemDOS" v-for="prod in item.orderItemDOS" :key="prod.orderItemId" style="color:red;fontWeight:bold;margin: 0 3px;">
{{ prod.adjustToDestWarehouseId > 0 ? ('('+$t('调仓')+')') : ''}}
</text>
<!-- 报关方式 -->
<dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="item.customsType" style="color:red;fontWeight:bold;margin: 0 3px;" />
<!-- 包装类型 -->
<text v-for="(prod, index) in item.orderItemDOS" :key="prod.orderItemId" style="color:red;fontWeight:bold;margin: 0 3px;">
<text v-if="item.orderItemDOS" v-for="(prod, index) in item.orderItemDOS" :key="prod.orderItemId" style="color:red;fontWeight:bold;margin: 0 3px;">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="prod.unit" />{{ index!== order.orderItemDOS.length-1 ? ',':'' }}
</text>
<!-- 混箱 -->
<text v-if="item.orderItemDOS&&item.orderItemDOS.orderWarehouseInCreateReqVO&&item.orderItemDOS.orderWarehouseInCreateReqVO.orderWarehouseInItemDoList&&item.orderItemDOS.orderWarehouseInCreateReqVO.orderWarehouseInItemDoList.orderWarehouseInDetailsVOList&&item.orderItemDOS.orderWarehouseInCreateReqVO.orderWarehouseInItemDoList.orderWarehouseInDetailsVOList.length>0" style="color:red;fontWeight:bold;margin: 0 3px;">{{$t('混箱')}}</text>
<text v-if="item.orderItemDOS&&item.orderItemDOS&&item.orderItemDOS.orderWarehouseInCreateReqVO&&item.orderItemDOS.orderWarehouseInCreateReqVO.orderWarehouseInItemDoList&&item.orderItemDOS.orderWarehouseInCreateReqVO.orderWarehouseInItemDoList.orderWarehouseInDetailsVOList&&item.orderItemDOS.orderWarehouseInCreateReqVO.orderWarehouseInItemDoList.orderWarehouseInDetailsVOList.length>0" style="color:red;fontWeight:bold;margin: 0 3px;">{{$t('混箱')}}</text>
<!-- 有牌 -->
<text v-if="item.orderItemDOS.some(ele => [$t('无牌'), $t('有牌'), $t('中性')][ele.brandType] !== $t('无牌'))" style="color:red;fontWeight:bold;margin: 0 3px;">{{ $t('有牌') }}</text>
<text v-if="item.orderItemDOS&&item.orderItemDOS.some(ele => [$t('无牌'), $t('有牌'), $t('中性')][ele.brandType] !== $t('无牌'))" style="color:red;fontWeight:bold;margin: 0 3px;">{{ $t('有牌') }}</text>
<!-- 带电 -->
<text v-if="item.orderItemDOS.some(ele => ele.electrifiedFreightPrice > 0)" style="color:red;fontWeight:bold;margin: 0 3px;">{{ $t('带电') }}</text>
<text v-if="item.orderItemDOS&&item.orderItemDOS.some(ele => ele.electrifiedFreightPrice > 0)" style="color:red;fontWeight:bold;margin: 0 3px;">{{ $t('带电') }}</text>
</view>
</view>
</view>
......@@ -93,7 +93,7 @@
<view>
<view class="label">{{$t('商品信息')}}: </view>
<view class="content">
<div v-for="(prod, index) in item.orderItemDOS" :key="item.orderItemId">
<div v-if="item.orderItemDOS" v-for="(prod, index) in item.orderItemDOS" :key="item.orderItemId">
{{index + 1}}、{{ $l(prod, 'prodTitle') }}
</div>
</view>
......@@ -103,7 +103,7 @@
<view>
<view class="label">{{$t('纸箱尺寸')}}: </view>
<view class="content">
<div v-for="item in item.orderItemDOS.filter(item => !!item.warehouseInInfoVO)" :key="item.orderItemId">
<div v-if="item.orderItemDOS" v-for="item in item.orderItemDOS.filter(item => !!item.warehouseInInfoVO)" :key="item.orderItemId">
{{ item.warehouseInInfoVO.boxGauge }}
</div>
</view>
......@@ -131,7 +131,7 @@
<view>
<view class="label">{{$t('储位')}}: </view>
<view class="content">
<div v-for="item in item.orderItemDOS.filter(item => !!item.warehouseInInfoVO).filter(item => !!item.warehouseInInfoVO)" :key="item.orderItemId">
<div v-if="item.orderItemDOS" v-for="item in item.orderItemDOS.filter(item => !!item.warehouseInInfoVO).filter(item => !!item.warehouseInInfoVO)" :key="item.orderItemId">
{{ notset(getpositionNo(item.warehouseInInfoVO.orderLocationMergeVOSet)) }}
</div>
</view>
......
......@@ -104,3 +104,18 @@ export function quantityRequired(lineId) {
method: 'get'
})
}
/**
* 关联单
*
* @export
* @param {*} data
* @return {*}
*/
export function tallyListGuanlianOrder(data) {
return http('/shipment/box/tallyListGuanlianOrder', data, {
method: 'POST',
loading: true,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
});
}
\ No newline at end of file
......@@ -31,8 +31,8 @@
</view>
<view class="padding-sm" v-for="(order, key) in v.sectionOrderList" :key="key">
<view class="flex text-center">
<view class="text-break text-blue" style="width:20%;" @tap="showOrderDetail(true, order.orderId)">
<view>{{ order.orderNo }}</view>
<view class="text-break text-blue" style="width:20%;">
<view @tap="showOrderDetail(true, order.orderId)">{{ order.orderNo }}</view>
<view style="color:blue;fontWeight:bold;">
{{ order.isExternalWarehouse === 1 ? ('('+$t('外部仓')+')') : ''}}
</view>
......@@ -50,7 +50,7 @@
</text>
</view>
<!-- 关联单 -->
<view v-if="order.guanLianOrderStatusVOList&&order.guanLianOrderStatusVOList.length>0" style="color:red;fontWeight:bold;">{{$t('关联单')}}</view>
<view v-if="order.guanLianOrderStatusVOList&&order.guanLianOrderStatusVOList.length>0" style="color:red;fontWeight:bold;" @tap="relatedClick(order.orderId)">{{$t('关联单')}}</view>
<!-- 混箱 -->
<view v-if="order.goodsList&&order.goodsList.length>1" style="color:red;fontWeight:bold;" @tap="showWarehouseList(order)">{{$t('混箱')}}</view>
</view>
......@@ -523,6 +523,13 @@ export default {
this.getLoadDetail();
});
},
/* 跳转到关联单 */
relatedClick(orderId) {
console.log('跳转到关联单')
uni.navigateTo({
url: `./relatedOrder?orderId=${orderId}`,
});
},
/* 跳转到补单 */
toPatch() {
const { boxInfo } = this.loadData;
......
<template>
<view style="background: #fff; min-height: calc(100vh - 44px)">
<scroll-view scroll-y="true" scroll-with-animation>
<view>
<view class="productsList">
<view class="flex text-center text-black bg-white text-bold padding-sm">
<view style="width:20%;">{{$t('关联单号')}}</view>
<view class="flex-sub">{{$t('体积') + "(m³)"}}</view>
<view class="flex-sub">{{$t("重量") + "(kg)"}}</view>
<view class="flex-sub">{{$t('箱数')}}</view>
<view class="flex-sub">{{$t("储位")}}</view>
<view class="flex-sub">{{$t('自编号')}}</view>
<view class="flex-sub">{{$t('同一个自编号')}}</view>
</view>
<view v-for="(v, index) in orderList" :key="'order-' + index">
<view class="flex text-center padding-sm" v-for="(order, index) in order.orderItemList" :key="'goods-' + index">
<view class="text-break text-blue" style="width:20%;">
<view @tap="showOrderDetail(true, order.orderId)">{{ order.orderNo }}</view>
<view style="color:blue;fontWeight:bold;">
{{ order.isExternalWarehouse === 1 ? ('('+$t('外部仓')+')') : ''}}
</view>
<view style="color:sandybrown;fontWeight:bold;">
{{ order.adjustToDestWarehouseId > 0 ? ('('+$t('调仓')+')') : ''}}
</view>
<!-- 报关方式 -->
<view v-if="order.customsType !== 1">
<dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="order.customsType" style="color:red;fontWeight:bold;" />
</view>
<!-- 包装类型 -->
<view style="color:red;fontWeight:bold;">
<text v-for="(prod, index) in order.goodsList" :key="prod.orderItemId">
<dict-tag :type="DICT_TYPE.ECW_PACKAGING_TYPE" :value="prod.unit" />{{ index!== order.goodsList.length-1 ? ',':'' }}
</text>
</view>
<!-- 关联单 -->
<view v-if="v.hasRelationOrder" style="color:red;fontWeight:bold;" @tap="relatedClick(order.orderNo)">{{$t('关联单')}}</view>
<!-- 混箱 -->
<view v-if="order.mixStatus === 1" style="color:red;fontWeight:bold;" @tap="showWarehouseList(order)">{{$t('混箱')}}</view>
</view>
<view class="flex-sub">{{ order.volume | toFixed }}</view>
<view class="flex-sub">{{ order.weight | toFixed }}</view>
<view class="flex-sub">
<view class="text-break text-blue" @tap="showGoodsDetail(true, order)">{{ order.num }}</view>
<view style="color:blue;fontWeight:bold;">
{{ order.multiSpecification === true ? ('('+$t('多规格')+')') : ''}}
</view>
</view>
<view class="flex-sub">{{ v.positionNo ? v.positionNo.split(',').join(', ') : '' }}</view>
</view>
</view>
</view>
</view>
</scroll-view>
<!-- 订单详情弹窗 -->
<OrderDetailModal :orderDetailModal="orderDetailModal" :orderDetail="orderDetail" @close="showOrderDetail"></OrderDetailModal>
<!-- 货物详情弹窗 -->
<view class="cu-modal" :class="goodsModal ? 'show' : ''" style="z-index: 900;">
<view class="cu-dialog">
<view class="cu-bar bg-white justify-end bottom-line">
<view class="content title-bolder" style="width:100%;">{{`${$t('货物详情')}-${$t('订单号')}${currRow.orderNo}`}}</view>
</view>
<scroll-view scroll-y="true" style="height: 400px;">
<uni-card v-for="(v, key) in currRow.goodsList" :key="key">
<view class="item-content noPadding">
<view>
<view>{{$t('中文名')}}{{ v.prodTitleZh }}</view>
<view>{{$t('英文名')}}{{ v.prodTitleEn }}</view>
</view>
<view>
<view>{{$t('品牌')}}
{{ v.brandName }}
</view>
<view>
<view class="flex">
{{$t('入仓件数')}}
<view class="text-break text-blue" @tap="showWarehouseLogs(v)">
<view>{{ v.num }}{{ $t('') }}</view>
<view style="color:blue;fontWeight:bold;">
{{ v.multiSpecification === true ? ('('+$t('多规格')+')') : '' }}
</view>
</view>
</view>
</view>
</view>
<view>
<view>{{$t('材质')}}:
<dict-tag :type="DICT_TYPE.ECW_PRODUCT_MATERIAL" :value="v.material" />
</view>
<view>{{$t('体积')}}{{ v.volume }}m³</view>
</view>
<view>
<view>{{$t('重量')}}{{ v.weight }}kg</view>
<view>{{$t('入仓快递单号')}}{{ JSON.parse(v.warehouseInInfo).expressNo }}</view>
</view>
<view>
<view>{{$t('数量') + '(个)'}}{{ v.num }}</view>
<view>{{$t('储位')}}{{v.positionNo || showLocationName(v.orderItemLocationList)}}</view>
</view>
</view>
</uni-card>
</scroll-view>
<view class="cu-bar bg-white justify-end top-line">
<view class="action"><button class="cu-btn bg-grey" @tap="showGoodsDetail(false)">{{$t('关闭')}}</button></view>
</view>
</view>
</view>
<warehouse-detail ref="warehouseDetail" :orderId="orderId" :orderItemId="showWarehouseInItemId" />
<warehouse-list ref="warehouseList" />
</view>
</template>
<script>
import { getOrder, getOrderWarehouseIn, tallyListGuanlianOrder } from "./api";
import WarehouseDetail from "./warehouseDetail.vue";
import WarehouseList from "@/pages/tally/warehouseList.vue";
import OrderDetailModal from "@/components/order-detail-modal/index.vue"
export default {
name: "related-order",
components: { WarehouseDetail,OrderDetailModal, WarehouseList },
data() {
return {
/* 订单详情 */
orderDetailModal: false,
orderDetail: {},
orderList: null,
locale: this.$lang.locale,
// 货物详情
goodsModal: false,
// 当前行
currRow: {},
// 入仓记录
showWarehouseInItemId: null,
orderId: null,
warehouseList: null,
};
},
methods: {
// 从warehouseInInfo中提取储位信息
showLocationName(locationList){
if(!locationList || !locationList.length) return ''
let locations = new Set()
locationList.forEach(item => {
locations.add((item.areaName || '') + (item.locationName || ''))
})
return Array.from(new Set(locations)).join(',')
},
getOrderWarehouseIn() {
getOrderWarehouseIn(this.orderDetail.orderId).then((res) => {
this.warehouseList = res;
});
},
},
// 货物详情
showGoodsDetail(show, row) {
if (show) this.currRow = row;
this.goodsModal = show;
},
/* 显示订单详情 */
showOrderDetail(show, id) {
this.orderDetailModal = show;
if (show) {
this.getOrderDetail(id);
}
},
/* 读取订单详情 */
getOrderDetail(id) {
return new Promise((resolve, reject) => {
getOrderDetail(id).then((data) => {
//订单信息
this.orderDetail = data;
listByOrderId({ orderId: id }).then((data) => {
let positionNos = data.map((item) => {
return `${item.warehouseName}${item.areaName}${item.locationName || ''}`;
});
this.$set(this.orderDetail, "positionNo", positionNos.join(","));
});
});
});
},
onLoad: function (option) {
uni.setNavigationBarTitle({
title: this.$t("关联单"),
});
if ("orderId" in option) {
tallyListGuanlianOrder({orderId : option.orderId}).then((res) => {
this.orderList = res;
});
}
},
};
</script>
<style lang="scss" scoped>
.scroll {
margin-top: -8px;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
padding: 8px;
background: #fff;
::v-deep .uni-card {
margin: 12px 0 0 !important;
padding: 0 !important;
}
.img-wrap {
width: calc(100% - 68px);
::v-deep .uni-grid-item {
background: #fbf8fb;
}
.grid-item-box-add {
height: 100%;
display: flex;
flex-flow: column;
font-size: 10px;
padding: 16px 0;
text-align: center;
justify-content: center;
}
}
}
.cu-dialog {
background-color: #fff;
.content {
&.title-bolder {
color: #333333;
font-weight: bolder;
}
}
.item-content {
text-align: left;
padding: 10px 20px 0px 20px;
&.noPadding {
padding: 0;
}
> view {
display: flex;
padding: 4px 0;
> view {
flex: 1;
word-break: break-all;
padding-left: 4px;
}
}
.flex{
display: flex;
align-items: center;
justify-content: space-between;
.left{
flex: 1;
}
}
.btn{
background-color: rgb(47, 77, 174);
color: #fff;
border-radius: 5rpx;
padding: 5rpx 10rpx;
margin-left: 10px;
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment