<!--
  @description: 采购公告
  @author: qk
  @routerPath:
  @date: 2020-2-24 16:03:58
-->
<template>
  <div>
    <InvitationPurchase v-if="status === '11' || status === '15' || status === '16' || status === '12' || status === '13'" :statusc="status" @stepPage="stepPage" />
    <projectNoticeAdd v-if="status === '10' || status === '14'" :statusc="status" @stepPage="stepPage" />
  </div>
</template>

<script>
/* 接口*/
import InvitationPurchase from '../InvitationPurchase/InvitationPurchase-add'
import projectNoticeAdd from './projectNotice-add'
import { queryBaseProcurementProjectInfo } from
  '@/api/procurement/procurementProject'// ，获取
export default {
  name: 'ProcurementProjectAdd',
  components: {
    InvitationPurchase,
    projectNoticeAdd
  },
  data() {
    return {
      status: '' // 采购方式：10公开询价  11邀请询价  12竞争性谈判  13竞争性磋商   14公开竞价  15邀请竞价  16单一来源采购
    }
  },
  computed: {
  },
  watch: {
  },
  created() {
    const tenderId = this.$route.query.id// 采购项目信息Id
    if (tenderId) {
      // 编辑时
      this.getStatusData(tenderId)
    }
  },
  methods: {
    stepPage() {
      const pathData = {
        id: this.$route.query.id,
        packId: this.$route.query.packId
      }
      this.$emit('stepPage', 'prev', pathData)// 步骤条切换方法 prev 上一步
    },
    // 封装获取数据方法
    getStatusData(tenderId) {
      // 查询采购项目信息
      queryBaseProcurementProjectInfo({ tenderId: tenderId }).then(res => {
        // 根据状态判断 公告类型/ 邀请函
        this.status = res.data.tenderMethod
      })
    }
  }
}
</script>

<style lang="less" scoped>

  /deep/.show-word-limit-padding{
    .el-input__inner{
      padding-right: 70px;
    }
  }
</style>
