<template>
  <a-modal
    :title="modalTitle"
    :width="1200"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <title-divider title="基本信息" width="90px"></title-divider>
    <detail-list title="" :col="2">
      <detail-list-item term="采购单号">{{ model.purchaseOrderNo }}</detail-list-item>
<!--      <detail-list-item term="项目名称">{{ model.projectName }}</detail-list-item>-->
      <detail-list-item term="公司名称">{{ model.companyName }}</detail-list-item>
      <detail-list-item term="数量">{{ BaseTool.Amount.formatter(model.quantity) }}</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-order-list-page ref="orderList"/>
    <template slot="footer">
      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
    </template>
  </a-modal></template>

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

export default {
  name: 'PurchaseOrderDispatchOrderDetail',
  components: {
    DetailList,
    PurchaseDispatchOrderListPage,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      model: {
        'purchaseOrderNo': null,
        'purchaseOrderId': null,
        'companyId': null,
        'companyName': null,
        'quantity': null,
        'remark': null,
        'delFlag': null,
        'createdUserId': null,
        'updateUserId': null,
        'updateUserName': null,
        'updateTime': null
      }
    }
  },
  created () {
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '发运单明细详情'
      this.model = record
      const modal = this.$refs.orderList
      modal.base(record.dispatchOrderId, record.purchaseOrderId)
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
      this.$emit('ok', {})
    }

  }
}
</script>
