<!--
|
* @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>
|