Merge remote-tracking branch 'origin/master'

This commit is contained in:
zjf committed 2025-09-02 18:31:33 +08:00
commit 96184b023f
7 files changed
+109 -79

No files matched your search

+2 -2
View File
@@ -12,7 +12,7 @@ ENV = 'development'
# VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
# VITE_ADMIN_PROXY_PATH = http://localhost:9999/
VITE_ADMIN_PROXY_PATH = http://192.168.101.185:9999 # 邓-本地
VITE_ADMIN_PROXY_PATH = http://192.168.101.196:9999 # 邓-本地
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境线上
# 图片访问基础地址
@@ -20,7 +20,7 @@ VITE_ADMIN_PROXY_PATH = http://192.168.101.185:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api/ # 测试线上-过期
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
# VITE_IMAGE_BASE_PATH = http://localhost:9999
VITE_IMAGE_BASE_PATH = http://192.168.101.185:9999 # 邓-本地
VITE_IMAGE_BASE_PATH = http://192.168.101.196:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境线上
# 代码生成服务地址
+8
View File
@@ -87,6 +87,14 @@ export function pageJoin(query?: Object) {
})
}
export function publicPageJoin(query?: Object) {
return request({
url: "/wallet/wallet-transaction/public/page-join",
method: "get",
params: query,
})
}
export function addObj(obj?: Object) {
return request({
url: "/wallet/wallet-transaction",
+53 -29
View File
@@ -32,7 +32,8 @@
</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">
show-summary @selection-change="selectionChangHandle" :cell-class-name="cellClassName"
@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="部门" />
@@ -47,34 +48,6 @@
<div :class="{ 'color-success': row.walletCount != 0 }">{{ row.walletCount }}次</div>
</template>
</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>
</template>
</el-table-column>
<!-- start 批量退换食堂 start -->
<el-table-column prop="walletReturnCanteenCount" label="批量退还各自食堂次数" align="center"
min-width="170">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReturnCanteenCount != 0 }">{{
row.walletReturnCanteenCount }}次</div>
</template>
</el-table-column>
<el-table-column prop="walletReturnCanteenPrice" label="批量退还各自食堂金额" align="center"
min-width="170">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReturnCanteenPrice != 0 }">{{
displayPrice(row.walletReturnCanteenPrice) }}</div>
</template>
</el-table-column>
<!-- end 批量退换食堂 end -->
<el-table-column prop="walletReduceCount" label="批量扣减次数" align="center" min-width="110">
<template #default="{ row }">
<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 }">{{
@@ -87,6 +60,18 @@
</div>
</template>
</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>
</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>
</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 }">{{
@@ -99,6 +84,23 @@
row.walletOnceReduceCount }}次</div>
</template>
</el-table-column>
<!-- start 批量退换食堂 start -->
<el-table-column prop="walletReturnCanteenPrice" label="批量退还各自食堂金额" align="center"
min-width="170">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReturnCanteenPrice != 0 }">{{
displayPrice(row.walletReturnCanteenPrice) }}</div>
</template>
</el-table-column>
<el-table-column prop="walletReturnCanteenCount" label="批量退还各自食堂次数" align="center"
min-width="170">
<template #default="{ row }">
<div :class="{ 'color-success': row.walletReturnCanteenCount != 0 }">{{
row.walletReturnCanteenCount }}次</div>
</template>
</el-table-column>
<!-- end 批量退换食堂 end -->
<el-table-column prop="orderPayPrice" label="流水金额" align="center" min-width="90">
<template #default="{ row }">
<div :class="{ 'color-primary': row.orderPayPrice != 0 }">{{
@@ -175,6 +177,17 @@ const exportExcel = () => {
postDownBlobFile("/hard/hard-total/export-dept", Object.assign(state.queryForm), "部门交易记录导出.xlsx")
}
const cellClassName = ({ row, column, rowIndex }: any) => {
if (column.property) {
if (column.property.includes("Count")) {
return 'success-cell'
}
if (column.property.includes("Price")) {
return 'warning-cell'
}
}
}
const getSummaries = (param: any) => {
const { columns, data } = param
const totalColumns = [
@@ -238,3 +251,14 @@ const handleGetSelectNode = (curClickedNode: any, checkedTreeNodes: any, isDeepT
getDataList()
}
</script>
<style>
.el-table .warning-cell {
background: var(--el-color-warning-light-9);
}
.el-table .success-cell {
background: var(--el-color-success-light-9);
}
</style>
@@ -1,5 +1,5 @@
<template>
<el-dialog title="后台退款" v-model="visible" width="50%" :close-on-click-modal="false" draggable>
<el-dialog title="后台退款" v-model="visible" width="70%" :close-on-click-modal="false" draggable>
<el-tabs v-model="state.currentTab" class="demo-tabs" @tab-click="tabClick">
<el-tab-pane v-for="(v) in data.tabs" :key="v.name" :label="v.label" :name="v.name" />
</el-tabs>
@@ -161,43 +161,47 @@ const { getDataList, sortChangeHandle, tableStyle } = useTable(state)
const getCarList = async (orderId: string) => {
state.queryForm.orderId = orderId
// 获取订单商品列表
await getDataList()
if (!state.dataList || !state.dataList.length) {
return
}
// 获取已退款的商品
const { data } = await hardCar.refundCar({ orderId })
if (!data || !data.length) {
disposeDataList.value = state.dataList.map((item) => {
try {
// 获取订单商品列表
await getDataList()
if (!state.dataList || !state.dataList.length) {
return
}
// 获取已退款的商品
const { data } = await hardCar.refundCar({ orderId })
if (!data || !data.length) {
disposeDataList.value = state.dataList.map((item) => {
if (!item) return null
return {
...item,
refundProductCount: 0,
maxRefundProductCount: item.productCount,
refundProductWeight: 0,
maxRefundProductWeight: displayWeight(item.productWeight),
refundTotalPrice: 0,
}
}).filter(Boolean)
return
}
refundSuccessList.value = data
// 计算出需要退款的商品
const refundViewList = [...state.dataList]
disposeDataList.value = refundViewList.map((item) => {
if (!item) return null
const target = data.find((v: any) => v.productId == item.productId)
return {
...item,
refundProductCount: 0,
maxRefundProductCount: item.productCount,
maxRefundProductCount: item.productCount - (target?.productCount ?? 0),
refundProductWeight: 0,
maxRefundProductWeight: displayWeight(item.productWeight),
maxRefundProductWeight: displayWeight(item.productWeight - (target?.productWeight ?? 0)),
refundTotalPrice: 0,
}
}).filter(Boolean)
return
} catch (error: any) {
state.dataList = []
disposeDataList.value = []
}
refundSuccessList.value = data
// 计算出需要退款的商品
const refundViewList = [...state.dataList]
disposeDataList.value = refundViewList.map((item) => {
if (!item) return null
const target = data.find((v: any) => v.productId == item.productId)
return {
...item,
refundProductCount: 0,
maxRefundProductCount: item.productCount - (target?.productCount ?? 0),
refundProductWeight: 0,
maxRefundProductWeight: displayWeight(item.productWeight - (target?.productWeight ?? 0)),
refundTotalPrice: 0,
}
}).filter(Boolean)
console.log("disposeDataList:", disposeDataList.value);
}
@@ -220,8 +224,6 @@ const handleAllRefund = () => {
v.refundTotalPrice = target.totalPrice
}
console.log("全部:", _list);
disposeDataList.value = _list
}
@@ -248,6 +250,11 @@ const getSummaries = (param: any) => {
// 提交
const validate = async () => {
// 如果购物车为空直接返回true
if (!state.dataList || !state.dataList.length) {
return []
}
let valid = false
for (const v of disposeDataList.value) {
if (v.refundProductCount > 0 || v.refundProductWeight > 0) {
+3 -2
View File
@@ -80,7 +80,7 @@
</div>
</template>
</el-table-column>
<el-table-column width="200px" prop="paymentInformation" label="付款信息">
<el-table-column width="220px" prop="paymentInformation" label="付款信息">
<template #default="{ row }">
<div class="flex justify-between items-start">
<div class="w-[200px] h-[25px]">
@@ -229,7 +229,8 @@
v-auth="'hard_hardwareOrder_edit'" @click="formDialogRef.openDialog(row.id)">
编辑
</el-button>
<el-button v-if="row.orderType !== '5' && !['5', '6', '8'].includes(row.payType)"
<el-button
v-if="row.orderType !== '5' && !['5', '6', '8'].includes(row.payType) && row.refundPrice != row.payPrice"
icon="stamp" text type="primary" v-auth="'hard_hardAfterSale_adminRefund'"
@click="adminRefundDailogRef.openDialog(row.id)">
退款
@@ -1,13 +1,7 @@
<template>
<el-dialog title="钱包余额明细" v-model="visible" width="60%" :close-on-click-modal="false" draggable>
<el-table
:data="state.dataList"
v-loading="state.loading"
border
:cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle"
@sort-change="sortChangeHandle"
>
<el-table :data="state.dataList" v-loading="state.loading" border :cell-style="tableStyle.cellStyle"
:header-cell-style="tableStyle.headerCellStyle" @sort-change="sortChangeHandle">
<el-table-column align="center" width="200" label="编号" prop="id" />
<el-table-column align="center" width="200" label="钱包编号" prop="walletId" />
<el-table-column align="center" width="200" label="交易类型" prop="title" />
@@ -20,30 +14,26 @@
<el-table-column align="center" label="交易时间" prop="createTime" width="180px" />
</el-table>
<template #footer>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
v-bind="state.pagination" />
</template>
</el-dialog>
</template>
<script setup lang="ts" name="WalletManageDialog">
import { BasicTableProps, useTable } from "/@/hooks/table"
import { useDict } from "/@/hooks/dict"
import { useMessage } from "/@/hooks/message"
import * as walletTransactionApi from "/@/api/wallet/wallet-transaction"
import { rule } from "/@/utils/validate"
import { displayPrice } from "/@/utils/formatMoney"
const emit = defineEmits(["refresh"])
// 定义变量内容
const visible = ref(false)
const loading = ref(false)
// 定义字典
// 提交表单数据
const form = reactive({})
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: walletTransactionApi.pageJoin,
pageList: walletTransactionApi.publicPageJoin,
})
// table hook