<template>
  <a-modal
    :title="modalTitle"
    :width="850"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <detail-list title="" :col="2">
      <detail-list-item term="入库单号">{{ model.inNo }}</detail-list-item>
      <detail-list-item term="入库仓库">{{ model.storeName }}</detail-list-item>
      <detail-list-item term="备件名称">{{ model.spareName }}</detail-list-item>
      <detail-list-item term="备件规格">{{ model.ggxh }}</detail-list-item>
      <detail-list-item term="原厂编号">{{ model.initNo }}</detail-list-item>
      <detail-list-item term="入库数量">{{ model.num }}</detail-list-item>
      <detail-list-item term="入库单价">{{ BaseTool.Amount.formatter(model.price) }}</detail-list-item>
      <detail-list-item term="入库总价">{{ BaseTool.Amount.formatter(model.totalPrice) }}</detail-list-item>
      <detail-list-item term="采购数量">{{ model.purchaseNum }}</detail-list-item>
      <detail-list-item term="采购单价">{{ BaseTool.Amount.formatter(model.purchasePrice) }}</detail-list-item>
      <detail-list-item term="采购总价">{{ BaseTool.Amount.formatter(model.purchaseTotalPrice) }}</detail-list-item>

      <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
      <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
      <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
    </detail-list>

    <template slot="footer">
      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
    </template>
  </a-modal>
</template>

<script>
import DetailList from '@/components/tools/DetailList'
const DetailListItem = DetailList.Item

export default {
  name: 'InStoreDetailDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      model: {
        'inId': null,
        'inNo': null,
        'storeId': null,
        'spareId': null,
        'initNo': null,
        'ggxh': null,
        'num': null,
        'price': null,
        'totalPrice': null,
        'createdUserId': null,
        'updateUserId': null,
        'updateTime': null,
        'column13': null,
        'createdUserName': null,
        'updateUserName': null
      }
    }
  },
  created () {
    // 下拉框map
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '详情'
      this.model = record
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
    }

  }
}
</script>
