<template>
  <a-modal
    :title="modalTitle"
    :width="850"
    :visible="visible"
    :confirmLoading="confirmLoading"
    @cancel="handleCancel"
  >
    <detail-list title="" :col="2">
      <detail-list-item term="标题">{{ model.title }}</detail-list-item>
      <detail-list-item term="调拨ID">{{ model.allocateId }}</detail-list-item>
      <detail-list-item term="审批人ID">{{ model.userId }}</detail-list-item>
      <detail-list-item term="审批人">{{ model.userName }}</detail-list-item>
      <detail-list-item term="状态：0.已申请，1.未处理，2.已通过，3.未通过">{{ BaseTool.Object.getField(statusMap,model.status) }}</detail-list-item>
      <detail-list-item term="说明">{{ model.remark }}</detail-list-item>
      <detail-list-item term="创建人">{{ model.createdUserId }}</detail-list-item>
      <detail-list-item term="更新人">{{ 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>

    <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: 'SbAllocateTaskDetail',
  components: {
    DetailList,
    DetailListItem
  },
  data () {
    return {
      confirmLoading: false,
      mdl: {},
      modalTitle: null,
      visible: false,
      // 下拉框map
      statusMap: {},
      model: {
        'title': null,
        'allocateId': null,
        'userId': null,
        'userName': null,
        'status': null,
        'remark': null,
        'createdUserId': null,
        'updateUserId': null,
        'updateUserName': null,
        'updateTime': null
      }
    }
  },
  created () {
    // 下拉框map
    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_ALLOCATE_TASK_STATUS)
  },
  methods: {
    base (record) {
      this.visible = true
      this.modalTitle = '详情'
      this.model = record
    },
    handleCancel () {
      this.visible = false
      this.confirmLoading = false
    }

  }
}
</script>
