Blame view

src/views/fee/staffFeeManageList.vue 4.8 KB
f61bd6e8   wuxw   费用下功能基本搞定
1
2
3
4
5
6
7
8
  <template>
    <div class="staff-fee-manage-container animated fadeInRight">
      <el-row :gutter="20" class="mb-20">
        <el-col :span="24">
          <el-card>
            <div slot="header" class="flex justify-between">
              <span>{{ $t('staffFeeManage.search.title') }}</span>
            </div>
26fd2f03   wuxw   费用功能测试完成
9
10
11
12
            <el-form :inline="true" :model="searchForm" class="demo-form-inline text-left" >
              <el-form-item >
                <el-input v-model="searchForm.userCode" :placeholder="$t('staffFeeManage.search.userCodePlaceholder')"
                  clearable />
f61bd6e8   wuxw   费用下功能基本搞定
13
              </el-form-item>
26fd2f03   wuxw   费用功能测试完成
14
15
16
              <el-form-item >
                <el-date-picker v-model="searchForm.startTime" type="datetime"
                  :placeholder="$t('staffFeeManage.search.startTimePlaceholder')" value-format="yyyy-MM-dd HH:mm:ss" />
f61bd6e8   wuxw   费用下功能基本搞定
17
              </el-form-item>
26fd2f03   wuxw   费用功能测试完成
18
19
20
              <el-form-item >
                <el-date-picker v-model="searchForm.endTime" type="datetime"
                  :placeholder="$t('staffFeeManage.search.endTimePlaceholder')" value-format="yyyy-MM-dd HH:mm:ss" />
f61bd6e8   wuxw   费用下功能基本搞定
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="handleSearch">
                  {{ $t('common.search') }}
                </el-button>
                <el-button @click="handleReset">
                  {{ $t('common.reset') }}
                </el-button>
              </el-form-item>
            </el-form>
          </el-card>
        </el-col>
      </el-row>
  
      <el-row :gutter="20">
        <el-col :span="24">
          <el-card>
            <div slot="header" class="flex justify-between">
              <span>{{ $t('staffFeeManage.list.title') }}</span>
26fd2f03   wuxw   费用功能测试完成
40
              <el-button type="primary" size="small" class="float-right" @click="handleExport">
f61bd6e8   wuxw   费用下功能基本搞定
41
42
43
                {{ $t('common.export') }}
              </el-button>
            </div>
26fd2f03   wuxw   费用功能测试完成
44
45
46
47
48
            <el-table v-loading="loading" :data="tableData" border style="width: 100%">
              <el-table-column prop="userId" :label="$t('staffFeeManage.table.userCode')" align="center" />
              <el-table-column prop="userName" :label="$t('staffFeeManage.table.userName')" align="center" />
              <el-table-column prop="receivableAmount" :label="$t('staffFeeManage.table.receivableAmount')"
                align="center">
f61bd6e8   wuxw   费用下功能基本搞定
49
50
51
52
                <template slot-scope="scope">
                  {{ scope.row.receivableAmount }} {{ $t('staffFeeManage.table.yuan') }}
                </template>
              </el-table-column>
26fd2f03   wuxw   费用功能测试完成
53
              <el-table-column prop="receivedAmount" :label="$t('staffFeeManage.table.receivedAmount')" align="center">
f61bd6e8   wuxw   费用下功能基本搞定
54
55
56
57
58
                <template slot-scope="scope">
                  {{ scope.row.receivedAmount }} {{ $t('staffFeeManage.table.yuan') }}
                </template>
              </el-table-column>
            </el-table>
26fd2f03   wuxw   费用功能测试完成
59
60
61
            <el-pagination :current-page="pagination.current" :page-sizes="[10, 20, 30, 50]" :page-size="pagination.size"
              layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" @size-change="handleSizeChange"
              @current-change="handleCurrentChange" />
f61bd6e8   wuxw   费用下功能基本搞定
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
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
          </el-card>
        </el-col>
      </el-row>
    </div>
  </template>
  
  <script>
  import { getStaffFeeList } from '@/api/fee/staffFeeManageApi'
  import { getCommunityId } from '@/api/community/communityApi'
  
  export default {
    name: 'StaffFeeManageList',
    data() {
      return {
        loading: false,
        searchForm: {
          communityId: '',
          userCode: '',
          startTime: '',
          endTime: ''
        },
        tableData: [],
        pagination: {
          current: 1,
          size: 10,
          total: 0
        }
      }
    },
    created() {
      this.searchForm.communityId = getCommunityId()
      this.getList()
    },
    methods: {
      async getList() {
        try {
          this.loading = true
          const params = {
            page: this.pagination.current,
            row: this.pagination.size,
            ...this.searchForm
          }
          const { data, total } = await getStaffFeeList(params)
          this.tableData = data
          this.pagination.total = total
        } catch (error) {
          this.$message.error(this.$t('staffFeeManage.fetchError'))
        } finally {
          this.loading = false
        }
      },
      handleSearch() {
        this.pagination.current = 1
        this.getList()
      },
      handleReset() {
        this.searchForm = {
          communityId: getCommunityId(),
          userCode: '',
          startTime: '',
          endTime: ''
        }
        this.pagination.current = 1
        this.getList()
      },
      handleExport() {
        // 导出逻辑
      },
      handleSizeChange(val) {
        this.pagination.size = val
        this.getList()
      },
      handleCurrentChange(val) {
        this.pagination.current = val
        this.getList()
      }
    }
  }
  </script>
  
  <style lang="scss" scoped>
  .staff-fee-manage-container {
    padding: 20px;
26fd2f03   wuxw   费用功能测试完成
145
  
f61bd6e8   wuxw   费用下功能基本搞定
146
147
148
    .mb-20 {
      margin-bottom: 20px;
    }
26fd2f03   wuxw   费用功能测试完成
149
  
f61bd6e8   wuxw   费用下功能基本搞定
150
151
152
153
154
    .float-right {
      float: right;
    }
  }
  </style>