batchMakeUpDetail.vue 6.36 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
<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('柜型')">
        {{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 v-if="approvalInfo.applyReason">
      <h1>{{$t('申请原因')}}</h1>
      <div>
        {{approvalInfo.applyReason}}
      </div>
    </div>

    <el-table :data="loadDetail.sectionOrderList" border class="mt-10">
      <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">
39
              <div>{{index+1}}{{$l(item, 'prodTitle')}}</div>
40 41 42 43 44
            </div>
          </section>
        </template>
      </el-table-column>
      <el-table-column :label="$t('收费箱数')" align="center" prop="num"></el-table-column>
45
      <el-table-column :label="$t('收费体积')" align="center" prop="chargeVolume"></el-table-column>
46
      <el-table-column :label="$t('收费重量')" align="center" prop="chargeWeight"></el-table-column>
47 48 49 50 51 52 53 54
      <el-table-column :label="$t('加价金额')" align="center">
        <template slot-scope="{row}" v-if="details">
          <div>
            {{$t('运费')}}{{details.freightFee || 0}}{{ currencyMap[details.freightCurrencyId]}}/{{unitMap[details.freightUnitId]}}
          </div>
          <div>
            {{$t('清关费')}}{{details.clearanceFee || 0}}{{ currencyMap[details.clearanceCurrencyId]}}/{{unitMap[details.clearanceUnitId]}}
          </div>
55 56 57 58 59 60 61 62 63 64 65 66 67
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { approvalDetail } 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 Template from "@/views/cms/template/index.vue";
68 69
import {getUnitList} from "@/api/ecw/unit";
import {getCurrencyList} from "@/api/ecw/currency";
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84

/**
 * 批量加价审核详情
 */
export default {
  name: "BatchMakeUpDetail",
  components: {Template},
  props: {
    processId: {
      type: [Number, String],
    },
    type: String,
  },
  data() {
    return {
85 86
      unitList:[],
      currencyList:[],
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
      approvalInfo: {},
      boxBackVO: {},
      loadDetail: {},
      // 柜型
      cabinetLabel: "",
      //渠道
      channelList: [],
      // 弹出配置
      dialogConfig: {
        title: "",
        visible: false,
      },
      srcStrs: [],
    };
  },
  created() {
103 104
    getUnitList().then(res => this.unitList = res.data)
    getCurrencyList().then(res => this.currencyList = res.data)
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
    getChannelList().then((res) => (this.channelList = res.data));
  },
  methods: {
    getTotlContent,
    /* 获取详情 */
    getApprovalDetail(processId) {
      approvalDetail({ approvalId: processId }).then((res) => {
        this.approvalInfo = res.data.approvalInfo;
        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;
          }
        }
      });
    },
    /* 合计 */
    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: {
    /* 渠道 */
    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;
      };
    },
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
    details(){
      if(!this.approvalInfo) return null
      return JSON.parse(this.approvalInfo?.details)
    },
    currencyMap(){
      let map = {}
      this.currencyList.forEach(item => {
        map[item.id] = this.$l(item, 'title')
      })
      return map
    },
    unitMap(){
      let map = {}
      this.unitList.forEach(item => {
        map[item.id] = this.$l(item, 'title')
      })
      return map
    },
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
  },
};
</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>