Blame view

src/components/fee/refundDepositFee.vue 1.66 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
15
16
      <el-alert
        :title="$t('refundDepositFee.alertText')"
        type="warning"
        :closable="false"
      ></el-alert>
  
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">{{ $t('refundDepositFee.cancel') }}</el-button>
        <el-button type="primary" @click="refundDepositFee">{{ $t('refundDepositFee.confirm') }}</el-button>
24d3590f   wuxw   房屋收费页面开发完成
17
      </div>
24d3590f   wuxw   房屋收费页面开发完成
18
19
20
21
22
    </el-dialog>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
24d3590f   wuxw   房屋收费页面开发完成
23
24
25
26
27
  
  export default {
    name: 'RefundDepositFee',
    data() {
      return {
1a0bdbe0   wuxw   优化缴费页面
28
29
        dialogVisible: false,
        refundData: {}
24d3590f   wuxw   房屋收费页面开发完成
30
31
32
      }
    },
    methods: {
1a0bdbe0   wuxw   优化缴费页面
33
34
35
      open(params) {
        this.refundData = { ...params }
        this.dialogVisible = true
24d3590f   wuxw   房屋收费页面开发完成
36
      },
1a0bdbe0   wuxw   优化缴费页面
37
38
      close() {
        this.dialogVisible = false
24d3590f   wuxw   房屋收费页面开发完成
39
      },
24d3590f   wuxw   房屋收费页面开发完成
40
41
      async refundDepositFee() {
        try {
1a0bdbe0   wuxw   优化缴费页面
42
43
44
45
46
          this.refundData.communityId = await getCommunityId()
          
          const response = await this.$http.post('/fee.refundFeeDeposit', this.refundData)
          if (response.data.code === 0) {
            this.$message.success(this.$t('refundDepositFee.success'))
24d3590f   wuxw   房屋收费页面开发完成
47
            this.$emit('success')
1a0bdbe0   wuxw   优化缴费页面
48
            this.dialogVisible = false
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>