shippingDetail.vue 7.09 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)}}
huhaiqing's avatar
huhaiqing committed
11
      </el-descriptions-item> -->
12
      <el-descriptions-item :label="$t('柜型')">
13 14 15 16 17
        {{cabinetLabel}}
      </el-descriptions-item>
      <el-descriptions-item label="体积/重量">
        {{getVolumeWeight(loadDetail.totalStatistics)}}
      </el-descriptions-item>
18
      <el-descriptions-item :label="$t('货柜状态')">
19
        {{boxBackVO.shipmentStatusText}}
20 21 22 23
      </el-descriptions-item>
    </el-descriptions>

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

huhaiqing's avatar
huhaiqing committed
27
    <div v-if="approvalInfo.applyReason">
28
      <h1>{{$t('申请原因')}}</h1>
29
      <div>
huhaiqing's avatar
huhaiqing committed
30
        {{approvalInfo.applyReason}}
31
      </div>
huhaiqing's avatar
huhaiqing committed
32
    </div>
33 34 35

    <el-dialog :title="dialogConfig.title" :visible.sync="dialogConfig.visible" fullscreen :modal-append-to-body=false append-to-body>
      <el-descriptions :column="6" border>
36 37
        <el-descriptions-item :label="$t('自编号')">{{boxBackVO.selfNo}}</el-descriptions-item>
        <el-descriptions-item :label="$t('运输方式')">
38 39
          <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="boxBackVO.transportType" />
        </el-descriptions-item>
40
        <!-- <el-descriptions-item :label="$t('出货渠道')">
41
          {{getShipChannelName(boxBackVO.shippingChannelId)}}
huhaiqing's avatar
huhaiqing committed
42
        </el-descriptions-item> -->
43
        <el-descriptions-item :label="$t('柜型')">
44 45
          {{cabinetLabel}}
        </el-descriptions-item>
46
        <el-descriptions-item :label="$t('体积') + '/' + $t('重量')">
47 48
          {{getVolumeWeight(loadDetail.totalStatistics)}}
        </el-descriptions-item>
49
        <el-descriptions-item :label="$t('货柜状态')">
50
          {{boxBackVO.shipmentStatusText}}
51 52 53 54 55
        </el-descriptions-item>
      </el-descriptions>

      <el-row style="marginTop:15px">
        <el-table :data="loadDetail.sectionOrderList" border>
56 57
          <el-table-column prop="sectionName" :label="$t('部分')" align="center"></el-table-column>
          <el-table-column prop="orderNo" :label="$t('订单号')" align="center">
58 59 60 61
            <template v-slot="{row}">
              <el-button type="text" @click="jumpOrderDetail(row)">{{row.orderNo}}</el-button>
            </template>
          </el-table-column>
62
          <el-table-column :label="$t('货物信息')" align="center" width="500px">
63
            <template v-slot="{row}">
huhaiqing's avatar
huhaiqing committed
64 65
              <section>
                <div v-for="(item, index) in row.goodsList" :key="index">
66 67
                  <div>{{index+1}}{{item.prodTitleZh}}</div>
                  <div>{{index+1}}{{item.prodTitleEn}}</div>
68 69 70 71
                </div>
              </section>
            </template>
          </el-table-column>
72
          <el-table-column :label="$t('入仓货物属性')" align="center">
73
            <template v-slot="{row}">
huhaiqing's avatar
huhaiqing committed
74
              <section>
75
                <div>{{$t('合计')}}{{calcSum(row.goodsList)}}{{$t('')}}</div>
huhaiqing's avatar
huhaiqing committed
76
                <div v-for="(item, index) in row.goodsList" :key="index">
huhaiqing's avatar
huhaiqing committed
77
                  {{getTotlContent(item,['volume','weight'])}}
78 79 80 81
                </div>
              </section>
            </template>
          </el-table-column>
82
          <el-table-column prop="installNum" :label="$t('实装箱数')" align="center"></el-table-column>
83
          <el-table-column prop="volume" label="体积m³" align="center"></el-table-column>
84 85
          <el-table-column prop="weight" :label="$t('重量')" align="center"></el-table-column>
          <el-table-column prop="unloadNum" :label="$t('卸柜箱数')" align="center" v-if="isShowColumn(boxBackVO)"></el-table-column>
86 87 88 89 90 91 92 93
        </el-table>
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
import { approvalDetail } from "@/api/ecw/box";
huhaiqing's avatar
huhaiqing committed
94 95 96 97 98
import {
  getSeaStatus,
  getStatusName,
  getTotlContent,
} from "./shippingSea/utils";
99 100
import { getCabinetPage } from "@/api/ecw/cabinet";
import { getChannelList } from "@/api/ecw/channel";
101
import Decimal from "decimal.js";
102 103 104 105 106 107 108 109 110 111 112 113 114

/**
 * 出货审核详情
 */
export default {
  name: "shippingDetail",
  props: {
    processId: {
      type: [Number, String],
    },
  },
  data() {
    return {
huhaiqing's avatar
huhaiqing committed
115
      approvalInfo: {},
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
      boxBackVO: {},
      loadDetail: {},
      // 柜型
      cabinetLabel: "",
      //渠道
      channelList: [],
      // 弹出配置
      dialogConfig: {
        title: "",
        visible: false,
      },
    };
  },
  created() {
    getChannelList().then((res) => (this.channelList = res.data));
  },
  methods: {
huhaiqing's avatar
huhaiqing committed
133
    getTotlContent,
134 135 136
    /* 获取详情 */
    getApprovalDetail(processId) {
      approvalDetail({ approvalId: processId }).then((res) => {
huhaiqing's avatar
huhaiqing committed
137
        this.approvalInfo = res.data.approvalInfo;
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
        this.boxBackVO = res.data.boxBackVO;
        this.loadDetail = res.data.loadDetail;
      });
    },
    /* 获取柜型 */
    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
156 157 158
      this.$set(
        this.dialogConfig,
        "title",
159
        `${this.boxBackVO.selfNo} ` + this.$t('订单列表')
huhaiqing's avatar
huhaiqing committed
160
      );
161 162 163 164 165 166
      this.$set(this.dialogConfig, "visible", true);
    },
    /* 合计 */
    calcSum(goodsList) {
      let sum = 0;
      goodsList.forEach((element) => {
167
        sum = Decimal.add(sum, element.num).toNumber();
168 169 170 171 172
      });
      return sum;
    },
    /* 跳转订单详情 */
    jumpOrderDetail(row) {
173
      this.$router.push("/order/detail?orderId=" + row.orderId);
174 175 176
    },
  },
  watch: {
huhaiqing's avatar
huhaiqing committed
177 178 179 180 181
    processId: {
      immediate: true,
      handler(val) {
        this.getApprovalDetail(val);
      },
182 183 184 185 186 187 188 189 190 191 192 193
    },
    boxBackVO(val) {
      // 柜型
      this.getCabinetLabel(val.cabinetId);
    },
  },
  computed: {
    /* 渠道 */
    getShipChannelName() {
      return (shippingChannelId) => {
        for (const channelItem of this.channelList) {
          if (channelItem.channelId == shippingChannelId) {
194
            return this.$l(channelItem, 'name');
195 196 197 198 199 200 201 202 203 204 205 206 207
          }
        }
      };
    },
    /* 货柜状态 */
    getCabinetStatus() {
      return (shippingVO) => {
        return getStatusName(getSeaStatus(shippingVO));
      };
    },
    /* 体积重量 */
    getVolumeWeight() {
      return (total) => {
huhaiqing's avatar
huhaiqing committed
208
        return this.getTotlContent(total);
209 210 211 212 213
      };
    },
    /* 是否显示卸柜箱数 */
    isShowColumn() {
      return (shippingVO) => {
huhaiqing's avatar
huhaiqing committed
214
        return getSeaStatus(shippingVO) >= 182 ? true : false;
215 216 217 218 219 220 221 222
      };
    },
  },
};
</script>

<style lang="scss" scoped>
</style>