warehouseDetails.vue 10.6 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
<template>
<div>
  <h1>{{ $t('申请信息【订单信息】') }}</h1>
  <el-table :data="list"  v-if="type === 1">
    <el-table-column
      prop="orderNo"
      :label="$t('订单编号')">
    </el-table-column>
    <el-table-column
      prop="marks"
      :label="$t('唛头')">
    </el-table-column>
    <el-table-column
      label="已到箱数/总箱数">
       <template v-slot="{row}">
        {{row.sumNum}}/{{row.totalNum}}
       </template>
    </el-table-column>
    <el-table-column
      :label="$t('下单统计')">
      <template v-slot="{row}">
        <div v-if="row.costVO">
          <div>箱数:{{row.costVO.totalNum}}</div>
           <div>体积:{{row.costVO.totalVolume}}CMB</div>
           <div>重量:{{row.costVO.totalWeight}}kg</div>
        </div>
      </template>
    </el-table-column>
    <el-table-column
      :label="$t('入仓统计')">
       <template v-slot="{row}">

         <div>总箱数:{{row.sumNum}}</div>
         <div>体积:{{row.sumVolume}}CBM </div>
         <div>重量:{{row.sumWeight}}kg</div>
       </template>
    </el-table-column>
    <el-table-column
      :label="$t('入仓时间')">
      <template  v-slot="{row}">
        {{parseTime(row.rucangTime)}}
      </template>
    </el-table-column>
    <el-table-column
      :label="$t('运输方式')">
      <template v-slot = {row}>
        <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="row.transportId"></dict-tag>
      </template>
    </el-table-column>
    <el-table-column
      :label="$t('出货渠道')">
        <template v-slot="{row}">{{row.channelName || '/'}}</template>
    </el-table-column>
    <el-table-column :label="$t('始发仓')" prop="startWarehouseName"></el-table-column>
    <el-table-column :label="$t('目的地')" prop="objectiveName"></el-table-column>
    <el-table-column :label="$t('发货人')">
      <template v-slot="{row}">
        <p>
          {{row.consignorName}}
        </p>
        <p style="white-space: nowrap">
         +{{row.consignorCountryCode}}  {{row.consignorPhone}}
        </p>
      </template>
  </el-table-column>
      <el-table-column :label="$t('收货人')">
    <template v-slot="{row}">
        <p>
          {{row.consigneeName}}
        </p>
        <p style="white-space: nowrap">
          +{{row.consigneeCountryCode}} {{row.consigneePhone}}
        </p>
      </template>
    </el-table-column>
  </el-table>
  <el-descriptions  v-else-if="type === 2" :column="4" border>
    <el-descriptions-item :label="$t('订单号')">{{FeeDetails.orderBackVO.orderNo}}</el-descriptions-item>
    <el-descriptions-item :label="$t('运输方式')">
      <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="FeeDetails.orderBackVO.transportId"></dict-tag>
    </el-descriptions-item>
    <el-descriptions-item :label="$t('出货方式')">
      {{selectChannel(FeeDetails.channelId)}}
    </el-descriptions-item>
    <el-descriptions-item :label="$t('订单状态')">
      <dict-tag :type="DICT_TYPE.ORDER_ABNORMAL_STATE" :value="FeeDetails.orderBackVO.abnormalState"></dict-tag>
    </el-descriptions-item>
    <el-descriptions-item :label="$t('唛头')">
      {{FeeDetails.orderBackVO.marks}}
    </el-descriptions-item>
    <el-descriptions-item :label="$t('始发仓')">{{FeeDetails.startWarehouse}}</el-descriptions-item>
    <el-descriptions-item :label="$t('目的仓')">{{FeeDetails.destWarehouse}}</el-descriptions-item>
  </el-descriptions>
  <el-descriptions  v-else-if="type === 3 || type === 4" :column="4" border>
    <el-descriptions-item :label="$t('订单号')">{{FeeDetails.orderNo}}</el-descriptions-item>
    <el-descriptions-item :label="$t('运输方式')">
      <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="FeeDetails.transportId"></dict-tag>
    </el-descriptions-item>
    <el-descriptions-item :label="$t('出货方式')">
      {{selectChannel(FeeDetails.channelId)}}
    </el-descriptions-item>
    <el-descriptions-item :label="$t('订单状态')">
      <dict-tag :type="DICT_TYPE.ORDER_ABNORMAL_STATE" :value="FeeDetails.abnormalState"></dict-tag>
    </el-descriptions-item>
    <el-descriptions-item :label="$t('唛头')">
      {{FeeDetails.marks}}
    </el-descriptions-item>
    <el-descriptions-item :label="$t('始发仓')">{{FeeDetails.logisticsInfoDto.startTitleZh}}</el-descriptions-item>
    <el-descriptions-item :label="$t('目的仓')">{{FeeDetails.logisticsInfoDto.destTitleZh}}</el-descriptions-item>
  </el-descriptions>
  <div v-if="type === 1">
    <p>{{ $t('申请说明') }}</p>
    <div >
      从 【{{selectWarehouse(FeeDetails.details && FeeDetails.details.warehouseOutId ? FeeDetails.details.warehouseOutId : '' )}}】 调到
      【{{selectWarehouse(FeeDetails.details && FeeDetails.details.warehouseInId ? FeeDetails.details.warehouseInId : '' )}}】
    </div>
  </div>
  <div v-if="type === 2">
    <p>{{ $t('申请理由') }}</p>
    <div>
      <dict-tag   :type="DICT_TYPE.FEE_TYPE" :value="FeeDetails.feeType" />
      {{FeeDetails.applicationFee}}
      <!-- <dict-tag   :type="DICT_TYPE.COMMISSION_    CURRENCY_TYPE" :value="FeeDetails.applicationFeeCurrency" />, -->
      {{currencyName(FeeDetails.applicationFeeCurrency)}}
      <dict-tag  :value="FeeDetails.payType"  :type="DICT_TYPE.PAYMENT_TYPE" ></dict-tag>
      【{{FeeDetails.remarks}}】
    </div>
  </div>
  <div v-if="type === 3">
    <p>{{ $t('申请理由') }}</p>
    <div>
      {{ FeeDetails.details && FeeDetails.details.reason ? FeeDetails.details.reason :''}}
    </div>
    <p>{{$t('退仓图片')}}</p>
    <div>
      <el-image
        v-for="(item, index) in (FeeDetails.details.imgUrl || '').split(',')"
        :key = 'index'
        style="width: 100px; height: 100px;margin:10px;"
        :src="item"
        :preview-src-list="(FeeDetails.details.imgUrl || '').split(',')">
      </el-image>
    </div>
  </div>
  <div v-if="type === 4">
    <p>{{ $t('申请理由') }}</p>
    <div>
      用户修改了订单中商品编号为【{{ FeeDetails.orderItemVOList[0].prodId }}】的【{{ prodName }}】信息:
      <ol>
        <template v-for="item in FeeDetails.details.applyInfoVOList">
          <li v-if="item.orgValue === undefined">{{ item.name }}{{ item.newValue }}</li>
          <li v-else-if="item.newValue === undefined">{{ $t('删除入仓') }}{{ item.orgValue }}</li>
          <li v-else-if="item.newValue !== item.orgValue">{{ item.name }}从【{{ item.orgValue }}】改为【{{ item.newValue }}</li>
        </template>
      </ol>
    </div>
  </div>
</div>
</template>

<script>
import {
  warehouseApprovalGetByFormId,
  warehouseApprovalGetById,
  warehouseAreaPositionList
} from "@/api/ecw/batchSingleApplication";
import {
168
  applicationGetOrderByProcessId, approvalFeeApplicationGet,
lanbaoming's avatar
lanbaoming committed
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
  feeApplicationGet,
  getOrder,
  getOrderPage,
  getWarehouseUpdateApprovalInfo
} from '@/api/ecw/order'

import { getChannelList } from '@/api/ecw/channel';
import Template from "@/views/cms/template";
import {getSupplierPage} from "@/api/ecw/supplier";
import { DICT_TYPE } from "@/utils/dict";

import { getCurrencyList } from "@/api/ecw/currency";
import {arrryToKeyedObjectBy} from '@/utils/index'
export default {
  components: {Template},
  props:{
    type:{
      type: Number,
       default:1,
    },
    processId:{
      type:[Number,String],
    }
  },
  name: "warehouseDetails",
  data(){
    return{
      DICT_TYPE,
      FeeDetails:{
        orderBackVO:{},
        logisticsInfoDto:{}
      },
      transfer:{},
      warehouseList:[],
      channelList:[],
      processInstanceID:undefined,
      list:[],
      currencyList:[],
      prodName: ''
    }
  },
  computed:{
    isChinese(){
      return this.$i18n.locale === 'zh_CN'
    },
    currencyMap(){
      return arrryToKeyedObjectBy(this.currencyList, 'id')
    },
    currencyName(){
      return id => {
        let obj = this.currencyMap[id]
        if(obj) return this.$l(obj, 'title')
        return this.$t('未知')
      }
    }
  },
  created() {
    getCurrencyList().then(res => {
      this.currencyList = res.data
    })
    getChannelList().then(r => this.channelList = r.data);
    warehouseAreaPositionList().then(r => this.warehouseList = r.data)
       if(this.type === 2){
232 233
         // feeApplicationGet({id:this.processId}).then(r => {
         approvalFeeApplicationGet({id:this.processId}).then(r => {
lanbaoming's avatar
lanbaoming committed
234
           if(r.code === 0){
235 236 237
             // this.processInstanceID = r.data.bpmProcessId;
             // this.getDetails()
             this.FeeDetails = r.data
lanbaoming's avatar
lanbaoming committed
238 239 240 241 242
           }
         })
       }else {
         warehouseApprovalGetById({id:this.processId}).then(r => {
           if(r.code === 0){
243 244
             this.processInstanceID = r.data.formId;
             this.getDetails()
lanbaoming's avatar
lanbaoming committed
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
           }
         })
       }
  },
  methods:{
    selectWarehouse(val){
      if(this.warehouseList.length > 0 && !!val){
       return  this.warehouseList.find(e => e.id === val).titleZh
      }
        return ''
    },
    selectChannel(val){
      if(this.channelList.length > 0 && !!val) return this.channelList.find(e => e.channelId === val)[this.isChinese ? 'nameZh' : 'nameEn']
      return ''
    },
    getDetails(){
      switch (this.type){
        case 1:
          //调仓
          warehouseApprovalGetByFormId({formId:this.processInstanceID}).then( r => {
            this.FeeDetails = r.data
            this.FeeDetails.details = JSON.parse(r.data.details)
              getOrderPage({orderIdList:r.data.adjustActualOrderIds}).then(res=>{
              this.list = res.data.list
            })

          });
          break;
273 274 275 276 277 278 279
        // case 2:
        //   // 费用申请
        //   applicationGetOrderByProcessId({processId:this.processInstanceID}).then(r => {
        //     this.FeeDetails = r.data
        //     console.log(this.FeeDetails,'FeeDetails')
        //   })
        //   break;
lanbaoming's avatar
lanbaoming committed
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
        case 3:
          //退仓
          warehouseApprovalGetByFormId({formId:this.processInstanceID}).then( res => {
            getOrder(res.data.orderIds).then(r =>{
              this.FeeDetails = r.data
              this.FeeDetails.details = JSON.parse(res.data.details)
            })
          });
          break;
        case 4:
          // 入仓修改
          getWarehouseUpdateApprovalInfo(this.processInstanceID).then(res => {
            getOrder(res.data.orderIds).then(r =>{
              this.FeeDetails = r.data
              this.FeeDetails.details = JSON.parse(res.data.details)
              const orderItem = this.FeeDetails.orderItemVOList.find(e => e.orderItemId === this.FeeDetails.details.orderItemId)
              if (orderItem){
                this.prodName = orderItem.prodTitleZh + '(' + orderItem.prodTitleEn + ')'
              }
            })
          })
          break
      }
    }

  }
}
</script>

<style scoped>

</style>