<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.updateUserName }}</detail-list-item>
      <detail-list-item term='方案修改时间'>{{ model.updateTime }}</detail-list-item>
    </detail-list>
    <detail-list title='' :col='1'>
      <detail-list-item term='维修意见'>{{ model.opinion }}</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>
    <detail-list title="" :col="8">
      <detail-list-item term="方案文件">
        <a-upload
          :multiple="true"
          :fileList="BaseTool.UPLOAD.transImg(model.opinionFile)"
        >
        </a-upload>
      </detail-list-item>
    </detail-list>
  </a-card>
</template>

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

const DetailListItem = DetailList.Item

export default {
  name: 'RepairSchemeDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data() {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      model: {
        'opinion': null,
        'imageList': null,
        'opinionFile': null,
        'createdUserName': null,
        'createdTime': null,
        'updateUserName': null,
        'updateTime': null
      }
    }
  },
  created () {
    // 下拉框map
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '方案详情'
      this.model = record
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
      this.$emit('ok')
    }
  }
}
</script>
