<!--
  @description:招标项目/采购项目-合同供应内容/价格
  @Modifier:郝定康
  @routerPath:
  @date:2021-10-21 09:30:46
-->
<template>
  <div>
    <contractLineItemInfo v-for="(item, index) in formData.supplyContractPartyVo" :key="index" :contract-id="formData.id" :data-info="item" />
    <!--保存按钮-->
    <div class="but_footer">
      <div class="but_footer-h" />
      <div class="but_footer-but">
        <el-button @click="prevStep">
          上一步
        </el-button>
        <el-button type="primary" @click="nextStep()">
          下一步
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
/* api */
import { getBidtCalibrationTenderContractData } from '@/api/contractManagement/index'
/* 公共组件*/
import contractLineItemInfo from './contractLineItemInfo' // 文件上传组件
export default {
  name: 'ContractContentAndPriceAdd',
  components: {
    contractLineItemInfo
  },
  data() {
    return {
      formData: {}
    }
  },
  created() {
    this.initData()
  },
  methods: {
    // 编辑初始化数据
    initData() {
      const data = {
        id: this.$route.query.id
      }
      getBidtCalibrationTenderContractData(data).then(response => {
        this.formData = response.data
      }).catch(() => {
        this.confirmLoading = false
      })
    },
    // 上一步
    prevStep() {
      const pathData = {
        ...this.$route.query
      }
      this.$emit('stepPage', 'prev', pathData)// 步骤条切换方法 prev 上一步
    },
    // 下一步
    nextStep() {
      const pathData = {
        ...this.$route.query
      }
      this.$emit('stepPage', 'next', pathData)// 步骤条切换方法 next 下一步
    }
  }
}
</script>

<style>
</style>
