Blame view

src/views/report/feeRemindList.vue 5.44 KB
b25b036d   wuxw   v1.9 优化日期
1
  <template>
51f9221a   wuxw   加入报表功能
2
3
4
5
    <div class="fee-remind-container">
      <el-card class="box-card">
        <div slot="header" class="flex justify-between">
          <span>{{ $t('feeRemind.queryCondition') }}</span>
51f9221a   wuxw   加入报表功能
6
7
8
9
10
11
12
        </div>
        <el-row :gutter="20">
          <el-col :span="4">
            <el-input v-model.trim="feeRemindInfo.conditions.objName" :placeholder="$t('feeRemind.objNamePlaceholder')"
              clearable />
          </el-col>
          <el-col :span="4">
f804bf62   wuxw   报表功能测试完成
13
14
            <el-input v-model.trim="feeRemindInfo.conditions.ownerName"
              :placeholder="$t('feeRemind.ownerNamePlaceholder')" clearable />
51f9221a   wuxw   加入报表功能
15
16
17
18
19
20
21
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
          </el-col>
          <el-col :span="4">
            <el-input v-model.trim="feeRemindInfo.conditions.link" :placeholder="$t('feeRemind.linkPlaceholder')"
              clearable />
          </el-col>
          <el-col :span="4">
            <el-select v-model="feeRemindInfo.conditions.configId" :placeholder="$t('feeRemind.feeConfigPlaceholder')"
              style="width:100%" clearable>
              <el-option v-for="item in feeRemindInfo.feeConfigs" :key="item.configId" :label="item.feeName"
                :value="item.configId" />
            </el-select>
          </el-col>
          <el-col v-if="feeRemindInfo.communitys.length > 1" :span="4">
            <el-select v-model="feeRemindInfo.conditions.communityId" :placeholder="$t('feeRemind.communityPlaceholder')"
              style="width:100%" @change="_changCommunity" clearable>
              <el-option v-for="item in feeRemindInfo.communitys" :key="item.communityId" :label="item.name"
                :value="item.communityId" />
            </el-select>
          </el-col>
          <el-col :span="4">
            <el-button type="primary" @click="_queryMethod">
              <i class="el-icon-search"></i>
              {{ $t('feeRemind.query') }}
            </el-button>
            <el-button @click="_resetMethod">
              <i class="el-icon-refresh"></i>
              {{ $t('feeRemind.reset') }}
            </el-button>
          </el-col>
        </el-row>
      </el-card>
  
      <el-card class="box-card margin-top">
f804bf62   wuxw   报表功能测试完成
48
        <el-tabs v-model="feeRemindInfo._currentTab" @tab-click="changeTab(feeRemindInfo._currentTab)">
51f9221a   wuxw   加入报表功能
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
          <el-tab-pane :label="$t('feeRemind.prePaymentRemind')" name="reportPrePaymentFee">
            <report-pre-payment-fee v-if="feeRemindInfo._currentTab === 'reportPrePaymentFee'" ref="prePaymentFee" />
          </el-tab-pane>
          <el-tab-pane :label="$t('feeRemind.deadlineRemind')" name="reportDeadlineFee">
            <report-deadline-fee v-if="feeRemindInfo._currentTab === 'reportDeadlineFee'" ref="deadlineFee" />
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </div>
  </template>
  
  <script>
  import { getCommunityId } from '@/api/community/communityApi'
  import ReportPrePaymentFee from '@/components/report/reportPrePaymentFee'
  import ReportDeadlineFee from '@/components/report/reportDeadlineFee'
  import {
    listFeeConfigs,
    listMyEnteredCommunitys
  } from '@/api/report/feeRemindApi'
  
  export default {
    name: 'FeeRemindList',
    components: {
      ReportPrePaymentFee,
      ReportDeadlineFee
    },
    data() {
      return {
        feeRemindInfo: {
          _currentTab: 'reportPrePaymentFee',
          feeConfigs: [],
          moreCondition: false,
          communitys: [],
          conditions: {
            objName: '',
            configId: '',
            ownerName: '',
            link: '',
            communityId: ''
          }
        }
      }
    },
    created() {
      this.feeRemindInfo.conditions.communityId = getCommunityId()
      this._loadStaffCommunitys()
      this._listFeeConfigs()
    },
    methods: {
      changeTab(tab) {
f804bf62   wuxw   报表功能测试完成
99
        this.feeRemindInfo._currentTab = tab
51f9221a   wuxw   加入报表功能
100
        setTimeout(() => {
f804bf62   wuxw   报表功能测试完成
101
          if (tab === 'reportPrePaymentFee') {
51f9221a   wuxw   加入报表功能
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
            this.$refs.prePaymentFee && this.$refs.prePaymentFee.loadData(this.feeRemindInfo.conditions)
          } else {
            this.$refs.deadlineFee && this.$refs.deadlineFee.loadData(this.feeRemindInfo.conditions)
          }
        }, 500)
  
      },
      _queryMethod() {
        this.changeTab(this.feeRemindInfo._currentTab)
      },
      _resetMethod() {
        this.feeRemindInfo.conditions = {
          objName: '',
          configId: '',
          ownerName: '',
          link: '',
          communityId: getCommunityId()
        }
        this.changeTab(this.feeRemindInfo._currentTab)
      },
      async _listFeeConfigs() {
        try {
          const params = {
            page: 1,
            row: 100,
            communityId: this.feeRemindInfo.conditions.communityId,
            isDefault: 'F'
          }
          const data = await listFeeConfigs(params)
          this.feeRemindInfo.feeConfigs = data.feeConfigs
        } catch (error) {
          console.error('Failed to load fee configs:', error)
        }
      },
      _moreCondition() {
        this.feeRemindInfo.moreCondition = !this.feeRemindInfo.moreCondition
      },
      async _loadStaffCommunitys() {
        try {
          const params = {
            _uid: '123mlkdinkldldijdhuudjdjkkd',
            page: 1,
            row: 100
          }
          const data = await listMyEnteredCommunitys(params)
          this.feeRemindInfo.communitys = data.communitys
        } catch (error) {
          console.error('Failed to load communities:', error)
        }
      },
      _changCommunity() {
        this._listFeeConfigs()
        this.changeTab(this.feeRemindInfo._currentTab)
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .fee-remind-container {
    padding: 20px;
  
    .box-card {
      margin-bottom: 20px;
    }
  
    .margin-top {
      margin-top: 20px;
    }
  
    .el-col {
      margin-bottom: 10px;
    }
  
    .el-button+.el-button {
      margin-left: 10px;
    }
  }
  </style>