Merge remote-tracking branch 'origin/master'

This commit is contained in:
zjf committed 2025-10-21 20:49:21 +08:00
commit 9f8d7a648a
15 files changed
+435 -466

No files matched your search

+40
View File
@@ -15,6 +15,14 @@ export function pageTh(query?: any) {
})
}
export function thTotal(data?: any) {
return request({
url: "/wallet/wallet-transaction/th-total",
method: "post",
data: data,
})
}
export function pageCz(query?: any) {
return request({
url: "/wallet/wallet-transaction/page-cz",
@@ -27,6 +35,14 @@ export function pageCz(query?: any) {
})
}
export function czTotal(data?: any) {
return request({
url: "/wallet/wallet-transaction/cz-total",
method: "post",
data: data,
})
}
export function pageJz(query?: any) {
return request({
url: "/wallet/wallet-transaction/page-jz",
@@ -39,6 +55,14 @@ export function pageJz(query?: any) {
})
}
export function jzTotal(data?: any) {
return request({
url: "/wallet/wallet-transaction/jz-total",
method: "post",
data: data,
})
}
export function pageXf(query?: any) {
return request({
url: "/wallet/wallet-transaction/page-xf",
@@ -51,6 +75,14 @@ export function pageXf(query?: any) {
})
}
export function xfTotal(data: any) {
return request({
url: "/wallet/wallet-transaction/xf-total",
method: "post",
data: data,
})
}
export function pageTk(query?: any) {
return request({
url: "/wallet/wallet-transaction/page-tk",
@@ -63,6 +95,14 @@ export function pageTk(query?: any) {
})
}
export function tkTotal(data: any) {
return request({
url: "/wallet/wallet-transaction/tk-total",
method: "post",
data: data,
})
}
export function updateBalance(obj?: Object) {
return request({
url: "/wallet/wallet-transaction/update-balance",
+3 -1
View File
@@ -1,6 +1,6 @@
<template>
<el-select style="width: 100%" v-model="state.selectId" :placeholder="props.placeholder" clearable
@visible-change="(e: boolean) => e && getDictOptions()">
:multiple="props.multiple" @visible-change="(e: boolean) => e && getDictOptions()">
<el-option v-for="v in filterDictList" :key="v.code" :label="v.label" :value="v.value" />
</el-select>
</template>
@@ -16,9 +16,11 @@ export type Props = {
dictCode: string
placeholder?: string
hideIds?: string | Array<string>
multiple?: boolean
}
const props = withDefaults(defineProps<Props>(), {
placeholder: "请选择",
multiple: false,
})
const state = reactive<any>({
+1 -1
View File
@@ -49,8 +49,8 @@
</template>
<template #default>
<div>联系热线:</div>
<div>18367908152</div>
<div>15657370065</div>
<div>18837698126</div>
</template>
</el-popover>
</div>
+7 -50
View File
@@ -7,7 +7,6 @@ interface JsonpOptions {
timeout?: number
callbackName?: string
callbackParam?: string
debug?: boolean
}
/**
@@ -18,17 +17,11 @@ interface JsonpOptions {
*/
export function jsonp(url: string, options: JsonpOptions = {}): Promise<any> {
const {
timeout = 15000,
timeout = 10000,
callbackName = `jsonp_callback_${Date.now()}_${Math.random().toString(36).substr(2)}`,
callbackParam = "callback",
debug = false
} = options
if (debug) {
console.log('[JSONP] 发起请求:', url)
console.log('[JSONP] 回调函数名:', callbackName)
}
return new Promise((resolve, reject) => {
// 创建 script 标签
const script = document.createElement("script")
@@ -36,11 +29,7 @@ export function jsonp(url: string, options: JsonpOptions = {}): Promise<any> {
// 设置超时
const timer = setTimeout(() => {
cleanup()
const error = new Error(`JSONP request timeout after ${timeout}ms`)
if (debug) {
console.error('[JSONP] 请求超时:', error)
}
reject(error)
reject(new Error("JSONP request timeout"))
}, timeout)
// 清理函数
@@ -56,34 +45,22 @@ export function jsonp(url: string, options: JsonpOptions = {}): Promise<any> {
// 设置全局回调函数
;(window as any)[callbackName] = (data: any) => {
if (debug) {
console.log('[JSONP] 收到响应:', data)
}
cleanup()
resolve(data)
}
// 处理错误
script.onerror = (event) => {
script.onerror = () => {
cleanup()
const error = new Error("JSONP request failed to load script")
if (debug) {
console.error('[JSONP] 脚本加载失败:', event)
}
reject(error)
reject(new Error("JSONP request failed"))
}
// 构建请求 URL
const separator = url.includes("?") ? "&" : "?"
const requestUrl = `${url}${separator}${callbackParam}=${callbackName}`
if (debug) {
console.log('[JSONP] 完整请求URL:', requestUrl)
}
// 发起请求
script.src = requestUrl
script.async = true
document.head.appendChild(script)
})
}
@@ -93,11 +70,9 @@ export function jsonp(url: string, options: JsonpOptions = {}): Promise<any> {
*/
export class TencentMapAPI {
private apiKey: string
private debug: boolean
constructor(apiKey: string, debug: boolean = false) {
constructor(apiKey: string) {
this.apiKey = apiKey
this.debug = debug
}
/**
@@ -109,17 +84,8 @@ export class TencentMapAPI {
async reverseGeocode(lat: number, lng: number): Promise<any> {
const url = `https://apis.map.qq.com/ws/geocoder/v1/?location=${lat},${lng}&key=${this.apiKey}&get_poi=1&output=jsonp`
if (this.debug) {
console.log('[TencentMapAPI] 逆地址解析请求:', { lat, lng })
}
try {
const data = await jsonp(url, { debug: this.debug })
if (this.debug) {
console.log('[TencentMapAPI] 逆地址解析响应:', data)
}
const data = await jsonp(url)
return data
} catch (error) {
console.error("逆地址解析失败:", error)
@@ -138,17 +104,8 @@ export class TencentMapAPI {
keyword,
)}&page_size=10&page_index=1&key=${this.apiKey}&output=jsonp`
if (this.debug) {
console.log('[TencentMapAPI] 地址搜索请求:', { keyword, boundary })
}
try {
const data = await jsonp(url, { debug: this.debug })
if (this.debug) {
console.log('[TencentMapAPI] 地址搜索响应:', data)
}
const data = await jsonp(url)
return data
} catch (error) {
console.error("地址搜索失败:", error)
+6 -2
View File
@@ -278,9 +278,13 @@ export function postDownBlobFile(url: any, data: any, fileName: string) {
descs: data?.descs ?? [],
},
data,
}).then((response) => {
handleBlobFile(response, fileName)
})
.then((response) => {
handleBlobFile(response, fileName)
})
.catch((error) => {
useMessage().error(error.msg || "下载失败")
})
}
/**
+4
View File
@@ -30,6 +30,10 @@
<el-form-item style="width: 250px" label="用餐时间段" prop="hourType">
<dict-select v-model="state.queryForm.hourType" dict-code="daily_menu" />
</el-form-item>
<el-form-item style="width: 300px" label="支付方式" prop="orderPayTypeCodes">
<dict-select v-model="state.queryForm.orderPayTypeCodes" dict-code="hard_pay_type"
multiple />
</el-form-item>
<el-form-item style="width: 300px" label="订单状态" prop="orderStatus">
<dict-select v-model="state.queryForm.orderStatus" dict-code="hard_order_status" />
</el-form-item>
+12 -1
View File
@@ -32,12 +32,22 @@
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-col :span="24" v-if="false" class="mb20">
<el-form-item label="门店位置" prop="location">
<MapSelect />
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item prop="sort">
<template #label>
<span>排序:</span>
<tip content="越大越在前" />
</template>
<el-input-number v-model="form.sort" placeholder="" />
</el-form-item>
</el-col>
<el-col :span="24" class="mb20">
<el-form-item label="门店简介" prop="introduction">
@@ -93,6 +103,7 @@ const form = reactive({
latitude: '',
longitude: '',
detailAddress: '',
sort: 0,
businessHoursJson: [] as BusinessHour[],
mchIds: [],
});
+2 -1
View File
@@ -9,7 +9,7 @@
<el-form-item style="width: 250px" label="门店联系手机号" prop="phone">
<el-input v-model="state.queryForm.phone" placeholder="请输入" />
</el-form-item>
<el-form-item style="width: 250px" label="合作状态" prop="visibleMobile">
<el-form-item style="width: 250px" label="合作状态" prop="status">
<dict-select v-model="state.queryForm.status" dict-code="mch_pick_up_status_enum" />
</el-form-item>
<el-form-item>
@@ -65,6 +65,7 @@
</div>
</template>
</el-table-column>
<el-table-column prop="sort" label="排序" />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'mch_mchPickUp_edit'"
-208
View File
@@ -1,208 +0,0 @@
<template>
<div class="test-jsonp-page">
<h2>JSONP 跨域测试页面</h2>
<div class="test-section">
<h3>1. 逆地址解析测试</h3>
<el-button @click="testReverseGeocode" type="primary">
测试逆地址解析 (北京天安门)
</el-button>
<div v-if="reverseResult" class="result">
<p><strong>结果:</strong> {{ reverseResult }}</p>
</div>
</div>
<div class="test-section">
<h3>2. 地址搜索测试</h3>
<el-input
v-model="searchKeyword"
placeholder="输入搜索关键词"
style="width: 300px; margin-right: 10px;"
/>
<el-button @click="testSearch" type="primary">搜索</el-button>
<div v-if="searchResults.length > 0" class="result">
<p><strong>搜索结果:</strong></p>
<ul>
<li v-for="(item, index) in searchResults" :key="index">
{{ item.title }} - {{ item.address }}
</li>
</ul>
</div>
</div>
<div class="test-section">
<h3>3. 地图选择器组件测试</h3>
<map-select
ref="mapSelectRef"
v-model="selectedLocation"
placeholder="点击选择位置"
style="width: 400px;"
/>
<div v-if="selectedLocation" class="result">
<p><strong>选中位置:</strong></p>
<p>地址: {{ selectedLocation.address }}</p>
<p>坐标: {{ selectedLocation.coordinates }}</p>
</div>
</div>
<div class="logs">
<h3>日志信息</h3>
<div class="log-content">
<div v-for="(log, index) in logs" :key="index" class="log-item">
{{ log }}
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { ElButton, ElInput, ElMessage } from 'element-plus'
import { TencentMapAPI } from '../utils/jsonp'
import MapSelect from '../components/map/map-select.vue'
// 创建腾讯地图API实例 (启用调试模式)
const mapAPI = new TencentMapAPI('CGABZ-3MH66-6VGST-MEMS3-K6U3V-DGBKA', true)
// 定义类型
interface LocationData {
address: string
coordinates: string
location: {
lat: number
lng: number
}
}
// 响应式数据
const reverseResult = ref('')
const searchKeyword = ref('北京大学')
const searchResults = ref<any[]>([])
const selectedLocation = ref<LocationData | null>(null)
const logs = ref<string[]>([])
// 添加日志
const addLog = (message: string) => {
const timestamp = new Date().toLocaleTimeString()
logs.value.unshift(`[${timestamp}] ${message}`)
if (logs.value.length > 10) {
logs.value.pop()
}
}
// 测试逆地址解析
const testReverseGeocode = async () => {
addLog('开始测试逆地址解析...')
try {
// 北京天安门坐标
const data = await mapAPI.reverseGeocode(39.908823, 116.397470)
if (data.status === 0) {
reverseResult.value = data.result.address
addLog(`逆地址解析成功: ${data.result.address}`)
ElMessage.success('逆地址解析成功')
} else {
addLog(`逆地址解析失败: ${data.message}`)
ElMessage.error('逆地址解析失败')
}
} catch (error) {
addLog(`逆地址解析错误: ${error}`)
ElMessage.error('逆地址解析错误')
console.error('逆地址解析错误:', error)
}
}
// 测试地址搜索
const testSearch = async () => {
if (!searchKeyword.value.trim()) {
ElMessage.warning('请输入搜索关键词')
return
}
addLog(`开始搜索: ${searchKeyword.value}`)
try {
const data = await mapAPI.searchLocation(searchKeyword.value)
if (data.status === 0) {
searchResults.value = data.data.map((item: any) => ({
title: item.title,
address: item.address,
location: item.location
}))
addLog(`搜索成功,找到 ${searchResults.value.length} 个结果`)
ElMessage.success(`搜索成功,找到 ${searchResults.value.length} 个结果`)
} else {
addLog(`搜索失败: ${data.message}`)
ElMessage.error('搜索失败')
}
} catch (error) {
addLog(`搜索错误: ${error}`)
ElMessage.error('搜索错误')
console.error('搜索错误:', error)
}
}
</script>
<style scoped>
.test-jsonp-page {
padding: 20px;
max-width: 800px;
margin: 0 auto;
}
.test-section {
margin-bottom: 30px;
padding: 20px;
border: 1px solid #e4e7ed;
border-radius: 8px;
background-color: #fafafa;
}
.test-section h3 {
margin-top: 0;
color: #409eff;
}
.result {
margin-top: 15px;
padding: 10px;
background-color: #f0f9ff;
border: 1px solid #b3d8ff;
border-radius: 4px;
}
.result ul {
margin: 5px 0;
padding-left: 20px;
}
.logs {
margin-top: 30px;
padding: 20px;
border: 1px solid #e4e7ed;
border-radius: 8px;
background-color: #f8f9fa;
}
.logs h3 {
margin-top: 0;
color: #67c23a;
}
.log-content {
max-height: 200px;
overflow-y: auto;
font-family: 'Courier New', monospace;
font-size: 12px;
}
.log-item {
padding: 2px 0;
border-bottom: 1px solid #eee;
}
.log-item:last-child {
border-bottom: none;
}
</style>
+72 -36
View File
@@ -1,16 +1,9 @@
<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>
@@ -24,7 +17,8 @@
<dict-select v-model="state.queryForm.type" dict-code="wallet_biz_recharge" />
</el-form-item>
<el-form-item style="width: 300px" label="充值时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD"
type="daterange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">
@@ -38,28 +32,18 @@
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<right-toolbar
:search="false"
v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
<right-toolbar :search="false" v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'" @exportExcel="exportExcel" class="ml10 mr20"
style="float: right" @queryTable="getDataList">
<el-tooltip class="item" effect="dark" content="统计" placement="top">
<el-button icon="DataLine" circle @click="viewBalanceStatistics" />
</el-tooltip>
</right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:summary-method="getSummaries"
show-summary
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table :data="state.dataList" v-loading="state.loading" border :summary-method="getSummaries"
show-summary :cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="username" label="用户" />
@@ -97,29 +81,56 @@
<el-table-column prop="createTime" width="200" label="充值时间" />
<el-table-column v-if="false" label="操作" width="150">
<template #default="scope">
<el-button icon="delete" text type="primary" v-auth="'wallet_walletRecharge_del'" @click="handleDelete([scope.row.id])"
>删除</el-button
>
<el-button icon="delete" text type="primary" v-auth="'wallet_walletRecharge_del'"
@click="handleDelete([scope.row.id])">删除</el-button>
</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" />
</template>
</DraggableDepTree>
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<el-drawer v-model="showDrawer" @closed="drawerClose">
<el-table :data="[balanceStatistics]" style="width: 100%">
<el-table-column align="center" label="充值统计">
<el-table-column align="center" prop="total" label="充值金额">
<template #default="{ row }">
{{ displayPrice(row.totalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="eatTotalPrice" label="饭卡钱包充值金额">
<template #default="{ row }">
{{ displayPrice(row.eatTotalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="xfTotalPrice" label="消费钱包充值金额">
<template #default="{ row }">
{{ displayPrice(row.xfTotalPrice) }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-drawer>
</div>
</template>
<script setup lang="ts" name="systemWalletRecharge">
import { BasicTableProps, useTable } from "/@/hooks/table"
import { pageCz, delObjs } from "/@/api/wallet/wallet-transaction"
import { pageCz, czTotal, delObjs } from "/@/api/wallet/wallet-transaction"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import { displayPrice } from "/@/utils/formatMoney"
import { deptTree } from "/@/api/admin/dept"
const showDrawer = ref(false)
const balanceStatisticsLoading = ref(false)
const balanceStatistics = reactive<any>({
})
// 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
@@ -154,6 +165,31 @@ const resetQuery = () => {
getDataList()
}
// 关闭抽屉
const drawerClose = () => {
for (const key in balanceStatistics) {
balanceStatistics[key] = 0
}
}
// 余额统计
const viewBalanceStatistics = async () => {
showDrawer.value = true
balanceStatisticsLoading.value = true
try {
const { code, data } = await czTotal({ ...state.queryForm })
if (code == 0) {
Object.assign(balanceStatistics, data)
return
}
return useMessage().error(data.msg || "获取数据失败")
} catch (error: any) {
useMessage().error(error.msg)
} finally {
balanceStatisticsLoading.value = false
}
}
const getSummaries = (param: any) => {
const { columns, data } = param
const totalColumns = ["price", "balance"]
+71 -33
View File
@@ -1,16 +1,9 @@
<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>
@@ -21,7 +14,8 @@
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz" />
</el-form-item>
<el-form-item style="width: 300px" label="消费时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD"
type="daterange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">
@@ -35,28 +29,16 @@
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<right-toolbar
:search="false"
v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
<right-toolbar :search="false" v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'" @exportExcel="exportExcel" class="ml10 mr20"
style="float: right" @queryTable="getDataList">
<el-button icon="DataLine" circle @click="viewBalanceStatistics" />
</right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:summary-method="getSummaries"
show-summary
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table :data="state.dataList" v-loading="state.loading" border :summary-method="getSummaries"
show-summary :cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="username" label="用户" show-overflow-tooltip />
@@ -88,21 +70,51 @@
</el-table-column>
<el-table-column prop="createTime" width="200" label="记账扣款时间" />
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
</template>
</DraggableDepTree>
</div>
<el-drawer v-model="showDrawer" @closed="drawerClose">
<el-table :data="[balanceStatistics]" style="width: 100%">
<el-table-column align="center" label="记账扣款统计">
<el-table-column align="center" prop="total" label="记账扣款金额">
<template #default="{ row }">
{{ displayPrice(row.totalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="eatTotalPrice" label="饭卡钱包记账扣款金额">
<template #default="{ row }">
{{ displayPrice(row.eatTotalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="xfTotalPrice" label="消费钱包记账扣款金额">
<template #default="{ row }">
{{ displayPrice(row.xfTotalPrice) }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-drawer>
</div>
</template>
<script setup lang="ts" name="systemWalletRecharge">
import { BasicTableProps, useTable } from "/@/hooks/table"
import { pageJz } from "/@/api/wallet/wallet-transaction"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { pageJz, jzTotal } from "/@/api/wallet/wallet-transaction"
import { useDict } from "/@/hooks/dict"
import { displayPrice } from "/@/utils/formatMoney"
const { push } = useRouter()
const showDrawer = ref(false)
const balanceStatisticsLoading = ref(false)
const balanceStatistics = reactive<any>({
})
// 定义查询字典
const { wallet_type, wallet_biz } = useDict("wallet_type", "wallet_biz")
// 搜索变量
@@ -133,6 +145,32 @@ const resetQuery = () => {
getDataList()
}
// 关闭抽屉
const drawerClose = () => {
for (const key in balanceStatistics) {
balanceStatistics[key] = 0
}
}
// 余额统计
const viewBalanceStatistics = async () => {
showDrawer.value = true
balanceStatisticsLoading.value = true
try {
const { code, data } = await jzTotal({ ...state.queryForm })
if (code == 0) {
Object.assign(balanceStatistics, data)
return
}
return useMessage().error(data.msg || "获取数据失败")
} catch (error: any) {
useMessage().error(error.msg)
} finally {
balanceStatisticsLoading.value = false
}
}
// 导出excel
const exportExcel = () => {
postDownBlobFile(
@@ -1,16 +1,9 @@
<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">
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
<el-form-item style="width: 250px" label="用户" prop="userId">
<select-user v-model="state.queryForm.userId" />
@@ -22,10 +15,12 @@
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_rule_transation_type" />
</el-form-item>
<el-form-item style="width: 350px" label="转账时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD"
type="daterange" />
</el-form-item>
<el-form-item style="width: 350px" label="退回时间" prop="refundTimeList">
<el-date-picker v-model="state.queryForm.refundTimeList" value-format="YYYY-MM-DD" type="daterange" />
<el-date-picker v-model="state.queryForm.refundTimeList" value-format="YYYY-MM-DD"
type="daterange" />
</el-form-item>
<el-row>
<el-form-item>
@@ -40,25 +35,14 @@
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<right-toolbar
v-model:showSearch="showSearch"
:export="'wallet_walletRuleTransaction_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
<!-- :export="'wallet_walletRuleTransaction_export'" -->
<right-toolbar v-model:showSearch="showSearch" @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"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<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">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="80" />
<el-table-column label="用户">
@@ -126,22 +110,18 @@
<el-table-column prop="refundTime" width="170" label="退回时间" />
</el-table-column>
<el-table-column prop="createTime" width="170" label="创建时间" />
<el-table-column label="操作" fixed="right" width="80" v-auths="['wallet_walletRuleTransaction_refund']">
<el-table-column label="操作" fixed="right" width="80"
v-auths="['wallet_walletRuleTransaction_refund']">
<template #default="{ row }">
<el-button
v-if="row.isRefund == '0'"
icon="RefreshRight"
text
type="primary"
v-auth="'wallet_walletRuleTransaction_refund'"
@click="doRefund(row)"
>
<el-button v-if="row.isRefund == '0'" icon="RefreshRight" text type="primary"
v-auth="'wallet_walletRuleTransaction_refund'" @click="doRefund(row)">
退回
</el-button>
</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" />
</DraggableDepTree>
</div>
+56 -2
View File
@@ -28,7 +28,9 @@
<div class="mb8" style="width: 100%">
<right-toolbar :search="false" v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'" @exportExcel="exportExcel" class="ml10 mr20"
style="float: right" @queryTable="getDataList"></right-toolbar>
style="float: right" @queryTable="getDataList">
<el-button icon="DataLine" circle @click="viewBalanceStatistics" />
</right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" border :summary-method="getSummaries"
@@ -78,17 +80,44 @@
</template>
</DraggableDepTree>
</div>
<el-drawer v-model="showDrawer" @closed="drawerClose">
<el-table :data="[balanceStatistics]" style="width: 100%">
<el-table-column align="center" label="退还各自食堂统计">
<el-table-column align="center" prop="total" label="退还各自食堂金额">
<template #default="{ row }">
{{ displayPrice(row.totalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="eatTotalPrice" label="饭卡钱包记账扣款金额">
<template #default="{ row }">
{{ displayPrice(row.eatTotalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="xfTotalPrice" label="消费钱包记账扣款金额">
<template #default="{ row }">
{{ displayPrice(row.xfTotalPrice) }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-drawer>
</div>
</template>
<script setup lang="ts" name="systemWalletRecharge">
import { BasicTableProps, useTable } from "/@/hooks/table"
import { pageTh } from "/@/api/wallet/wallet-transaction"
import { pageTh, thTotal } from "/@/api/wallet/wallet-transaction"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import * as hardAfterSaleApi from "/@/api/hard/hard-after-sale"
import { displayPrice } from "/@/utils/formatMoney"
const showDrawer = ref(false)
const balanceStatisticsLoading = ref(false)
const balanceStatistics = reactive<any>({
})
// 定义查询字典
const { wallet_type, wallet_biz } = useDict("wallet_type", "wallet_biz")
// 定义变量内容
@@ -123,6 +152,31 @@ const resetQuery = () => {
getDataList()
}
// 关闭抽屉
const drawerClose = () => {
for (const key in balanceStatistics) {
balanceStatistics[key] = 0
}
}
// 余额统计
const viewBalanceStatistics = async () => {
showDrawer.value = true
balanceStatisticsLoading.value = true
try {
const { code, data } = await thTotal({ ...state.queryForm })
if (code == 0) {
Object.assign(balanceStatistics, data)
return
}
return useMessage().error(data.msg || "获取数据失败")
} catch (error: any) {
useMessage().error(error.msg)
} finally {
balanceStatisticsLoading.value = false
}
}
const doRefund = async (row: any) => {
const { data } = await hardAfterSaleApi.getObj(row.bizId)
if (!data) {
+70 -42
View File
@@ -1,16 +1,9 @@
<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>
@@ -18,7 +11,8 @@
<select-user v-model="state.queryForm.userId" />
</el-form-item>
<el-form-item style="width: 300px" label="退款时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD"
type="daterange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">
@@ -32,28 +26,16 @@
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<right-toolbar
:search="false"
v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
<right-toolbar :search="false" v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'" @exportExcel="exportExcel" class="ml10 mr20"
style="float: right" @queryTable="getDataList">
<el-button icon="DataLine" circle @click="viewBalanceStatistics" />
</right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:summary-method="getSummaries"
show-summary
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table :data="state.dataList" v-loading="state.loading" border :summary-method="getSummaries"
show-summary :cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="username" label="用户" show-overflow-tooltip />
@@ -87,36 +69,57 @@
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button icon="InfoFilled" link type="primary" @click="doRefund(row)"> 详情 </el-button>
<el-button
v-if="false"
icon="edit-pen"
text
type="primary"
<el-button v-if="false" icon="edit-pen" text type="primary"
v-auth="'wallet_walletRecharge_edit'"
@click="formDialogRef.openDialog(row.id)"
>编辑</el-button
>
@click="formDialogRef.openDialog(row.id)">编辑</el-button>
</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" />
</template>
</DraggableDepTree>
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<el-drawer v-model="showDrawer" @closed="drawerClose">
<el-table :data="[balanceStatistics]" style="width: 100%">
<el-table-column align="center" label="充值统计">
<el-table-column align="center" prop="total" label="充值金额">
<template #default="{ row }">
{{ displayPrice(row.totalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="eatTotalPrice" label="饭卡钱包充值金额">
<template #default="{ row }">
{{ displayPrice(row.eatTotalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="xfTotalPrice" label="消费钱包充值金额">
<template #default="{ row }">
{{ displayPrice(row.xfTotalPrice) }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-drawer>
</div>
</template>
<script setup lang="ts" name="systemWalletRecharge">
import { BasicTableProps, useTable } from "/@/hooks/table"
import { pageTk } from "/@/api/wallet/wallet-transaction"
import { pageTk, tkTotal } from "/@/api/wallet/wallet-transaction"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import * as hardAfterSaleApi from "/@/api/hard/hard-after-sale"
import { displayPrice } from "/@/utils/formatMoney"
const showDrawer = ref(false)
const balanceStatisticsLoading = ref(false)
const balanceStatistics = reactive<any>({
})
// 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
@@ -153,6 +156,31 @@ const resetQuery = () => {
getDataList()
}
// 关闭抽屉
const drawerClose = () => {
for (const key in balanceStatistics) {
balanceStatistics[key] = 0
}
}
// 余额统计
const viewBalanceStatistics = async () => {
showDrawer.value = true
balanceStatisticsLoading.value = true
try {
const { code, data } = await tkTotal({ ...state.queryForm })
if (code == 0) {
Object.assign(balanceStatistics, data)
return
}
return useMessage().error(data.msg || "获取数据失败")
} catch (error: any) {
useMessage().error(error.msg)
} finally {
balanceStatisticsLoading.value = false
}
}
const doRefund = async (row: any) => {
const { data } = await hardAfterSaleApi.getObj(row.bizId)
if (!data) {
+72 -50
View File
@@ -1,16 +1,9 @@
<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>
@@ -21,7 +14,8 @@
<dict-select v-model="state.queryForm.bizType" dict-code="wallet_biz" />
</el-form-item>
<el-form-item style="width: 300px" label="消费时间" prop="createTimeList">
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD" type="daterange" />
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD"
type="daterange" />
</el-form-item>
<el-form-item>
<el-button icon="Search" type="primary" @click="getDataList">
@@ -35,28 +29,16 @@
</el-form>
<el-row>
<div class="mb8" style="width: 100%">
<right-toolbar
:search="false"
v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'"
@exportExcel="exportExcel"
class="ml10 mr20"
style="float: right"
@queryTable="getDataList"
></right-toolbar>
<right-toolbar :search="false" v-model:showSearch="showSearch"
:export="'wallet_walletTransaction_export'" @exportExcel="exportExcel" class="ml10 mr20"
style="float: right" @queryTable="getDataList">
<el-button icon="DataLine" circle @click="viewBalanceStatistics" />
</right-toolbar>
</div>
</el-row>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:summary-method="getSummaries"
show-summary
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle"
>
<el-table :data="state.dataList" v-loading="state.loading" border :summary-method="getSummaries"
show-summary :cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle" @sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="username" label="用户" show-overflow-tooltip />
@@ -90,40 +72,49 @@
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button icon="InfoFilled" link type="primary" @click="doRefund(row)"> 详情 </el-button>
<el-button
v-if="false"
icon="edit-pen"
text
type="primary"
<el-button v-if="false" icon="edit-pen" text type="primary"
v-auth="'wallet_walletRecharge_edit'"
@click="formDialogRef.openDialog(row.id)"
>编辑</el-button
>
<el-button
v-if="false"
icon="delete"
text
type="primary"
v-auth="'wallet_walletRecharge_del'"
@click="handleDelete([row.id])"
>删除</el-button
>
@click="formDialogRef.openDialog(row.id)">编辑</el-button>
<el-button v-if="false" icon="delete" text type="primary"
v-auth="'wallet_walletRecharge_del'" @click="handleDelete([row.id])">删除</el-button>
</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" />
</template>
</DraggableDepTree>
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
<el-drawer v-model="showDrawer" @closed="drawerClose">
<el-table :data="[balanceStatistics]" style="width: 100%">
<el-table-column align="center" label="充值统计">
<el-table-column align="center" prop="total" label="充值金额">
<template #default="{ row }">
{{ displayPrice(row.totalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="eatTotalPrice" label="饭卡钱包充值金额">
<template #default="{ row }">
{{ displayPrice(row.eatTotalPrice) }}
</template>
</el-table-column>
<el-table-column align="center" prop="xfTotalPrice" label="消费钱包充值金额">
<template #default="{ row }">
{{ displayPrice(row.xfTotalPrice) }}
</template>
</el-table-column>
</el-table-column>
</el-table>
</el-drawer>
</div>
</template>
<script setup lang="ts" name="systemWalletRecharge">
import { BasicTableProps, useTable } from "/@/hooks/table"
import { pageXf } from "/@/api/wallet/wallet-transaction"
import { pageXf, xfTotal } from "/@/api/wallet/wallet-transaction"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
import { displayPrice } from "/@/utils/formatMoney"
@@ -131,6 +122,13 @@ import { deptTree } from "/@/api/admin/dept"
const { push } = useRouter()
const showDrawer = ref(false)
const balanceStatisticsLoading = ref(false)
const balanceStatistics = reactive<any>({
})
// 引入组件
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
@@ -165,6 +163,30 @@ const resetQuery = () => {
getDataList()
}
// 关闭抽屉
const drawerClose = () => {
for (const key in balanceStatistics) {
balanceStatistics[key] = 0
}
}
const viewBalanceStatistics = async () => {
showDrawer.value = true
balanceStatisticsLoading.value = true
try {
const { code, data } = await xfTotal({ ...state.queryForm })
if (code == 0) {
Object.assign(balanceStatistics, data)
return
}
return useMessage().error(data.msg || "获取数据失败")
} catch (error: any) {
useMessage().error(error.msg)
} finally {
balanceStatisticsLoading.value = false
}
}
// 导出excel
const exportExcel = () => {
postDownBlobFile(