<template>
  <a-modal
    :title="modalTitle"
    :width="850"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <detail-list title="" :col="2">
      <detail-list-item term="编码">{{ model.no }}</detail-list-item>
      <detail-list-item term="名称">{{ model.name }}</detail-list-item>
      <detail-list-item term="维修类别">{{ model.type }}</detail-list-item>
      <detail-list-item term="维修工艺">{{ model.technology }}</detail-list-item>
      <detail-list-item term="标准工时">{{ model.standardHours }}</detail-list-item>
      <detail-list-item term="标准费用">{{ model.standardMoney }}</detail-list-item>
      <detail-list-item term="考核工时">{{ model.checkHours }}</detail-list-item>
      <detail-list-item term="排序">{{ model.sort }}</detail-list-item>
      <detail-list-item term="助记码">{{ model.remark }}</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: 'CheckProjectDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      repairProjectMap: {},
      repairTechnologyMap: {},
      visible: false,
      // 下拉框map
      model: {
        'no': null,
        'name': null,
        'type': null,
        'technology': null,
        'standardHours': null,
        'standardMoney': null,
        'checkHours': null,
        'sort': null,
        'remark': null
      }
    }
  },
  created () {
    // 下拉框map
    this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
    this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '详情'
      this.model = record
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
    }

  }
}
</script>
