<template>
  <div class="biddingManagement-template-review">
    <cy-up-down-drag>
      <div slot="top">
        <bidding-management-view></bidding-management-view>
      </div>
      <div slot="bar">
        <div>
          模板审核
        </div>
      </div>
      <div slot="bottom">
        <div class="tempalte-content" style="min-height: auto; padding: 0px 20px ">
          <template-review-content ref="templateReviewContent" />
          <div class="submit-btn">
            <el-button style="width: 150px;" type="primary" @click="onSubmit">确定</el-button>
            <el-button style="width: 150px;" @click="() => { $router.go(-1) }">取消</el-button>
          </div>
        </div>
      </div>
    </cy-up-down-drag>
  </div>
</template>

<script setup>
import { templateReviewTo } from '@/api/biddingManagement/biddingManagement'
import TemplateReviewContent from './components/TemplateReviewContent'
export default {
  name: 'BiddingManagementTemplateReview',
  components: {
    TemplateReviewContent,
    BiddingManagementView: () => import('./components/BiddingManagementView')
  },
  data() {
    return {

    }
  },
  methods: {
    async onSubmit() {
      const templateReview = await this.$refs.templateReviewContent.validate()
      const { id, taskId } = this.$route.query
      const params = {
        Loading: true,
        ...templateReview,
        biddingBasicInfoId: id,
        taskId
      }
      templateReviewTo(params).then(() => {
        this.$message.success('模板审核成功')
        this.$router.push({ name: 'BiddingManagement' })
      })
    }
  }
}
</script>

<style lang="scss" scoped>
  /* .template-examine .submit-btn {
    position: absolute;
    bottom: 40px;
    right: 40px;
  } */
</style>

