<!--
  @description: 立项-预览-标段（包）信息 不分包信息
  @Modifier: haoFx
  @routerPath:
  @date: 2019/12/26-20:34
-->

<template>
  <div>
    <!--标段不分包-->
    <table class="tableData">
      <!--固定金额01显示服务费金额 不添加class 否则添加singleRow-->
      <tr :class="projectData.agentServiceFeeMethod=== '01'?'':'singleRow'">
        <td>项目最高限价（元）</td>
        <td>{{ packageList.maxLimitedPrice?moneyFormat(packageList.maxLimitedPrice.toFixed(2)):packageList.maxLimitedPrice }}</td>
        <template v-if="bidProjectSystemSourceType && projectData.agentServiceFeeMethod ==='01'">
          <td>服务费金额（元）</td>
          <td>{{ packageList.servicePrice }}</td>
        </template>
      </tr>
      <!--有招标计划则显示-->
      <!--    <tr v-if="isProcurementPlan==='01'" class="singleRow">
        <td>关联招标计划</td>
        <td colspan="3">
          {{ packageList.schemeName }}
          &lt;!&ndash;流程信息&#45;&#45;有招标计划则显示&ndash;&gt;
          <el-link
            :underline="false"
            :disabled="!packageList.schemeName"
            type="primary"
            @click="processcControl(packageList.taskPlanList[0].schemeId)">[流程信息]</el-link>
        </td>
      </tr>-->
    </table>
    <!--流程控制-弹框-->
    <processControlInfoDialog v-if="projectData.isProcurementPlan === '01'" ref="processControlInfo" />
  </div>
</template>

<script>
/* api*/
import { queryLimitedPriceInfo } from '@/api/bidding/biddingProject'
/* 组件*/
// import materielListDialog from './materielList-dialog'// 已选物料查看
import processControlInfoDialog from '@views/purchasePlan/tenderPlan/tenderPlan-dialog/processControlInfo-dialog' // 流程控制弹框
/* 公用方法*/
import { moneyFormat } from '@assets/js/utils'// 常用方法
/* 混入*/
import { bidProjectCommon } from '../mixins/bidProjectCommon'
export default {
  name: 'PreviewPackageDetail',
  components: {
    // materielListDialog, // 物料查看
    processControlInfoDialog // 流程控制弹框
  },
  mixins: [bidProjectCommon],
  data() {
    return {
      moneyFormat: moneyFormat, // 千分位转换
      // 项目限价信息
      packageList: {
        tenderId: '', // 项目Id
        schemeName: '', // 计划名称(显示用)
        isSetUpMaxLimitedPrice: '', // 最高限价 00 否 01 是
        maxLimitedPrice: ''// 限价金额
      }
    }
  },
  created() {
    let tenderId = ''
    tenderId = this.projectData.id ? this.projectData.id : this.$route.params.id
    if (this.$route.query.id) tenderId = this.$route.query.id // 传参方式都改完删除
    this.initData(tenderId)
  },
  methods: {
    // 获取标包列表
    initData(tenderId) {
      queryLimitedPriceInfo({ tenderId: tenderId }).then(response => {
        const { data } = response
        this.packageList = Object.assign(this.packageList, data)
        // 回显招标计划已选计划名称
        if (this.packageList.taskPlanList && this.packageList.taskPlanList.length > 0) {
          this.packageList.schemeName = this.packageList.taskPlanList[0].schemeName
        }
      })
    }
    // 流程信息
    /*    processcControl(schemeId) {
      this.$refs.processcControlInfo.openProcesscControlInfoDetail(schemeId)
    }*/
  }
}
</script>

<style lang="less" scoped>
</style>
