导出excel加上日期

This commit is contained in:
weiwei committed 2025-03-06 14:38:52 +08:00
1 parent 8bdf76ae3a
commit 5dce0acf8c
67 files changed
+2300 -2278

No files matched your search

+43 -31
View File
@@ -16,7 +16,13 @@
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_boxesAvailability_add'">
<el-button
icon="folder-add"
type="primary"
class="ml10"
@click="formDialogRef.openDialog()"
v-auth="'canteen_boxesAvailability_add'"
>
新 增
</el-button>
<el-button
@@ -63,7 +69,13 @@
<el-table-column prop="hourIndex" label="时间索引(0-24)" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesAvailability_edit'" @click="formDialogRef.openDialog(scope.row.id)">
<el-button
icon="edit-pen"
text
type="primary"
v-auth="'canteen_boxesAvailability_edit'"
@click="formDialogRef.openDialog(scope.row.id)"
>
编辑
</el-button>
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesAvailability_del'" @click="handleDelete([scope.row.id])">
@@ -81,67 +93,67 @@
</template>
<script setup lang="ts" name="systemBoxesAvailability">
import { BasicTableProps, useTable } from '/@/hooks/table';
import { fetchList, delObjs } from '/@/api/canteen/boxesAvailability';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { fetchList, delObjs } from "/@/api/canteen/boxesAvailability"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
const { booking_status } = useDict('booking_status');
const { booking_status } = useDict("booking_status")
// 定义变量内容
const formDialogRef = ref();
const formDialogRef = ref()
// 搜索变量
const queryRef = ref();
const showSearch = ref(true);
const queryRef = ref()
const showSearch = ref(true)
// 多选变量
const selectObjs = ref([]) as any;
const multiple = ref(true);
const selectObjs = ref([]) as any
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
});
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
// 清空搜索条件
queryRef.value?.resetFields();
queryRef.value?.resetFields()
// 清空多选
selectObjs.value = [];
getDataList();
};
selectObjs.value = []
getDataList()
}
// 导出excel
const exportExcel = () => {
downBlobFile('/canteen/boxesAvailability/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesAvailability.xlsx');
};
downBlobFile("/canteen/boxesAvailability/export", Object.assign(state.queryForm, { ids: selectObjs }), "包厢时间段管理.xlsx")
}
// 多选事件
const selectionChangHandle = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ id }) => id)
multiple.value = !objs.length
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm('此操作将永久删除');
await useMessageBox().confirm("此操作将永久删除")
} catch {
return;
return
}
try {
await delObjs(ids);
getDataList();
useMessage().success('删除成功');
await delObjs(ids)
getDataList()
useMessage().success("删除成功")
} catch (err: any) {
useMessage().error(err.msg);
useMessage().error(err.msg)
}
};
}
</script>
+47 -32
View File
@@ -23,7 +23,14 @@
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_boxesBooking_add'">
新 增
</el-button>
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'canteen_boxesBooking_del'" @click="handleDelete(selectObjs)">
<el-button
plain
:disabled="multiple"
icon="Delete"
type="primary"
v-auth="'canteen_boxesBooking_del'"
@click="handleDelete(selectObjs)"
>
删 除
</el-button>
<right-toolbar
@@ -66,10 +73,18 @@
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip min-width="160" />
<el-table-column label="操作" width="150" fixed="right">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesBooking_edit'" @click="formDialogRef.openDialog(scope.row.id)">
<el-button
icon="edit-pen"
text
type="primary"
v-auth="'canteen_boxesBooking_edit'"
@click="formDialogRef.openDialog(scope.row.id)"
>
编辑
</el-button>
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesBooking_del'" @click="handleDelete([scope.row.id])">删除</el-button>
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesBooking_del'" @click="handleDelete([scope.row.id])"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@@ -82,67 +97,67 @@
</template>
<script setup lang="ts" name="systemBoxesBooking">
import { BasicTableProps, useTable } from '/@/hooks/table';
import { fetchList, delObjs } from '/@/api/canteen/boxesBooking';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { fetchList, delObjs } from "/@/api/canteen/boxesBooking"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
const { check_status } = useDict('check_status');
const { check_status } = useDict("check_status")
// 定义变量内容
const formDialogRef = ref();
const formDialogRef = ref()
// 搜索变量
const queryRef = ref();
const showSearch = ref(true);
const queryRef = ref()
const showSearch = ref(true)
// 多选变量
const selectObjs = ref([]) as any;
const multiple = ref(true);
const selectObjs = ref([]) as any
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
});
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
// 清空搜索条件
queryRef.value?.resetFields();
queryRef.value?.resetFields()
// 清空多选
selectObjs.value = [];
getDataList();
};
selectObjs.value = []
getDataList()
}
// 导出excel
const exportExcel = () => {
downBlobFile('/canteen/boxesBooking/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesBooking.xlsx');
};
downBlobFile("/canteen/boxesBooking/export", Object.assign(state.queryForm, { ids: selectObjs }), "包厢预约管理.xlsx")
}
// 多选事件
const selectionChangHandle = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ id }) => id)
multiple.value = !objs.length
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm('此操作将永久删除');
await useMessageBox().confirm("此操作将永久删除")
} catch {
return;
return
}
try {
await delObjs(ids);
getDataList();
useMessage().success('删除成功');
await delObjs(ids)
getDataList()
useMessage().success("删除成功")
} catch (err: any) {
useMessage().error(err.msg);
useMessage().error(err.msg)
}
};
}
</script>
+47 -32
View File
@@ -17,7 +17,14 @@
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_boxesInfo_add'">
新 增
</el-button>
<el-button plain :disabled="multiple" icon="Delete" type="primary" v-auth="'canteen_boxesInfo_del'" @click="handleDelete(selectObjs)">
<el-button
plain
:disabled="multiple"
icon="Delete"
type="primary"
v-auth="'canteen_boxesInfo_del'"
@click="handleDelete(selectObjs)"
>
删 除
</el-button>
<right-toolbar
@@ -59,10 +66,18 @@
<el-table-column prop="merchantId" label="商户id" show-overflow-tooltip />
<el-table-column label="操作" width="150" fixed="right">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'canteen_boxesInfo_edit'" @click="formDialogRef.openDialog(scope.row.id)">
<el-button
icon="edit-pen"
text
type="primary"
v-auth="'canteen_boxesInfo_edit'"
@click="formDialogRef.openDialog(scope.row.id)"
>
编辑
</el-button>
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesInfo_del'" @click="handleDelete([scope.row.id])">删除</el-button>
<el-button icon="delete" text type="primary" v-auth="'canteen_boxesInfo_del'" @click="handleDelete([scope.row.id])"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
@@ -75,67 +90,67 @@
</template>
<script setup lang="ts" name="systemBoxesInfo">
import { BasicTableProps, useTable } from '/@/hooks/table';
import { fetchList, delObjs } from '/@/api/canteen/boxesInfo';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useDict } from '/@/hooks/dict';
import { BasicTableProps, useTable } from "/@/hooks/table"
import { fetchList, delObjs } from "/@/api/canteen/boxesInfo"
import { useMessage, useMessageBox } from "/@/hooks/message"
import { useDict } from "/@/hooks/dict"
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
const FormDialog = defineAsyncComponent(() => import("./form.vue"))
// 定义查询字典
const { boxes_status } = useDict('boxes_status');
const { boxes_status } = useDict("boxes_status")
// 定义变量内容
const formDialogRef = ref();
const formDialogRef = ref()
// 搜索变量
const queryRef = ref();
const showSearch = ref(true);
const queryRef = ref()
const showSearch = ref(true)
// 多选变量
const selectObjs = ref([]) as any;
const multiple = ref(true);
const selectObjs = ref([]) as any
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList,
});
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state);
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
// 清空搜索条件
queryRef.value?.resetFields();
queryRef.value?.resetFields()
// 清空多选
selectObjs.value = [];
getDataList();
};
selectObjs.value = []
getDataList()
}
// 导出excel
const exportExcel = () => {
downBlobFile('/canteen/boxesInfo/export', Object.assign(state.queryForm, { ids: selectObjs }), 'boxesInfo.xlsx');
};
downBlobFile("/canteen/boxesInfo/export", Object.assign(state.queryForm, { ids: selectObjs }), "包厢列表.xlsx")
}
// 多选事件
const selectionChangHandle = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};
selectObjs.value = objs.map(({ id }) => id)
multiple.value = !objs.length
}
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm('此操作将永久删除');
await useMessageBox().confirm("此操作将永久删除")
} catch {
return;
return
}
try {
await delObjs(ids);
getDataList();
useMessage().success('删除成功');
await delObjs(ids)
getDataList()
useMessage().success("删除成功")
} catch (err: any) {
useMessage().error(err.msg);
useMessage().error(err.msg)
}
};
}
</script>
+4 -17
View File
@@ -7,9 +7,7 @@
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenCategory_view'">
查询
</el-button>
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenCategory_view'"> 查询 </el-button>
<el-button icon="Refresh" @click="resetQuery" v-auth="'canteen_canteenCategory_view'">重置</el-button>
</el-form-item>
</el-form>
@@ -81,13 +79,7 @@
>
编辑
</el-button>
<el-button
icon="delete"
text
type="primary"
v-auth="'canteen_canteenCategory_del'"
@click="handleDelete([scope.row.id])"
>
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenCategory_del'" @click="handleDelete([scope.row.id])">
删除
</el-button>
</template>
@@ -126,8 +118,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
@@ -140,11 +131,7 @@ const resetQuery = () => {
// 导出excel
const exportExcel = () => {
downBlobFile(
"/canteen/canteenCategory/export",
Object.assign(state.queryForm, { ids: selectObjs }),
"canteenCategory.xlsx",
)
downBlobFile("/canteen/canteenCategory/export", Object.assign(state.queryForm, { ids: selectObjs }), "每日菜品分类.xlsx")
}
// 多选事件
@@ -7,9 +7,7 @@
<el-input placeholder="请输入分类名称" v-model="state.queryForm.name" />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenOnlineCategory_view'">
查询
</el-button>
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenOnlineCategory_view'"> 查询 </el-button>
<el-button icon="Refresh" @click="resetQuery" v-auth="'canteen_canteenOnlineCategory_view'">重置</el-button>
</el-form-item>
</el-form>
@@ -75,13 +73,7 @@
>
编辑
</el-button>
<el-button
icon="delete"
text
type="primary"
v-auth="'canteen_canteenOnlineCategory_del'"
@click="handleDelete([scope.row.id])"
>
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenOnlineCategory_del'" @click="handleDelete([scope.row.id])">
删除
</el-button>
</template>
@@ -118,8 +110,7 @@ const state: BasicTableProps = reactive<BasicTableProps>({
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
@@ -132,11 +123,7 @@ const resetQuery = () => {
// 导出excel
const exportExcel = () => {
downBlobFile(
"/canteen/canteenOnlineCategory/export",
Object.assign(state.queryForm, { ids: selectObjs }),
"canteenOnlineCategory.xlsx",
)
downBlobFile("/canteen/canteenOnlineCategory/export", Object.assign(state.queryForm, { ids: selectObjs }), "线上菜品分类.xlsx")
}
// 多选事件
+4 -17
View File
@@ -10,9 +10,7 @@
<select-ctcgol v-model="state.queryForm.categoryId" style="width: 200px" />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenOnlineSpu_view'">
查询
</el-button>
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenOnlineSpu_view'"> 查询 </el-button>
<el-button icon="Refresh" @click="resetQuery" v-auth="'canteen_canteenOnlineSpu_view'">重置</el-button>
</el-form-item>
</el-form>
@@ -100,13 +98,7 @@
>
编辑
</el-button>
<el-button
icon="delete"
text
type="primary"
v-auth="'canteen_canteenOnlineSpu_del'"
@click="handleDelete([scope.row.id])"
>
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenOnlineSpu_del'" @click="handleDelete([scope.row.id])">
删除
</el-button>
</template>
@@ -156,8 +148,7 @@ onMounted(async () => {
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
@@ -170,11 +161,7 @@ const resetQuery = () => {
// 导出excel
const exportExcel = () => {
downBlobFile(
"/canteen/canteenOnlineSpu/export",
Object.assign(state.queryForm, { ids: selectObjs }),
"canteenOnlineSpu.xlsx",
)
downBlobFile("/canteen/canteenOnlineSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "线上菜品列表.xlsx")
}
// 多选事件
+5 -20
View File
@@ -10,22 +10,14 @@
<select-ctcg v-model="state.queryForm.categoryId" style="width: 200px" />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenSpu_view'">
查询
</el-button>
<el-button icon="search" type="primary" @click="getDataList" v-auth="'canteen_canteenSpu_view'"> 查询 </el-button>
<el-button icon="Refresh" @click="resetQuery" v-auth="'canteen_canteenSpu_view'">重置</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button
icon="folder-add"
type="primary"
class="ml10"
@click="formDialogRef.openDialog()"
v-auth="'canteen_canteenSpu_add'"
>
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()" v-auth="'canteen_canteenSpu_add'">
新 增
</el-button>
<el-button
@@ -104,13 +96,7 @@
>
编辑
</el-button>
<el-button
icon="delete"
text
type="primary"
v-auth="'canteen_canteenSpu_del'"
@click="handleDelete([scope.row.id])"
>
<el-button icon="delete" text type="primary" v-auth="'canteen_canteenSpu_del'" @click="handleDelete([scope.row.id])">
删除
</el-button>
</template>
@@ -161,8 +147,7 @@ onMounted(async () => {
})
// table hook
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } =
useTable(state)
const { getDataList, currentChangeHandle, sizeChangeHandle, sortChangeHandle, downBlobFile, tableStyle } = useTable(state)
// 清空搜索条件
const resetQuery = () => {
@@ -175,7 +160,7 @@ const resetQuery = () => {
// 导出excel
const exportExcel = () => {
downBlobFile("/canteen/canteenSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "canteenSpu.xlsx")
downBlobFile("/canteen/canteenSpu/export", Object.assign(state.queryForm, { ids: selectObjs }), "菜品列表.xlsx")
}
// 多选事件