class="grid-demo-grid">
:style="{ height: '30px', marginRight: '28px' }" placeholder="省市选择" allow-clear />
@clear="empty(item.key)" v-model="item.value.value" allow-clear />
:value="optionItem.value">
{{ optionItem.label }}
{{ item.label }}
{{ ((dataAcct.totalAcct) / 100).toFixed(2) }}元
{{ (dataAcct.recepitAcct / 100).toFixed(2) }}元
{{ (dataAcct.refundAcct / 100).toFixed(2) }}元
{{ (dataAcct.failAcct / 100).toFixed(2)
}}元
{{ dataAcct.totalCount }}
{{ dataAcct.totalSuccCount }}
@selection-change="onSelectionChange">
:width="item.width" :data-index="item.key" :fixed="item.fixed" :ellipsis="item.ellipsis"
:tooltip="item.tooltip">
{{ (record.billAcct / 100).toFixed(2) }}
{{ (record.cancelAcct / 100).toFixed(2) }}
盛付通
微信
支付宝
云闪付
成功
失败
不明确
详情
详情
订单信息
订单流水号:{{ drawerData.fromFlowId }}
订单编号:{{ drawerData.orderId }}
订单号:{{ drawerData.fromOrderId }}
订单创建时间:{{ drawerData.crtDate }}
支付金额(元):{{ (drawerData.billAcct / 100).toFixed(2) }}
退款金额(元):{{ (drawerData.cancelAcct / 100).toFixed(2) }}
商户信息
平台商户号:{{ drawerData.pfMerchantId }}
公司编码:{{ drawerData.companyId }}
店铺名称:{{ drawerData.pfMerchantName }}
店铺编号:{{ drawerData.shopId }}
用户标识:{{ drawerData.userId }}
通道类型:盛付通
返回信息:{{ drawerData.respMsg }}
返回码:{{ drawerData.respCode }}
import { post, get } from '@/api/http'
import { getMerchantList, searchProveniceCityList, getOrderPage, getOrderStatis } from '@/api/url'
import { usePagination, useRowKey, useRowSelection, useTable, useTableColumn } from '@/hooks/table'
import { FormItem } from '@/types/components'
import { before } from 'lodash'
import { onBeforeMount, onBeforeUnmount, h, onMounted, ref, reactive, computed, watch, onBeforeUpdate, onActivated } from 'vue'
import PayOrderAcctChart from './chart/PayOrderAcctChart.vue'
import PayOrderCountChart from './chart/PayOrderCountChart.vue'
const conditionItems: Array = [
{
key: 'ordId',
label: '订单流水号',
placeholder: '请输入订单流水号或订单号',
type: 'input',
value: ref(''),
reset: function () {
this.value.value = ''
},
},
{
key: 'shopId',
label: '店铺编号',
placeholder: '请输入店铺编号',
type: 'input',
value: ref(''),
reset: function () {
this.value.value = ''
},
},
{
key: 'pfMerchantId',
label: '平台商户号',
placeholder: '请输入平台商户号',
type: 'input',
value: ref(''),
reset: function () {
this.value.value = ''
},
},
{
key: 'payChannel',
label: '支付方式',
placeholder: '请选择支付方式',
type: 'select',
value: ref(),
optionItems: [
{
label: '微信',
value: '60',
},
{
label: '支付宝',
value: '70',
},
{
label: '云闪付',
value: '40',
},
],
reset: function () {
this.value.value = undefined
},
},
{
key: 'state',
label: '订单状态',
placeholder: '请选择订单状态',
type: 'select',
value: ref(),
optionItems: [
{
label: '成功',
value: '10A',
},
{
label: '失败',
value: '10F',
},
{
label: '不明确/退款时',
value: '10E',
},
],
reset: function () {
this.value.value = undefined
},
},
]
interface Acct {
totalAcct: any
recepitAcct: any
refundAcct: any
failAcct: any
totalCount: any
totalSuccCount: any
failCount: any
incomeDetail: any
}
const dataAcct = reactive({
totalAcct: '',
recepitAcct: '',
refundAcct: '',
failAcct: '',
totalCount: '',
totalSuccCount: '',
failCount: '',
incomeDetail: []
})
export default {
name: 'TableWithSearch',
components: {
PayOrderAcctChart,
PayOrderCountChart,
},
setup() {
const selectedKeys = ref([])
const rowSelection = {
type: 'checkbox',
showCheckedAll: true,
}
const searchForm = ref()
const pagination = usePagination(onSearchByPage)
const { selectedRowKeys, onSelectionChange } = useRowSelection()
const table = useTable()
const rowKey = useRowKey('id')
const provinceCity = reactive([])
const companyValueId = ref('')
const payOrderAcctChart = ref>()
const payOrderCountChart = ref>()
const tableColumns = useTableColumn([
{
title: '订单流水号',
key: 'fromFlowId',
dataIndex: 'fromFlowId',
fixed: 'left',
width: 200,
},
{
title: '订单号',
key: 'fromOrderId',
dataIndex: 'fromOrderId',
width: 340,
fixed: 'left',
},
{
title: '支付金额(元)',
key: 'billAcct',
dataIndex: 'billAcct',
},
{
title: '退款金额(元)',
key: 'cancelAcct',
dataIndex: 'cancelAcct',
},
{
title: '公司编码',
key: 'companyId',
dataIndex: 'companyId',
},
{
title: '店铺名称',
key: 'pfMerchantName',
dataIndex: 'pfMerchantName',
width: 260,
},
{
title: '店铺编号',
key: 'shopId',
dataIndex: 'shopId',
},
{
title: '平台商户号',
key: 'pfMerchantId',
dataIndex: 'pfMerchantId',
},
{
title: '用户标识',
key: 'userId',
dataIndex: 'userId',
ellipsis: true,
tooltip: true,
width: 280,
},
{
title: '通道类型',
key: 'channelId',
dataIndex: 'channelId',
},
{
title: '支付方式',
key: 'payChannel',
dataIndex: 'payChannel',
},
{
title: '订单状态',
key: 'state',
dataIndex: 'state',
},
{
title: '创建时间',
key: 'crtDate',
dataIndex: 'crtDate',
width: 200,
},
{
title: '操作',
key: 'actions',
fixed: 'right',
width: 140,
dataIndex: 'actions',
},
])
const dataList = reactive([])
const scroll = {
x: 2600,
y: 600,
}
function doRefresh() {
const param = {
current: pagination.page,
size: pagination.pageSize,
}
get({
url: getOrderPage,
data: { sign: param },
header: { auth: true },
})
.then((res) => {
const resData = {
data: res.data.records,
}
dataList.value = resData.data
table.handleSuccess(resData)
pagination.setTotalSize(res.data.total || 10)
})
.catch(console.log)
}
function getProveniceAndCity() {
get({
url: searchProveniceCityList,
data: {},
header: { auth: true },
})
.then((res) => {
const resData = res.data
for (let k = 0; k < resData.length; k++) {
if (resData[k].cityList.length > 0) {
let singleIncomeInfo = {
label: resData[k].provinceName,
value: resData[k].provinceCode,
children: [],
}
provinceCity.push(singleIncomeInfo)
for (let i = 0; i < resData[k].cityList.length; i++) {
let countyTown = {
label: resData[k].cityList[i].companyDesc,
value: resData[k].cityList[i].companyId,
}
provinceCity[k].children.push(countyTown)
}
} else {
let singleIncomeInfo = {
label: resData[k].provinceName,
value: resData[k].companyId,
}
provinceCity.push(singleIncomeInfo)
}
}
})
.catch(console.log)
return provinceCity
}
onMounted(getProveniceAndCity)
//日期参数
const dateValue = ref([])
const dateValueParem = [
{
key: 'beginDate',
value: ref('')
},
{
key: 'endDate',
value: ref('')
},
]
function onChangeDate(dateString) {
if (dateString && dateString != []) {
dateValueParem[0].value.value = dateString[0];
dateValueParem[1].value.value = dateString[1];
dateValue.value = dateString
}
}
function onSearch() {
pagination.setPage(1)
onSearchByPage()
flushData.value = false
setTimeout(() => { // 此处采用了定时器,并没有采用网上比较常见的nextTick
flushData.value = true // 设置为true,重新挂载dom
}, 500)
}
//页码
function onSearchByPage() {
const param = {
current: pagination.page,
size: pagination.pageSize,
}
if (companyValueId.value != '') {
param['companyId'] = companyValueId.value
}
conditionItems.reduce((pre, cur) => {
if (cur.value.value !== '') {
param[cur.key] = cur.value.value
}
}, {})
dateValueParem.reduce((pre, cur) => {
if (cur.value.value !== '') {
param[cur.key] = cur.value.value
}
}, {})
get({
url: getOrderPage,
data: { sign: param },
header: { auth: true },
})
.then((res) => {
const resData = {
data: res.data.records,
}
table.handleSuccess(resData)
pagination.setTotalSize(res.data.total || 10)
})
.catch(console.log)
get({
url: getOrderStatis,
data: { sign: param },
header: { auth: true },
})
.then((res) => {
const resData = {
data: res.data
}
dataAcct.totalAcct = resData.data.totalAcct
dataAcct.recepitAcct = resData.data.recepitAcct
dataAcct.refundAcct = resData.data.failAcct
dataAcct.failAcct = resData.data.totalAcct
dataAcct.totalCount = resData.data.totalCount
dataAcct.totalSuccCount = resData.data.totalSuccCount
dataAcct.failCount = resData.data.failCount
dataAcct.incomeDetail = resData.data.incomeDetail
dayIncomeDetail.value = dataAcct.incomeDetail
})
.catch(console.log)
}
function onResetSearch() {
conditionItems.forEach((it) => {
it.reset ? it.reset() : (it.value.value = '')
empty(it.key)
})
//清楚省市为空
companyValueId.value = ''
//清除日期为空
dateValue.value = []
dateValueParem.forEach((it) => {
it.value.value = ''
})
doRefresh()
}
//数据统计展开
const show = ref(false)
//刷新数据
const flushData = ref(false)
function openC() {
show.value = !show.value
flushData.value = !flushData.value
onSearchCount()
}
//数据统计
const dayIncomeDetail = ref([])
function onSearchCount() {
const param = {
ordType: "1",
}
if (companyValueId.value != '') {
param['companyId'] = companyValueId.value
}
conditionItems.reduce((pre, cur) => {
if (cur.value.value !== '') {
param[cur.key] = cur.value.value
}
}, {})
dateValueParem.reduce((pre, cur) => {
if (cur.value.value !== '') {
param[cur.key] = cur.value.value
}
}, {})
get({
url: getOrderStatis,
data: { sign: param },
header: { auth: true },
})
.then((res) => {
const resData = {
data: res.data
}
dataAcct.totalAcct = resData.data.totalAcct
dataAcct.recepitAcct = resData.data.recepitAcct
dataAcct.refundAcct = resData.data.failAcct
dataAcct.failAcct = resData.data.totalAcct
dataAcct.totalCount = resData.data.totalCount
dataAcct.totalSuccCount = resData.data.totalSuccCount
dataAcct.failCount = resData.data.failCount
dataAcct.incomeDetail = resData.data.incomeDetail
dayIncomeDetail.value = dataAcct.incomeDetail
})
.catch(console.log)
}
onBeforeMount(onSearchCount)
//倒计时
const timeValue = ref('yes')
const time = ref(200);
let timeRun = setInterval(countDown, 1000)
function stop() {
if (timeValue.value == 'yes') {
timeRun = setInterval(countDown, 1000)
} else {
clearInterval(timeRun)
}
}
function countDown() {
if (time.value === 0) {
doRefresh()
onSearchCount()
time.value = 200;
return;
} else {
time.value--;
}
}
onBeforeUnmount(() => {//销毁
clearInterval(timeRun)
})
//详情遮罩
const visible = ref(false);
let drawerData = ref
const handleClick = (item: object) => {
drawerData.value = item
visible.value = true;
};
const handleOk = () => {
visible.value = false;
};
const handleCancel = () => {
visible.value = false;
}
onMounted(doRefresh)
//placeholder文字上滑
const changeIndex = ref(0)
const changeIndex1 = ref(0)
const changeIndex2 = ref(0)
function download(key) {
if (key == 'ordId') {
changeIndex.value = 1; //获取焦点等于1,展示第二套样式,文字提示平移到input框上面
} else if (key == 'shopId') {
changeIndex1.value = 1;
} else if (key == 'pfMerchantId') {
changeIndex2.value = 1;
}
}
function inputText(key) {
if (key == 'ordId') {
changeIndex.value = 1;
} else if (key == 'shopId') {
changeIndex1.value = 1;
} else if (key == 'pfMerchantId') {
changeIndex2.value = 1;
}
//changeIndex.value = 1; //当input值改变时,展示第二套样式,文字提示平移到input框上面
}
function empty(key) {
if (key == 'ordId') {
changeIndex.value = 0; //点击清空展示默认的样式
} else if (key == 'shopId') {
changeIndex1.value = 0;
} else if (key == 'pfMerchantId') {
changeIndex2.value = 0;
}
}
function unfocused(key, value) {
if (key == 'ordId') {
if (value != "") {
changeIndex.value = 2; //如果框中有值,展示第三套样式
} else if (value == "") {
changeIndex.value = 0; //失焦等于 0,展示默认样式
}
} else if (key == 'shopId') {
if (value != "") {
changeIndex1.value = 2; //如果框中有值,展示第三套样式
} else if (value == "") {
changeIndex1.value = 0; //失焦等于 0,展示默认样式
}
} else if (key == 'pfMerchantId') {
if (value != "") {
changeIndex2.value = 2; //如果框中有值,展示第三套样式
} else if (value == "") {
changeIndex2.value = 0; //失焦等于 0,展示默认样式
}
}
}
return {
changeIndex,
changeIndex1,
changeIndex2,
download,
inputText,
empty,
unfocused,
onChangeDate,
dateValue,
...table,
rowKey,
pagination,
searchForm,
tableColumns,
conditionItems,
onSearch,
onSearchByPage,
onResetSearch,
selectedRowKeys,
onSelectionChange,
provinceCity,
companyValueId,
scroll,
rowSelection,
selectedKeys,
openC,
onSearchCount,
show,
dataAcct,
payOrderAcctChart,
payOrderCountChart,
dayIncomeDetail,
timeValue,
stop,
time,
visible,
handleClick,
handleOk,
handleCancel,
drawerData,
flushData
}
},
}
.avatar-container {
position: relative;
width: 30px;
height: 30px;
margin: 0 auto;
vertical-align: middle;
.avatar {
width: 100%;
height: 100%;
border-radius: 50%;
}
.avatar-vip {
border: 2px solid #cece1e;
}
.vip {
position: absolute;
top: 0;
right: -9px;
width: 15px;
transform: rotate(60deg);
}
}
.gender-container {
.gender-icon {
width: 20px;
}
}
.class1 {
margin: 0px auto 20px;
}
.left {
margin-left: auto;
}
.right {
float: right;
display: flex;
align-items: center;
}
.btn1 {
background-color: transparent;
border: 0px;
}
.fontSize {
font-size: 26px;
white-space: nowrap;
}
.countStyle {
// height: 160px;
margin: 10px;
background-color: rgb(245, 245, 245);
}
.acctStyle {
margin: 20px;
height: 122px;
}
.detalis {
padding-top: 6px;
padding-bottom: 6px;
}
.grid-demo-grid .demo-item,
.grid-demo-grid .demo-suffix {
height: 48px;
line-height: 48px;
color: var(--color-white);
text-align: center;
}
.grid-demo-grid .demo-item:nth-child(2n) {
background-color: rgba(var(--arcoblue-6), 0.9);
}
.grid-demo-grid .demo-item:nth-child(2n + 1) {
background-color: var(--color-primary-light-4);
}
.frame {
/* 宽高大家可根据自己需求进行调整,调整完后下面的样式也要进行微调 */
width: 100%;
height: 40px;
/* 父元素设置相对定位,这样子元素设置绝对定位后就会在父元素的左上角*/
position: relative;
}
.frame label {
/* 默认情况下的样式 */
position: absolute;
top: 0;
left: 3%;
padding: 0px 7px;
display: inline-block;
margin-top: -1.4%;
color: #9e9e9e;
font-size: 14px;
pointer-events: none;
height: 40px;
display: flex;
align-items: center;
transition: all 0.3s;
/*平移上方时,添加一个过渡效果让其没有那么的不自然,我这边设置了0.3秒执行完这个上移的操作 */
}
/* 获取焦点后的第一种样式 */
.frame .focusBlur {
position: absolute;
font-size: 12px;
top: -16%;
height: 16px;
color: rgb(64, 158, 255);
background-color: white;
}
/* 如果框中有值顶部文字颜色展示为黑色,第二种样式 */
.frame .focusBlurTwo {
position: absolute;
font-size: 12px;
top: -16%;
height: 16px;
background-color: white;
}