SpecialDetail.vue 7.63 KB
Newer Older
dragondean@qq.com's avatar
dragondean@qq.com committed
1
<template>
dragondean@qq.com's avatar
dragondean@qq.com committed
2
  <el-descriptions border :column="3" v-if="offer">
3 4
    <el-descriptions-item :label="$t('报价单号')">{{offer.number}}</el-descriptions-item>
    <el-descriptions-item :label="$t('运输方式')">
dragondean@qq.com's avatar
dragondean@qq.com committed
5 6
        <dict-tag :type="DICT_TYPE.TRANSPORT_TYPE" :value="offer.transportId" />
    </el-descriptions-item>
7
    <el-descriptions-item :label="$t('出货方式')">
dragondean@qq.com's avatar
dragondean@qq.com committed
8 9
        {{ channel ? $l(channel, 'name') : '/' }}
    </el-descriptions-item>
10
    <el-descriptions-item :label="$t('报价单状态')">
dragondean@qq.com's avatar
dragondean@qq.com committed
11 12
        <dict-tag :type="DICT_TYPE.ECW_OFFER_STATUS" :value="offer.status" />
    </el-descriptions-item>
13 14 15 16
    <el-descriptions-item :label="$t('唛头')">{{offer.marks}}</el-descriptions-item>
    <el-descriptions-item :label="$t('始发仓')">{{form.departureName}}</el-descriptions-item>
    <el-descriptions-item :label="$t('目的仓')">{{form.objectiveName}}</el-descriptions-item>
    <el-descriptions-item :label="$t('申请原因')" :span="3" v-if="type == 2">
dragondean@qq.com's avatar
dragondean@qq.com committed
17
      <div class="item">
18
        {{$t('商品')}}{{$l(form, 'prodTitle')}}
dragondean@qq.com's avatar
dragondean@qq.com committed
19 20
      </div>
      <div class="item">
21
        {{$t('佣金规则')}}{{$t('从【{oldType}】改为【{newType}', {
22
          oldType: getDictDataLabel(DICT_TYPE.COMMISSION_TYPE, form.orgCommissionType) ,
dragondean@qq.com's avatar
dragondean@qq.com committed
23 24 25
          newType: getDictDataLabel(DICT_TYPE.COMMISSION_TYPE, form.commissionType),
        })}}
      </div>
26 27 28 29
      <!---
        http://zentao.jdshangmen.com/bug-view-1632.html
        1.原运费改成原销售价,新运费改成新销售价,新增一个实际返佣金额
        --->
dragondean@qq.com's avatar
dragondean@qq.com committed
30
      <div>
31
        {{form.charging ? $t('原全包价') : $t('原销售价')}}{{form.orgSeaFreight}}{{currencyMap[form.seaFreightCurrency]}} / {{unitMap[form.seaFreightVolume]}}
dragondean@qq.com's avatar
dragondean@qq.com committed
32 33
      </div>
      <div>
34
        {{form.charging ? $t('新全包价') : $t('新销售价')}}{{salePrice}}{{currencyMap[form.seaFreightCurrency]}} / {{unitMap[form.seaFreightVolume]}}
dragondean@qq.com's avatar
dragondean@qq.com committed
35 36
      </div>
      <div>
37
        {{$t('成本价')}}{{costPrice}}{{currencyMap[form.seaFreightCurrency]}} / {{unitMap[form.seaFreightVolume]}}
dragondean@qq.com's avatar
dragondean@qq.com committed
38 39
      </div>
      <div>
40
        {{$t('明佣')}}{{ form.lightCommissionAmount}}{{currencyMap[form.seaFreightCurrency]}} / {{unitMap[form.seaFreightVolume]}}
dragondean@qq.com's avatar
dragondean@qq.com committed
41 42
      </div>
      <div>
43
        {{$t('暗佣')}}{{form.shadeCommissionAmount }}{{currencyMap[form.seaFreightCurrency]}} / {{unitMap[form.seaFreightVolume]}}
dragondean@qq.com's avatar
dragondean@qq.com committed
44 45
      </div>
    </el-descriptions-item>
46

Marcus's avatar
Marcus committed
47
    <el-descriptions-item :label="$t('申请原因')" :span="3" v-if="type == 1">
dragondean@qq.com's avatar
dragondean@qq.com committed
48
      <div class="item">
49
        {{$t('商品')}}{{$l(form, 'prodTitle')}}
dragondean@qq.com's avatar
dragondean@qq.com committed
50
      </div>
51 52 53
      <template v-if="form.charging"> 
        {{$t('原全包价')}}{{form.orgSeaFreight}} {{currencyMap[form.seaFreightCurrency]}} / {{unitMap[form.seaFreightVolume]}}, 
        {{$t('新全包价')}}{{form.seaFreight}} {{currencyMap[form.seaFreightCurrency]}} / {{unitMap[form.seaFreightVolume]}}
54 55 56
      </template>
      <template v-else>
        <div>
57
          {{$t('原销售价')}}{{form.orgSeaFreight}} {{ currencyMap[form.seaFreightCurrency]}} /{{unitMap[form.seaFreightVolume]}}
58
          {{$t('原清关费')}}{{form.orgClearanceFreight}} {{currencyMap[form.clearanceFreightCurrency]}} / {{unitMap[form.clearanceFreightVolume]}}
59 60
        </div>
        <div>
61
          {{$t('新销售价')}}{{form.seaFreight}} {{currencyMap[form.seaFreightCurrency]}} / {{unitMap[form.seaFreightVolume]}}
62
          {{$t('新清关费')}}{{form.clearanceFreight}} {{currencyMap[form.clearanceFreightCurrency]}} / {{unitMap[form.clearanceFreightVolume]}}
63 64
        </div>
      </template>
dragondean@qq.com's avatar
dragondean@qq.com committed
65 66 67
    </el-descriptions-item>
    <!-- 
    
Marcus's avatar
Marcus committed
68 69 70 71
    <el-descriptions-item :label="$t('商品类型')">{{ $l(productType, 'title') }}</el-descriptions-item>
    <el-descriptions-item :label="$t('商品名称')">{{ form.prodTitleZh }}</el-descriptions-item>
    <el-descriptions-item :label="$t('英文名称')">{{ form.prodTitleEn }}</el-descriptions-item>
    <el-descriptions-item :label="$t('线路')">{{ $t('') }}<dict-tag :type="DICT_TYPE.TRANSPORT_TYPE" :value="form.transportId" />{{ $t('') }}<template v-if="channel">
dragondean@qq.com's avatar
dragondean@qq.com committed
72 73 74 75
        {{ $l(channel, 'name') }}
        
      </template>
      {{$t("从【{start}】发往【{dest}", { start: form.departureName, dest: form.objectiveName })}}
dragondean@qq.com's avatar
dragondean@qq.com committed
76
    </el-descriptions-item>
Marcus's avatar
Marcus committed
77
    <el-descriptions-item :label="$t('是否预付')">
dragondean@qq.com's avatar
dragondean@qq.com committed
78 79
      <dict-tag :type="DICT_TYPE.ECW_PAY_ADVANCE" :value="form.isPayAdvance" />
    </el-descriptions-item> -->
Marcus's avatar
Marcus committed
80 81 82 83
    <!-- <el-descriptions-item :label="$t('旧运费')">{{ form.orgSeaFreight }} {{ currencyMap[form.orgSeaFreightCurrency] }}/{{ unitMap[form.orgSeaFreightVolume] }}</el-descriptions-item>
    <el-descriptions-item :label="$t('旧清关费')">{{ form.orgClearanceFreight }} {{ currencyMap[form.orgClearanceFreightCurrency] }}/{{ unitMap[form.orgClearanceFreightVolume] }}</el-descriptions-item>
    <el-descriptions-item :label="$t('新运费')">{{ form.seaFreight }} {{ currencyMap[form.seaFreightCurrency] }}/{{ unitMap[form.seaFreightVolume] }}</el-descriptions-item>
    <el-descriptions-item :label="$t('新清关费')">{{ form.clearanceFreight }} {{ currencyMap[form.clearanceFreightCurrency] }}/{{ unitMap[form.clearanceFreightVolume] }}</el-descriptions-item> -->
dragondean@qq.com's avatar
dragondean@qq.com committed
84 85 86 87
  </el-descriptions>
</template>

<script>
dragondean@qq.com's avatar
dragondean@qq.com committed
88
import {getOfferSpecialByApproveId, getOffer} from "@/api/ecw/offer"
dragondean@qq.com's avatar
dragondean@qq.com committed
89
import {getUnitList} from "@/api/ecw/unit"
dragondean@qq.com's avatar
dragondean@qq.com committed
90
import {getChannel} from "@/api/ecw/channel"
dragondean@qq.com's avatar
dragondean@qq.com committed
91
import { getCurrencyList } from '@/api/ecw/currency'
dragondean@qq.com's avatar
dragondean@qq.com committed
92 93
import {getProductType} from '@/api/ecw/productType'
import Decimal from 'decimal.js'
dragondean@qq.com's avatar
dragondean@qq.com committed
94
export default {
dragondean@qq.com's avatar
dragondean@qq.com committed
95
  name: "SpecialDetail",
dragondean@qq.com's avatar
dragondean@qq.com committed
96 97
  props: {
    id: [String, Number],
dragondean@qq.com's avatar
dragondean@qq.com committed
98
    type: Number, // 类型,1特价,2佣金
dragondean@qq.com's avatar
dragondean@qq.com committed
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
  },
  created() {
    // 从流程查看详情
    if(this.id)
      this.getOfferSpecialByApproveId()

    getUnitList().then(res => this.unitList = res.data)
    getCurrencyList().then(res => this.currencyList = res.data)

  },
  data() {
    return {
      unitList:[],
      channelList:[],
      currencyList:[],
dragondean@qq.com's avatar
dragondean@qq.com committed
114 115 116 117
      productType: null,
      channel: null,
      offer: null,
      form:{}
dragondean@qq.com's avatar
dragondean@qq.com committed
118 119 120
    }
  },
  computed: {
121
    currencyMap(){
dragondean@qq.com's avatar
dragondean@qq.com committed
122 123
      let map = {}
      this.currencyList.forEach(item => {
dragondean@qq.com's avatar
dragondean@qq.com committed
124
        map[item.id] = this.$l(item, 'title')
dragondean@qq.com's avatar
dragondean@qq.com committed
125 126 127 128 129 130
      })
      return map
    },
    unitMap(){
      let map = {}
      this.unitList.forEach(item => {
dragondean@qq.com's avatar
dragondean@qq.com committed
131
        map[item.id] = this.$l(item, 'title')
dragondean@qq.com's avatar
dragondean@qq.com committed
132 133
      })
      return map
dragondean@qq.com's avatar
dragondean@qq.com committed
134 135
    },
    // 新运费
dragondean@qq.com's avatar
dragondean@qq.com committed
136
    /* newSeaFreight(){
dragondean@qq.com's avatar
dragondean@qq.com committed
137
      return Decimal(this.form.seaFreight).plus(this.form.shadeCommissionAmount).plus(this.form.lightCommissionAmount)
dragondean@qq.com's avatar
dragondean@qq.com committed
138 139
    }, */
    // 成本价
140
    /* costPrice(){
dragondean@qq.com's avatar
dragondean@qq.com committed
141
      return Decimal(this.form.seaFreight || 0).minus(this.form.lightCommissionAmount || 0).minus(this.form.shadeCommissionAmount || 0)
142
    } */
143 144
    // 最初的运费
    initialPrice(){
145
      return Decimal(this.form.orgSeaFreight || 0)
146 147 148 149 150
        // .minus(this.form.orgShadeCommissionAmount || 0)
        .minus(this.form.orgLightCommissionAmount || 0)
    },
    costPrice(){
      return this.initialPrice.minus(this.form.shadeCommissionAmount || 0)
151 152
    },
    salePrice(){
153
      return this.initialPrice.plus(this.form.lightCommissionAmount || 0)
154
    },
dragondean@qq.com's avatar
dragondean@qq.com committed
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
  },
  methods: {
    getOfferSpecialByApproveId(){
      getOfferSpecialByApproveId(this.id).then(r => {
        this.form = r.data
        getOffer(this.form.offerId).then(res => {
          this.offer = res.data
        })
        if(this.form.productType){
          getProductType(this.form.productType).then(res => {
            this.productType = res.data
          })
        }
        if(this.form.channelId){
          getChannel(this.form.channelId).then(res => {
            this.channel = res.data
          })
        }
      })
dragondean@qq.com's avatar
dragondean@qq.com committed
174
    }
dragondean@qq.com's avatar
dragondean@qq.com committed
175 176
  },
  
dragondean@qq.com's avatar
dragondean@qq.com committed
177
}
dragondean@qq.com's avatar
dragondean@qq.com committed
178
</script>