feat:现金支付不予许退款

This commit is contained in:
dzc committed 2025-06-10 15:30:14 +08:00
1 parent 2937f29168
commit 3c9b7f118f
2 files changed
+78 -127

No files matched your search

+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,28 +3,16 @@
<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">
@@ -32,22 +20,15 @@
<div class="color-success">{{ displayPrice(row.currentImport_price) }}</div>
</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] }}
@@ -55,18 +36,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>
@@ -74,9 +58,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>