用户管理修改把部门去掉和增加不活跃钱包统计
This commit is contained in:
1 parent
29d0cfd24d
commit
8b2306aac0
3 files changed
+238
-26
No files matched your search
@@ -42,7 +42,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-col v-if="!dataForm.userId" :span="12" class="mb20">
|
||||
<el-form-item :label="$t('sysuser.dept')" prop="deptId">
|
||||
<el-tree-select
|
||||
:data="deptData"
|
||||
@@ -214,8 +214,8 @@ const openDialog = async (id: string) => {
|
||||
dataForm.password = "******"
|
||||
}
|
||||
|
||||
// 加载使用的数据
|
||||
getDeptData()
|
||||
// 新增时加载部门树数据,修改时不加载
|
||||
!id ? getDeptData() : ""
|
||||
getPostData()
|
||||
getRoleData()
|
||||
}
|
||||
|
||||
@@ -25,17 +25,17 @@
|
||||
<div class="relative mb-2 flex items-center justify-center">
|
||||
<!-- 左侧条纹 -->
|
||||
<div class="continuous-flow-stripe absolute left-0 flex h-2 w-[calc(50%-8rem)] items-center">
|
||||
<div class="h-full w-full rounded-full bg-gradient-to-r from-transparent via-[#4a88ff]/30 to-transparent"></div>
|
||||
<div class="h-full w-full rounded-full bg-gradient-to-r from-transparent via-[#F7D6C3]/30 to-transparent"></div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center">
|
||||
<h1 class="gradient-text relative text-2xl font-bold tracking-wider">今日菜品</h1>
|
||||
<h1 class="gradient-text relative text-2xl font-bold tracking-wider">今日午餐菜品</h1>
|
||||
<div class="flow-text mt-2 text-lg font-medium text-[#8ab4ff] drop-shadow-lg">{{ currentDate }} {{ currentTime }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧条纹 -->
|
||||
<div class="continuous-flow-stripe absolute right-0 flex h-2 w-[calc(50%-8rem)] items-center">
|
||||
<div class="h-full w-full rounded-full bg-gradient-to-r from-transparent via-[#4a88ff]/30 to-transparent"></div>
|
||||
<div class="h-full w-full rounded-full bg-gradient-to-r from-transparent via-[#F7D6C3]/30 to-transparent"></div>
|
||||
</div>
|
||||
|
||||
<!-- 全屏按钮和滚动控制按钮 -->
|
||||
@@ -43,7 +43,7 @@
|
||||
<el-tooltip v-if="needScroll" :content="isScrolling ? '暂停滚动' : '开始滚动'" placement="bottom" effect="dark">
|
||||
<button
|
||||
@click="toggleScroll"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-xl bg-[#4a88ff]/20 transition-all hover:scale-110 hover:bg-[#4a88ff]/40"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-xl bg-[#F7D6C3]/20 transition-all hover:scale-110 hover:bg-[#F7D6C3]/40"
|
||||
>
|
||||
<el-icon class="h-10 w-10 font-bold">
|
||||
<component :is="isScrolling ? 'VideoPause' : 'VideoPlay'" />
|
||||
@@ -54,7 +54,7 @@
|
||||
<el-tooltip :content="isFullscreen ? '退出全屏' : '全屏'" placement="bottom" effect="dark">
|
||||
<button
|
||||
@click="toggleFullScreen"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-xl bg-[#4a88ff]/20 transition-all hover:scale-110 hover:bg-[#4a88ff]/40"
|
||||
class="flex h-8 w-8 items-center justify-center rounded-xl bg-[#F7D6C3]/20 transition-all hover:scale-110 hover:bg-[#F7D6C3]/40"
|
||||
>
|
||||
<el-icon class="icon h-10 w-10 font-bold bg-contain bg-center bg-no-repeat"><FullScreen /></el-icon>
|
||||
</button>
|
||||
@@ -71,7 +71,7 @@
|
||||
<div
|
||||
v-for="dish in hourType"
|
||||
:key="dish.id"
|
||||
class="group relative flex flex-col overflow-hidden rounded-xl border border-[#4a88ff]/10 bg-[#1d2b45]/60 transition-all duration-500 hover:scale-[1.02] hover:-translate-y-1 hover:bg-[#1d2b45]/80 hover:shadow-[0_0_20px_rgba(74,136,255,0.1)]"
|
||||
class="group relative flex flex-col overflow-hidden rounded-xl border border-[#F7D6C3]/10 bg-[#1d2b45]/60 transition-all duration-500 hover:scale-[1.02] hover:-translate-y-1 hover:bg-[#1d2b45]/80 hover:shadow-[0_0_20px_rgba(74,136,255,0.1)]"
|
||||
>
|
||||
<div class="relative h-32 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-b from-transparent"></div>
|
||||
@@ -104,7 +104,7 @@
|
||||
</div>
|
||||
<!-- <span class="text-base text-[#8ab4ff]/80 line-clamp-1">{{ dish.name }}</span> -->
|
||||
</div>
|
||||
<div class="absolute inset-px rounded-xl border border-[#4a88ff]/10 pointer-events-none"></div>
|
||||
<div class="absolute inset-px rounded-xl border border-[#F7D6C3]/10 pointer-events-none"></div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
@@ -114,7 +114,7 @@
|
||||
<div
|
||||
v-for="dish in hourType"
|
||||
:key="dish.id"
|
||||
class="group relative flex flex-col overflow-hidden rounded-xl border border-[#4a88ff]/10 bg-[#1d2b45]/60 transition-all duration-500 hover:scale-[1.02] hover:-translate-y-1 hover:bg-[#1d2b45]/80 hover:shadow-[0_0_20px_rgba(74,136,255,0.1)]"
|
||||
class="group relative flex flex-col overflow-hidden rounded-xl border border-[#F7D6C3]/10 bg-[#1d2b45]/60 transition-all duration-500 hover:scale-[1.02] hover:-translate-y-1 hover:bg-[#1d2b45]/80 hover:shadow-[0_0_20px_rgba(74,136,255,0.1)]"
|
||||
>
|
||||
<div class="relative h-32 overflow-hidden">
|
||||
<div class="absolute inset-0 bg-gradient-to-b from-transparent"></div>
|
||||
@@ -147,7 +147,7 @@
|
||||
</div>
|
||||
<!-- <span class="text-base text-[#8ab4ff]/80 line-clamp-1">{{ dish.name }}</span> -->
|
||||
</div>
|
||||
<div class="absolute inset-px rounded-xl border border-[#4a88ff]/10 pointer-events-none"></div>
|
||||
<div class="absolute inset-px rounded-xl border border-[#F7D6C3]/10 pointer-events-none"></div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
@@ -157,9 +157,9 @@
|
||||
|
||||
<!-- 底部区域 -->
|
||||
<div class="mt-4 flex items-center justify-center gap-8 pb-2 text-sm text-[#8ab4ff]/60">
|
||||
<div class="h-[1px] w-32 bg-gradient-to-r from-transparent via-[#4a88ff]/20 to-transparent"></div>
|
||||
<div class="h-[1px] w-32 bg-gradient-to-r from-transparent via-[#F7D6C3]/20 to-transparent"></div>
|
||||
<span>智慧食堂</span>
|
||||
<div class="h-[1px] w-32 bg-gradient-to-r from-transparent via-[#4a88ff]/20 to-transparent"></div>
|
||||
<div class="h-[1px] w-32 bg-gradient-to-r from-transparent via-[#F7D6C3]/20 to-transparent"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -172,10 +172,8 @@ import dayjs from "dayjs"
|
||||
import { ElTooltip } from "element-plus"
|
||||
import { selectTimeFoodApi } from "/@/api/canteen/canteenDailyMenu"
|
||||
import { getAllSimple as getCanteenCategory } from "/@/api/canteen/canteenCategory"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
|
||||
const { daily_menu } = useDict("daily_menu")
|
||||
const containerRef = ref<HTMLElement | null>(null)
|
||||
const currentDate = ref(dayjs().format("YYYY年MM月DD日"))
|
||||
const currentTime = ref(dayjs().format("HH:mm:ss"))
|
||||
@@ -210,23 +208,22 @@ const foodData = reactive<{
|
||||
dinner: [],
|
||||
})
|
||||
|
||||
// 根据时段获取菜品
|
||||
// 根据日期和时段获取菜品
|
||||
const getDishByType = async () => {
|
||||
const result = await selectTimeFoodApi({
|
||||
time: dayjs().format("YYYY-MM-DD"),
|
||||
// time: "2025-03-14",
|
||||
// time: "2025-02-07",
|
||||
merchantId: "1887400193644199937",
|
||||
// hourType: 2,
|
||||
})
|
||||
if (result.code === 0) {
|
||||
if (result.code == 0) {
|
||||
result.data.forEach((r: any) => {
|
||||
switch (r.hourType) {
|
||||
case 1:
|
||||
// foodData.breakfast = r.dailyMenuVOS
|
||||
break
|
||||
case 2:
|
||||
foodData.lunch = r.dailyMenuVOS.filter((v: any, index: number) => index < 13)
|
||||
foodData.lunch = r.dailyMenuVOS.filter((v: any, index: number) => index < 12)
|
||||
break
|
||||
case 3:
|
||||
// foodData.dinner = r.dailyMenuVOS
|
||||
@@ -464,7 +461,7 @@ const gridStyle = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
// 添加一个简单的防抖函数
|
||||
// 防抖函数
|
||||
function debounce(fn: Function, delay: number) {
|
||||
let timer: number | null = null
|
||||
return function (this: any, ...args: any[]) {
|
||||
@@ -478,16 +475,16 @@ function debounce(fn: Function, delay: number) {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.bg-pattern {
|
||||
background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zm20.97 0l9.315 9.314-1.414 1.414L34.828 0h2.83zM22.344 0L13.03 9.314l1.414 1.414L25.172 0h-2.83zM32 0l12.142 12.142-1.414 1.414L30 .828 17.272 13.556l-1.414-1.414L28 0h4zM.284 0l28 28-1.414 1.414L0 2.544V0h.284zM0 5.373l25.456 25.455-1.414 1.415L0 8.2V5.374zm0 5.656l22.627 22.627-1.414 1.414L0 13.86v-2.83zm0 5.656l19.8 19.8-1.415 1.413L0 19.514v-2.83zm0 5.657l16.97 16.97-1.414 1.415L0 25.172v-2.83zM0 28l14.142 14.142-1.414 1.414L0 30.828V28zm0 5.657L11.314 44.97 9.9 46.386l-9.9-9.9v-2.828zm0 5.657L8.485 47.8 7.07 49.212 0 42.143v-2.83zm0 5.657l5.657 5.657-1.414 1.415L0 47.8v-2.83zm0 5.657l2.828 2.83-1.414 1.413L0 53.456v-2.83zM54.627 60L30 35.373 5.373 60H8.2L30 38.2 51.8 60h2.827zm-5.656 0L30 41.03 11.03 60h2.828L30 43.858 46.142 60h2.83zm-5.656 0L30 46.686 16.686 60h2.83L30 49.515 40.485 60h2.83zm-5.657 0L30 52.343 22.344 60h2.83L30 55.172 34.828 60h2.83zM32 60l-2-2-2 2h4zM59.716 0l-28 28 1.414 1.414L60 2.544V0h-.284zM60 5.373L34.544 30.828l1.414 1.415L60 8.2V5.374zm0 5.656L37.373 33.656l1.414 1.414L60 13.86v-2.83zm0 5.656l-19.8 19.8 1.415 1.413L60 19.514v-2.83zm0 5.657l-16.97 16.97 1.414 1.415L60 25.172v-2.83zM60 28L45.858 42.142l1.414 1.414L60 30.828V28zm0 5.657L48.686 44.97l1.415 1.415 9.9-9.9v-2.828zm0 5.657L51.515 47.8l1.414 1.413 7.07-7.07v-2.83zm0 5.657l-5.657 5.657 1.414 1.415L60 47.8v-2.83zm0 5.657l-2.828 2.83 1.414 1.413L60 53.456v-2.83zM39.9 16.385l1.414-1.414L30 3.658 18.686 14.97l1.415 1.415 9.9-9.9 9.9 9.9zm-2.83 2.828l1.415-1.414L30 9.313 21.515 17.8l1.414 1.413L30 11.8l7.07 7.414v-.002zm-2.827 2.83l1.414-1.416L30 14.97l-5.657 5.657 1.414 1.415L30 17.8l4.243 4.242zm-2.83 2.827l1.415-1.414L30 20.626l-2.828 2.83 1.414 1.414L30 23.456l1.414 1.414zM56.87 59.414L58.284 58 30 29.716 1.716 58l1.414 1.414L30 32.544l26.87 26.87z' fill='%234a88ff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
|
||||
background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zm20.97 0l9.315 9.314-1.414 1.414L34.828 0h2.83zM22.344 0L13.03 9.314l1.414 1.414L25.172 0h-2.83zM32 0l12.142 12.142-1.414 1.414L30 .828 17.272 13.556l-1.414-1.414L28 0h4zM.284 0l28 28-1.414 1.414L0 2.544V0h.284zM0 5.373l25.456 25.455-1.414 1.415L0 8.2V5.374zm0 5.656l22.627 22.627-1.414 1.414L0 13.86v-2.83zm0 5.656l19.8 19.8-1.415 1.413L0 19.514v-2.83zm0 5.657l16.97 16.97-1.414 1.415L0 25.172v-2.83zM0 28l14.142 14.142-1.414 1.414L0 30.828V28zm0 5.657L11.314 44.97 9.9 46.386l-9.9-9.9v-2.828zm0 5.657L8.485 47.8 7.07 49.212 0 42.143v-2.83zm0 5.657l5.657 5.657-1.414 1.415L0 47.8v-2.83zm0 5.657l2.828 2.83-1.414 1.413L0 53.456v-2.83zM54.627 60L30 35.373 5.373 60H8.2L30 38.2 51.8 60h2.827zm-5.656 0L30 41.03 11.03 60h2.828L30 43.858 46.142 60h2.83zm-5.656 0L30 46.686 16.686 60h2.83L30 49.515 40.485 60h2.83zm-5.657 0L30 52.343 22.344 60h2.83L30 55.172 34.828 60h2.83zM32 60l-2-2-2 2h4zM59.716 0l-28 28 1.414 1.414L60 2.544V0h-.284zM60 5.373L34.544 30.828l1.414 1.415L60 8.2V5.374zm0 5.656L37.373 33.656l1.414 1.414L60 13.86v-2.83zm0 5.656l-19.8 19.8 1.415 1.413L60 19.514v-2.83zm0 5.657l-16.97 16.97 1.414 1.415L60 25.172v-2.83zM60 28L45.858 42.142l1.414 1.414L60 30.828V28zm0 5.657L48.686 44.97l1.415 1.415 9.9-9.9v-2.828zm0 5.657L51.515 47.8l1.414 1.413 7.07-7.07v-2.83zm0 5.657l-5.657 5.657 1.414 1.415L60 47.8v-2.83zm0 5.657l-2.828 2.83 1.414 1.413L60 53.456v-2.83zM39.9 16.385l1.414-1.414L30 3.658 18.686 14.97l1.415 1.415 9.9-9.9 9.9 9.9zm-2.83 2.828l1.415-1.414L30 9.313 21.515 17.8l1.414 1.413L30 11.8l7.07 7.414v-.002zm-2.827 2.83l1.414-1.416L30 14.97l-5.657 5.657 1.414 1.415L30 17.8l4.243 4.242zm-2.83 2.827l1.415-1.414L30 20.626l-2.828 2.83 1.414 1.414L30 23.456l1.414 1.414zM56.87 59.414L58.284 58 30 29.716 1.716 58l1.414 1.414L30 32.544l26.87 26.87z' fill='%23F7D6C3' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.pattern-dots {
|
||||
background-image: radial-gradient(#4a88ff 1px, transparent 1px);
|
||||
background-image: radial-gradient(#f7d6c3 1px, transparent 1px);
|
||||
background-size: calc(10 * 1px) calc(10 * 1px);
|
||||
}
|
||||
|
||||
.gradient-text {
|
||||
background: linear-gradient(-45deg, #4a88ff, #1d4ed8, #2563eb, #3b82f6);
|
||||
background: linear-gradient(-45deg, #f7d6c3, #1d4ed8, #2563eb, #3b82f6);
|
||||
background-size: 200% 200%;
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
@@ -557,7 +554,7 @@ function debounce(fn: Function, delay: number) {
|
||||
}
|
||||
|
||||
.ink-cloud {
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%234a88ff' d='M50,0C36.7,0,25,11.7,25,25c0,13.3,11.7,25,25,25s25-11.7,25-25C75,11.7,63.3,0,50,0z M50,40c-8.3,0-15-6.7-15-15s6.7-15,15-15s15,6.7,15,15S58.3,40,50,40z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 50 50' to='360 50 50' dur='20s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%23F7D6C3' d='M50,0C36.7,0,25,11.7,25,25c0,13.3,11.7,25,25,25s25-11.7,25-25C75,11.7,63.3,0,50,0z M50,40c-8.3,0-15-6.7-15-15s6.7-15,15-15s15,6.7,15,15S58.3,40,50,40z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 50 50' to='360 50 50' dur='20s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
background-position: center;
|
||||
@@ -580,7 +577,7 @@ function debounce(fn: Function, delay: number) {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(90deg, #4a88ff 50%, transparent 50%);
|
||||
background: linear-gradient(90deg, #f7d6c3 50%, transparent 50%);
|
||||
background-size: 200% 100%;
|
||||
animation: borderFlow 4s linear infinite;
|
||||
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
<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: 200px" label="饭卡类型" prop="walletTypeId">
|
||||
<select-wallet-type v-model="state.queryForm.walletTypeId" placeholder="饭卡类型" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 200px" label="月份" prop="walletRecordMonth">
|
||||
<el-date-picker
|
||||
v-model="state.queryForm.walletRecordMonth"
|
||||
value-format="YYYY-MM"
|
||||
type="month"
|
||||
:clearable="false"
|
||||
placeholder="选择月份"
|
||||
/>
|
||||
</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%">
|
||||
<el-button
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="Delete"
|
||||
type="primary"
|
||||
v-auth="'wallet_walletManage_del'"
|
||||
@click="handleDelete(selectObjs)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
:export="'wallet_walletInactive_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 v-auth="'wallet_walletManage_del'" type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="80" />
|
||||
<el-table-column prop="username" width="100" label="用户" />
|
||||
<el-table-column prop="userAvatar" width="80" label="头像">
|
||||
<template #default="{ row }">
|
||||
<preview-image :src="row.userAvatar" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userMobile" width="120" label="手机号" />
|
||||
<el-table-column prop="deptName" label="部门" width="200" />
|
||||
<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="cardNumber" width="150" label="饭卡卡号" />
|
||||
<el-table-column prop="balance" align="center" width="100" label="余额">
|
||||
<template #default="{ row }">
|
||||
<div class="color-primary">{{ displayPrice(row.balance) }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isFreeze" width="120" label="是否冻结饭卡">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="yes_no_type" :value="row.isFreeze" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="false" prop="activeBindStatus" width="120" label="饭卡绑定状态" />
|
||||
<el-table-column prop="lastTopUpTime" width="200" label="最后充值时间">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.lastTopUpTime">{{ row.lastTopUpTime }}</span>
|
||||
<span v-else class="color-danger">本月未充值</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="" width="200" label="是否最近三个月未充值">
|
||||
<template #default="{ row }">{{ "??" }}</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="systemWalletManage">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchListJoinQb, delObjs } from "/@/api/wallet/wallet-manage"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import { formatDate } from "/@/utils/formatTime"
|
||||
|
||||
const { wallet_type, yes_no_type } = useDict("wallet_type", "yes_no_type")
|
||||
// 定义变量内容
|
||||
const draggableDepTreeRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
walletRecordMonth: formatDate(new Date(), "YYYY-mm"),
|
||||
},
|
||||
pageList: fetchListJoinQb,
|
||||
})
|
||||
|
||||
// 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()
|
||||
}
|
||||
|
||||
// 导出excel
|
||||
const exportExcel = () => {
|
||||
postDownBlobFile(
|
||||
"/wallet/wallet-manage/export-qb",
|
||||
Object.assign(state.queryForm, { current: state.pagination?.current, size: state.pagination?.size }),
|
||||
"钱包记录.xlsx",
|
||||
)
|
||||
}
|
||||
|
||||
const getSummaries = (param: any) => {
|
||||
const { columns, data } = param
|
||||
const totalColumns = ["balance"]
|
||||
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()
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
const handleDelete = async (ids: string[]) => {
|
||||
try {
|
||||
await useMessageBox().confirm("此操作将永久删除")
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await delObjs(ids)
|
||||
getDataList()
|
||||
useMessage().success("删除成功")
|
||||
} catch (err: any) {
|
||||
useMessage().error(err.msg)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in new issue
Block a user