<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='审核人'>{{ model.createdUserName }}</detail-list-item>
      <detail-list-item term='审核时间'>{{ model.createdTime }}</detail-list-item>
      <detail-list-item term='审核类别'>{{ model.typeStr }}</detail-list-item>
      <detail-list-item term='审核状态'>{{ model.statusStr }}</detail-list-item>
    </detail-list>
    <detail-list title='' :col='1'>
      <detail-list-item term='审核意见'>{{ model.dataRemark }}</detail-list-item>
    </detail-list>
    <title-divider title="审核图片" width="90px"></title-divider>
    <detail-list title="" :col="1">
      <detail-list-item term="" v-if="model.imageList != null && model.imageList.length > 0">
        <viewer :images="model.imageList" @inited="inited" ref="viewer" :index="1" >
          <img v-for="item in model.imageList" :src="item.url" :key="item.id" class="image">
        </viewer>
      </detail-list-item>
      <detail-list-item term="" v-if="model.imageList == null || model.imageList.length === 0">
        暂无
      </detail-list-item>
    </detail-list>
  </a-card>
</template>

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

const DetailListItem = DetailList.Item

export default {
  name: 'DetailCheckNew',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      model: {
        'dataRemark': null,
        'imageList': null,
        'createdUserName': null,
        'createdTime': null,
        'status': null,
        'statusStr': null,
        'type': null,
        'typeStr': null
      }
    }
  },
  created () {
    // 下拉框map
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '审核详情'
      this.model = record
      if (record.status === 1) {
        this.model.statusStr = '审核通过'
      } else if (record.status === 2) {
        this.model.statusStr = '审核拒绝'
      }
      if (record.type === 1) {
        this.model.typeStr = '维修审核'
      } else if (record.type === 2) {
        this.model.typeStr = '报修审核'
      }
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
      this.$emit('ok')
    }
  }
}
</script>
