<!--
  @description: 会议信息表
  @Modifier: haofengxian
  @routerPath: /fee/conferenceInfoList
  @date: 2020-10-12-9:48
-->
<template>
  <table-crud
    ref="tableCrud"
    :search-form="searchForm"
    search-label-width="100px"
    @on-load="loadData"
  >
    <template v-slot:header>
      会议信息表
    </template>
    <template v-slot:search="search">
      <el-form-item ref="batchNumber" label="批次号" prop="batchNumber">
        <el-input
          v-model.trim="searchForm.batchNumber"
          style="width:220px"
          @keyup.enter.native="search.onSearch"
        />
      </el-form-item>
      <el-form-item ref="groupName" label="分组名称" prop="groupName">
        <el-input
          v-model.trim="searchForm.groupName"
          style="width:220px"
          @keyup.enter.native="search.onSearch"
        />
      </el-form-item>
      <!-- 评标开始时间 -->
      <el-form-item label="评标开始时间">
        <el-date-picker
          v-model="searchForm.evalStartTime"
          :format="elValueFormatDate"
          :value-format="elValueSaveFormat"
          type="date"
          style="width:228px"
        />
      </el-form-item>
      <!-- 评标结束时间 -->
      <el-form-item label="评标结束时间">
        <el-date-picker
          v-model="searchForm.evalStopTime"
          :format="elValueFormatDate"
          :value-format="elValueSaveFormat"
          type="date"
          style="width:228px"
        />
      </el-form-item>
    </template>
    <template v-slot:GXTable>
      <el-table
        ref="smallTable"
        v-loading="loading"
        :data="tableData"
      >
        <el-table-column
          type="index"
          label="序号"
          width="60px"
          align="center"
        />
        <el-table-column
          prop="batchNumber"
          align="center"
          label="批次号"
          width="170"
        />
        <el-table-column
          header-align="center"
          prop="groupName"
          label="分组名称"
          min-width="230"
        />
        <el-table-column
          header-align="center"
          prop="packNum"
          label="标段（包）数量"
          width="110"
          align="right"
        />
        <el-table-column
          header-align="center"
          prop="auditNumber"
          label="评委会人数"
          width="90"
        />
        <el-table-column
          header-align="center"
          label="牵头部门"
          prop="leadDepart"
          min-width="200"
        />
        <el-table-column
          header-align="center"
          label="牵头人"
          prop=""
          width="110"
        />
        <el-table-column
          label="评标开始时间"
          prop="evalStartTime"
          width="130"
        >
          <template slot-scope="scope">
            {{ scope.row.evalStartTime && $Moment(scope.row.evalStartTime).format(momentDateTime) }}
          </template>
        </el-table-column>
        <el-table-column
          label="评标结束时间"
          prop="evalStopTime"
          width="130"
        >
          <template slot-scope="scope">
            {{ scope.row.evalStopTime && $Moment(scope.row.evalStopTime).format(momentDateTime) }}
          </template>
        </el-table-column>
      </el-table>
    </template>
  </table-crud>
</template>
<script>
/* 接口*/
import { queryMeetingInfoList } from '@/api/intensiveeval/intensiveeval'

export default {
  name: 'ConferenceInfoList',
  data() {
    return {
      loading: true,
      // 搜索
      searchForm: {
        batchNumber: '', // 批次号
        groupName: '', // 分组名称
        evalStartTime: '', // 评标开始时间
        evalStopTime: '' // 评标结束时间
      },
      tableData: []
    }
  },
  methods: {
    // 获取数据
    loadData(params, callback) {
      queryMeetingInfoList(params).then(response => {
        this.loading = false
        this.tableData = response.data.records
        callback(response.data.total)
      }).catch(() => {
        this.loading = false
      })
    },
    // 到账时间
    changeAccountingTime(val) {
      if (val) {
        this.searchForm.accountingStartTime = this.$Moment(val[0]).format(this.momentDate)// 到账开始时间
        this.searchForm.accountingEndTime = this.$Moment(val[1]).format(this.momentDate)// 到账结束时间
      }
    },
    // 开票时间
    changeInvoiceTime(val) {
      if (val) {
        this.searchForm.invoiceStartTime = this.$Moment(val[0]).format(this.momentDate)//  开票开始时间
        this.searchForm.invoiceEndTime = this.$Moment(val[1]).format(this.momentDate)// 开票结束时间
      }
    },
    // 返回
    back() {
      this.$router.push({
        path: '/fee/tenderFeeManage'
      })
    }
  }
}
</script>
<style lang="less" scoped>
</style>
