feat:退换各自食堂明细
This commit is contained in:
1 parent
86b3435821
commit
c769c261ca
2 files changed
+187
No files matched your search
@@ -1,5 +1,20 @@
|
|||||||
import request from "/@/utils/request"
|
import request from "/@/utils/request"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 各自食堂退还记录
|
||||||
|
*/
|
||||||
|
export function pageTh(query?: any) {
|
||||||
|
return request({
|
||||||
|
url: "/wallet/wallet-transaction/page-th",
|
||||||
|
method: "post",
|
||||||
|
params: {
|
||||||
|
current: query.current,
|
||||||
|
size: query.size,
|
||||||
|
},
|
||||||
|
data: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function pageCz(query?: any) {
|
export function pageCz(query?: any) {
|
||||||
return request({
|
return request({
|
||||||
url: "/wallet/wallet-transaction/page-cz",
|
url: "/wallet/wallet-transaction/page-cz",
|
||||||
|
|||||||
@@ -0,0 +1,172 @@
|
|||||||
|
<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">
|
||||||
|
<template #default>
|
||||||
|
<el-form ref="queryRef" :inline="true" :model="state.queryForm" @keyup.enter="getDataList">
|
||||||
|
<el-row>
|
||||||
|
<el-form-item style="width: 300px" label="用户" prop="userId">
|
||||||
|
<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-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<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="'wallet_walletTransaction_export'" @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 :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" width="120" label="用户" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="userAvatar" label="头像" show-overflow-tooltip>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<preview-image :src="row.userAvatar" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="userMobile" width="120" label="手机号" show-overflow-tooltip />
|
||||||
|
<el-table-column prop="walletTypeUniqueCode" width="200" label="饭卡类型">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div class="flex items-center justify-center">
|
||||||
|
<div class="color-primary">{{ row.walletTypeName }}</div>
|
||||||
|
<div class="flex items-center just ml5">
|
||||||
|
<dict-tag :options="wallet_type" :value="row.walletTypeUniqueCode" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="wallet_biz" width="200" label="交易类型">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<dict-tag :options="wallet_biz" :value="row.bizType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="price" align="center" width="200" label="退还各自食堂金额">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<div class="color-danger">{{ displayPrice(row.price) }}</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="createTime" width="200" label="退款时间" />
|
||||||
|
<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"
|
||||||
|
v-auth="'wallet_walletRecharge_edit'"
|
||||||
|
@click="formDialogRef.openDialog(row.id)">编辑</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle"
|
||||||
|
v-bind="state.pagination" />
|
||||||
|
</template>
|
||||||
|
</DraggableDepTree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts" name="systemWalletRecharge">
|
||||||
|
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||||
|
import { pageTh } 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 { wallet_type, wallet_biz } = useDict("wallet_type", "wallet_biz")
|
||||||
|
// 定义变量内容
|
||||||
|
const formDialogRef = ref()
|
||||||
|
// 搜索变量
|
||||||
|
const queryRef = ref()
|
||||||
|
const showSearch = ref(true)
|
||||||
|
// 多选变量
|
||||||
|
const selectObjs = ref([]) as any
|
||||||
|
const multiple = ref(true)
|
||||||
|
const draggableDepTreeRef = ref()
|
||||||
|
|
||||||
|
const { push } = useRouter()
|
||||||
|
|
||||||
|
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||||
|
queryForm: {},
|
||||||
|
pageList: pageTh,
|
||||||
|
})
|
||||||
|
|
||||||
|
// table hook
|
||||||
|
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, postDownBlobFile, tableStyle } = useTable(state)
|
||||||
|
|
||||||
|
// 清空搜索条件
|
||||||
|
const resetQuery = () => {
|
||||||
|
// 清空搜索条件
|
||||||
|
queryRef.value?.resetFields()
|
||||||
|
// 清空多选
|
||||||
|
selectObjs.value = []
|
||||||
|
state.queryForm.deptId = ""
|
||||||
|
state.queryForm.deptIds = []
|
||||||
|
draggableDepTreeRef.value.resetData()
|
||||||
|
getDataList()
|
||||||
|
}
|
||||||
|
|
||||||
|
const doRefund = async (row: any) => {
|
||||||
|
const { data } = await hardAfterSaleApi.getObj(row.bizId)
|
||||||
|
if (!data) {
|
||||||
|
useMessage().error("查看错误")
|
||||||
|
}
|
||||||
|
push({ path: "/hard/hard-after-sale/order-refund", query: { id: data.orderId, type: "view" } })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出excel
|
||||||
|
const exportExcel = () => {
|
||||||
|
postDownBlobFile(
|
||||||
|
"/wallet/wallet-transaction/export-th",
|
||||||
|
Object.assign(state.queryForm, { current: state.pagination?.current, size: state.pagination?.size }),
|
||||||
|
"退还各自食堂记录.xlsx",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
const getSummaries = (param: any) => {
|
||||||
|
const { columns, data } = param
|
||||||
|
const totalColumns = ["price"]
|
||||||
|
const totalRow = Array.from({ length: columns.length })
|
||||||
|
columns.forEach((i: any, index: number) => {
|
||||||
|
if (totalColumns.includes(i.property)) {
|
||||||
|
const total = data
|
||||||
|
.filter((v: any) => v[i.property] != null)
|
||||||
|
.map((v: any) => v[i.property])
|
||||||
|
.reduce((pren: number, next: number) => pren + next, 0)
|
||||||
|
totalRow[index] = displayPrice(total)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return totalRow
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多选事件
|
||||||
|
const selectionChangHandle = (objs: { id: string }[]) => {
|
||||||
|
selectObjs.value = objs.map(({ id }) => id)
|
||||||
|
multiple.value = !objs.length
|
||||||
|
}
|
||||||
|
|
||||||
|
// 树节点选择时
|
||||||
|
const handleGetSelectNode = (curClickedNode: any, checkedTreeNodes: any, isDeepTree: any) => {
|
||||||
|
state.queryForm.deptId = curClickedNode.id
|
||||||
|
state.queryForm.deptIds = checkedTreeNodes.map((item: any) => item.id)
|
||||||
|
state.queryForm.isInclude = !isDeepTree
|
||||||
|
getDataList()
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Reference in new issue
Block a user