<!--
  @description: 付款-履约评价详情
  @author: 郝定康
  @routerPath:
  @date： 2021-11-30 11:17:34
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :before-close="close"
    :lock-scroll="false"
    append-to-body
    width="1000px"
    title="履约评价"
  >
    <div class="p0-16 mb10">
      <p class="page-title">
        1.合同信息
      </p>
      <table class="tableData">
        <tr>
          <td>
            合同名称
          </td>
          <td colspan="3">
            {{ formData.contractName }}
          </td>
          <td>
            合同编号
          </td>
          <td>
            {{ formData.contractNo }}
          </td>
        </tr>
      </table>
      <p class="page-title">
        2.供应商信息
      </p>
      <table class="tableData">
        <tr>
          <td>
            供应商名称
          </td>
          <td colspan="3">
            {{ formData.supplierName }}
          </td>
          <td>
            供应商编号
          </td>
          <td>
            {{ formData.supplierCode }}
          </td>
        </tr>
      </table>
      <p class="page-title">
        3.履约评价单
      </p>
      <table class="tableData">
        <tr>
          <td>
            履约评价单
          </td>
          <td colspan="3">
            <downloadFile :data="contractSupplierEvaluation" />
          </td>
        </tr>
      </table>
      <p class="page-title">
        4.评分
      </p>
      <table class="tableData">
        <tr>
          <td>
            申请说明
          </td>
          <td colspan="3">
            {{ formData.score }}
          </td>
        </tr>
      </table>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="close">
        取消
      </el-button>
    </span>
  </el-dialog>
</template>

<script>
/* api */
import { queryContractSupplierEvaluation } from '@/api/contractManagement/index'
/* 公共混入*/
import { contractSigningMixins } from '../mixins/contractSigningMixins'
/* 公共组件*/
import downloadFile from '@comp/common/updownload/downloadFile' // 附件回显
export default {
  name: 'ContractPaymentEvaluationDetailDialog',
  components: {
    downloadFile
  },
  mixins: [contractSigningMixins],
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      formData: {
      }
    }
  },
  watch: {
    'dialogData.dialog'(val) {
      // 打开弹框加载数据
      if (val) {
        this.initData()
      }
    }
  },
  created() {
  },
  methods: {
    // 获取详情
    initData() {
      const params = {
        contractId: this.dialogData.contractId, // 合同id
        payStageId: this.dialogData.id, // 付款阶段id
        checkId: this.dialogData.checkId // 验收id
      }
      queryContractSupplierEvaluation(params).then(res => {
        this.formData = res.data
        this.contractSupplierEvaluation.bizId = this.formData.id // 履约评价单
      })
    },
    // 取消
    close() {
      this.dialogData.dialog = false
    }
  }
}
</script>

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