<!--
  @description:合同审核
  @Modifier:郝定康
  @routerPath:
  @date:2021-10-19 09:33:45
-->
<template>
  <div class="p0-16">
    <section class="title p0-16 clearfix mb10">
      <!-- 返回 -->
      <div class="title title_border" @click="back()">
        <i class="iconfont icon-fanhui mr10" />合同审核
      </div>
    </section>
    <div>
      <contractSigningDetail />
    </div>
  </div>
</template>
<script>
/* api*/
import { auditContractMainInfo } from '@/api/contractManagement/index'// 招标项目-签订列表
/* 组件*/
import contractSigningDetail from '@views/contractManagement/contractSigning/contractSigningInfo/contractSigning-detail'

export default {
  name: 'SupplierReceiptSettingsAudit',
  components: {
    contractSigningDetail
  },
  data() {
    return {
      confirmLoading: false,
      bizId: this.$route.query.id,
      dialog: false // 弹窗状态 false 关闭 true 打开
    }
  },
  created() {
  },
  methods: {
    // 返回
    back() {
      this.$router.push({
        path: '/contractManagement/contractAudit-list'
      })
    },
    // 审核通过/不通过
    handleAudit(auditStatus) {
      const params = {
        auditOpinion: this.auditInfoParam.auditOpinion, // 审批意见
        auditStatus: auditStatus, // 审批状态 02驳回,01通过
        contractId: this.$route.params.id
      }
      if (auditStatus === '01') {
        this.$confirm('是否确认通过?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          confirmButtonClass: 'confirmBtn',
          cancelButtonClass: 'cancelBtn',
          type: 'warning'
        }).then(() => {
          auditContractMainInfo(params).then(res => {
            this.$message.success(res.header.msg)
            this.back()
          }).catch(() => {
          })
        }).catch(() => {
        })
      } else {
        if (this.auditInfoParam.auditOpinion === '') {
          this.$message.warning('请填写审批意见')
          return false
        }
        this.$confirm('是否确认不通过?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          confirmButtonClass: 'confirmBtn',
          cancelButtonClass: 'cancelBtn',
          type: 'warning'
        }).then(() => {
          auditContractMainInfo(params).then(res => {
            this.$message.success(res.header.msg)
            this.back()
          }).catch(() => {
          })
        }).catch(() => {
        })
      }
    }
  }
}
</script>
<style lang="less" scoped>

</style>
