<template>
  <div>
    <el-descriptions border v-if="order.orderId">
      <el-descriptions-item label="唛头">{{ order.marks }}</el-descriptions-item>
      <el-descriptions-item label="已到箱数/总箱数">{{ order.sumNum }}/{{ order.costVO.totalNum }}</el-descriptions-item>
      <el-descriptions-item label="订单状态"><dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="order.status" :class="{red: order.status === 1, green: order.status === 5 || order.status === 2}" /></el-descriptions-item>
      <el-descriptions-item label="送货时间">{{ order.consigneeVO && order.consigneeVO.deliveryDate || '' }}</el-descriptions-item>
      <el-descriptions-item label="运输方式">
        <dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="order.logisticsInfoDto.transportId"></dict-tag>
      </el-descriptions-item>
      <el-descriptions-item label="始发地">{{ order.logisticsInfoDto.startAddressZh || '' }}</el-descriptions-item>
      <el-descriptions-item label="目的地">{{ order.logisticsInfoDto.destTitleZh || '' }}</el-descriptions-item>
      <el-descriptions-item label="发货人姓名">{{ order.consignorVO && order.consignorVO.name || ''}}</el-descriptions-item>
      <el-descriptions-item label="发货人公司">{{ order.consignorVO && order.consignorVO.company || '' }}</el-descriptions-item>
      <el-descriptions-item label="发货人电话">{{ order.consignorVO && order.consignorVO.phone || '' }}</el-descriptions-item>
      <el-descriptions-item label="收货人姓名">{{ order.consigneeVO && order.consigneeVO.name || ''}}</el-descriptions-item>
      <el-descriptions-item label="收货人公司">{{ order.consigneeVO && order.consigneeVO.company || '' }}</el-descriptions-item>
      <el-descriptions-item label="收货人电话">{{ order.consigneeVO && order.consigneeVO.phone || '' }}</el-descriptions-item>
      <el-descriptions-item label="入仓类型">{{ getDictDataLabel(DICT_TYPE.ECW_WAREHOUSING_TYPE, order.warehouseType) }}</el-descriptions-item>
      <el-descriptions-item label="订单号">{{ order.orderNo }}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
import {DICT_TYPE, getDictDataLabel} from "@/utils/dict"

export default {
  name: "orderBaseInfo",

  props: {
    order: Object
  },

  data () {
    return {
      DICT_TYPE,
      getDictDataLabel
    }
  }
}
</script>

<style scoped lang="scss">
@import "src/assets/styles/element-variables";
.red{
  color: $--color-danger;
}
.green{
  color: $--color-success;
}
</style>
