<!--订单修改审核的申请信息部分-->
<template>
    <div v-if="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 ? $l(order.logisticsInfoDto, 'startTitle') : '-'}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('目的仓')" :span="2">
                {{order.logisticsInfoDto ? $l(order.logisticsInfoDto, 'destAddress') : '-'}}
            </el-descriptions-item>
            <el-descriptions-item :label="$t('申请理由')" :span="4">
                <div>
                    <div v-for="(item, index) in order.applyInfoList" :key="index">
                    {{index+1}}、 {{item.name}} 
                        <template v-if="item.type != 1">{{$t('从旧的【{orgValue}】改成新的【{newValue}】', {orgValue: item.orgValue, newValue: item.newValue })}}</template>
                        <div v-else class="pl-30">
                            <div>
                                {{$t('旧值')}}：<div v-if="!item.orgExternalWarehouse" class="pl-30">{{$t('无')}}</div>
                            </div>
                            <div v-for="it in item.orgExternalWarehouse" class="pl-30">
                                {{$t('时间')}}：{{it.estLoadingTime}}，{{$t('地址')}}：{{it.loadingAddress}}
                            </div>
                            <div>
                                {{$t('新值')}}：<template v-if="!item.newExternalWarehouse">{{$t('无')}}</template>
                            </div>
                            <div v-for="it in item.newExternalWarehouse" class="pl-30">
                                {{$t('时间')}}：{{it.estLoadingTime}}，{{$t('地址')}}：{{it.loadingAddress}}
                            </div>
                        </div>
                    </div>
                </div>
            </el-descriptions-item>
        </el-descriptions>
    </div>
</template>
<script>
import {getOrder, getUpdateInfoByApproveId} from '@/api/ecw/order'
import {getChannel} from '@/api/ecw/channel'
import {getBillOfLandingInProcessing, getBillService} from '@/api/ecw/box'

export default {
    name: 'OrderApprovalDetail',
    props:{
        id: [String, Number],
        path: String
    },
    components:{
        PrintLandingBill: () => import('./PrintLadingBill.vue')
    },
    data(){
        return {
            order: null,
            channel: null
        }
    },
    watch:{
        id(){
            this.getData()
        },
        order(){
            if(this.order.channelId){
                this.getChannel()
            }
        }
    },
    created(){
        if(this.id){
            this.getData()
        }
    },
    methods:{
        getData(){
            getUpdateInfoByApproveId(this.id).then(res => {
                this.order = res.data
            })
        },
        getChannel(){
            getChannel(this.order.channelId).then(res => {
                this.channel = res.data
            })
        }
    }
}
</script>
<style scoped lang="scss">
.title{
    padding: 10px 0;
    span{
        font-size: 14px;
        font-weight: bold;
    }
}
</style>