overweightException.vue 10.3 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 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
<!--拆单审核中的申请信息部分-->
<template>
    <div v-if="order">
        <el-descriptions :column="3" 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.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('异常描述')+':'" :span="2">
                {{$l(orderExceptionData.orderExceptionDescVO, 'desc')}}
            </el-descriptions-item>
        </el-descriptions>
        <div v-for="(row,index) in orderItemData" :key="row.orderItemId">
            <div style="font-weight:600;font-size:14px;margin-bottom:10px">品名{{parseInt(index)+1}}{{$l(row, 'prodTitle')}}</div>
            <div v-if="row.charging ==1"  class="price_list">

               <span>旧成交价:</span>
                 <div>
                   <div v-if="!row.freightFee">
                    <span>{{$t('全包价')}}:</span>
                    <span>{{$t('未报价')}}</span>
                   </div>
                   <div v-else>
                    <span>{{$t('全包价')}}:</span>
                    <span>{{row.freightFee}} {{currencyMap[row.freightCurrencyId]}} / {{unitMap[row.freightUnitId]}}</span>
                  </div>
                 </div>
            </div>
            <div v-else class="price_list">
                 <span>旧成交价:</span>
                 <div>
                   <div v-if="!row.freightFee">
                     <span>{{$t('运费')}}:</span>
                     <span>{{$t('未报价')}}</span>
                    </div>
                    <div v-else>
                     <span>{{$t('运费')}}:</span>
                     <span>{{row.freightFee}} {{currencyMap[row.freightCurrencyId]}} / {{unitMap[row.freightUnitId]}}</span>
                   </div>
                 </div>
                 <div>
                   <div v-if="!row.clearanceFee">
                     <span >{{$t('清关费')}}:</span>
                     <span>{{$t('未报价')}}</span>
                    </div>
                    <div v-else>
                     <span>{{$t('清关费')}}:</span>
                     <span>{{row.clearanceFee}} {{currencyMap[row.clearanceCurrencyId]}} / {{unitMap[row.clearanceUnitId]}}</span>
                   </div>
                 </div>
              </div>
              <div v-if="loopOrderItem.length>index&&loopOrderItem[index].charging ==1"  class="price_list">
                 <span>新成交价:</span>
                   <div>
                     <div v-if="!loopOrderItem[index].freightFee">
                      <span >{{$t('全包价')}}:</span>
                      <span>{{$t('未报价')}}</span>
                     </div>
                     <div v-else>
                      <span >{{$t('全包价')}}:</span>
                      <span>{{loopOrderItem[index].freightFee}} {{currencyMap[loopOrderItem[index].freightCurrencyId]}} / {{unitMap[loopOrderItem[index].freightUnitId]}}</span>
                    </div>
                   </div>
              </div>
              <div v-else-if="loopOrderItem.length>index"  class="price_list">
                   <span>新成交价:</span>
                   <div>
                     <div v-if="!loopOrderItem[index].freightFee">
                       <span>{{$t('运费')}}:</span>
                       <span>{{$t('未报价')}}</span>
                      </div>
                      <div v-else>
                       <span >{{$t('运费')}}:</span>
                       <span>{{loopOrderItem[index].freightFee}} {{currencyMap[loopOrderItem[index].freightCurrencyId]}} / {{unitMap[loopOrderItem[index].freightUnitId]}}</span>
                     </div>
                   </div>
                   <div>
                     <div v-if="!loopOrderItem[index].clearanceFee">
                       <span >{{$t('清关费')}}:</span>
                       <span>{{$t('未报价')}}</span>
                      </div>
                      <div v-else>
                       <span>{{$t('清关费')}}:</span>
                       <span>{{loopOrderItem[index].clearanceFee}} {{currencyMap[loopOrderItem[index].clearanceCurrencyId]}} / {{unitMap[loopOrderItem[index].clearanceUnitId]}}</span>
                     </div>
                   </div>
                </div>
          </div>
        <!-- <div v-for="row in loopOrderItem" :key="row.orderItemId"> -->

          <!-- </div> -->
          <el-descriptions :column="3" v-if="order" :colon="false">
              <el-descriptions-item :label="$t('备注')+':'" :span="2">
                  {{orderExceptionData.orderExceptionNotes||'/'}}
              </el-descriptions-item>
          </el-descriptions>
    </div>
</template>
<script>
import {getOrder} from '@/api/ecw/order'
import {getChannel} from '@/api/ecw/channel'
import {getUnitList} from "@/api/ecw/unit"
import { getCurrencyList } from '@/api/ecw/currency'
import {getProductAttrList} from '@/api/ecw/productAttr'
import Decimal from 'decimal.js'
import {getExceptionDetailByBusinessId,getOrderExceptionChannelPriceList} from '@/api/ecw/orderException'

export default {
    name: 'overweightException',
    props:{
        id: [String, Number],
        path: String
    },
    data(){
        return {
            orderExceptionData: null,
            order: null,
            channel: null,
            unitList:[],
            currencyList:[],
            detail:null,
            loopOrderItem:[],
            orderItemData:[]
        }
    },
    watch:{
        id(){
            this.getData()
        },
        order(){
            if(this.order.channelId){
                this.getChannel()
            }
        },
    },
    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
        }
    },
    async created(){
        await getUnitList().then(res => this.unitList = res.data)
        await getCurrencyList().then(res => this.currencyList = res.data)
        this.productAttrList = (await getProductAttrList()).data
        if(this.id){
            this.getData()
        }
    },
    methods:{
        Decimal,
        getData(){
            getExceptionDetailByBusinessId({businessId:this.id}).then(res => {
                this.orderExceptionData = res.data
                if(this.orderExceptionData.orderExceptionRemark){
                  this.orderExceptionData.orderExceptionRemark=JSON.parse(this.orderExceptionData.orderExceptionRemark)
                }
                if(res.data.oldPriceJson){
                  this.orderItemData = JSON.parse(res.data.oldPriceJson)
                }
                if(res.data.orderId){
                    getOrder(res.data.orderId).then(res => {
                        this.order = res.data
                        this.orderItemData.map(v=>{
                           let item = this.order.orderItemVOList.find(vs=>vs.orderItemId==v.orderItemId)
                           if(item){
                             v.prodTitleZh = item.prodTitleZh
                             v.prodTitleEn = item.prodTitleEn
                           }
                        })
                        this.getExceptionPriceList(res.data.orderId)
                    })
                }

            })
        },
        getProdAtrr(ids){
          if(!ids) return ''
          let attr = []

          let attrIds = ids.split(',')
          this.productAttrList.forEach(item=>{
             if(attrIds.indexOf(item.id) > -1||attrIds.indexOf(item.id+'')>-1){
               attr.push(this.$l(item, 'attrName'))
             }
          })
          return attr.join(',')
        },
        getChannel(){
            getChannel(this.order.channelId).then(res => {
                this.channel = res.data
            })
        },
        getExceptionPriceList(orderId){
          let that = this
          that.loopOrderItem = []
          getOrderExceptionChannelPriceList({orderId:orderId,exceptionId:this.orderExceptionData.id,exceptionResultId:parseInt(that.id)}).then(res=>{
            if(res.code==0&&res.data.length>0){
              that.orderItemData.map(v=>{
               let item = res.data.find(vs=>vs.orderItemId==v.orderItemId)
               let orderItem = {}
               if(item){
                 // orderItem.oneSeaFreight = item.freightFee
                 // orderItem.seaFreightCurrency = item.freightCurrencyId
                 // orderItem.seaFreightVolume = item.freightUnitId
                 // orderItem.oneClearanceFreight = item.clearanceFee
                 // orderItem.clearanceFreightCurrency = item.clearanceCurrencyId
                 // orderItem.clearanceFreightVolume = item.clearanceUnitId
                 item.charging = v.charging
                 that.loopOrderItem.push(item)
                 console.log(that.loopOrderItem)
                 // that.orderItemData.push(v)
               }
              })
            }

          })
        }
    }
}
</script>
<style scoped lang="scss">
.title{
    padding: 10px 0;
    span{
        font-size: 14px;
        font-weight: bold;
    }
}
.bold{
    font-weight: bold;
}
::v-deep .prepay_exception_detail .el-form-item{
    margin-bottom: 0;
}
  .price_list{
    display: flex;
    align-items: center;
    margin-right:10px;
    font-weight: 700;
    font-size: 14px;
    color:#333;
    margin-bottom:10px;
  }
  .price_list div{

  }
</style>