<template> <div class="app-approvalShipping"> <h1>{{$t('申请信息')}}【{{$t('出货信息')}}】</h1> <el-descriptions :column="6" border> <el-descriptions-item :label="$t('自编号')">{{boxBackVO.selfNo}}</el-descriptions-item> <el-descriptions-item :label="$t('运输方式')"> <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="boxBackVO.transportType" /> </el-descriptions-item> <el-descriptions-item :label="$t('出货渠道')"> {{getShipChannelName(boxBackVO.shippingChannelId)}} </el-descriptions-item> <el-descriptions-item :label="$t('柜型')" v-if="boxBackVO.transportType != 3&&type!='air_warehouse'"> {{cabinetLabel}} </el-descriptions-item> <el-descriptions-item :label="$t('体积/重量')"> {{getVolumeWeight(loadDetail.totalStatistics)}} </el-descriptions-item> <el-descriptions-item :label="$t('货柜状态')"> {{boxBackVO.shipmentStatusText}} </el-descriptions-item> </el-descriptions> <div class="mt-20" v-if="type === 'shipment'"> <el-descriptions :column="1" v-if="boxAirShipmentBackVO" border :label-style="{width: '200px'}"> <el-descriptions-item :label="$t('出货方式')"> {{deliverType}} </el-descriptions-item> <el-descriptions-item :label="$t('送货时间') + '/' + $t('自提时间')"> {{parseTime(boxAirShipmentBackVO.deliverTime)}} </el-descriptions-item> <el-descriptions-item :label="$t('送货地址') + '/' + $t('自提地址')"> {{boxAirShipmentBackVO.deliverAddress}} </el-descriptions-item> <el-descriptions-item :label="$t('车牌')"> {{boxAirShipmentBackVO.licensePlate}} </el-descriptions-item> <el-descriptions-item :label="$t('司机')"> {{boxAirShipmentBackVO.driver}} </el-descriptions-item> <el-descriptions-item :label="$t('司机联系方式')"> {{boxAirShipmentBackVO.driverPhone}} </el-descriptions-item> </el-descriptions> <template v-else>暂无出货审核信息</template> </div> <el-row style="marginTop:15px"> <el-button type="primary" @click="showOrder">{{$t('订单列表')}}</el-button> </el-row> <div v-if="approvalInfo.applyReason"> <h1>{{$t('申请原因')}}</h1> <div> {{approvalInfo.applyReason}} </div> </div> <div v-if="(type === 'unload_container' || type === 'close_container') && srcStrs" style="marginTop:15px"> <h1>{{$t('图片')}}</h1> <!-- <ImagePreview :src="srcStrs" :width="146" :height="146" /> --> <div style="display:flex"> <el-image v-for="(srcStr, i) in srcStrs" :key="i" :src="srcStr" fit="cover" style="width:146px;height:146px;margin-right:10px" :preview-src-list="[srcStr]"> <div slot="error" class="image-slot"> <i class="el-icon-picture-outline"></i> </div> </el-image> </div> </div> <el-dialog :title="dialogConfig.title" :visible.sync="dialogConfig.visible" fullscreen :modal-append-to-body=false append-to-body> <el-descriptions :column="6" border> <el-descriptions-item :label="$t('自编号')">{{boxBackVO.selfNo}}</el-descriptions-item> <el-descriptions-item :label="$t('运输方式')"> <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="boxBackVO.transportType" /> </el-descriptions-item> <!-- <el-descriptions-item :label="$t('出货渠道')"> {{getShipChannelName(boxBackVO.shippingChannelId)}} </el-descriptions-item> --> <el-descriptions-item v-if="type!='air_warehouse'" :label="$t('柜型')"> {{cabinetLabel}} </el-descriptions-item> <el-descriptions-item :label="$t('体积') + '/' + $t('重量')"> {{getVolumeWeight(loadDetail.totalStatistics)}} </el-descriptions-item> <el-descriptions-item :label="$t('货柜状态')"> {{boxBackVO.shipmentStatusText}} </el-descriptions-item> </el-descriptions> <el-row style="marginTop:15px"> <el-table :data="loadDetail.sectionOrderList" border> <el-table-column prop="sectionName" :label="$t('部分')" align="center"></el-table-column> <el-table-column prop="orderNo" :label="$t('订单号')" align="center"> <template v-slot="{row}"> <el-button type="text" @click="jumpOrderDetail(row)">{{row.orderNo}}</el-button> </template> </el-table-column> <el-table-column :label="$t('货物信息')" align="center" width="500px"> <template v-slot="{row}"> <section> <div v-for="(item, index) in row.goodsList" :key="index"> <div>{{index+1}}:{{item.prodTitleZh}}</div> <div>{{index+1}}:{{item.prodTitleEn}}</div> </div> </section> </template> </el-table-column> <el-table-column :label="$t('入仓货物属性')" align="center"> <template v-slot="{row}"> <section> <div>{{$t('合计')}}:{{calcSum(row.goodsList)}}{{$t('箱')}}</div> <div v-for="(item, index) in row.goodsList" :key="index"> {{getTotlContent(item,['volume','weight'])}} </div> </section> </template> </el-table-column> <el-table-column prop="installNum" :label="$t('实装箱数')" align="center"></el-table-column> <el-table-column prop="volume" label="体积m³" align="center"></el-table-column> <el-table-column prop="weight" :label="$t('重量')" align="center"></el-table-column> <el-table-column prop="unloadNum" :label="type=='air_warehouse'?$t('到仓箱数'):$t('卸柜箱数')" align="center" v-if="isShowColumn(boxBackVO)"></el-table-column> </el-table> </el-row> </el-dialog> </div> </template> <script> import {approvalDetail, getbox} from "@/api/ecw/box"; import { getSeaStatus, getTotlContent } from "./shippingSea/utils"; import { getCabinetPage } from "@/api/ecw/cabinet"; import { getChannelList } from "@/api/ecw/channel"; import Decimal from "decimal.js"; import ImagePreview from "@/components/ImagePreview"; import {constantDict} from "@/views/ecw/box/shippingAir/utils"; import {parseTime} from "../../../utils/ruoyi"; /** * 出货审核详情 */ export default { name: "shippingDetail", components: { ImagePreview }, props: { processId: { type: [Number, String], }, type: String, }, data() { return { approvalInfo: {}, boxBackVO: {}, loadDetail: {}, // 柜型 cabinetLabel: "", //渠道 channelList: [], // 弹出配置 dialogConfig: { title: "", visible: false, }, srcStrs: [], // 出货审核详情 boxAirShipmentBackVO: null }; }, created() { getChannelList().then((res) => (this.channelList = res.data)); }, methods: { parseTime, getTotlContent, /* 获取详情 */ getApprovalDetail(processId) { approvalDetail({ approvalId: processId }).then((res) => { this.approvalInfo = res.data.approvalInfo; this.boxBackVO = res.data.boxBackVO; this.loadDetail = res.data.loadDetail; if (this.type === "close_container" && res.data.cabinetVO) { const ldPictures = res.data.cabinetVO.ldPictures ? JSON.parse(res.data.cabinetVO.ldPictures) : []; this.srcStrs = ldPictures.map((item) => item.url); } if (this.type === "unload_container" && res.data.cabinetUnloadVO) { this.srcStrs = res.data.cabinetUnloadVO.ulImgs ? res.data.cabinetUnloadVO.ulImgs.split(",") : []; } // 如果是出货审核则需要调用出货详情获取出货信息 if (this.type === "shipment") { this.getShipmentDetail(); } if (this.type === "deleteExit") { this.getDeleteExit(); } }); }, getShipmentDetail(){ getbox(this.boxBackVO.id).then(res => { this.boxAirShipmentBackVO = res.data.boxAirShipmentBackVO }) }, /* 获取柜型 */ getCabinetLabel(cabinetId) { getCabinetPage(null).then((response) => { const cabinetList = response.data.list; for (const cabinetItem of cabinetList) { if (cabinetItem.id == cabinetId) { this.cabinetLabel = cabinetItem.name; break; } } }); }, /* 打开订单列表 */ showOrder() { this.$set( this.dialogConfig, "title", `${this.boxBackVO.selfNo} ` + this.$t("订单列表") ); this.$set(this.dialogConfig, "visible", true); }, /* 合计 */ calcSum(goodsList) { let sum = 0; goodsList.forEach((element) => { sum = Decimal.add(sum, element.num).toNumber(); }); return sum; }, /* 跳转订单详情 */ jumpOrderDetail(row) { this.$router.push("/order/detail?orderId=" + row.orderId); }, }, watch: { processId: { immediate: true, handler(val) { this.getApprovalDetail(val); }, }, boxBackVO(val) { // 柜型 this.getCabinetLabel(val.cabinetId); }, }, computed: { constantDict() { return constantDict }, /* 渠道 */ getShipChannelName() { return (shippingChannelId) => { for (const channelItem of this.channelList) { if (channelItem.channelId == shippingChannelId) { return this.$l(channelItem, "name"); } } }; }, /* 体积重量 */ getVolumeWeight() { return (total) => { return this.getTotlContent(total); }; }, /* 是否显示卸柜箱数 */ isShowColumn() { return (shippingVO) => { return getSeaStatus(shippingVO) >= 182 ? true : false; }; }, // 出乎方式 deliverType(){ if(!this.boxAirShipmentBackVO) return '' return constantDict.deliverType.find(item => item.value == this.boxAirShipmentBackVO.deliverType)?.label } }, }; </script> <style lang="scss" scoped> .el-image { border-radius: 5px; background-color: #ebeef5; box-shadow: 0 0 5px 1px #ccc; ::v-deep .el-image__inner { transition: all 0.3s; cursor: pointer; &:hover { transform: scale(1.2); } } ::v-deep .image-slot { display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; color: #909399; font-size: 30px; } } </style>