<template>
  <a-card :bordered='false' v-show='visible' class='card' :title='modalTitle'>
    <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' type='default' @click='handleCancel()'>返回</a-button>
              </span>
      </a-col>
    </a-row>
    <detail-list title='' :col='2'>
      <detail-list-item term='采购人ID'>{{ model.createdUserId }}</detail-list-item>
      <detail-list-item term='修改人ID'>{{ model.updateUserId }}</detail-list-item>
      <detail-list-item term='修改人'>{{ model.updateUserName }}</detail-list-item>
      <detail-list-item term='修改时间'>{{ model.updateTime }}</detail-list-item>
      <detail-list-item term='价值'>{{ model.price }}</detail-list-item>
      <detail-list-item term='价值小计'>{{ model.totalPrice }}</detail-list-item>
      <detail-list-item term='数量小计'>{{ model.num }}</detail-list-item>
      <detail-list-item term='采购入库单'><a @click='purchaseStoreFormIdhandleDetail'>{{ model.purchaseStoreFormId }}</a>
      </detail-list-item>
      <detail-list-item term='备件'><a @click='sparePartInfoIdhandleDetail'>{{ model.sparePartInfoId }}</a>
      </detail-list-item>
    </detail-list>
  </a-card>
</template>

<script>
import DetailList from '@/components/tools/DetailList'

const DetailListItem = DetailList.Item

export default {
  name: 'PurchaseStoreFormDetailDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data() {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      model: {
        'createdUserId': null,
        'updateUserId': null,
        'updateUserName': null,
        'updateTime': null,
        'price': null,
        'totalPrice': null,
        'num': null,
        'purchaseStoreFormId': null,
        'sparePartInfoId': null
      }
    }
  },
  created() {
    // 下拉框map

  },
  methods: {
    base(record) {
      this.visible = true
      this.modalTitle = '详情'
      this.model = record
    },
    handleCancel() {
      this.visible = false
      this.confirmLoading = false
    }
    ,
    purchaseStoreFormIdhandleDetail() {
      const text = this.$router.resolve({
        name: purchaseStoreForm,
        query: { id: this.model.purchaseStoreFormId }
      })
      // 打开一个新的页面
      window.open(text.href, '_blank')
    }
    ,
    sparePartInfoIdhandleDetail() {
      const text = this.$router.resolve({
        name: sparePartInfo,
        query: { id: this.model.sparePartInfoId }
      })
      // 打开一个新的页面
      window.open(text.href, '_blank')
    }
  }
}
</script>
