This commit is contained in:
weiwei committed 2025-06-11 11:31:10 +08:00
commit 8ce1cdf9e1
3 files changed
+113 -170

No files matched your search

+35 -43
View File
@@ -1,59 +1,40 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<DraggableDepTree
ref="draggableDepTreeRef"
placeholder="请输入部门名称"
:show-expand="true"
@getSelectNode="handleGetSelectNode"
switch-inactive-text="包含"
switch-active-text="不包含"
:defaultTreeWidth="20"
:nodeClickable="false"
>
<DraggableDepTree ref="draggableDepTreeRef" placeholder="请输入部门名称" :show-expand="true"
@getSelectNode="handleGetSelectNode" switch-inactive-text="包含" switch-active-text="不包含"
:defaultTreeWidth="20" :nodeClickable="false">
<template #default>
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-row>
<el-form-item style="width: 400px" label="时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
<el-date-picker v-model="state.queryForm.createTimeList"
value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn")
}}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-row>
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<right-toolbar
:search="false"
v-model:showSearch="showSearch"
:export="'hard_hardTotal_export_dept'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
<right-toolbar :search="false" v-model:showSearch="showSearch"
:export="'hard_hardTotal_export_dept'" @exportExcel="exportExcel" class="ml10 mr20"
style="float: right" @queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
height="70vh"
:header-cell-style="tableStyle.headerCellStyle"
:summary-method="getSummaries"
show-summary
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
height="70vh" :header-cell-style="tableStyle.headerCellStyle" :summary-method="getSummaries"
show-summary @selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="80" />
<el-table-column prop="deptName" min-width="150" label="部门" />
<el-table-column prop="walletPrice" label="批量充值金额" align="center" min-width="110">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletPrice != 0 }">{{ displayPrice(row.walletPrice) }}</div>
<div :class="{ 'color-success': row.walletPrice != 0 }">{{ displayPrice(row.walletPrice)
}}</div>
</template>
</el-table-column>
<el-table-column prop="walletCount" label="批量充值次数" align="center" min-width="110">
@@ -63,37 +44,44 @@
</el-table-column>
<el-table-column prop="walletReducePrice" label="批量扣减金额" align="center" min-width="110">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReducePrice != 0 }">{{ displayPrice(row.walletReducePrice) }}</div>
<div :class="{ 'color-success': row.walletReducePrice != 0 }">{{
displayPrice(row.walletReducePrice) }}</div>
</template>
</el-table-column>
<el-table-column prop="walletReduceCount" label="批量扣减次数" align="center" min-width="110">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReduceCount != 0 }">{{ row.walletReduceCount }}次</div>
<div :class="{ 'color-success': row.walletReduceCount != 0 }">{{ row.walletReduceCount
}}次</div>
</template>
</el-table-column>
<el-table-column prop="walletOncePrice" label="单次充值金额" align="center" min-width="110">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletOncePrice != 0 }">{{ displayPrice(row.walletOncePrice) }}</div>
<div :class="{ 'color-success': row.walletOncePrice != 0 }">{{
displayPrice(row.walletOncePrice) }}</div>
</template>
</el-table-column>
<el-table-column prop="walletOnceCount" label="单次充值次数" align="center" min-width="110">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletOnceCount != 0 }">{{ row.walletOnceCount }}次</div>
<div :class="{ 'color-success': row.walletOnceCount != 0 }">{{ row.walletOnceCount }}次
</div>
</template>
</el-table-column>
<el-table-column prop="walletOnceReducePrice" label="单次扣减金额" align="center" min-width="110">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletOnceReducePrice != 0 }">{{ displayPrice(row.walletOnceReducePrice) }}</div>
<div :class="{ 'color-success': row.walletOnceReducePrice != 0 }">{{
displayPrice(row.walletOnceReducePrice) }}</div>
</template>
</el-table-column>
<el-table-column prop="walletOnceReduceCount" label="单次扣减次数" align="center" min-width="110">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletOnceReduceCount != 0 }">{{ row.walletOnceReduceCount }}次</div>
<div :class="{ 'color-success': row.walletOnceReduceCount != 0 }">{{
row.walletOnceReduceCount }}次</div>
</template>
</el-table-column>
<el-table-column prop="orderPayPrice" label="流水金额" align="center" min-width="90">
<template #default="{ row }">
<div :class="{ 'color-primary': row.orderPayPrice != 0 }">{{ displayPrice(row.orderPayPrice) }}</div>
<div :class="{ 'color-primary': row.orderPayPrice != 0 }">{{
displayPrice(row.orderPayPrice) }}</div>
</template>
</el-table-column>
<el-table-column prop="orderPayCount" label="流水次数" align="center" min-width="90">
@@ -110,7 +98,9 @@
</el-table-column>
<el-table-column prop="orderRefundCont" label="退款次数" align="center" min-width="90">
<template #default="{ row }">
<div :class="{ 'color-danger': row.orderRefundCont != 0 }">{{ row.orderRefundCont }}次</div>
<div :class="{ 'color-danger': row.orderRefundCont != 0 }">
{{ row.orderRefundCont }}次
</div>
</template>
</el-table-column>
<el-table-column prop="orderProfitPrice" label="消费净金额" align="center" min-width="120">
@@ -122,7 +112,9 @@
</el-table-column>
<el-table-column prop="orderProfitCont" label="消费净次数" align="center" min-width="120">
<template #default="{ row }">
<div :class="{ 'color-success': row.orderProfitCont != 0 }">{{ row.orderProfitCont }}次</div>
<div :class="{ 'color-success': row.orderProfitCont != 0 }">
{{ row.orderProfitCont }}次
</div>
</template>
</el-table-column>
<el-table-column v-if="false" label="操作" width="300"> </el-table-column>
+57 -91
View File
@@ -25,10 +25,12 @@
<dict-select v-model="state.queryForm.orderStatus" dict-code="hard_order_status" />
</el-form-item>
<el-form-item style="width: 450px" label="创建时间" prop="payTimeList">
<el-date-picker v-model="state.queryForm.payTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
<el-date-picker v-model="state.queryForm.payTimeList" value-format="YYYY-MM-DD HH:mm:ss"
type="datetimerange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn") }}</el-button>
<el-button icon="Search" type="primary" @click="getDataList">{{ $t("common.queryBtn")
}}</el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-row>
@@ -41,33 +43,20 @@
</el-tab-pane>
</div>
</el-tabs>
<right-toolbar
v-model:showSearch="showSearch"
:export="'sys_audit_export'"
@exportExcel="exportExcel"
class="ml10"
style="float: right; margin-right: 20px"
@queryTable="getDataList"
/>
<right-toolbar v-model:showSearch="showSearch" :export="'sys_audit_export'" @exportExcel="exportExcel"
class="ml10" style="float: right; margin-right: 20px" @queryTable="getDataList" />
</div>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
:show-summary="false"
:summary-method="getSummaries"
>
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" @selection-change="selectionChangHandle"
@sort-change="sortChangeHandle" :show-summary="false" :summary-method="getSummaries">
<el-table-column type="selection" width="60" align="center" />
<el-table-column type="index" label="#" width="50" />
<el-table-column width="200" label="用户">
<template #default="{ row }">
<div v-if="row.userId && row.userId != -1" class="flex flex-row items-center justify-center">
<preview-image width="50px" height="50px" :src="row.userAvatar" />
<div class="flex flex-col ml-2 items-start cursor-pointer hover:underline hover:text-blue-500">
<div
class="flex flex-col ml-2 items-start cursor-pointer hover:underline hover:text-blue-500">
<span> {{ row.username }}</span>
<span> {{ row.userMobile }}</span>
</div>
@@ -198,65 +187,42 @@
<el-table-column fixed="right" label="操作" width="200">
<template #default="{ row }">
<div class="grid grid-cols-2 justify-evenly">
<el-button
v-if="row.orderType !== '5'"
icon="Printer"
text
type="primary"
@click="print(row)"
v-auth="'hard_hardInvoice_admin_print'"
>
<el-button v-if="row.orderType !== '5'" icon="Printer" text type="primary"
@click="print(row)" v-auth="'hard_hardInvoice_admin_print'">
打印发票
</el-button>
<el-button
v-if="row.orderType !== '5'"
icon="ShoppingCartFull"
text
type="primary"
@click="shopCarDialogRef.openDialog(row.id)"
>
<el-button v-if="row.orderType !== '5'" icon="ShoppingCartFull" text type="primary"
@click="shopCarDialogRef.openDialog(row.id)">
购物车
</el-button>
<el-button
icon="Money"
link
type="primary"
v-if="row.userId && row.userId != '-1'"
@click="transactionListRef.openDialog(row.walletId)"
>
<el-button icon="Money" link type="primary" v-if="row.userId && row.userId != '-1'"
@click="transactionListRef.openDialog(row.walletId)">
钱包明细
</el-button>
<el-button icon="InfoFilled" link type="primary" v-auth="'wallet_walletTransaction_update_balance'" @click="doRefund(row)">
<el-button icon="InfoFilled" link type="primary"
v-auth="'wallet_walletTransaction_update_balance'" @click="doRefund(row)">
订单详情
</el-button>
<el-button
v-if="false"
icon="edit-pen"
text
type="primary"
v-auth="'hard_hardwareOrder_edit'"
@click="formDialogRef.openDialog(row.id)"
>
<el-button v-if="false" icon="edit-pen" text type="primary"
v-auth="'hard_hardwareOrder_edit'" @click="formDialogRef.openDialog(row.id)">
编辑
</el-button>
<el-button
v-if="!row.payRefundId && row.orderType !== '5' && !['5', '6'].includes(row.payType)"
icon="stamp"
text
type="primary"
v-auth="'hard_hardAfterSale_adminRefund'"
@click="adminRefundDailogRef.openDialog(row.id)"
>
v-if="!row.payRefundId && row.orderType !== '5' && !['5', '6', '8'].includes(row.payType)"
icon="stamp" text type="primary" v-auth="'hard_hardAfterSale_adminRefund'"
@click="adminRefundDailogRef.openDialog(row.id)">
退款
</el-button>
<el-button v-if="false" icon="delete" text type="primary" v-auth="'hard_hardwareOrder_del'" @click="handleDelete([row.id])">
<el-button v-if="false" icon="delete" text type="primary" v-auth="'hard_hardwareOrder_del'"
@click="handleDelete([row.id])">
删除
</el-button>
</div>
</template>
</el-table-column>
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
</div>
<!-- 编辑、新增 -->
@@ -412,36 +378,36 @@ const getSummaries = (param: SummaryMethodProps) => {
}
if (column.property === "paymentInformation") {
const priceVNode: VNode[] & string[] = []
;[
{ column: "totalPrice", columnName: "商品总价", color: "#67C260" },
{ column: "extraPrice", columnName: "额外支付", color: "#F56E9B" },
{ column: "payPrice", columnName: "实际支付", color: "#355CF6" },
].forEach(({ column, columnName, color }: any, index: number) => {
const values = data.map((item) => Number(item[column]))
if (!values.every((value) => Number.isNaN(value))) {
priceVNode.push(
h("div", {}, [
h("span", { style: { marginRight: "40px", minWidth: "60px", fontWeight: "bold" } }, [columnName]),
h("span", { style: { color, minWidth: "50px", flex: 1 } }, [
displayPrice(
values.reduce((prev, curr) => {
const value = Number(curr)
if (!Number.isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0),
"元",
2,
),
;[
{ column: "totalPrice", columnName: "商品总价", color: "#67C260" },
{ column: "extraPrice", columnName: "额外支付", color: "#F56E9B" },
{ column: "payPrice", columnName: "实际支付", color: "#355CF6" },
].forEach(({ column, columnName, color }: any, index: number) => {
const values = data.map((item) => Number(item[column]))
if (!values.every((value) => Number.isNaN(value))) {
priceVNode.push(
h("div", {}, [
h("span", { style: { marginRight: "40px", minWidth: "60px", fontWeight: "bold" } }, [columnName]),
h("span", { style: { color, minWidth: "50px", flex: 1 } }, [
displayPrice(
values.reduce((prev, curr) => {
const value = Number(curr)
if (!Number.isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0),
"元",
2,
),
]),
]),
]),
)
} else {
priceVNode.push("NaN")
}
})
)
} else {
priceVNode.push("NaN")
}
})
sums[index] = h("div", { style: {} }, [...priceVNode])
} else {
sums[index] = ""
@@ -3,49 +3,30 @@
<div class="layout-padding-auto layout-padding-view">
<el-row>
<div class="mb8" style="width: 100%">
<right-toolbar
class="ml10 mr20"
style="float: right"
:search="false"
@queryTable="getList"
:export="true"
@exportExcel="exportExcel"
/>
<right-toolbar class="ml10 mr20" style="float: right" :search="false" @queryTable="getList"
:export="true" @exportExcel="exportExcel" />
</div>
</el-row>
<el-table
:data="data.list"
v-loading="state.loading"
border
:header-cell-style="tableStyle.headerCellStyle"
show-summary
:summary-method="getSummaries"
>
<el-table-column type="index" label="#" align="center" width="60" />
<el-table-column prop="username" label="用户" align="center" width="120" />
<el-table-column prop="userMobile" label="手机号" align="center" width="120" />
<el-table-column prop="bizType" label="充值类型" align="center" width="100">
<el-table :data="data.list" v-loading="state.loading" border :header-cell-style="tableStyle.headerCellStyle"
show-summary :summary-method="getSummaries">
<el-table-column type="index" label="#" align="center" />
<el-table-column prop="username" label="用户" align="center" />
<el-table-column prop="userMobile" label="手机号" align="center" />
<el-table-column prop="bizType" label="充值类型" align="center">
<dict-tag :options="wallet_biz_recharge" :value="detail.bizType" />
</el-table-column>
<el-table-column prop="currentImport_price" label="操作金额" align="center" min-width="250">
<template #default="{ row }">{{ displayPrice(row.currentImport_price) }}</template>
</el-table-column>
<el-table-column v-if="detail.bizType == 2 && false" prop="afterBalance" label="记账扣款后余额" align="center" min-width="180">
<el-table-column v-if="detail.bizType == 2 && false" prop="afterBalance" label="记账扣款后余额" align="center">
<template #default="{ row }">
<div class="color-danger">{{ displayPrice(row.afterBalance) }}</div>
<div v-if="row.afterBalance < 0" class="color-danger">(余额不足记账扣款)</div>
</template>
</el-table-column>
<slot>
<el-table-column
v-if="data.tableList && data.tableList.length"
:prop="v"
v-for="(v, i) in data.tableList"
:key="i"
align="center"
min-width="250"
>
<!-- <slot>
<el-table-column v-if="data.tableList && data.tableList.length" :prop="v"
v-for="(v, i) in data.tableList" :key="i" align="center" min-width="250">
<template #header>
<div>
{{ data.tableListStr[i] }}
@@ -53,18 +34,21 @@
</template>
<template #default="{ row }">
<div class="change">
<div v-if="row[`${v}_price`] >= 0" class="change_price">{{ displayPrice(row[`${v}_price`]) }}</div>
<div v-if="row[`${v}_price`] >= 0" class="change_price">{{
displayPrice(row[`${v}_price`]) }}</div>
<div v-else class="change_price">{{ displayPrice(row[`${v}_price`]) }}</div>
<div class="change_text">
<div v-if="row[`${v}_transaction_price`]">
<span>对比上月</span>
<span :class="[row[`${v}_transaction_price`] >= 0 ? 'success' : 'error']" style="margin-left: 5px">
<span :class="[row[`${v}_transaction_price`] >= 0 ? 'success' : 'error']"
style="margin-left: 5px">
{{ displayPrice(row[`${v}_transaction_price`]) }}
</span>
</div>
<div v-if="row[`${v}_transaction_percent`]">
<span>对比上月</span>
<span :class="[row[`${v}_transaction_price`] >= 0 ? 'success' : 'error']" style="margin-left: 5px">
<span :class="[row[`${v}_transaction_price`] >= 0 ? 'success' : 'error']"
style="margin-left: 5px">
{{ row[`${v}_transaction_percent`] }}%
</span>
</div>
@@ -72,9 +56,10 @@
</div>
</template>
</el-table-column>
</slot>
</slot> -->
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
</div>
</div>
</template>