<!--
  @description:  项目经理-采购计划明细-查看行项目信息--产品未使用
  @author: gmy
  @routerPath:/procurement/procurementPlanDetail
  @date： 2020-08-3 14:30:12
-->
<template>
  <div class="p0-16">
    <section class="title">
      <i class="iconfont icon-fanhui pointer" @click="back()" />
      查看行项目信息
    </section>
    <table class="tableData">
      <tr>
        <td>采购计划编号</td>
        <td>{{ formData.purchasePlanNo }}</td>
        <td>采购计划名称</td>
        <td>{{ formData.purchasePlanName }}</td>
      </tr>
      <!-- purchaseOrganization采购类型00 自采 01 委托 -->
      <tr>
        <td>采购组织形式</td>
        <td>
          <span>{{ filterDictText(plan_purchase_organizationList, formData.purchaseOrganization) }}</span>
        </td>
        <td>类型</td>
        <td>
          <span>{{ filterDictText(plan_purchase_typeList, formData.purchaseType) }}</span>
        </td>
      </tr>
      <tr v-if="formData.purchaseOrganization==='01'">
        <td>代理机构</td>
        <td colspan="3">
          {{ formData.agentDepartName }}
        </td>
      </tr>
      <tr v-if="formData.purchaseOrganization==='01'">
        <td>项目经理</td>
        <td>{{ formData.agentRealName }}</td>
        <td>联系方式</td>
        <td>{{ formData.contactNumber }}</td>
      </tr>
      <tr>
        <td>行项目编码</td>
        <td>{{ formData.purchaseNo }}</td>
        <td>产品编码</td>
        <td>{{ formData.purchaseCode }}</td>
      </tr>
      <tr>
        <td>产品描述</td>
        <td colspan="3">
          {{ formData.purchaseDesc }}
        </td>
      </tr>
      <tr>
        <td>数量</td>
        <td>{{ formData.purchaseNum }}</td>
        <td>计量单位</td>
        <td>
          <span>{{ filterDictText(purchaseUnitList, formData.purchaseUnit) }}</span>
        </td>
      </tr>
      <tr>
        <td>税率（%）</td>
        <td>{{ filterDictText(taxRateList,formData.purchaseTaxRate) }}</td>
        <td>预算净单价（元）</td>
        <td>
          {{ formData.purchaseBudget }}
        </td>
      </tr>
      <tr>
        <td>预算净总价（元）</td>
        <td>
          {{ formData.purchaseTotalBudget }}
        </td>
        <td>交货时间</td>
        <td>{{ formData.deliveryTime }}</td>
      </tr>
      <tr>
        <td>交货地点</td>
        <td colspan="3">
          {{ formData.deliveryAreaName + formData.deliveryAddress }}
        </td>
      </tr>
      <!-- purchaseOrganization采购组织形式 00 自采 01委托采购  委托采购显示采购单位 采购员 联系电话 邮箱 -->
      <tr v-if="formData.purchaseOrganization==='01'">
        <td>采购单位</td>
        <td>
          {{ formData.purchaseDepartName }}
        </td>
        <td>采购员</td>
        <td>
          {{ formData.purchaseUserRealName }}
        </td>
      </tr>
      <tr v-if="formData.purchaseOrganization==='01'">
        <td>联系电话</td>
        <td>
          {{ formData.purchaseUserTel }}
        </td>
        <td>邮箱</td>
        <td>
          {{ formData.purchaseUserEmail }}
        </td>
      </tr>
      <tr>
        <td>备注</td>
        <td colspan="3">
          {{ formData.remark }}
        </td>
      </tr>
      <tr>
        <td>附件</td>
        <td colspan="3">
          <downloadFile v-if="lineItemFileType.bizId" :data="lineItemFileType" />
        </td>
      </tr>
      <tr>
        <td>状态</td>
        <td colspan="3">
          <span>{{ filterDictText(plan_data_statusList, formData.dataStatus) }}</span>
        </td>
      </tr>
    </table>
  </div>
</template>

<script>
/* api接口*/
import { queryPurchasePlanDetailInfo } from '@/api/procurement/purchasplan'
/** 公共方法 */
import { procurementPlanGrounpMixins } from '../mixins/procurementPlanGroupMixins'// 字典信息
import { procurementMixins } from '../../mixins/procurementMixins'// 公共数据
import { moneyFormat, filterDictText } from '@/assets/js/utils' // 转千分位 数据字典方法
/* 公共组件*/
import downloadFile from '@comp/common/updownload/downloadFile' // 文件回显
export default {
  name: 'ProcurementPlanDetail',
  components: {
    downloadFile // 文件回显组件
  },
  mixins: [procurementPlanGrounpMixins, procurementMixins],
  data() {
    return {
      formData: {}, // 项目基本信息
      planDetailId: this.$route.query.planDetailId
    }
  },
  created() {
    // 字典接口数据方法
    // this.initWebTypeGroup()
  },
  mounted() {
    // 获取采购计划单条信息
    this.getConstructionProject()
  },
  methods: {
    filterDictText, // 数据字典方法
    // 获取采购计划单条信息
    getConstructionProject() {
      queryPurchasePlanDetailInfo(this.planDetailId).then(res => {
        this.formData = {
          ...res.data,
          purchaseBudget: moneyFormat(res.data.purchaseBudget), // 单价转千分位
          purchaseTotalBudget: moneyFormat(res.data.purchaseTotalBudget) // 总价转千分位
        }
        this.lineItemFileType.bizId = this.planDetailId
      }).catch(() => {
      })
    },
    // 返回按钮
    back() {
      this.$router.push({ path: '/procurement/procurementPlanDetailList' })
    }
  }
}
</script>
<style lang="less" scoped>
</style>
