<!--
  @description:采购立项-供应商-竞价大厅已开启
  @Modifier:gmy
  @routerPath:/biddingLobby/offerLobbyBidding
  @date:2020/5/9-15:48
-->
<template>
  <el-scrollbar class="open-info-scrollbar">
    <div class="open-info">
      <offerHeader @closeHall="closeHall" />
      <section class="offer-content">
        <div class="offer-Supplier-left">
          <!-- 我的报价 -->
          <offerMy :project-rules-data="projectRulesData" :bidding-status="biddingStatus" @reloadData="reloadData" />
          <!-- 实时聊天 -->
          <!-- <offerScoket /> -->
        </div>
        <div class="offer-bidding-centre offer-common">
          <!-- 我的报价 全部报价 -->
          <offerAll ref="offerAll" :project-rules-data="projectRulesData" :hall-type="hallType" />
          <!-- 物资明细 -->
          <offerSupplier />
        </div>
        <!-- 当前竞价状态 -->
        <div class="offer-bidding-right">
          <OfferRules ref="OfferRules" :project-rules-data="projectRulesData" :hall-type="hallType" :bidding-status="biddingStatus" />
        </div>
      </section>
    </div>
  </el-scrollbar>
</template>

<script>
/* 引入公共方法*/
import { procurementBiddingGroupMixin } from '../mixins/procurementBiddingGrounpMixins'
import { procurementBiddingMixins } from '../mixins/procurementBiddingMixins'
import { ListMixin } from '@/mixins/ListMixin'// 分页
/* 公共组件*/
import offerMy from '../components/proBiddingLobbyMy-add' // 我的报价
import offerHeader from '../components/proBiddingLobbyHeader' // 公共头部
import offerAll from '../components/proBiddingSupplierLobbyAll-detail' // 我的报价/全部报价
import OfferRules from '../components/proBiddingLobbyRules-detail' // 当前竞价状态与竞价规则
import offerSupplier from '../components/proBiddingLobbyGoods-list' // 竞价物资组件
import offerScoket from '../components/proBiddingScoket-add'
export default {
  name: 'OfferlobbyBiddingAddVue',
  components: {
    offerSupplier,
    offerHeader,
    OfferRules,
    offerScoket,
    offerAll,
    offerMy
  },
  mixins: [procurementBiddingGroupMixin, procurementBiddingMixins, ListMixin],
  props: {
    // 竞价状态 00竞价未开始 01竞价开始 02竞价结束
    biddingStatus: {
      type: String,
      default: '00'
    },
    // 竞价规则
    projectRulesData: {
      type: Object,
      default: () => {
        return {}
      }
    },
    // 大厅类型 00采购 01供应商
    hallType: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      num: 10,
      activeName: 'first'
    }
  },
  created() {
    const packId = this.$route.query.packId // 获取标段id
    const tenderId = this.$route.query.tenderId // 获取项目id
    if (packId && tenderId) {
      // 调用获取竞价规则的方法
      this.getOfferRulesData(packId)
      // 查询我的报价记录方法
      this.getMyOfferData()
    }
  },
  methods: {
    // 更新页面图表内容
    reloadData() {
      // 我的报价获取数据
      this.$refs.offerAll.reload()
      // 倒计时获取最新时间
      this.$refs.OfferRules.getCurrentTime()
    },
    // 关闭大厅
    closeHall() {
      this.$emit('closeHall')
    }
  }
}
</script>

<style lang="less" scoped>
  @import "~@assets/style/procurement/procurement.bidding.less";
  /deep/.el-input-number--medium {
    line-height: 28px;
  }
  /deep/.el-input-number__increase{
    height:28px;
  }
  /deep/.el-input__inner{
    height:30px;
    line-height: 30px;
  }

</style>
