<!--
  @description: 采购员-采购方式维护-新增物资采购方式工作流处理页面
  @author: lxl
  @routerPath:/procurementPlanMateriel/purPlanPackMaterielFlowDetail
  @date： 2020-12-17
-->
<template>
  <div class="p0-16" style="margin:10px 0px">
    <p class="page-title">
      1.业务基本信息
    </p>
    <table class="tableData">
      <tr>
        <td>创建人</td>
        <td>{{ formData.createUserName }}</td>
        <td>创建日期</td>
        <td>{{ formData.createTime && $Moment(formData.createTime).format(momentDate) }}</td>
      </tr>
      <tr>
        <td>制造厂商名称</td>
        <td>{{ formData.manufacturerName }}</td>
        <td>品牌</td>
        <td>{{ formData.purchaseBrand }}</td>
      </tr>
      <tr>
        <td>物资编码</td>
        <td>{{ formData.purchaseCode }}</td>
        <td>采购方式名称</td>
        <td>{{ formData.purchaseMethod }}</td>
      </tr>
      <tr>
        <td>采购方式</td>
        <td>{{ filterDictText(tenderMethodList,formData.purchaseMethodValue) }}</td>
        <td>物资名称</td>
        <td>{{ formData.purchaseName }}</td>
      </tr>
      <tr>
        <td>供货厂商名称</td>
        <td>{{ formData.suppliersName }}</td>
        <td>附件</td>
        <!--查看附件 -->
        <td>
          <el-link
            :underline="false"
            size="mini"
            plain
            type="primary"
            @click="checkAccessory"
          >
            查看
          </el-link>
        </td>
      </tr>
    </table>
    <!-- 查看附件弹框 -->
    <checkFIleCompDialog :dialog-file-data="dialogFileData" />
  </div>
</template>
<script>
/* api*/
import { getProcurementMaintenanceInfo } from '@/api/procurement/purchasplan'
// 组件
import checkFIleCompDialog from '@/views/procurement/procurementPlan/components/checkFIleComp-dialog.vue'// 查看附件
/* 公用方法*/
import { filterDictText } from '@/assets/js/utils'// 常用方法
/*  mixins*/
import { materielMixins } from '../mixins/materielMixins' // 字典混入

export default {
  name: 'PurPlanAddFlowDetail',
  components: {
    checkFIleCompDialog
  },
  mixins: [materielMixins],
  data() {
    return {
      formData: {},
      // 查看附件弹框数据
      dialogFileData: {
        checkFileVisible: false, // 查看附件弹框状态
        bizId: '', // 附件主键id
        fileType: 'purchase_maintenance_file_'
      }
    }
  },
  created() {
    this.getMaintenanceInfo() // 初始化数据
  },
  methods: {
    filterDictText, // 字典
    // 数据请求
    getMaintenanceInfo() {
      const params = {
        purchaseMaintenanceId: this.$route.query.id
      }
      getProcurementMaintenanceInfo(params).then((res) => {
        this.formData = res.data
        this.dialogFileData.bizId = this.$route.query.packId
      })
    },
    checkAccessory() {
      this.dialogFileData.checkFileVisible = true
    }
  }
}
</script>
