Blame view

src/views/fee/payFeeBatchList.vue 7.01 KB
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
1
  <template>
f61bd6e8   wuxw   费用下功能基本搞定
2
3
4
5
6
7
8
9
10
11
12
13
14
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
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
78
79
80
81
    <div class="pay-fee-batch-container animated fadeInRight">
      <el-row :gutter="20">
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="flex justify-between">
              <span>{{ $t('payFeeBatch.search.title') }}</span>
            </div>
            <div class="search-content">
              <el-row :gutter="20">
                <el-col :span="6">
                  <el-input v-model="payFeeBatchInfo.conditions.batchId" :placeholder="$t('payFeeBatch.search.batchId')"
                    clearable />
                </el-col>
                <el-col :span="6">
                  <el-select v-model="payFeeBatchInfo.conditions.state" :placeholder="$t('payFeeBatch.search.state')"
                    style="width:100%">
                    <el-option :label="$t('payFeeBatch.state.normal')" value="2006001" />
                    <el-option :label="$t('payFeeBatch.state.applyCancel')" value="2007001" />
                    <el-option :label="$t('payFeeBatch.state.auditPass')" value="2008001" />
                    <el-option :label="$t('payFeeBatch.state.auditFail')" value="2009001" />
                  </el-select>
                </el-col>
                <el-col :span="6">
                  <el-input v-model="payFeeBatchInfo.conditions.createUserName"
                    :placeholder="$t('payFeeBatch.search.createUserName')" clearable />
                </el-col>
                <el-col :span="6">
                  <el-button type="primary" @click="_queryPayFeeBatchMethod">
                    <i class="el-icon-search"></i>
                    {{ $t('common.search') }}
                  </el-button>
                  <el-button @click="_resetPayFeeBatchMethod">
                    <i class="el-icon-refresh"></i>
                    {{ $t('common.reset') }}
                  </el-button>
                </el-col>
              </el-row>
            </div>
          </el-card>
        </el-col>
      </el-row>
  
      <el-row :gutter="20" style="margin-top:20px">
        <el-col :span="24">
          <el-card class="box-card">
            <div slot="header" class="flex justify-between">
              <span>{{ $t('payFeeBatch.list.title') }}</span>
            </div>
            <el-table :data="payFeeBatchInfo.payFeeBatchs" border style="width:100%">
              <el-table-column prop="batchId" :label="$t('payFeeBatch.table.batchId')" align="center" />
              <el-table-column prop="createUserName" :label="$t('payFeeBatch.table.createUserName')" align="center" />
              <el-table-column prop="createTime" :label="$t('payFeeBatch.table.createTime')" align="center" />
              <el-table-column prop="remark" :label="$t('payFeeBatch.table.remark')" align="center">
                <template slot-scope="scope">
                  {{ scope.row.remark || $t('payFeeBatch.table.noRemark') }}
                </template>
              </el-table-column>
              <el-table-column prop="stateName" :label="$t('payFeeBatch.table.stateName')" align="center" />
              <el-table-column prop="msg" :label="$t('payFeeBatch.table.msg')" align="center" />
              <el-table-column :label="$t('common.operation')" align="center" width="200">
                <template slot-scope="scope">
                  <el-button v-if="scope.row.state === '2006001'" size="mini" @click="_openApply(scope.row)">
                    {{ $t('payFeeBatch.button.applyCancel') }}
                  </el-button>
                  <el-button v-if="scope.row.state === '2007001'" size="mini" type="primary"
                    @click="_openPayFeeBatchAuditModel(scope.row)">
                    {{ $t('payFeeBatch.button.audit') }}
                  </el-button>
                </template>
              </el-table-column>
            </el-table>
  
            <el-pagination :current-page.sync="pagination.current" :page-sizes="[10, 20, 30, 50]"
              :page-size="pagination.size" :total="pagination.total" layout="total, sizes, prev, pager, next, jumper"
              @size-change="handleSizeChange" @current-change="handleCurrentChange" />
          </el-card>
        </el-col>
      </el-row>
  
      <apply-delete-fee-batch ref="applyDeleteFeeBatch" @success="handleSuccess" />
26fd2f03   wuxw   费用功能测试完成
82
      <audit ref="audit" @success="_auditPayFeeBatchState" />
f61bd6e8   wuxw   费用下功能基本搞定
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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
    </div>
  </template>
  
  <script>
  import { listPayFeeBatch, updatePayFeeBatch } from '@/api/fee/payFeeBatchApi'
  import { getCommunityId } from '@/api/community/communityApi'
  import ApplyDeleteFeeBatch from '@/components/fee/applyDeleteFeeBatch'
  import Audit from '@/components/fee/audit'
  
  export default {
    name: 'PayFeeBatchList',
    components: {
      ApplyDeleteFeeBatch,
      Audit
    },
    data() {
      return {
        payFeeBatchInfo: {
          payFeeBatchs: [],
          conditions: {
            communityId: '',
            state: '',
            batchId: '',
            createUserName: ''
          }
        },
        pagination: {
          current: 1,
          size: 10,
          total: 0
        }
      }
    },
    created() {
      this.payFeeBatchInfo.conditions.communityId = getCommunityId()
      this._listPayFeeBatchs(this.pagination.current, this.pagination.size)
    },
    methods: {
      async _listPayFeeBatchs(page, size) {
        try {
          const params = {
            ...this.payFeeBatchInfo.conditions,
            page,
            row: size
          }
          const { data, total } = await listPayFeeBatch(params)
          this.payFeeBatchInfo.payFeeBatchs = data
          this.pagination.total = total
        } catch (error) {
          console.error('获取数据失败:', error)
        }
      },
      _queryPayFeeBatchMethod() {
        this.pagination.current = 1
        this._listPayFeeBatchs(this.pagination.current, this.pagination.size)
      },
      _resetPayFeeBatchMethod() {
        this.payFeeBatchInfo.conditions = {
          ...this.payFeeBatchInfo.conditions,
          state: '',
          batchId: '',
          createUserName: ''
        }
        this._queryPayFeeBatchMethod()
      },
      _openApply(payFee) {
        this.$refs.applyDeleteFeeBatch.open(payFee)
      },
      _openPayFeeBatchAuditModel(payFee) {
        this.payFeeBatchInfo.payFeeBatch = payFee
        this.$refs.audit.open()
      },
      async _auditPayFeeBatchState(auditInfo) {
        try {
          const payFeeBatch = {
            ...this.payFeeBatchInfo.payFeeBatch,
            state: auditInfo.state,
            msg: auditInfo.remark
          }
          await updatePayFeeBatch(payFeeBatch)
6ec243d6   wuxw   v1.9 点击提交后,成功提示没有...
163
          this.$message.success(this.$t('common.operationSuccess'))
f61bd6e8   wuxw   费用下功能基本搞定
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
          this._listPayFeeBatchs(this.pagination.current, this.pagination.size)
        } catch (error) {
          console.error('审核失败:', error)
        }
      },
      handleSuccess() {
        this._listPayFeeBatchs(this.pagination.current, this.pagination.size)
      },
      handleSizeChange(val) {
        this.pagination.size = val
        this._listPayFeeBatchs(this.pagination.current, this.pagination.size)
      },
      handleCurrentChange(val) {
        this.pagination.current = val
        this._listPayFeeBatchs(this.pagination.current, this.pagination.size)
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .pay-fee-batch-container {
    padding: 20px;
  
    .search-content {
      margin-bottom: 20px;
    }
  
    .el-pagination {
      margin-top: 20px;
      text-align: right;
    }
  }
  </style>