Blame view

src/components/fee/refundDepositFee.vue 1.63 KB
24d3590f   wuxw   房屋收费页面开发完成
1
2
3
  <template>
    <el-dialog
      :title="$t('refundDepositFee.title')"
1a0bdbe0   wuxw   优化缴费页面
4
5
6
      :visible.sync="dialogVisible"
      width="30%"
      @close="handleClose"
24d3590f   wuxw   房屋收费页面开发完成
7
    >
1a0bdbe0   wuxw   优化缴费页面
8
9
10
11
12
13
14
      <el-alert
        :title="$t('refundDepositFee.alertText')"
        type="warning"
        :closable="false"
      ></el-alert>
  
      <div slot="footer" class="dialog-footer">
ab1ebb3c   wuxw   缴费支持 押金 优惠券 优惠折扣 ...
15
16
        <el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
        <el-button type="primary" @click="refundDepositFee">{{ $t('common.confirm') }}</el-button>
24d3590f   wuxw   房屋收费页面开发完成
17
      </div>
24d3590f   wuxw   房屋收费页面开发完成
18
19
20
21
22
    </el-dialog>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
ab1ebb3c   wuxw   缴费支持 押金 优惠券 优惠折扣 ...
23
  import { refundFeeDeposit } from '@/api/fee/payFeeOrderApi'
24d3590f   wuxw   房屋收费页面开发完成
24
25
26
27
28
  
  export default {
    name: 'RefundDepositFee',
    data() {
      return {
1a0bdbe0   wuxw   优化缴费页面
29
30
        dialogVisible: false,
        refundData: {}
24d3590f   wuxw   房屋收费页面开发完成
31
32
33
      }
    },
    methods: {
1a0bdbe0   wuxw   优化缴费页面
34
35
36
      open(params) {
        this.refundData = { ...params }
        this.dialogVisible = true
24d3590f   wuxw   房屋收费页面开发完成
37
      },
1a0bdbe0   wuxw   优化缴费页面
38
39
      close() {
        this.dialogVisible = false
24d3590f   wuxw   房屋收费页面开发完成
40
      },
24d3590f   wuxw   房屋收费页面开发完成
41
42
      async refundDepositFee() {
        try {
1a0bdbe0   wuxw   优化缴费页面
43
44
          this.refundData.communityId = await getCommunityId()
          
ab1ebb3c   wuxw   缴费支持 押金 优惠券 优惠折扣 ...
45
46
          const response = await refundFeeDeposit(this.refundData)
          if (response.code === 0) {
1a0bdbe0   wuxw   优化缴费页面
47
            this.$message.success(this.$t('refundDepositFee.success'))
24d3590f   wuxw   房屋收费页面开发完成
48
            this.$emit('success')
24d3590f   wuxw   房屋收费页面开发完成
49
          } else {
1a0bdbe0   wuxw   优化缴费页面
50
            this.$message.error(response.data.msg)
24d3590f   wuxw   房屋收费页面开发完成
51
52
          }
        } catch (error) {
1a0bdbe0   wuxw   优化缴费页面
53
54
          console.error('退押金失败:', error)
          this.$message.error(this.$t('refundDepositFee.error'))
24d3590f   wuxw   房屋收费页面开发完成
55
        }
1a0bdbe0   wuxw   优化缴费页面
56
57
58
      },
      handleClose() {
        this.refundData = {}
24d3590f   wuxw   房屋收费页面开发完成
59
60
61
62
63
      }
    }
  }
  </script>
  
1a0bdbe0   wuxw   优化缴费页面
64
65
66
67
68
69
  <style scoped>
  .el-alert {
    margin-bottom: 20px;
  }
  .dialog-footer {
    text-align: right;
24d3590f   wuxw   房屋收费页面开发完成
70
71
  }
  </style>