<template>
  <a-card :bordered="false" :title="modalTitle" v-show="visible">
    <a-row :gutter="48" slot="extra">
      <a-col :md="48" :sm="48">
        <span class="table-page-search-submitButtons" style="float: right">
          <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
        </span>
      </a-col>
    </a-row>
    <title-divider title="基本信息" width="90px"></title-divider>
    <detail-list title="" :col="2">
      <detail-list-item term="存货位置">{{ model.inventoryLocation }}</detail-list-item>
      <detail-list-item term="公司名称">{{ model.companyName }}</detail-list-item>
      <detail-list-item term="项目名称">{{ model.projectName }}</detail-list-item>
      <detail-list-item term="数量">{{ BaseTool.Amount.formatter(model.quantity) }}</detail-list-item>
      <detail-list-item term="重量">{{ BaseTool.Amount.formatter(model.weight) }}</detail-list-item>
      <detail-list-item term="体积">{{ BaseTool.Amount.formatter(model.volume) }}</detail-list-item>
      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
      <detail-list-item term="更新人名称">{{ model.updateUserName }}</detail-list-item>
      <detail-list-item term="更新时间">{{ model.updateTime }}</detail-list-item>
    </detail-list>
    <title-divider title="装箱明细" width="90px"></title-divider>
    <purchase-dispatch-container-list-page ref="containerList"/>
  </a-card>
</template>

<script>
import DetailList from '@/components/tools/DetailList'
import PurchaseDispatchContainerListPage from '@/views/purchase/purchase-dispatch-container-list/PurchaseDispatchContainerListPage'
const DetailListItem = DetailList.Item

export default {
  name: 'PurchaseDispatchContainerDetail',
  components: {
    DetailList,
    DetailListItem,
    PurchaseDispatchContainerListPage
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      model: {
        'billNo': null,
        'purchaseApplyId': null,
        'purchasePlanId': null,
        'demandPlanId': null,
        'purchaseOrderId': null,
        'dispatchOrderId': null,
        'companyId': null,
        'companyName': null,
        'projectId': null,
        'projectName': null,
        'inventoryLocation': null,
        'quantity': null,
        'weight': null,
        'volume': null,
        'status': null,
        'remark': null,
        'delFlag': null,
        'createdUserId': null,
        'updateUserId': null,
        'updateUserName': null,
        'updateTime': null
      }
    }
  },
  created () {
    // 下拉框map
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '装箱详情'
      this.model = record
      const containerModal = this.$refs.containerList
      containerModal.base(record.dispatchOrderId, record.id)
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
      this.$emit('ok', {})
    }

  }
}
</script>
