Blame view

src/components/fee/payFeeUserAccount.vue 4.13 KB
24d3590f   wuxw   房屋收费页面开发完成
1
  <template>
1a0bdbe0   wuxw   优化缴费页面
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
    <el-dialog
      :title="$t('payFeeUserAccount.title')"
      :visible.sync="dialogVisible"
      width="70%"
      @close="handleClose"
    >
      <el-card v-if="accountList.length > 0">
        <div slot="header" class="clearfix">
          <span>{{ $t('payFeeUserAccount.accountInfo') }}</span>
          <el-button
            type="primary"
            size="small"
            style="float: right;"
            @click="queryPayFeeUserAccount"
          >
            <i class="el-icon-refresh"></i>
            {{ $t('payFeeUserAccount.refresh') }}
          </el-button>
        </div>
24d3590f   wuxw   房屋收费页面开发完成
21
  
1a0bdbe0   wuxw   优化缴费页面
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
        <el-table
          :data="accountList"
          border
          style="width: 100%"
        >
          <el-table-column
            align="center"
            :label="$t('payFeeUserAccount.select')"
            width="80"
          >
            <template slot-scope="scope">
              <el-radio
                v-model="selectedAccount"
                :label="scope.row.acctId"
                @change="computeFeeUserAmount(scope.row.acctId)"
              ></el-radio>
            </template>
          </el-table-column>
          <el-table-column
            prop="acctTypeName"
            align="center"
            :label="$t('payFeeUserAccount.accountType')"
          />
          <el-table-column
            prop="acctName"
            align="center"
            :label="$t('payFeeUserAccount.accountName')"
          />
          <el-table-column
            prop="amount"
            align="center"
            :label="$t('payFeeUserAccount.accountAmount')"
          >
            <template slot-scope="scope">
              {{ scope.row.amount }} {{ $t('payFeeUserAccount.yuan') }}
            </template>
          </el-table-column>
          <el-table-column
            align="center"
            :label="$t('payFeeUserAccount.operation')"
            width="150"
          >
            <template slot-scope="scope">
              <el-button
                type="primary"
                size="mini"
                @click="openAddUserAmountModal(scope.row)"
              >
                <i class="el-icon-plus"></i>
                {{ $t('payFeeUserAccount.prestore') }}
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-card>
    </el-dialog>
24d3590f   wuxw   房屋收费页面开发完成
78
79
80
81
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
24d3590f   wuxw   房屋收费页面开发完成
82
83
84
85
86
  
  export default {
    name: 'PayFeeUserAccount',
    data() {
      return {
1a0bdbe0   wuxw   优化缴费页面
87
88
89
90
91
92
        dialogVisible: false,
        accountList: [],
        feeId: '',
        ownerId: '',
        communityId: '',
        selectedAccount: null
24d3590f   wuxw   房屋收费页面开发完成
93
94
      }
    },
24d3590f   wuxw   房屋收费页面开发完成
95
    methods: {
1a0bdbe0   wuxw   优化缴费页面
96
97
98
99
100
101
102
103
104
105
      open(params) {
        this.feeId = params.feeId
        this.ownerId = params.ownerId || ''
        this.listUserAccount()
        this.dialogVisible = true
      },
      close() {
        this.dialogVisible = false
      },
      async listUserAccount() {
24d3590f   wuxw   房屋收费页面开发完成
106
        try {
1a0bdbe0   wuxw   优化缴费页面
107
          this.communityId = await getCommunityId()
24d3590f   wuxw   房屋收费页面开发完成
108
          const params = {
1a0bdbe0   wuxw   优化缴费页面
109
110
111
112
113
            page: 1,
            row: 20,
            feeId: this.feeId,
            ownerId: this.ownerId,
            communityId: this.communityId
24d3590f   wuxw   房屋收费页面开发完成
114
115
          }
  
1a0bdbe0   wuxw   优化缴费页面
116
117
          const response = await this.$http.get('/account.queryCommunityOwnerAccount', { params })
          this.accountList = response.data.data || []
24d3590f   wuxw   房屋收费页面开发完成
118
        } catch (error) {
1a0bdbe0   wuxw   优化缴费页面
119
          console.error('查询用户账户失败:', error)
24d3590f   wuxw   房屋收费页面开发完成
120
121
        }
      },
1a0bdbe0   wuxw   优化缴费页面
122
123
      queryPayFeeUserAccount() {
        this.listUserAccount()
24d3590f   wuxw   房屋收费页面开发完成
124
      },
1a0bdbe0   wuxw   优化缴费页面
125
      openAddUserAmountModal(userAccount) {
9d019fa6   wuxw   测试OA相关流程
126
        window.open(`/#/views/owner/ownerDetail?ownerId=${userAccount.objId}&currentTab=ownerDetailAccount`)
24d3590f   wuxw   房屋收费页面开发完成
127
      },
1a0bdbe0   wuxw   优化缴费页面
128
129
130
131
132
133
134
135
      computeFeeUserAmount(acctId) {
        let totalUserAmount = 0.0
        let selectAccount = []
        
        this.accountList.forEach(item => {
          if (acctId === item.acctId && item.amount != 0) {
            totalUserAmount += parseFloat(item.amount)
            selectAccount.push(item)
24d3590f   wuxw   房屋收费页面开发完成
136
137
138
139
          }
        })
  
        this.$emit('changeUserAmountPrice', {
1a0bdbe0   wuxw   优化缴费页面
140
141
          totalUserAmount,
          accountList: this.accountList,
24d3590f   wuxw   房屋收费页面开发完成
142
          integralAmount: 0,
1a0bdbe0   wuxw   优化缴费页面
143
          cashAmount: totalUserAmount,
24d3590f   wuxw   房屋收费页面开发完成
144
          couponAmount: 0,
1a0bdbe0   wuxw   优化缴费页面
145
          selectAccount
24d3590f   wuxw   房屋收费页面开发完成
146
147
        })
      },
1a0bdbe0   wuxw   优化缴费页面
148
149
150
151
152
      handleClose() {
        this.accountList = []
        this.selectedAccount = null
        this.feeId = ''
        this.ownerId = ''
24d3590f   wuxw   房屋收费页面开发完成
153
154
155
156
157
      }
    }
  }
  </script>
  
1a0bdbe0   wuxw   优化缴费页面
158
159
160
  <style scoped>
  .el-table {
    margin-top: 20px;
24d3590f   wuxw   房屋收费页面开发完成
161
162
  }
  </style>