<!--
  @description: 文件领购记录收取标书费
  @Modifier: sxm/王秀阳
  @routerPath:/procurement/procurementDrive/supplierResponse/docRecordList
  @date: 2020-5-9 14:24:31
-->
<template>
  <div class="p0-16">
    <p class="page-title">
      1、参与项目情况
    </p>
    <table class="tableData">
      <tr>
        <td>标书费（元）</td>
        <td>{{ tableObj.documentPrice }}</td>
        <td>参与家数</td>
        <td>{{ tableObj.supplierNum }} </td>
      </tr>
      <tr>
        <td>已付款</td>
        <td>{{ tableObj.paymentSuccessNum }}</td>
        <td>标书费总额（元）</td>
        <td>{{ tableObj.documentPriceTotal }}</td>
      </tr>
    </table>
    <p class="page-title">
      2、购标供应商列表
    </p>
    <div style="padding:10px 0">
      <gx-button :code="'001_011_001'" @click="exportNameList">
        导出名单
      </gx-button>
    </div>
    <section>
      <el-table
        ref="smallTable"
        :data="tableData"
      >
        <el-table-column
          type="index"
          label="序号"
          align="center"
          width="60"
        />
        <el-table-column
          prop="supplierName"
          align="left"
          label="单位名称"
          header-align="center"
        />
        <el-table-column
          prop="payType"
          align="center"
          width="160"
          label="支付方式"
          header-align="center"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.payType === '01'">微信支付</span>
            <span v-else-if="scope.row.payType === '00'">支付宝支付</span>
            <span v-else>工商</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="auditStatus"
          align="center"
          label="支付状态"
          header-align="center"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.auditStatus === '00'">待审核</span>
            <span v-else>支付成功</span>
          </template>
        </el-table-column>
        <el-table-column
          prop="payTime"
          align="center"
          label="支付时间"
          header-align="center"
        />
        <el-table-column
          prop="downloadTime"
          align="center"
          label="下载时间"
          header-align="center"
        />
        <!--<el-table-column
          prop="linkerTel"
          align="center"
          label="操作"
          header-align="center"
        >
          <template slot-scope="scope">
            <el-button v-if="scope.row.auditStatus === '00'" type="text" size="small" @click="audit(scope.row)">
              审核
            </el-button>
            <el-button v-else type="text" size="small" @click="look(scope.row)">
              查看
            </el-button>
          </template>
        </el-table-column>-->
      </el-table>
    </section>
    <!--分页组件-->
    <pagination :pagination-data="paginationData" />
  </div>
</template>

<script>
/* 接口*/
import { documentAcquisitionPurchaseRecordYes, exportDocumentAcquisitionPurchaseRecordList } from '@/api/procurement/procurementSignup'// 获取信息
/* 公共方法 */
import { download } from '@/assets/js/utils/index'
import pagination from '@comp/common/pagination/pagination'// 分页
export default {
  name: 'ContactInfoAdd',
  inject: ['getTenderBase'],
  components: {
    pagination // 分页
  },
  mixins: [],
  props: {
    // 弹框展示状态bu
    tenderId: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      tableData: [], // 邀请供应商列表
      tableObj: {}, // 参与情况
      // 分页数据
      paginationData: {
        pageNo: 1,
        pageSize: 10,
        total: 0
      },
      serchForm: {
        pageNo: 1,
        pageSize: 10,
        packId: ''
      },
      tenderBase: this.getTenderBase() // 获取项目信息
    }
  },
  created() {
    this.serchForm.packId = this.tenderBase.packId
    this.initData(this.serchForm)// 查询文件领购记录
  },
  methods: {
    // 查询邀请函信息
    initData(serchForm) {
      documentAcquisitionPurchaseRecordYes(serchForm).then(response => {
        if (response.header.ret === '0') {
          this.tableObj = {
            paymentSuccessNum: response.data.paymentSuccessNum,
            documentPrice: response.data.documentPrice,
            supplierNum: response.data.supplierNum,
            documentPriceTotal: response.data.documentPriceTotal
          }
          this.tableData = response.data.recordYesList.records
        }
      }).catch(() => {
      })
    },
    // 导出名单
    exportNameList() {
      exportDocumentAcquisitionPurchaseRecordList(this.tenderBase.packId).then(res => {
        download(res, '购标供应商名单.xls')
      })
    },
    // 审核
    audit(val) {
      this.$router.push({
        path: '/procurement/procurementDrive/supplierResponse/docRecordAudit',
        query: { data: val }
      })
    },
    // 查看
    look(val) {
      if (val.payType === '01' || val.payType === '02') {
        this.$router.push({
          path: '/procurement/procurementDrive/supplierResponse/docRecorLookPayment',
          query: { data: val }
        })
      } else {
        this.$router.push({
          path: '/procurement/procurementDrive/supplierResponse/docRecorLookVoucher',
          query: { data: val }
        })
      }
    }
  }
}
</script>

<style lang="less" scoped>

</style>
