<!--
  @description: 运维业务数据信息
  @Modifier: liyang
  @routerPath:/statisticalAnalysis/projectInfoList
  @date: 2021-5-14-16:30
-->
<template>
  <table-crud
    :menu="true"
    :search-form="searchForm"
    search-label-width="110px"
    @on-load="loadData"
  >
    <template v-slot:header>
      运维业务数据信息
    </template>
    <template v-slot:search="search">
      <el-form-item ref="tenderName" label="项目名称" prop="tenderName">
        <el-input
          v-model.trim="searchForm.tenderName"
          placeholder="请输入项目名称"
          style="width:220px"
          @keyup.enter.native="search.onSearch"
        />
      </el-form-item>
      <el-form-item ref="tenderNo" label="项目编号" prop="tenderNo">
        <el-input
          v-model.trim="searchForm.tenderNo"
          style="width:220px"
          placeholder="请输入项目编号"
          @keyup.enter.native="search.onSearch"
        />
      </el-form-item>

      <el-form-item ref="tenderManager" label="项目经理" prop="tenderManager">
        <el-input
          v-model.trim="searchForm.tenderManager"
          style="width:220px"
          placeholder="请输入项目经理"
          @keyup.enter.native="search.onSearch"
        />
      </el-form-item>

      <el-form-item ref="packNo" label="标段编号" prop="packNo">
        <el-input
          v-model.trim="searchForm.packNo"
          placeholder="请输入标段编号"
          style="width:220px"
          @keyup.enter.native="search.onSearch"
        />
      </el-form-item>
      <!--      <el-form-item ref="schemeNo" label="招标汇总号" prop="schemeNo">
        <el-input
          v-model.trim="searchForm.schemeNo"
          placeholder="请输入标段编号"
          style="width:220px"
          @keyup.enter.native="search.onSearch"
        />
      </el-form-item>-->
    </template>
    <!--    <template slot="menuLeft">-->
    <!--      <div class="mb10">-->
    <!--        <el-button type="primary" @click="exportCurrentPage">-->
    <!--          导出当前页面-->
    <!--        </el-button>-->
    <!--        <el-button type="primary" @click="exportAll">-->
    <!--          导出全部-->
    <!--        </el-button>-->
    <!--      </div>-->
    <!--    </template>-->

    <template v-slot:GXTable>
      <div class="crud_menu_title clearfix">
        <el-button
          type="primary"
          class="mb10 ml10"
          plain
          @click="exportBidServiceFeeInfoList"
        >
          导出列表
        </el-button>
        <el-table
          ref="smallTable"
          v-loading="loading"
          :data="tableData"
        >
          <el-table-column
            type="index"
            label="序号"
            width="60px"
            align="center"
          />
          <el-table-column
            header-align="center"
            prop="packNo"
            label="项目标段"
            width="170"
          />
          <el-table-column
            header-align="center"
            prop="packName"
            label="标段名称"
            width="170"
          />
          <el-table-column
            header-align="center"
            prop="tenderNo"
            label="项目编号"
            width="170"
          />
          <el-table-column
            header-align="center"
            prop="tenderName"
            label="项目名称"
            width="170"
          />
          <!--        <el-table-column
          header-align="center"
          prop="schemeNo"
          label="招标汇总号"
          width="170"
        />-->
          <el-table-column
            header-align="center"
            prop="tenderManager"
            label="项目经理"
            width="170"
          />
          <el-table-column
            prop="createProjectTime"
            align="center"
            label="立项时间"
            width="230"
          />

          <el-table-column
            header-align="center"
            prop="department"
            label="业务部门"
            min-width="170"
          />
          <el-table-column
            header-align="center"
            prop="packStatus"
            label="项目状态"
            min-width="230"
          />

          <!--        <el-table-column
          header-align="center"
          prop="secondCompany"
          label="所属二级公司"
          min-width="230"
        />-->
          <el-table-column
            header-align="center"
            prop="openBidStartTime"
            label="开标时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="economicOpenBidStartTime"
            label="经济标开标时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="technicalOpenBidStartTime"
            label="技术标开标时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="evaluationResultTime"
            label="评标结果回传时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="evaluationStartTime"
            label="评标开始时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="evaluationEndTime"
            label="评标结束时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="purchaseLevel"
            label="采购级别"
            min-width="170"
          >
            <template slot-scope="scope">
              <span
                v-for="(item,index) in purchaseLevelList"
                v-if="scope.row.purchaseLevel===item.typecode"
                :key="index"
              >{{ item.typename }}</span>
            </template>
          </el-table-column>
          <el-table-column
            header-align="center"
            prop="projectIndustryName"
            label="项目行业"
            min-width="170"
          />
          <el-table-column
            header-align="center"
            prop="buyerName"
            label="招标人名称"
            min-width="170"
          />
          <el-table-column
            header-align="center"
            prop="agentName"
            label="招标代理机构名称"
            min-width="170"
          />
          <el-table-column
            header-align="center"
            prop="isCommissionBid"
            label="是否委托招标"
            min-width="100"
            align="center"
          >
            <template slot-scope="scope">
              <span
                v-for="(item,index) in tenderOrgMethodList"
                v-if="scope.row.isCommissionBid===item.typecode"
                :key="index"
              >{{ item.typename }}</span>
            </template>
          </el-table-column>
          <el-table-column
            header-align="center"
            prop="beyondLegalLimit"
            label="是否限额以下"
            min-width="100"
            align="center"
          >
            <template slot-scope="scope">
              <span
                v-for="(item,index) in beyondLegalLimitList"
                v-if="scope.row.beyondLegalLimit===item.typecode"
                :key="index"
              >{{ item.typename }}</span>
            </template>
          </el-table-column>
          <el-table-column
            header-align="center"
            prop="isLegalTender"
            label="是否依法必招"
            min-width="100"
            align="center"
          >
            <template slot-scope="scope">
              <span
                v-for="(item,index) in isLegalTenderList"
                v-if="scope.row.isLegalTender===item.typecode"
                :key="index"
              >{{ item.typename }}</span>
            </template>
          </el-table-column>
          <el-table-column
            header-align="center"
            prop="qualificationMethod"
            label="资格审查方式"
            min-width="100"
            align="center"
          >
            <template slot-scope="scope">
              <span
                v-for="(item,index) in phaseTypeList"
                v-if="scope.row.qualificationMethod===item.typecode"
                :key="index"
              >{{ item.typename }}</span>
            </template>
          </el-table-column>
          <!--        <el-table-column
          header-align="center"
          prop="tenderType"
          label="招标项目类型"
          min-width="100"
        >
          <template slot-scope="scope">
            <span
              v-for="(item,index) in allTenderMethodTypeList"
              v-if="scope.row.tenderType===item.typecode"
              :key="index"
            >{{ item.typename }}</span>
          </template>
        </el-table-column>-->
          <el-table-column
            header-align="center"
            prop="bulletinPublishTime"
            label="公告发布时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="changeBulletinPublishTime"
            label="变更公告发布时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="profilePublishTime"
            label="招标文件发布时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="candidatePublishTime"
            label="候选人公示发布时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="winNoticePulishTime"
            label="中标通知书发布时间"
            min-width="230"
          />
          <el-table-column
            header-align="center"
            prop="winSupplierName"
            label="中标单位"
            min-width="170"
          />
          <el-table-column
            header-align="center"
            prop="bidPrice"
            label="中标金额"
            min-width="80"
          />
          <el-table-column
            header-align="center"
            prop="budgetTotalMoney"
            label="概算金额"
            min-width="80"
          />
          <el-table-column
            header-align="center"
            prop="invoiceAmount"
            label="应收服务费金额"
            min-width="120"
          />
          <el-table-column
            header-align="center"
            prop="invitationPublishTime"
            label="邀请函发布时间"
            min-width="230"
          />
        </el-table>
      </div>
    </template>
  </table-crud>
</template>
<script>
/* 接口*/
import { download } from '@/assets/js/utils'// 常用方法
import { queryProjectList } from '@api/bidding/biddingProject'
import { statisticalAnalysisGroupMixin } from '../mixins/statisticalAnalysisGroupMixin'
import { exportProjectList } from '@/api/bidService/bidServiceStatistics.js'// 专家入库审核表格接口
export default {
  name: 'BuildProjectList',
  mixins: [statisticalAnalysisGroupMixin],
  data() {
    return {
      loading: true,
      // 搜索
      searchForm: {
        supplierName: '', // 供应商
        invoiceNumber: '', // 招标文件发票编号
        accountNo: '', // 保证金子账号
        bidBondInvoiceNumber: '', // 中标服务费发票编号
        bulletinPublishTime: ''// 公告发布开始时间
      },
      tableData: []
    }
  },
  created() {
    this.initWebTypeGroup()
  },
  methods: {
    // 导出
    exportBidServiceFeeInfoList() {
      var params = this.searchForm
      exportProjectList(params).then(res => {
        download(res, '运维业务数据信息.xls')
      })
    },
    // 获取数据
    loadData(params, callback) {
      queryProjectList(params).then(response => {
        this.loading = false
        this.tableData = response.data.records
        callback(response.data.total)
      }).catch(() => {
        this.loading = false
      })
    },
    // 处理搜索时间格式
    handleCreateTime(val) {
      if (val) {
        this.searchForm.bulletinPublishStartTime = this.$Moment(val[0]).format(this.momentSaveFormat)// 创建开始时间
        this.searchForm.bulletinPublishEndTime = this.$Moment(val[1]).format(this.momentSaveFormat)// 创建结束时间
      }
    }
  }
}
</script>
<style lang="less" scoped>

</style>
