WithdrawalDialog.vue 1.28 KB
<template>
  <el-dialog title='提示' :visible.sync='dialogVisible' width='30%'>
    <div v-html='textTooltip'></div>
    <span slot='footer' class='dialog-footer'>
        <el-button @click='dialogVisible = false'>取 消</el-button>
        <el-button type='primary' @click='handleDebounce'
        >确 定</el-button
        >
      </span>
  </el-dialog>
</template>

<script>
import { withdrawalApi } from '@/api/withdrawalManagement'
import debounce from '@/utils/debounce'
import { profitApi } from '@/api/profitManagement'

export default {
  name: 'WithdrawalDialog',
  props: ['textTooltip', 'auditId'],
  data() {
    return {
      dialogVisible: false
    }
  },
  methods: {
    handleDebounce: debounce(
      async function() {
        const params = {
          ...JSON.parse(JSON.stringify(
            { idList: this.auditId }
          )),
          withDrawType: 1
        }
        await withdrawalApi.batchWithdrawal(params).then(res => {
          if (res.code !== '0') {
            this.$message.error('审核失败')
          } else {
            this.$message.success('审核成功')
          }
        }).catch(err => {
            this.$message.error(err)
          }
        )
        this.dialogVisible = false
      },
      1000
    )
  }
}
</script>

<style scoped>

</style>