shippingDetail.vue 10.5 KB
Newer Older
1 2
<template>
  <div class="app-approvalShipping">
3
    <h1>{{$t('申请信息')}}{{$t('出货信息')}}</h1>
4
    <el-descriptions :column="6" border>
5 6
      <el-descriptions-item :label="$t('自编号')">{{boxBackVO.selfNo}}</el-descriptions-item>
      <el-descriptions-item :label="$t('运输方式')">
7 8
        <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="boxBackVO.transportType" />
      </el-descriptions-item>
9
      <el-descriptions-item :label="$t('出货渠道')">
10
        {{getShipChannelName(boxBackVO.shippingChannelId)}}
11
      </el-descriptions-item>
我在何方's avatar
我在何方 committed
12
      <el-descriptions-item :label="$t('柜型')" v-if="boxBackVO.transportType != 3&&type!='air_warehouse'">
13 14
        {{cabinetLabel}}
      </el-descriptions-item>
huhaiqing's avatar
huhaiqing committed
15
      <el-descriptions-item :label="$t('体积/重量')">
16 17
        {{getVolumeWeight(loadDetail.totalStatistics)}}
      </el-descriptions-item>
18
      <el-descriptions-item :label="$t('货柜状态')">
19
        {{boxBackVO.shipmentStatusText}}
20 21 22
      </el-descriptions-item>
    </el-descriptions>

dragondean@qq.com's avatar
dragondean@qq.com committed
23
    <div class="mt-20" v-if="type === 'shipment'">
24
      <el-descriptions :column="1" v-if="boxAirShipmentBackVO" border :label-style="{width: '200px'}">
dragondean@qq.com's avatar
dragondean@qq.com committed
25 26 27 28
        <el-descriptions-item :label="$t('出货方式')">
          {{deliverType}}
        </el-descriptions-item>
        <el-descriptions-item :label="$t('送货时间') + '/' + $t('自提时间')">
29
          {{parseTime(boxAirShipmentBackVO.deliverTime)}}
dragondean@qq.com's avatar
dragondean@qq.com committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
        </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>

47
    <el-row style="marginTop:15px">
48
      <el-button type="primary" @click="showOrder">{{$t('订单列表')}}</el-button>
49 50
    </el-row>

huhaiqing's avatar
huhaiqing committed
51
    <div v-if="approvalInfo.applyReason">
52
      <h1>{{$t('申请原因')}}</h1>
53
      <div>
huhaiqing's avatar
huhaiqing committed
54
        {{approvalInfo.applyReason}}
55
      </div>
huhaiqing's avatar
huhaiqing committed
56
    </div>
57

huhaiqing's avatar
huhaiqing committed
58
    <div v-if="(type === 'unload_container' || type === 'close_container') && srcStrs" style="marginTop:15px">
huhaiqing's avatar
huhaiqing committed
59
      <h1>{{$t('图片')}}</h1>
huhaiqing's avatar
huhaiqing committed
60 61 62 63 64 65 66 67 68
      <!-- <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>

huhaiqing's avatar
huhaiqing committed
69 70
    </div>

71 72
    <el-dialog :title="dialogConfig.title" :visible.sync="dialogConfig.visible" fullscreen :modal-append-to-body=false append-to-body>
      <el-descriptions :column="6" border>
73 74
        <el-descriptions-item :label="$t('自编号')">{{boxBackVO.selfNo}}</el-descriptions-item>
        <el-descriptions-item :label="$t('运输方式')">
75 76
          <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="boxBackVO.transportType" />
        </el-descriptions-item>
77
        <!-- <el-descriptions-item :label="$t('出货渠道')">
78
          {{getShipChannelName(boxBackVO.shippingChannelId)}}
huhaiqing's avatar
huhaiqing committed
79
        </el-descriptions-item> -->
我在何方's avatar
我在何方 committed
80
        <el-descriptions-item v-if="type!='air_warehouse'" :label="$t('柜型')">
81 82
          {{cabinetLabel}}
        </el-descriptions-item>
83
        <el-descriptions-item :label="$t('体积') + '/' + $t('重量')">
84 85
          {{getVolumeWeight(loadDetail.totalStatistics)}}
        </el-descriptions-item>
86
        <el-descriptions-item :label="$t('货柜状态')">
87
          {{boxBackVO.shipmentStatusText}}
88 89 90 91 92
        </el-descriptions-item>
      </el-descriptions>

      <el-row style="marginTop:15px">
        <el-table :data="loadDetail.sectionOrderList" border>
93 94
          <el-table-column prop="sectionName" :label="$t('部分')" align="center"></el-table-column>
          <el-table-column prop="orderNo" :label="$t('订单号')" align="center">
95 96 97 98
            <template v-slot="{row}">
              <el-button type="text" @click="jumpOrderDetail(row)">{{row.orderNo}}</el-button>
            </template>
          </el-table-column>
99
          <el-table-column :label="$t('货物信息')" align="center" width="500px">
100
            <template v-slot="{row}">
huhaiqing's avatar
huhaiqing committed
101 102
              <section>
                <div v-for="(item, index) in row.goodsList" :key="index">
103 104
                  <div>{{index+1}}{{item.prodTitleZh}}</div>
                  <div>{{index+1}}{{item.prodTitleEn}}</div>
105 106 107 108
                </div>
              </section>
            </template>
          </el-table-column>
109
          <el-table-column :label="$t('入仓货物属性')" align="center">
110
            <template v-slot="{row}">
huhaiqing's avatar
huhaiqing committed
111
              <section>
112
                <div>{{$t('合计')}}{{calcSum(row.goodsList)}}{{$t('')}}</div>
huhaiqing's avatar
huhaiqing committed
113
                <div v-for="(item, index) in row.goodsList" :key="index">
huhaiqing's avatar
huhaiqing committed
114
                  {{getTotlContent(item,['volume','weight'])}}
115 116 117 118
                </div>
              </section>
            </template>
          </el-table-column>
119
          <el-table-column prop="installNum" :label="$t('实装箱数')" align="center"></el-table-column>
120
          <el-table-column prop="volume" label="体积m³" align="center"></el-table-column>
121
          <el-table-column prop="weight" :label="$t('重量')" align="center"></el-table-column>
我在何方's avatar
我在何方 committed
122
          <el-table-column prop="unloadNum" :label="type=='air_warehouse'?$t('到仓箱数'):$t('卸柜箱数')" align="center" v-if="isShowColumn(boxBackVO)"></el-table-column>
123 124 125 126 127 128 129
        </el-table>
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
dragondean@qq.com's avatar
dragondean@qq.com committed
130
import {approvalDetail, getbox} from "@/api/ecw/box";
huhaiqing's avatar
huhaiqing committed
131
import { getSeaStatus, getTotlContent } from "./shippingSea/utils";
132 133
import { getCabinetPage } from "@/api/ecw/cabinet";
import { getChannelList } from "@/api/ecw/channel";
134
import Decimal from "decimal.js";
huhaiqing's avatar
huhaiqing committed
135
import ImagePreview from "@/components/ImagePreview";
dragondean@qq.com's avatar
dragondean@qq.com committed
136
import {constantDict} from "@/views/ecw/box/shippingAir/utils";
137
import {parseTime} from "../../../utils/ruoyi";
138 139 140 141 142 143

/**
 * 出货审核详情
 */
export default {
  name: "shippingDetail",
huhaiqing's avatar
huhaiqing committed
144
  components: { ImagePreview },
145 146 147 148
  props: {
    processId: {
      type: [Number, String],
    },
huhaiqing's avatar
huhaiqing committed
149
    type: String,
150 151 152
  },
  data() {
    return {
huhaiqing's avatar
huhaiqing committed
153
      approvalInfo: {},
huhaiqing's avatar
huhaiqing committed
154
      boxBackVO: {},
155 156 157 158 159 160 161 162 163 164
      loadDetail: {},
      // 柜型
      cabinetLabel: "",
      //渠道
      channelList: [],
      // 弹出配置
      dialogConfig: {
        title: "",
        visible: false,
      },
huhaiqing's avatar
huhaiqing committed
165
      srcStrs: [],
dragondean@qq.com's avatar
dragondean@qq.com committed
166 167
      // 出货审核详情
      boxAirShipmentBackVO: null
168 169 170 171 172 173
    };
  },
  created() {
    getChannelList().then((res) => (this.channelList = res.data));
  },
  methods: {
174
      parseTime,
huhaiqing's avatar
huhaiqing committed
175
    getTotlContent,
176 177 178
    /* 获取详情 */
    getApprovalDetail(processId) {
      approvalDetail({ approvalId: processId }).then((res) => {
huhaiqing's avatar
huhaiqing committed
179
        this.approvalInfo = res.data.approvalInfo;
180 181
        this.boxBackVO = res.data.boxBackVO;
        this.loadDetail = res.data.loadDetail;
huhaiqing's avatar
huhaiqing committed
182 183 184 185
        if (this.type === "close_container" && res.data.cabinetVO) {
          const ldPictures = res.data.cabinetVO.ldPictures
            ? JSON.parse(res.data.cabinetVO.ldPictures)
            : [];
huhaiqing's avatar
huhaiqing committed
186
          this.srcStrs = ldPictures.map((item) => item.url);
huhaiqing's avatar
huhaiqing committed
187 188
        }
        if (this.type === "unload_container" && res.data.cabinetUnloadVO) {
huhaiqing's avatar
huhaiqing committed
189 190 191
          this.srcStrs = res.data.cabinetUnloadVO.ulImgs
            ? res.data.cabinetUnloadVO.ulImgs.split(",")
            : [];
huhaiqing's avatar
huhaiqing committed
192
        }
dragondean@qq.com's avatar
dragondean@qq.com committed
193 194 195 196
        // 如果是出货审核则需要调用出货详情获取出货信息
        if (this.type === "shipment") {
          this.getShipmentDetail();
        }
zhoutong's avatar
zhoutong committed
197 198 199
        if (this.type === "deleteExit") {
          this.getDeleteExit();
        }
200 201
      });
    },
dragondean@qq.com's avatar
dragondean@qq.com committed
202 203 204 205 206
    getShipmentDetail(){
      getbox(this.boxBackVO.id).then(res => {
        this.boxAirShipmentBackVO = res.data.boxAirShipmentBackVO
      })
    },
207 208 209 210 211 212 213 214 215 216 217 218 219 220
    /* 获取柜型 */
    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() {
huhaiqing's avatar
huhaiqing committed
221 222 223
      this.$set(
        this.dialogConfig,
        "title",
huhaiqing's avatar
huhaiqing committed
224
        `${this.boxBackVO.selfNo} ` + this.$t("订单列表")
huhaiqing's avatar
huhaiqing committed
225
      );
226 227 228 229 230 231
      this.$set(this.dialogConfig, "visible", true);
    },
    /* 合计 */
    calcSum(goodsList) {
      let sum = 0;
      goodsList.forEach((element) => {
232
        sum = Decimal.add(sum, element.num).toNumber();
233 234 235 236 237
      });
      return sum;
    },
    /* 跳转订单详情 */
    jumpOrderDetail(row) {
238
      this.$router.push("/order/detail?orderId=" + row.orderId);
239 240 241
    },
  },
  watch: {
huhaiqing's avatar
huhaiqing committed
242 243 244 245 246
    processId: {
      immediate: true,
      handler(val) {
        this.getApprovalDetail(val);
      },
247 248 249 250 251 252 253
    },
    boxBackVO(val) {
      // 柜型
      this.getCabinetLabel(val.cabinetId);
    },
  },
  computed: {
dragondean@qq.com's avatar
dragondean@qq.com committed
254 255 256
    constantDict() {
      return constantDict
    },
257 258 259 260 261
    /* 渠道 */
    getShipChannelName() {
      return (shippingChannelId) => {
        for (const channelItem of this.channelList) {
          if (channelItem.channelId == shippingChannelId) {
huhaiqing's avatar
huhaiqing committed
262
            return this.$l(channelItem, "name");
263 264 265 266 267 268 269
          }
        }
      };
    },
    /* 体积重量 */
    getVolumeWeight() {
      return (total) => {
huhaiqing's avatar
huhaiqing committed
270
        return this.getTotlContent(total);
271 272 273 274 275
      };
    },
    /* 是否显示卸柜箱数 */
    isShowColumn() {
      return (shippingVO) => {
huhaiqing's avatar
huhaiqing committed
276
        return getSeaStatus(shippingVO) >= 182 ? true : false;
277 278
      };
    },
dragondean@qq.com's avatar
dragondean@qq.com committed
279 280 281 282 283
    // 出乎方式
    deliverType(){
      if(!this.boxAirShipmentBackVO) return ''
      return constantDict.deliverType.find(item => item.value == this.boxAirShipmentBackVO.deliverType)?.label
    }
284 285 286 287 288
  },
};
</script>

<style lang="scss" scoped>
huhaiqing's avatar
huhaiqing committed
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
.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;
  }
}
310
</style>