<!--
  @description: 采购员-结果执行管理-审核页面
  @author: lxl
  @routerPath:procurementPlanRstMgmt/purPlanRstmgmtAddFlowDetail
  @date： 2020-12-21
-->
<template>
  <div>
    <div class="p0-16">
      <!-- 执行结果基本信息 -->
      <div class="mb16">
        <p class="page-title">
          1.执行结果基本信息
        </p>
        <table class="tableData">
          <tr>
            <td>
              执行方式
            </td>
            <td>
              <!-- 00-一次谈判一次采购;01-一次谈判多次采购; -->
              {{ filterDictText(executeTypeList, formData.executeType) }}
            </td>
            <td>
              执行编号
            </td>
            <td>
              {{ formData.executeNo }}
            </td>

            <!-- <td>
            物资编号
          </td>
          <td>
            {{ formData.purchaseCode }}
          </td> -->
          </tr>
          <!-- <tr> -->
          <!-- <td>
            物资信息
          </td>
          <td>
            {{ formData.purchaseName }}
          </td> -->
          <!-- <td>
              采购单位
            </td>
            <td colspan="3">
              {{ formData.belongOrgName }}
            </td> -->
          <!-- </tr> -->
          <tr>
            <td>
              成交供应商
            </td>
            <td>
              {{ formData.suppliersName }}
            </td>
            <td>
              采购单净总价（元）
            </td>
            <td>
              {{ formData.purchaseTotalBudget && numFilter(formData.purchaseTotalBudget) }}
            </td>
          </tr>
          <tr>
            <td>
              来源
            </td>
            <td>
              {{ filterDictText(tenderMethodList, formData.tenderMethod) }}
            </td>
            <td>
              来源编号
            </td>
            <td>
              {{ formData.belongTenderNo }}
            </td>
          </tr>
          <tr>
            <td>
              付款方式
            </td>
            <td colspan="3">
              {{ filterDictText(paymentTypeList, formData.paymentType) }}
            </td>
          </tr>
          <tr>
            <td>
              执行日期
            </td>
            <td>
              {{ formData.executeTime && $Moment(formData.executeTime).format(momentDate) }}
            </td>
            <td>
              有效期至
            </td>
            <td>
              {{ formData.validityPeriod }}
            </td>
          </tr>
          <tr>
            <td>
              创建人
            </td>
            <td>
              {{ formData.exeCreateUserRealName }}
            </td>
            <td>
              创建日期
            </td>
            <td>
              {{ formData.createTime && $Moment(formData.createTime).format(momentDate) }}
            </td>
          </tr>
        </table>
      </div>
      <!-- 采购计划基本信息 -->
      <div class="mb16">
        <p class="page-title">
          2.采购计划基本信息
        </p>
        <!-- 行项目信息组件 -->
        <projectLineItemInfo :line-project-data="formData.detailsList" />
      </div>
    </div>
  </div>
</template>
<script>
/* api*/
import { goPurchasePlanResultExecutePage } from '@/api/procurement/purchasplan'
import { queryProcurementProjectRuleInitInfo } from '@/api/procurement/procurementProject' // 付款方式字典 queryProcurementProjectRuleInitInfo

/* 公用方法*/
import { filterDictText, numFilter } from '@/assets/js/utils' // 金额转换千分位
import { rstMgmtMixins } from '../mixins/rstMgmtMixins'
/* 公共组件 */
import projectLineItemInfo from '../rstMgmtAdd/lineItemInfoTable' // 行项目信息组件

export default {
  name: 'RstmgmtAddFlowDetail',
  components: {
    projectLineItemInfo
  },
  mixins: [rstMgmtMixins],
  data() {
    return {
      paymentTypeList: [], // 付款方式字典
      formData: {},
      tableData: []
    }
  },
  created() {
    this.getMaintenanceInfo()
    // 付款方式字典请求
    this.queryRuleInitInfo()
  },
  methods: {
    filterDictText, // 字典替换
    numFilter, // 金额补零
    // 付款方式字典请求
    queryRuleInitInfo() {
      queryProcurementProjectRuleInitInfo().then((res) => {
        this.paymentTypeList = res.data.protproject_payType.typeList // 支付方式
      })
    },
    getMaintenanceInfo() {
      const params = {
        executeId: this.$route.query.id,
        resultExeType: ''
      }
      goPurchasePlanResultExecutePage(params).then((res) => {
        this.formData = res.data
        this.tableData = res.data.detailsList
      })
    }
  }
}
</script>
