ApprovalDetail.vue 7.6 KB
Newer Older
dragondean@qq.com's avatar
dragondean@qq.com committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<!--拆单审核中的申请信息部分-->
<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>
            <el-descriptions-item :label="$t('出货方式')">
                {{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>
22 23
            
            <!-- 优惠申请 -->
24
            <el-descriptions-item :label="$t('申请理由')" v-if="type == 1 || type == 2" :span="4">
25 26
                <div class="bold">
                    <div>
dragondean@qq.com's avatar
dragondean@qq.com committed
27 28
                        {{$t('原运费')}}{{detail.orgFreight}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }}
                        {{$t('新运费')}}{{detail.freight}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }}
29 30
                    </div>
                    <div>
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
            <!-- 佣金设置 -->
            <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}', {
                        oldType: getDictDataLabel(DICT_TYPE.COMMISSION_TYPE, detail.commissionType) ,
                        newType: getDictDataLabel(DICT_TYPE.COMMISSION_TYPE, detail.commissionType),
                        })}}
                    </div>
                    
                    <div>
                        {{$t('原运费')}}{{detail.orgFreight}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
                    </div>
                    <div>
                        {{$t('新运费')}}{{Decimal(detail.freight).plus(detail.lightCommissionAmount)}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
                    </div>
                    <div>
                       {{$t('成本价')}}{{Decimal(detail.freight).minus(detail.shadeCommissionAmount)}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }}
                    </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'
dragondean@qq.com's avatar
dragondean@qq.com 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 122 123 124
优惠申请	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
    },
    components:{
        PrintLandingBill: () => import('./PrintLadingBill.vue')
    },
    data(){
        return {
125
            type: null,
dragondean@qq.com's avatar
dragondean@qq.com committed
126 127 128
            detail: null,
            order: null,
            channel: null,
129 130 131 132
            ShowLandingBill: false,

            unitList:[],
            currencyList:[],
dragondean@qq.com's avatar
dragondean@qq.com committed
133 134 135 136 137 138 139 140 141 142 143 144 145
        }
    },
    watch:{
        id(){
            this.getData()
        },
        detail(){
            this.getOrder()
        },
        order(){
            if(this.order.channelId){
                this.getChannel()
            }
146 147 148 149 150 151 152 153 154 155
        },
        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
156
        currencyMap(){
157 158 159 160 161 162 163 164 165 166 167 168
            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
169 170 171 172 173 174 175 176
        }
    },
    created(){
        if(this.id){
            this.getData()
        }
    },
    methods:{
dragondean@qq.com's avatar
dragondean@qq.com committed
177
        Decimal,
dragondean@qq.com's avatar
dragondean@qq.com committed
178 179
        getData(){
            getApproval(this.id).then(res => {
180
                this.type = res.data.type
dragondean@qq.com's avatar
dragondean@qq.com committed
181 182 183 184 185 186 187 188 189 190 191 192 193
                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
            })
        },
dragondean@qq.com's avatar
dragondean@qq.com committed
194 195 196 197 198 199 200 201
        getBillService(){

        },
        getBillOfLandingInProcessing(){
            getBillOfLandingInProcessing({orderId: this.detail.orderId}).then(res => {
                console.log(res)
            })
        }
dragondean@qq.com's avatar
dragondean@qq.com committed
202 203 204 205 206 207 208 209 210 211 212
    }
}
</script>
<style scoped lang="scss">
.title{
    padding: 10px 0;
    span{
        font-size: 14px;
        font-weight: bold;
    }
}
213 214 215
.bold{
    font-weight: bold;
}
dragondean@qq.com's avatar
dragondean@qq.com committed
216
</style>