ApprovalDetail.vue 7.67 KB
Newer Older
dragondean@qq.com's avatar
dragondean@qq.com committed
1 2 3 4 5 6 7 8
<!--拆单审核中的申请信息部分-->
<template>
    <div v-if="detail && order">
        <el-descriptions :column="4" v-if="order" :colon="false">
            <el-descriptions-item :label="$t('订单号')">{{order.orderNo}}</el-descriptions-item>
            <el-descriptions-item :label="$t('运输方式')">
                <dict-tag class="mr-10" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="order.transportId" />
            </el-descriptions-item>
houjn@hikoon.cn's avatar
houjn@hikoon.cn committed
9
            <el-descriptions-item :label="$t('出货渠道')">
dragondean@qq.com's avatar
dragondean@qq.com committed
10 11 12 13 14 15 16 17 18 19 20 21
                {{channel ? channel.nameZh : '/'}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('订单状态')">
                {{order.statusMsg}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('唛头')">{{order.marks}}</el-descriptions-item>
            <el-descriptions-item :label="$t('始发仓')">
                {{order.logisticsInfoDto.startTitleZh}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('目的仓')" :span="2">
                {{order.logisticsInfoDto.destAddressZh}}
            </el-descriptions-item>
houjn@hikoon.cn's avatar
houjn@hikoon.cn committed
22

23
            <!-- 优惠申请 -->
24
            <el-descriptions-item :label="$t('申请理由')" v-if="type == 1 || type == 2" :span="4">
25 26
                <div class="bold">
                    <div>
27 28
                        {{detail.charging ? $t('原全包价') : $t('原运费')}}{{detail.orgFreight}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }}
                        {{detail.charging ? $t('新全包价') : $t('新运费')}}{{detail.freight}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }}
29
                    </div>
30
                    <div v-if="!detail.charging">
dragondean@qq.com's avatar
dragondean@qq.com committed
31 32 33 34 35 36
                        {{$t('原清关费')}}{{detail.orgClearanceFreight}} {{ currencyMap[detail.clearanceFreightCurrency] }} / {{ unitMap[detail.clearanceFreightVolume] }}
                        {{$t('新清关费')}}{{detail.clearanceFreight}} {{ currencyMap[detail.clearanceFreightCurrency] }} / {{ unitMap[detail.clearanceFreightVolume] }}
                    </div>
                </div>
            </el-descriptions-item>

37 38 39 40 41 42 43
            <!-- 重泡货 -->
            <el-descriptions-item :label="$t('申请理由')" v-if="type == 4 || type ==5" :span="4">
                <div class="bold" v-if="type == 4">
                    {{$t('重货优惠标准申请为:{new}kg/cbm,原重货标准:{old}kg/cbm', {
                        new: detail.wVolume,
                        old: detail.orgWVolume
                    })}}
44
                </div>
45 46 47 48 49 50 51
                <div class="bold" v-if="type == 5">
                    {{$t('泡货优惠标准申请为:{new}kg/cbm,原泡货标准:{old}kg/cbm', {
                        new: detail.vWeight,
                        old: detail.orgVWeight
                    })}}
                </div>
            </el-descriptions-item>
52

dragondean@qq.com's avatar
dragondean@qq.com committed
53 54 55 56 57 58 59 60
            <!-- 佣金设置 -->
            <el-descriptions-item :label="$t('申请理由')" v-if="type == 3" :span="4">
                <div class="bold">
                    <div class="item">
                        {{$t('商品')}}{{$l(detail, 'prodTitle')}}
                    </div>
                    <div class="item">
                        {{$t('佣金规则')}}{{$t('从【{oldType}】改为【{newType}', {
61
                        oldType: getDictDataLabel(DICT_TYPE.COMMISSION_TYPE, detail.orgCommissionType) ,
dragondean@qq.com's avatar
dragondean@qq.com committed
62 63 64
                        newType: getDictDataLabel(DICT_TYPE.COMMISSION_TYPE, detail.commissionType),
                        })}}
                    </div>
houjn@hikoon.cn's avatar
houjn@hikoon.cn committed
65

dragondean@qq.com's avatar
dragondean@qq.com committed
66 67 68 69
                    <div>
                        {{$t('原运费')}}{{detail.orgFreight}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
                    </div>
                    <div>
70
                        {{$t('新运费')}}{{Decimal(detail.orgFreight || 0).minus(detail.orgLightCommissionAmount || 0).plus(detail.lightCommissionAmount || 0)}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
dragondean@qq.com's avatar
dragondean@qq.com committed
71 72
                    </div>
                    <div>
73
                       {{$t('成本价')}}{{Decimal(detail.orgFreight || 0).minus(detail.orgLightCommissionAmount || 0).minus(detail.shadeCommissionAmount || 0)}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }}
dragondean@qq.com's avatar
dragondean@qq.com committed
74 75 76 77 78 79
                    </div>
                    <div>
                        {{$t('明佣')}}{{ detail.lightCommissionAmount}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
                    </div>
                    <div>
                        {{$t('暗佣')}}{{detail.shadeCommissionAmount }}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
80 81
                    </div>
                </div>
dragondean@qq.com's avatar
dragondean@qq.com committed
82 83 84 85 86 87 88 89
            </el-descriptions-item>
        </el-descriptions>

    </div>
</template>
<script>
import {getOrder, getApproval} from '@/api/ecw/order'
import {getChannel} from '@/api/ecw/channel'
90 91
import {getUnitList} from "@/api/ecw/unit"
import { getCurrencyList } from '@/api/ecw/currency'
dragondean@qq.com's avatar
dragondean@qq.com committed
92
import Decimal from 'decimal.js'
houjn@hikoon.cn's avatar
houjn@hikoon.cn committed
93
/*
94
type含义
dragondean@qq.com's avatar
dragondean@qq.com committed
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
优惠申请	1
管理优惠	2
佣金设置	3
重货优惠	4
泡货优惠	5
拆单申请	6
控货订单放货修改	7
控货订单反复核	8
控货订单已放货记录调货审批	9
控货订单取消放货	10
合单申请	11
费用申请	12
调仓申请	13
订单修改	14
预装审核	18
封柜审核	19
入仓修改	22
退仓	23
*/
export default {
    name: 'OrderApprovalDetail',
    props:{
        id: [String, Number],
        path: String
    },
    data(){
        return {
122
            type: null,
dragondean@qq.com's avatar
dragondean@qq.com committed
123 124 125
            detail: null,
            order: null,
            channel: null,
126 127 128 129
            ShowLandingBill: false,

            unitList:[],
            currencyList:[],
dragondean@qq.com's avatar
dragondean@qq.com committed
130 131 132 133 134 135 136 137 138 139 140 141 142
        }
    },
    watch:{
        id(){
            this.getData()
        },
        detail(){
            this.getOrder()
        },
        order(){
            if(this.order.channelId){
                this.getChannel()
            }
143 144 145 146 147 148 149 150 151 152
        },
        type(){
            if([1,2,3,4,5].indexOf(this.type) > -1){
                // 加载费用体积单位
                getUnitList().then(res => this.unitList = res.data)
                getCurrencyList().then(res => this.currencyList = res.data)
            }
        }
    },
    computed:{
dragondean@qq.com's avatar
dragondean@qq.com committed
153
        currencyMap(){
154 155 156 157 158 159 160 161 162 163 164 165
            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
dragondean@qq.com's avatar
dragondean@qq.com committed
166 167 168 169 170 171 172 173
        }
    },
    created(){
        if(this.id){
            this.getData()
        }
    },
    methods:{
dragondean@qq.com's avatar
dragondean@qq.com committed
174
        Decimal,
dragondean@qq.com's avatar
dragondean@qq.com committed
175 176
        getData(){
            getApproval(this.id).then(res => {
177
                this.type = res.data.type
dragondean@qq.com's avatar
dragondean@qq.com committed
178 179 180 181 182 183 184 185 186 187 188 189
                this.detail = JSON.parse(res.data.details)
            })
        },
        getOrder(){
            getOrder(this.detail.orderId).then(res => {
                this.order = res.data
            })
        },
        getChannel(){
            getChannel(this.order.channelId).then(res => {
                this.channel = res.data
            })
houjn@hikoon.cn's avatar
houjn@hikoon.cn committed
190
        },/*
dragondean@qq.com's avatar
dragondean@qq.com committed
191 192 193 194
        getBillOfLandingInProcessing(){
            getBillOfLandingInProcessing({orderId: this.detail.orderId}).then(res => {
                console.log(res)
            })
195
        } */
dragondean@qq.com's avatar
dragondean@qq.com committed
196 197 198 199 200 201 202 203 204 205 206
    }
}
</script>
<style scoped lang="scss">
.title{
    padding: 10px 0;
    span{
        font-size: 14px;
        font-weight: bold;
    }
}
207 208 209
.bold{
    font-weight: bold;
}
houjn@hikoon.cn's avatar
houjn@hikoon.cn committed
210
</style>