Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1b6d271296
11 files changed
+575
-107
No files matched your search
@@ -1,5 +1,16 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
/**
|
||||
* 更新审核进度
|
||||
*/
|
||||
export function updateProgress(query: any) {
|
||||
return request({
|
||||
url: "/hard/hard-spu/progress",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备id智能柜编号查询商品
|
||||
* @param hardId 设备id
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
/**
|
||||
* 不活跃用户统计分页
|
||||
*/
|
||||
export function pageJoinActive(data: any) {
|
||||
return request({
|
||||
url: "/wallet/wallet-manage/page-join-active",
|
||||
method: "post",
|
||||
params: {
|
||||
current: data.current,
|
||||
size: data.size,
|
||||
},
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 不活跃用户统计list
|
||||
*/
|
||||
export function listJoinActive(data: any) {
|
||||
return request({
|
||||
url: "/wallet/wallet-manage/list-list-active",
|
||||
method: "post",
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-manage/page",
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
:remote-method="remoteSearch"
|
||||
:loading="state.loading"
|
||||
@visible-change="(e: boolean) => e && getOptions()"
|
||||
@change="change"
|
||||
>
|
||||
<el-option v-for="v in state.options" :key="v.userId" :label="`${v.name}-${v.phone}`" :value="v.userId">
|
||||
<div class="flex items-center">
|
||||
@@ -23,6 +24,7 @@
|
||||
<script setup lang="ts" name="select-user">
|
||||
import { reactive } from "vue"
|
||||
import * as userApi from "/@/api/admin/user"
|
||||
const emit = defineEmits(["change"])
|
||||
|
||||
const selectId = defineModel()
|
||||
|
||||
@@ -80,4 +82,9 @@ function clear() {
|
||||
state.selectId = null
|
||||
getOptions()
|
||||
}
|
||||
|
||||
function change(v: any) {
|
||||
const targetUser = state.options.find((i: any) => i.userId == v)
|
||||
emit("change", targetUser)
|
||||
}
|
||||
</script>
|
||||
@@ -1,55 +1,30 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" width="40%" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户id" />
|
||||
<el-form-item label="调动用户" prop="userId">
|
||||
<select-user v-model="form.userId" @change="(v: any) => { form.sourceDeptId = v?.deptId ?? null}" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="业务id" prop="bizId">
|
||||
<el-input v-model="form.bizId" placeholder="请输入业务id" />
|
||||
<el-form-item label="源部门" prop="sourceDeptId">
|
||||
<select-dept v-model="form.sourceDeptId" clearable disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="业务类型" prop="bizType">
|
||||
<el-input v-model="form.bizType" placeholder="请输入业务类型" />
|
||||
<el-form-item label="调用类型" prop="bizType">
|
||||
<dict-select v-model="form.bizType" dict-code="user_transaction" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20" v-if="form.bizType == '30'">
|
||||
<el-form-item label="目标部门" prop="targetDeptId">
|
||||
<select-dept v-model="form.targetDeptId" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="源部门id" prop="sourceDeptId">
|
||||
<el-input v-model="form.sourceDeptId" placeholder="请输入源部门id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="目标部门id" prop="targetDeptId">
|
||||
<el-input v-model="form.targetDeptId" placeholder="请输入目标部门id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="是否离职自动转账" prop="isWalletTransaction">
|
||||
<el-input v-model="form.isWalletTransaction" placeholder="请输入是否离职自动转账" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="离职自动转账时间" prop="walletTransactionTime">
|
||||
<el-input v-model="form.walletTransactionTime" placeholder="请输入离职自动转账时间" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="流程id" prop="processId">
|
||||
<el-input v-model="form.processId" placeholder="请输入流程id" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="审核状体" prop="processStatus">
|
||||
<el-input v-model="form.processStatus" placeholder="请输入审核状体" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="审核时间" prop="processTime">
|
||||
<el-input v-model="form.processTime" placeholder="请输入审核时间" />
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" type="textarea" :autosize="{ minRows: 6 }" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -75,7 +50,7 @@ const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
|
||||
const { user_transaction } = useDict("user_transaction")
|
||||
// 提交表单数据
|
||||
const form = reactive({
|
||||
id: "",
|
||||
@@ -89,10 +64,16 @@ const form = reactive({
|
||||
processId: "",
|
||||
processStatus: "",
|
||||
processTime: "",
|
||||
remark: "",
|
||||
})
|
||||
|
||||
// 定义校验规则
|
||||
const dataRules = ref({})
|
||||
const dataRules = ref({
|
||||
userId: [{ required: true, message: "请选择用户", trigger: "change" }],
|
||||
sourceDeptId: [{ required: true, message: "请选择源部门", trigger: "change" }],
|
||||
bizType: [{ required: true, message: "请选择调用类型", trigger: "change" }],
|
||||
targetDeptId: [{ required: true, message: "请选择目标部门", trigger: "change" }],
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
|
||||
@@ -1,6 +1,32 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
<div class="layout-padding-auto layout-padding-view">
|
||||
<el-row>
|
||||
<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" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 250px" label="调动类型" prop="bizType">
|
||||
<dict-select v-model="state.queryForm.bizType" dict-code="user_transaction" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 300px" label="自动转账到消费钱包" prop="isWalletTransaction">
|
||||
<dict-select v-model="state.queryForm.isWalletTransaction" dict-code="yes_no_type" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 450px" label="申请时间" prop="createTimeList">
|
||||
<el-date-picker v-model="state.queryForm.createTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 450px" label="审核时间" prop="processTimeList">
|
||||
<el-date-picker v-model="state.queryForm.processTimeList" value-format="YYYY-MM-DD HH:mm:ss" type="datetimerange" />
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 450px" label="自动转账时间" prop="walletTransactionTimeList">
|
||||
<el-date-picker v-model="state.queryForm.walletTransactionTimeList" 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="Refresh" @click="resetQuery">{{ $t("common.resetBtn") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="mb8" style="width: 100%">
|
||||
<el-button
|
||||
@@ -43,35 +69,82 @@
|
||||
>
|
||||
<el-table-column type="selection" width="40" align="center" />
|
||||
<el-table-column type="index" label="#" width="40" />
|
||||
<el-table-column prop="userId" label="用户id" show-overflow-tooltip />
|
||||
<el-table-column prop="bizId" label="业务id" show-overflow-tooltip />
|
||||
<el-table-column prop="bizType" label="业务类型" show-overflow-tooltip />
|
||||
<el-table-column prop="sourceDeptId" label="源部门id" show-overflow-tooltip />
|
||||
<el-table-column prop="targetDeptId" label="目标部门id" show-overflow-tooltip />
|
||||
<el-table-column prop="isWalletTransaction" label="是否离职自动转账" show-overflow-tooltip />
|
||||
<el-table-column prop="walletTransactionTime" label="离职自动转账时间" show-overflow-tooltip />
|
||||
<el-table-column prop="processId" label="流程id" show-overflow-tooltip />
|
||||
<el-table-column prop="processStatus" label="审核状体" show-overflow-tooltip />
|
||||
<el-table-column prop="processTime" label="审核时间" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-table-column prop="applyUsername" label="申请人" />
|
||||
<el-table-column prop="username" label="调动人" />
|
||||
<el-table-column prop="userMobile" label="调动人手机号" width="120" />
|
||||
<el-table-column prop="bizType" width="120" label="调动类型">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="user_transaction" :value="row.bizType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sourceDeptName" width="200" label="源部门" />
|
||||
<el-table-column prop="targetDeptName" width="200" label="目标部门" />
|
||||
<el-table-column prop="isWalletTransaction" width="160" label="自动转账到消费钱包">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="yes_no_type" :value="row.isWalletTransaction" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="walletTransactionTime" width="150" label="自动转账时间">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.walletTransactionTime">{{ row.walletTransactionTime }}</span>
|
||||
<span v-else class="color-danger">未自动转账</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="processStatus" width="160" label="审核状态">
|
||||
<template #default="{ row }">
|
||||
<dict-tag :options="check_status" :value="row.processStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="processTime" width="160" label="审核时间">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.processTime">{{ row.processTime }}</span>
|
||||
<span v-else class="color-danger">未审核</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="250"
|
||||
v-auths="['admin_sysUserTransaction_edit', 'admin_sysUserTransaction_check', 'admin_sysUserTransaction_del']"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
icon="edit-pen"
|
||||
v-if="row.processStatus == 1"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'admin_sysUserTransaction_edit'"
|
||||
@click="formDialogRef.openDialog(scope.row.id)"
|
||||
>编辑</el-button
|
||||
@click="formDialogRef.openDialog(row.id)"
|
||||
>
|
||||
<el-button icon="delete" text type="primary" v-auth="'admin_sysUserTransaction_del'" @click="handleDelete([scope.row.id])"
|
||||
>删除</el-button
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="VideoPlay"
|
||||
v-if="row.processStatus == 1"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'admin_sysUserTransaction_check'"
|
||||
@click="deal(row)"
|
||||
>
|
||||
开始处理
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="delete"
|
||||
v-if="row.processStatus == 1"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'admin_sysUserTransaction_del'"
|
||||
@click="handleDelete([row.id])"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 审批抽屉 -->
|
||||
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
</div>
|
||||
@@ -85,8 +158,9 @@ import { useDict } from "/@/hooks/dict"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const ProcessDrawer = defineAsyncComponent(() => import("/@/components/processDrawer/index.vue"))
|
||||
// 定义查询字典
|
||||
|
||||
const { user_transaction, yes_no_type, check_status } = useDict("user_transaction", "yes_no_type", "check_status")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
// 搜索变量
|
||||
@@ -95,6 +169,8 @@ const showSearch = ref(true)
|
||||
// 多选变量
|
||||
const selectObjs = ref([]) as any
|
||||
const multiple = ref(true)
|
||||
const processDrawerRef = ref()
|
||||
const batchDealRef = ref()
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
@@ -104,6 +180,17 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
// table hook
|
||||
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
|
||||
|
||||
// 点击开始处理
|
||||
const deal = (row: any) => {
|
||||
if (!row.processId) return useMessage().warning("流程id不存在")
|
||||
processDrawerRef.value.openProcessDrawer(row)
|
||||
}
|
||||
|
||||
// 审批提交事件
|
||||
const taskSubmitEvent = () => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
// 清空搜索条件
|
||||
const resetQuery = () => {
|
||||
// 清空搜索条件
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -101,7 +101,9 @@ const { yes_no_type, hard_ks_sku_type } = useDict("yes_no_type", "hard_ks_sku_ty
|
||||
const queryRef = ref()
|
||||
const visible = ref(false)
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
queryForm: {
|
||||
spuCategoryIdIsNotNull: true,
|
||||
},
|
||||
pageList: hardSpu.pageJoin,
|
||||
})
|
||||
const curCabinetItemId = ref<string>("")
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<el-dialog title="审核进度" width="40%" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" formDialogRef label-width="120px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-divider>商品信息</el-divider>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商品名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="分类" prop="spuCategoryId">
|
||||
<select-hard-spu-category v-model="form.spuCategoryId" :apiParams="{ hardId: form.hardId }" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="商品封面图片" prop="cover">
|
||||
<preview-image :src="form.cover" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item label="商品识别图片" prop="pic">
|
||||
<preview-image :src="form.pic" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-divider>审核信息</el-divider>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="商品名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="审核进度" prop="ksStatusTitle">
|
||||
<el-input v-model="form.ksStatusTitle" placeholder="" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="核状态描述" prop="ksComments">
|
||||
<el-input v-model="form.ksComments" placeholder="" type="textarea" :autosize="{ minRows: 6 }" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button icon="RefreshRight" type="primary" @click="updateProgress">更新进度</el-button>
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="check-progress">
|
||||
import { storePrice, displayPrice } from "/@/utils/formatMoney"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import * as hardSpu from "/@/api/hard/hard-spu"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
// 定义变量内容
|
||||
const dataFormRef = ref()
|
||||
const visible = ref(false)
|
||||
const loading = ref(false)
|
||||
// 定义字典
|
||||
const { yes_no_type } = useDict("yes_no_type")
|
||||
// 提交表单数据
|
||||
const form = reactive<any>({
|
||||
id: "",
|
||||
hardId: "",
|
||||
spuCategoryId: "",
|
||||
name: "",
|
||||
cover: "",
|
||||
pic: "",
|
||||
specsTaste: "",
|
||||
specsCapacity: "",
|
||||
specsWeight: "",
|
||||
price: 0,
|
||||
salesCount: 0,
|
||||
repertoryCount: 0,
|
||||
sort: 0,
|
||||
hardDoorNumber: 1,
|
||||
status: "1",
|
||||
isDefault: "0",
|
||||
})
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (id: string) => {
|
||||
visible.value = true
|
||||
form.id = ""
|
||||
// 重置表单数据
|
||||
nextTick(() => {
|
||||
dataFormRef.value?.resetFields()
|
||||
})
|
||||
// 获取hardSpu信息
|
||||
if (id) {
|
||||
form.id = id
|
||||
gethardSpuData(id)
|
||||
}
|
||||
}
|
||||
|
||||
// 更新进度
|
||||
const updateProgress = async () => {
|
||||
try {
|
||||
await hardSpu.updateProgress({ id: form.id })
|
||||
gethardSpuData(form.id)
|
||||
useMessage().success("更新成功")
|
||||
} catch (error: any) {
|
||||
useMessage().error(error.msg)
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化表单数据
|
||||
const gethardSpuData = (id: string) => {
|
||||
// 获取数据
|
||||
loading.value = true
|
||||
hardSpu
|
||||
.getObj(id)
|
||||
.then((res: any) => {
|
||||
Object.assign(form, res.data, { price: Number(displayPrice(res.data.price, "", 0)) })
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
})
|
||||
</script>
|
||||
@@ -67,12 +67,20 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" width="240" label="规格">
|
||||
<template #default="{ row }">
|
||||
<span>口味:</span>
|
||||
<span class="color-primary">{{ row.specsTaste }}</span>
|
||||
<span>容量:</span>
|
||||
<span class="color-primary">{{ row.specsCapacity }}</span>
|
||||
<span>重量:</span>
|
||||
<span class="color-primary">{{ row.specsWeight }}</span>
|
||||
<div class="flex">
|
||||
<div v-if="row.specsTaste">
|
||||
<span>口味:</span>
|
||||
<span class="color-primary">{{ row.specsTaste }}</span>
|
||||
</div>
|
||||
<div v-if="row.specsCapacity">
|
||||
<span>容量:</span>
|
||||
<span class="color-primary">{{ row.specsCapacity }}</span>
|
||||
</div>
|
||||
<div v-if="row.specsWeight">
|
||||
<span>重量:</span>
|
||||
<span class="color-primary">{{ row.specsWeight }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="salesCount" label="销量">
|
||||
@@ -96,29 +104,41 @@
|
||||
<dict-tag :options="yes_no_type" :value="row.isDefault" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="150">
|
||||
<el-table-column label="操作" fixed="right" width="250">
|
||||
<template #default="{ row }">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'hard_hardSpu_edit'" @click="formDialogRef.openDialog(row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="!(row.skuType == '0')"
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'hard_hardSpu_del'"
|
||||
@click="handleDelete([row.id])"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
<div class="flex">
|
||||
<el-button icon="edit-pen" text type="primary" v-auth="'hard_hardSpu_edit'" @click="formDialogRef.openDialog(row.id)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.skuType != '0'"
|
||||
icon="CircleCheck"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'hard_hardSpu_edit'"
|
||||
@click="checkProgRessRef.openDialog(row.id)"
|
||||
>
|
||||
审核进度
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="row.skuType != '0'"
|
||||
icon="delete"
|
||||
text
|
||||
type="primary"
|
||||
v-auth="'hard_hardSpu_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" />
|
||||
</div>
|
||||
|
||||
<!-- 编辑、新增 -->
|
||||
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
||||
<check-progRess ref="checkProgRessRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -131,10 +151,12 @@ import { displayPrice } from "/@/utils/formatMoney"
|
||||
|
||||
// 引入组件
|
||||
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
|
||||
const CheckProgRess = defineAsyncComponent(() => import("./check-progress.vue"))
|
||||
// 定义查询字典
|
||||
const { yes_no_type, hard_ks_sku_type } = useDict("yes_no_type", "hard_ks_sku_type")
|
||||
// 定义变量内容
|
||||
const formDialogRef = ref()
|
||||
const checkProgRessRef = ref()
|
||||
// 搜索变量
|
||||
const queryRef = ref()
|
||||
const showSearch = ref(true)
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
<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="unactiveMonthsNumber">
|
||||
<el-input v-model="state.queryForm.unactiveMonthsNumber" type="number" 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="tableList"
|
||||
v-loading="state.loading"
|
||||
:row-key="(row:any) => row.id"
|
||||
lazy
|
||||
:load="load"
|
||||
:indent="30"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
:summary-method="getSummaries"
|
||||
show-summary
|
||||
:header-cell-style="tableStyle.headerCellStyle"
|
||||
:cell-style="tableStyle.cellStyle"
|
||||
@selection-change="selectionChangHandle"
|
||||
@sort-change="sortChangeHandle"
|
||||
:row-class-name="tableRowClassName"
|
||||
>
|
||||
<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" label="用户" />
|
||||
<el-table-column prop="userAvatar" label="头像">
|
||||
<template #default="{ row }">
|
||||
<preview-image :src="row.userAvatar" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="userMobile" label="手机号" />
|
||||
<el-table-column prop="deptName" label="部门" />
|
||||
<el-table-column prop="walletTypeName" label="钱包类型" />
|
||||
<el-table-column prop="balance" label="余额">
|
||||
<template #default="{ row }">{{ row.balance && displayPrice(row.balance) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="updateTime" label="最后充值时间" />
|
||||
</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 { pageJoinActive, delObjs, listJoinActive } 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: {
|
||||
unactiveMonthsNumber: 3,
|
||||
},
|
||||
pageList: pageJoinActive,
|
||||
})
|
||||
const tableList = computed(() => {
|
||||
return state.dataList?.map((item: any) => ({ ...item, walletTypeName: "", updateTime: "", balance: "", children: [], hasChildren: true }))
|
||||
})
|
||||
|
||||
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-inactive/export",
|
||||
Object.assign(state.queryForm, { current: state.pagination?.current, size: state.pagination?.size }),
|
||||
"不活跃钱包统计.xlsx",
|
||||
)
|
||||
}
|
||||
|
||||
const tableRowClassName = ({ row, rowIndex }: { row: any; rowIndex: number }) => {
|
||||
if (row._flag) {
|
||||
return "success-row"
|
||||
}
|
||||
}
|
||||
|
||||
const load = (row: any, treeNode: unknown, resolve: (date: any[]) => void) => {
|
||||
listJoinActive({ userId: row.userId }).then((res) => {
|
||||
resolve(res.data.map((item: any) => ({ ...item, id: item.id + "0", _flag: true })))
|
||||
})
|
||||
}
|
||||
|
||||
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>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .el-table .success-row {
|
||||
--el-table-tr-bg-color: var(--el-color-success-light-9);
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user