<!--
  @description: 报价大厅-线下补录弹框
  @author: 郝定康
  @routerPath:
  @date： 2021-09-07 14:32:19
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :before-close="close"
    :lock-scroll="false"
    append-to-body
    width="800px"
    title="验收"
  >
    <div class="p0-16 mb10">
      <p class="page-title">
        1.合同信息
      </p>
      <table class="tableData">
        <tr>
          <td>
            合同编号
          </td>
          <td>
            {{ dialogData.contractNo }}
          </td>
          <td>
            合同名称
          </td>
          <td colspan="3">
            {{ dialogData.contractName }}
          </td>
        </tr>
      </table>
      <p class="page-title">
        2.申请验收信息
      </p>
      <table class="tableData">
        <tr>
          <td>
            验收阶段
          </td>
          <td colspan="3">
            {{ formData.checkStage }}
          </td>
        </tr>
        <tr>
          <td>
            验收名称
          </td>
          <td>
            {{ formData.checkName }}
          </td>
          <td>
            验收编号
          </td>
          <td>
            {{ formData.checkNo }}
          </td>
        </tr>
        <tr>
          <td>
            验收人
          </td>
          <td>
            {{ formData.checkUserRealName }}
          </td>
          <td>
            参与人
          </td>
          <td>
            {{ formData.participantRealName }}
          </td>
        </tr>
        <tr>
          <td>
            验收描述
          </td>
          <td colspan="3">
            {{ formData.checkDesc }}
          </td>
        </tr>
        <tr>
          <td>
            时间
          </td>
          <td colspan="3">
            {{ formData.checkTime }}
          </td>
        </tr>
        <tr>
          <td>
            附件列表
          </td>
          <td colspan="3">
            <downloadFile :data="contract_check_file" />
          </td>
        </tr>
      </table>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="close">
        取消
      </el-button>
    </span>
  </el-dialog>
</template>

<script>
import { queryContractCheckStageById } from '@/api/contractManagement/index'
/* 公共混入*/
import { contractSigningMixins } from '../mixins/contractSigningMixins'
/* 公共组件*/
import downloadFile from '@comp/common/updownload/downloadFile' // 附件回显
export default {
  name: 'AcceptanceAddDialog',
  components: {
    downloadFile
  },
  mixins: [contractSigningMixins],
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      formData: {
        checkDesc: '', // 验收描述
        checkName: '', // 验收名称
        checkNo: '', // 验收编号
        checkStage: '', // 验收
        checkTime: '', // 验收时间
        checkUserRealName: '', // 验收人名称
        contractId: '', // 合同id
        id: '',
        participantRealName: '', // 参与人名称
        status: '' // 00保存 01提交
      }
    }
  },
  watch: {
    'dialogData.dialog'(val) {
      // 打开弹框加载数据
      if (val) {
        this.initData()
      }
    }
  },
  created() {
  },
  methods: {
    initData() {
      queryContractCheckStageById(this.dialogData.id, '').then(res => {
        this.formData = res.data
        this.contract_check_file.bizId = this.formData.id
      })
    },
    // 取消
    close() {
      this.dialogData.dialog = false
    }
  }
}
</script>

<style scoped lang="less">
</style>
