<template>
  <div>
    <el-dialog
      :close-on-click-modal="false"
      title="报价详情"
      :visible.sync="showTroubleshooting"
      width="60%"
      :close-on-press-escape="false"
      :before-close="handleClose"
    >
      <template>
        <div class="bbsl-table-search">
        <el-table
          ref="multipleSelection"
          v-loading="loading"
          border
          :data="tableData"
          :style="{width: '100%'}"
          :max-height="tableMaxHeight"
          :cell-style="{'text-align': 'center'}"
          :header-cell-style="{'text-align': 'center'}"
        >
          <el-table-column
            prop="date"
            min-width="10%"
            label="物料名称"
            align="center"
            resizable
          >
          </el-table-column>
          <el-table-column
            prop="name"
            show-overflow-tooltip
            min-width="10%"
            align="center"
            label="数量"
            resizable
          >
          </el-table-column>
          <el-table-column
            prop="companyName"
            show-overflow-tooltip
            min-width="10%"
            align="center"
            label="单位"
            resizable
          >
          </el-table-column>
          <el-table-column
            prop="upset"
            show-overflow-tooltip
            min-width="10%"
            align="center"
            label="拍卖底价"
            resizable
          >
          </el-table-column>
          <el-table-column
            prop="quote"
            show-overflow-tooltip
            min-width="10%"
            align="center"
            label="当前报价"
            resizable
          >
          </el-table-column>
          <el-table-column
            prop="companyName"
            show-overflow-tooltip
            min-width="10%"
            align="center"
            label="我的报价"
            resizable
          >
          </el-table-column>
        </el-table>
      </template>
    </el-dialog>
  </div>
</template>

<script>
import {TableMixin} from '@/mixins/tableMixin'
// import nineLittlePlaceApi from '@/views/Manage/saftyDanger/api/nineLittlePlaceApi'
export default {
  name: 'CmgtSaftyDangerCheckplanFormDialogTroubleshooting', // 排查计划明细
  props: {},
  data() {
    return {
      tableMaxHeight: 400,
      showTroubleshooting: false, // 控制弹层显示与隐藏
      activeName: '综合评标法',
      tableData: [],
      querys: [
        {
          group: 'main',
          operation: 'EQUAL',
          parentGroup: '',
          property: 'quo.noticeId',
          relation: 'AND',
          value: ''
        },
        {
          group: 'main',
          operation: 'EUQAL',
          parentGroup: '',
          property: 'quo.quotationCompanyId',
          relation: 'AND',
          value: ''
        },
        {
          group: 'main',
          operation: 'EQUAL',
          parentGroup: '',
          property: 'quo.quotationRounds',
          relation: 'AND',
          value: ''
        }],
      queryParam: {
        pageBean: {
          page: 1,
          pageSize: 20
        }
      },
      checkedGh: '',
      sorter: [
        {
          direction: 'DESC',
          property: 'createTime'
        }
      ] // 排序数据
    }
  },
  mixins: [TableMixin],
  created() {},
  methods: {
    //搜索
    handleSearch() {
      // this.loadData()
    },
    //重置
    handleReset() {
      // this.loadData()
    },
    //显示弹框
    add(row) {
      this.querys[0].value = row.noticeId
      this.querys[1].value = row.quotationCompanyId
      this.querys[2].value = row.quotationRounds
      this.showTroubleshooting = true
      this.loadData()
    },
    // 获取list
    loadData(page) {
      if (page) {
        this.queryParam.pageBean.page = page
      }
      // 不分页
      this.queryParam.pageBean.pageSize = -1
      this.loading = true
      this.tableData = []
      this.queryParam.querys = []
      this.queryParam.sorter = this.sorter
      if (this.querys[0].value) {
        this.queryParam.querys.push(this.querys[0])
      }
      if (this.querys[1].value) {
        this.queryParam.querys.push(this.querys[1])
      }
      if (this.querys[2].value) {
        this.queryParam.querys.push(this.querys[2])
      }
      this.$http.post('${portal}/bizBiddingQuotation/v1/pageProDetail',this.queryParam).then(res=>{
        if(res.data.state){
          this.tableData = res.data.value.rows
          this.total = res.data.value.total
        }
        this.$set(this.tableData)
        this.loading = false
      })
    },
    // 重置
    clearQuerys() {
      this.querys[0].value = ''
      this.querys[1].value = ''
    },
    // 点击关闭按钮
    handleClose() {
      this.$refs.multipleSelection.clearSelection()
      this.showTroubleshooting = false
    },
    // 保存按钮
    handleSave() {
      this.$emit('addDetail', this.multipleSelection[0])
      this.handleClose()
    }
  }
}
</script>

<style scoped lang="scss">
/deep/.el-dialog__body {
  padding: 0 20px 40px 20px;
}
</style>
