
<!--
  @description: 采购-查看历史报价
  @Modifier：郝定康
  @routerPath:
  @date：2020-12-01 16:05:21
-->
<template>
  <el-dialog
    v-dialogDrag
    :visible.sync="dialogData.dialog"
    :close-on-click-modal="false"
    append-to-body
    title="历史报价"
    width="1160px"
    custom-class="el-dialog__body-p8 el-dialog_table"
  >
    <div class="floatTip">
      <div class="floatTipText">
        物资名称:
      </div>
      {{ dialogData.productName }}
    </div>
    <div class="floatTip">
      <div class="floatTipText">
        物资编号:
      </div>
      {{ dialogData.productNo }}
    </div>
    <el-table
      ref="smallTable"
      :data="tableData"
      class="lineItemList"
    >
      <el-table-column header-align="center" align="center" type="index" width="60px" label="序号" />
      <el-table-column header-align="center" align="right" prop="transactionBudget" label="成交单价（元）" />
      <el-table-column header-align="center" prop="supplierName" label="成交供应商" />
      <el-table-column header-align="center" prop="purchaseDepartName" label="采购单位" />
      <el-table-column header-align="center" align="right" prop="distributionNumber" label="采购数量" />
      <el-table-column header-align="center" align="center" prop="orderNo" min-width="100" label="采购订单号" />
      <el-table-column header-align="center" align="center" prop="transactionTime" min-width="100" label="成交时间" />
    </el-table>
    <span slot="footer" class="dialog-footer">
      <el-button @click="closeDialog">
        关闭
      </el-button>
    </span>
  </el-dialog>
</template>

<script>
import { getProtProjectTransactionRecordsList } from '@/api/procurement/procurementResult' // 获取历史报价
export default {
  name: 'HistoricalQuotationDialog',
  mixins: [],
  props: {
    dialogData: {
      type: Object,
      default: function() {
        return {}
      }
    }
  },
  data() {
    return {
      tableData: []
    }
  },
  watch: {
    'dialogData.dialog'(val) {
      if (val) {
        // 获取历史报价
        this.getData(this.dialogData.productNo)
      }
    }
  },
  created() {
  },
  methods: {
    getData(productNo) {
      const params = {
        productNo // 行项目编号
      }
      // 获取历史报价
      getProtProjectTransactionRecordsList(params).then(respose => {
        this.tableData = respose.data
      })
    },
    // 关闭弹框
    closeDialog() {
      this.dialogData.dialog = false
    }
  }
}
</script>

<style scoped lang="less">
.floatTip{
  margin: 0 10px;
  float: right;
  .floatTipText{
    display: inline-block;
  }
  .floatTipInput{
    display: inline-block !important;
    margin-bottom: 18px;
  }
}
</style>
