ApprovalDetail.vue 9.14 KB
Newer Older
lanbaoming's avatar
lanbaoming committed
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 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 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 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 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 222 223 224 225 226 227 228 229 230
<!--拆单审核中的申请信息部分-->
<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>

            <!-- 优惠申请 -->
            <el-descriptions-item :label="$t('申请理由')" v-if="type == 1 || type == 2" :span="4">
                <div class="bold">
                    <div>
                        {{detail.charging ? $t('原全包价') : $t('原运费')}}{{detail.orgFreight}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }}
                        {{detail.charging ? $t('新全包价') : $t('新运费')}}{{detail.freight}} {{ currencyMap[detail.freightCurrency] }} / {{ unitMap[detail.freightVolume] }}
                    </div>
                    <div v-if="!detail.charging">
                        {{$t('原清关费')}}{{detail.orgClearanceFreight}} {{ currencyMap[detail.clearanceFreightCurrency] }} / {{ unitMap[detail.clearanceFreightVolume] }}
                        {{$t('新清关费')}}{{detail.clearanceFreight}} {{ currencyMap[detail.clearanceFreightCurrency] }} / {{ unitMap[detail.clearanceFreightVolume] }}
                    </div>
                </div>
            </el-descriptions-item>
            <!-- 优惠申请 -->
            <el-descriptions-item :label="$t('申请理由')" v-if="type == 31 || type == 32" :span="4">
                <div class="bold" v-for="(item,index) in detail.batchApplyOrderItemDetailVOList" :key="index">
                  <div>{{index+1}}.【{{$l(item, 'prodTitle')}}</div>
                    <div>
                        {{item.charging ? $t('原全包价') : $t('原运费')}}{{item.orgFreight}} {{ currencyMap[item.freightCurrency] }} / {{ unitMap[item.freightVolume] }}
                        {{item.charging ? $t('新全包价') : $t('新运费')}}{{item.freight}} {{ currencyMap[item.freightCurrency] }} / {{ unitMap[item.freightVolume] }}
                    </div>
                    <div v-if="!item.charging">
                        {{$t('原清关费')}}{{item.orgClearanceFreight}} {{ currencyMap[item.clearanceFreightCurrency] }} / {{ unitMap[item.clearanceFreightVolume] }}
                        {{$t('新清关费')}}{{item.clearanceFreight}} {{ currencyMap[item.clearanceFreightCurrency] }} / {{ unitMap[item.clearanceFreightVolume] }}
                    </div>
                </div>
            </el-descriptions-item>
            <!-- 重泡货 -->
            <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
                    })}}
                </div>
                <div class="bold" v-if="type == 5">
                    {{$t('泡货优惠标准申请为:{new}kg/cbm,原泡货标准:{old}kg/cbm', {
                        new: detail.vWeight,
                        old: detail.orgVWeight
                    })}}
                </div>
            </el-descriptions-item>

            <!-- 佣金设置 -->
            <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.orgCommissionType) ,
                        newType: getDictDataLabel(DICT_TYPE.COMMISSION_TYPE, detail.commissionType),
                        })}}
                    </div>

                    <div>
                        {{$t('原运费')}}{{detail.orgFreight}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
                    </div>
                    <div>
                        {{$t('新运费')}}{{Decimal(detail.orgFreight || 0).minus(detail.orgLightCommissionAmount || 0).plus(detail.lightCommissionAmount || 0)}}{{currencyMap[detail.freightCurrency]}} / {{unitMap[detail.freightVolume]}}
                    </div>
                    <div>
                       {{$t('成本价')}}{{Decimal(detail.orgFreight || 0).minus(detail.orgLightCommissionAmount || 0).minus(detail.shadeCommissionAmount || 0)}} {{ 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]}}
                    </div>
                </div>
            </el-descriptions-item>

        </el-descriptions>
        <!-- 泡重优惠申请 -->
        <div v-if="type == 29" style="font-size: 14px; line-height: 1.5">
          <div>{{$t('原泡重')}}:{{detail.orgVWeight}}kg</div>
          <div>{{$t('新泡重')}}:{{detail.vWeight}}kg</div>
        </div>

    </div>
</template>
<script>
import {getOrder, getApproval} from '@/api/ecw/order'
import {getChannel} from '@/api/ecw/channel'
import {getUnitList} from "@/api/ecw/unit"
import { getCurrencyList } from '@/api/ecw/currency'
import Decimal from 'decimal.js'
/*
type含义
优惠申请	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 {
            type: null,
            detail: null,
            order: null,
            channel: null,
            ShowLandingBill: false,

            unitList:[],
            currencyList:[],
        }
    },
    watch:{
        id(){
            this.getData()
        },
        detail(){
            this.getOrder()
        },
        order(){
            if(this.order.channelId){
                this.getChannel()
            }
        },
        type(){
            if([1,2,3,4,5,31,32].indexOf(this.type) > -1){
                // 加载费用体积单位
                getUnitList().then(res => this.unitList = res.data)
                getCurrencyList().then(res => this.currencyList = res.data)
            }
        }
    },
    computed:{
        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
        }
    },
    created(){
        if(this.id){
            this.getData()
        }
    },
    methods:{
        Decimal,
        getData(){
            getApproval(this.id).then(res => {
                this.type = res.data.type
                this.detail = JSON.parse(res.data.details)
                console.log(this.detail)
            })
        },
        getOrder(){
            getOrder(this.detail.orderId).then(res => {
                this.order = res.data
            })
        },
        getChannel(){
            getChannel(this.order.channelId).then(res => {
                this.channel = res.data
            })
        },/*
        getBillOfLandingInProcessing(){
            getBillOfLandingInProcessing({orderId: this.detail.orderId}).then(res => {
                console.log(res)
            })
        } */
    }
}
</script>
<style scoped lang="scss">
.title{
    padding: 10px 0;
    span{
        font-size: 14px;
        font-weight: bold;
    }
}
.bold{
    font-weight: bold;
}
</style>