
<!--
  @description: 评标大厅-经济评审行项目报价弹框
  @Modifier：wxy
  @routerPath:
  @date：   2020-08-05 16:02:13
-->
<template>
  <el-dialog
    :visible.sync="dialogData.dialog"
    custom-class="project_mall"
    title="行项目报价"
    width="70%"
    min-height="400px"
  >
    <el-table
      :data="reviewList"
      style="width: 100%;height:100%;overflow-y: scroll;"
    >
      <el-table-column header-align="center" align="center" type="index" width="60px" label="序号" />
      <el-table-column header-align="center" align="left" prop="purchaseDesc" min-width="150" label="物资描述" />
      <el-table-column header-align="center" align="right" width="80px" prop="taxRate" label="税率(%)" />
      <el-table-column header-align="center" align="right" width="80px" prop="quantity" label="数量" />
      <el-table-column header-align="center" align="center" width="100px" prop="unit" label="计量单位">
        <template slot-scope="scope">
          {{ filterDictText(purchaseUnitList, scope.row.unit) }}
        </template>
      </el-table-column>
      <!-- 供应商 -->
      <el-table-column :label="reviewList.length?reviewList[0].supplierName:''" width="300px" align="center">
        <template>
          <!-- 含税单价(元) -->
          <el-table-column header-align="right" prop="taxUnitPrice" label="含税单价（元）" width="110" align="right">
            <template slot-scope="scope">
              {{ moneyFormat(scope.row.taxUnitPrice.toFixed(2)) }}
            </template>
          </el-table-column>
          <!-- 含税总价（元） -->
          <el-table-column header-align="right" prop="singleTotalOfferPrice" label="含税总价（元）" width="110" align="right">
            <template slot-scope="scope">
              {{ moneyFormat(scope.row.singleTotalOfferPrice.toFixed(2)) }}
            </template>
          </el-table-column>
        </template>
      </el-table-column>
    </el-table>
  </el-dialog>
</template>

<script>
import { moneyFormat } from '@assets/js/utils'
/* api*/
import {
  getLastOfferSureDetatilByOfferId
} from '@api/procurement/procurementOffer'
/* 公用方法*/
import { filterDictText } from '@/assets/js/utils'// 常用方法
// 引入数据字典
import { procurementGroupMixins } from '@/views/procurement/mixins/procurementGrounpMixins'
export default {
  mixins: [procurementGroupMixins],
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return {
          dialog: false,
          id: ''
        } // false 关闭 true 打开
      }
    }
  },
  data() {
    return {
      reviewList: [] // 行项目数据列表
    }
  },
  watch: {
    // 弹框打开状态
    'dialogData.dialog'(val) {
      if (val) {
        this.initData()
      }
    }
  },
  created() {
    // 查询计量单位数据字典
    this.initWebTypeGroup()
  },
  methods: {
    filterDictText,
    moneyFormat, // 金额添加千分位
    // 初始化数据
    initData() {
      getLastOfferSureDetatilByOfferId(this.dialogData.id).then(res => {
        this.reviewList = res.data
      })
    }
  }
}
</script>

<style lang="less" scoped>
/deep/.project_mall .el-dialog__body {
    padding: 10px 10px;
    height: 93%;
}
/deep/.project_mall{
  height: 70%;
}
</style>
