移动系统liao
2025-05-01 a247547df86f0fad8f03aebb91de68d3f2bc7918
1
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
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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!--
 * @FilePath: cylsgPayrollReport.vue
 * @Author: 小飞侠
 * @Date: 2025-03-17 09:45:10
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2025-03-27 13:24:58
 * Copyright: 2025  MinTinge CO.,LTD. All Rights Reserved.
 * @Descripttion: 写入你的描述
-->
<!--
 * @FilePath: cylsgPayrollReport.vue
 * @Author: 小飞侠
 * @Date: 2025-03-17 09:45:10
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2025-03-19 11:33:32
 * Copyright: 2025  MinTinge CO.,LTD. All Rights Reserved.
 * @Descripttion: 写入你的描述
-->
<!-- -->
<template>
  <div style="max-width: 1440px; margin: 0 auto">
 
    <el-card>
      <PlusForm v-model="formdata" :columns="FromColumns" :row-props="{ gutter: 100 }" :col-props="{
        span: 5
      }" @submit="mysubmit">
        <template #footer="{ handleSubmit }">
          <div style="margin: 0 auto">
            <el-button type="primary" @click="handleSubmit">搜索</el-button>
          </div>
        </template>
      </PlusForm>
    </el-card>
    <PlusTable ref="plusTableInstance" :columns="tableConfig" :table-data="tableData" table-title="表格" show-summary
      :summary-method="getSummaries" :pagination="{ total, modelValue: pageInfo }"
      @paginationChange="handlePaginationChange" adaptive />
  </div>
</template>
<script setup lang='tsx'>
import { GetTransferOrder, OrderByType, type WeChatTransferOrder } from '@/Api/apis';
import moment from 'moment';
import type { PlusColumn, PlusTableInstance, PageInfo } from 'plus-pro-components'
import { useTable } from 'plus-pro-components'
import { h, onMounted, ref, type VNode } from 'vue'
const formdata = ref<WeChatTransferOrder>({
  userName: null,
  userIDCode: null,
  DataTime: [],
  itCode: null
 
})
 
const FromColumns: PlusColumn[] = [
  {
    label: '姓名',
    prop: 'userName',
    labelWidth: 60,
 
  },
  {
    label: '身份证号码',
    labelWidth: 100,
 
    prop: 'userIDCode'
  }
  ,
  {
    label: '电话号码',
    labelWidth: 100,
 
    prop: 'itCode'
  },
  {
    label: '支付时间',
    labelWidth: 100,
    width: 400,
    colProps: {
      span: 8
    },
    prop: 'DataTime',
    valueType: 'date-picker',
    fieldProps: {
      type: 'datetimerange',
      startPlaceholder: '请选择开始时间',
      endPlaceholder: '请选择结束时间',
      rangeSeparator: '-',
      valueFormat: 'YYYY-MM-DDTHH:mm:ss',
 
    },
 
 
 
  }
]
 
const tableConfig = ref<PlusColumn[]>(
  [
    {
      label: '姓名',
      prop: 'userName',
      width: 80
    },
    {
      label: '身份证',
      prop: 'userIDCode',
      width: 170
 
 
    },
    {
      label: '电话号码',
      prop: 'itCode',
      width: 120
    },
 
 
    {
      width: 100,
      label: '总额度',
      prop: 'totalAmount',
      render: (value) => {
 
        let formattedAmount = ((value ?? 0) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
 
        return <span>{formattedAmount}元</span>
      }
 
 
    },
 
    {
      width: 100,
      label: '成功额度',
      prop: 'successAmount',
      sortable: true,
      render: (value) => {
 
        let formattedAmount = ((value ?? 0) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
 
        return <span>{formattedAmount}元</span>
      }
 
    },
    {
      width: 100,
      label: '失败额度',
      prop: 'failAmount',
      sortable: true,
      render: (value) => {
 
        let formattedAmount = ((value ?? 0) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
 
        return <span>{formattedAmount}元</span>
      }
 
    },
 
    {
      width: 180,
      label: '提现时间',
      prop: 'upDataTime',
      render: (value) => {
        return <span>{moment(value).format('YYYY-MM-DD HH:mm:ss')}</span>
      }
 
    },
    {
 
      label: '腾讯单号',
      prop: 'batchId'
 
    },
    {
 
      label: '客户单号',
      prop: 'outBatchNumber'
 
    },
    {
      width: 100,
      label: '总工资',
      prop: 'zhongGz',
      render: (value) => {
 
        let formattedAmount = ((value ?? 0)).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
 
        return <span>{formattedAmount}元</span>
      }
 
    },
    {
      width: 100,
      label: '已提工资',
      prop: 'yiTiXianGz',
      render: (value) => {
        let formattedAmount = ((value ?? 0)).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
 
        return <span>{formattedAmount}元</span>
      }
 
    }
 
  ]
);
 
const { tableData, pageInfo, total, loadingStatus } = useTable<WeChatTransferOrder[]>()
 
onMounted(() => {
  getList();
})
const getList = async () => {
  loadingStatus.value = true
  if (formdata.value.DataTime && Array.isArray(formdata.value.DataTime) && formdata.value.DataTime.length === 2) {
    debugger
    formdata.value.upDataTime = `${formdata.value.DataTime[0]}~${formdata.value.DataTime[1].toString()}`;
  } else {
 
  }
  GetTransferOrder({
    page: { pageIndex: pageInfo.value.page, pageSize: pageInfo.value.pageSize },
     where: JSON.stringify(formdata.value),
     order:{
       name:"upDataTime",
       des:OrderByType.Desc
     }
 
  }).then((res) => {
 
    if (res.data.code == 1) {
      tableData.value = res.data.data?.data as WeChatTransferOrder[];
 
      total.value = res.data.data?.page?.totalCount as number;
    }
  }).finally(() => {
    loadingStatus.value = false
  })
 
}
 
 
const mysubmit = () => {
  getList();
}
const getSummaries = (param: any) => {
  const { columns, data } = param
  const sums: (string | VNode)[] = []
  columns.forEach((column: { property: string | number; }, index: number) => {
    if (index === 0) {
      sums[index] = h('div', { style: { textDecoration: 'underline' } }, [
        '统计',
      ])
      return
    }
    if (column.property == "totalAmount") {
      const values = data.map((x:any) => x.totalAmount);
      let formattedAmount = (values.reduce((prev: any, cur: any) => prev + cur) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
      sums[index] = formattedAmount
      return
    }
 
 
    if (column.property == "successAmount") {
      const values = data.map((x: { successAmount: any; }) => x.successAmount);
      let formattedAmount = (values.reduce((prev: any, cur: any) => prev + cur) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
      sums[index] = formattedAmount
      return
    }
    if (column.property == "failAmount") {
      const values = data.map((x: { failAmount: any; }) => x.failAmount);
      let formattedAmount = (values.reduce((prev: any, cur: any) => prev + cur) / 100).toLocaleString('zh-CN', { style: 'currency', currency: 'CNY' });
      sums[index] = formattedAmount
      return
    }
  })
 
 
 
  return sums
}
const handlePaginationChange = (_pageInfo: PageInfo): void => {
  pageInfo.value = _pageInfo
  getList()
}
 
</script>
<style lang='scss' scoped></style>