Merge branch 'develop' of https://git.openserver.cn:8089/XinJiang/TheProjectOfFour/kelamayireligongsi/plrl/vue into develop
This commit is contained in:
commit
085e8c6a86
|
@ -59,10 +59,13 @@ export const useRender = {
|
|||
// if (params?.maxLine && params?.maxLine > 0) {
|
||||
// classArr.push(`line-clamp-${params?.maxLine}`);
|
||||
// }
|
||||
|
||||
return h(
|
||||
EllipsisText,
|
||||
{ class: classArr.join(' '), line: params?.maxLine || 6 },
|
||||
text,
|
||||
{
|
||||
default: () => text,
|
||||
},
|
||||
);
|
||||
}
|
||||
return '';
|
||||
|
|
|
@ -104,7 +104,7 @@ const coreRoutes: RouteRecordRaw[] = [
|
|||
hideInMenu: true,
|
||||
hideInTab: true,
|
||||
icon: 'lucide:area-chart',
|
||||
title: '供热公司网络生产会议系统-会议查询篇',
|
||||
title: '热力公司会议管理系统',
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -86,6 +86,15 @@ const routes: RouteRecordRaw[] = [
|
|||
title: '会议填报',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'MeetingProuctionList',
|
||||
path: '/meeting/production/list',
|
||||
component: () => import('#/views/meeting/production-list/index.vue'),
|
||||
meta: {
|
||||
icon: 'lucide:area-chart',
|
||||
title: '生产会议',
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'MeetingList',
|
||||
path: '/meeting/list',
|
||||
|
|
|
@ -121,7 +121,7 @@ const searchForm = ref({
|
|||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: true,
|
||||
format: 'YYYY-MM-DD',
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
|
@ -134,7 +134,7 @@ const searchForm = ref({
|
|||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: true,
|
||||
format: 'YYYY-MM-DD',
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
<script lang="ts" setup>
|
||||
import { reactive, ref, nextTick } from "vue";
|
||||
import { useVbenModal } from "@vben/common-ui";
|
||||
import { message } from "ant-design-vue";
|
||||
import { useVxeTable } from "#/hooks/vxeTable";
|
||||
import type { VxeGridPropTypes, VxeTablePropTypes } from "vxe-table";
|
||||
import { getColumns } from "./crud.tsx";
|
||||
import Apis from "#/api";
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
import { DICT_TYPE, getDictObj, getDictOptions } from "#/utils/dict/index.ts";
|
||||
import Big from "big.js";
|
||||
import type { VxeTablePropTypes } from 'vxe-table';
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: "rowClick", row: any): any;
|
||||
(e: "confirm", row: any[]): any[];
|
||||
(e: "register"): any;
|
||||
(e: "success"): any;
|
||||
}>();
|
||||
import { reactive, ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { dict } from '@fast-crud/fast-crud';
|
||||
import { message } from 'ant-design-vue';
|
||||
import Big from 'big.js';
|
||||
|
||||
import Apis from '#/api';
|
||||
import { useVxeTable } from '#/hooks/vxeTable';
|
||||
import { DICT_TYPE, getDictObj, getDictOptions } from '#/utils/dict/index.ts';
|
||||
|
||||
import { getColumns } from './crud.tsx';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
|
@ -25,12 +23,19 @@ const props = withDefaults(
|
|||
{
|
||||
multiple: false,
|
||||
showDepartment: true,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'confirm', row: any[]): any[];
|
||||
(e: 'register'): any;
|
||||
(e: 'rowClick', row: any): any;
|
||||
(e: 'success'): any;
|
||||
}>();
|
||||
|
||||
const [messageApi] = message.useMessage();
|
||||
|
||||
const { xGridRef, triggerProxy, gridProps } = useVxeTable({ ref: "xGridRef" });
|
||||
const { xGridRef, triggerProxy, gridProps } = useVxeTable({ ref: 'xGridRef' });
|
||||
|
||||
const searchRef = ref();
|
||||
|
||||
|
@ -48,25 +53,25 @@ const searchBinding = ref({
|
|||
initialForm: {},
|
||||
columns: {
|
||||
startDate: {
|
||||
title: "开始日期",
|
||||
key: "startDate",
|
||||
title: '开始日期',
|
||||
key: 'startDate',
|
||||
component: {
|
||||
name: "a-date-picker",
|
||||
vModel: "value",
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: false,
|
||||
format: 'YYYY-MM-DD',
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
show: true,
|
||||
},
|
||||
endDate: {
|
||||
title: "截止日期",
|
||||
key: "endDate",
|
||||
title: '截止日期',
|
||||
key: 'endDate',
|
||||
component: {
|
||||
name: "a-date-picker",
|
||||
vModel: "value",
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: false,
|
||||
format: 'YYYY-MM-DD',
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
show: true,
|
||||
|
@ -98,8 +103,8 @@ const searchBinding = ref({
|
|||
allowClear: true,
|
||||
dict: dict({
|
||||
data: [
|
||||
{ label: "已结算", value: "1", },
|
||||
{ label: "未结算", value: "0", },
|
||||
{ label: '已结算', value: '1' },
|
||||
{ label: '未结算', value: '0' },
|
||||
],
|
||||
}),
|
||||
},
|
||||
|
@ -108,20 +113,20 @@ const searchBinding = ref({
|
|||
},
|
||||
},
|
||||
onSearch(context: any) {
|
||||
triggerProxy("reload");
|
||||
triggerProxy('reload');
|
||||
},
|
||||
onReset(context: any) {
|
||||
searchRef.value.setForm(searchParams)
|
||||
searchRef.value.setForm(searchParams);
|
||||
},
|
||||
});
|
||||
|
||||
const searchParams = reactive({})
|
||||
const searchParams = reactive({});
|
||||
/** Hooks - 表格 */
|
||||
const gridOptions = reactive(
|
||||
gridProps({
|
||||
height: "400px",
|
||||
height: '400px',
|
||||
columns: getColumns(),
|
||||
pagerConfig: { size: "mini" },
|
||||
pagerConfig: { size: 'mini' },
|
||||
proxyConfig: {
|
||||
autoLoad: false,
|
||||
ajax: {
|
||||
|
@ -139,33 +144,37 @@ const gridOptions = reactive(
|
|||
},
|
||||
showFooter: true,
|
||||
footerMethod: (e) => footerMethod(e),
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
/**
|
||||
* 表格计算规则
|
||||
* @param param0
|
||||
*/
|
||||
const footerMethod: VxeTablePropTypes.FooterMethod<any> = ({ columns, data }) => {
|
||||
const footerMethod: VxeTablePropTypes.FooterMethod<any> = ({
|
||||
columns,
|
||||
data,
|
||||
}) => {
|
||||
data.forEach((item) => {
|
||||
item.sPrice = getDictObj(DICT_TYPE.canteen_dineway, item.diningMode)?.extend1 || 0;
|
||||
item.sPrice =
|
||||
getDictObj(DICT_TYPE.canteen_dineway, item.diningMode)?.extend1 || 0;
|
||||
item.sPrice = Number(item.sPrice);
|
||||
});
|
||||
console.log("[ columns, data ] >", columns, data);
|
||||
console.log('[ columns, data ] >', columns, data);
|
||||
const footerData = [
|
||||
columns.map((column, _columnIndex) => {
|
||||
if (_columnIndex === 0) {
|
||||
return "合计";
|
||||
return '合计';
|
||||
}
|
||||
|
||||
// if (["count", "deliveryCount", "eatInCount"].includes(column.field)) {
|
||||
// return sumNum(data, column.field) + " 次";
|
||||
// }
|
||||
if (["settlementPrice"].includes(column.field)) {
|
||||
return sumNum(data, "sPrice") + " 元";
|
||||
if (['settlementPrice'].includes(column.field)) {
|
||||
return `${sumNum(data, 'sPrice')} 元`;
|
||||
}
|
||||
|
||||
return "";
|
||||
return '';
|
||||
}),
|
||||
];
|
||||
return footerData;
|
||||
|
@ -179,7 +188,7 @@ const footerMethod: VxeTablePropTypes.FooterMethod<any> = ({ columns, data }) =>
|
|||
const sumNum = (list: any[], field: string) => {
|
||||
let count = null;
|
||||
list.forEach((item) => {
|
||||
if (typeof item[field] == "number") {
|
||||
if (typeof item[field] === 'number') {
|
||||
if (count == null) {
|
||||
count = new Big(0);
|
||||
}
|
||||
|
@ -193,9 +202,9 @@ function handleExport() {
|
|||
const $grid = xGridRef.value;
|
||||
if ($grid) {
|
||||
$grid.exportData({
|
||||
type: "xlsx",
|
||||
type: 'xlsx',
|
||||
});
|
||||
message.success("导出成功");
|
||||
message.success('导出成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -207,48 +216,45 @@ function handleCellClick({ row }) {
|
|||
}
|
||||
|
||||
function getMonthRange(yearMonth) {
|
||||
const [year, month] = yearMonth.split("-").map(Number);
|
||||
const [year, month] = yearMonth.split('-').map(Number);
|
||||
const startDate = `${yearMonth}-01`;
|
||||
const endDate = `${yearMonth}-${new Date(year, month, 0).getDate()}`;
|
||||
return [startDate, endDate];
|
||||
}
|
||||
|
||||
let title = ref('')
|
||||
const title = ref('');
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
onOpenChange(isOpen: boolean) {
|
||||
if (isOpen) {
|
||||
data.value = modalApi.getData<Record<string, any>>() || {};
|
||||
let [startMonth, endMonth] = data.value.month;
|
||||
const [startMonth, endMonth] = data.value.month;
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
|
||||
console.log(searchRef.value);
|
||||
|
||||
title.value = `订餐明细-${data.value.record.name}`;
|
||||
|
||||
|
||||
if (startMonth) {
|
||||
searchParams.startDate = getMonthRange(startMonth)[0]
|
||||
searchParams.startDate = getMonthRange(startMonth)[0];
|
||||
}
|
||||
|
||||
if (endMonth) {
|
||||
searchParams.endDate = getMonthRange(endMonth)[1]
|
||||
searchParams.endDate = getMonthRange(endMonth)[1];
|
||||
}
|
||||
|
||||
searchParams.userId = data.value.record.id
|
||||
searchParams.userId = data.value.record.id;
|
||||
if (data.value.record.balance == 1 || data.value.record.balance == 0) {
|
||||
searchParams.balance = data.value.record.balance
|
||||
searchParams.balance = data.value.record.balance;
|
||||
}
|
||||
searchRef.value.setForm(searchParams)
|
||||
triggerProxy("reload");
|
||||
searchRef.value.setForm(searchParams);
|
||||
triggerProxy('reload');
|
||||
}, 50);
|
||||
}
|
||||
},
|
||||
onConfirm() {
|
||||
console.info("onConfirm");
|
||||
emit("success");
|
||||
console.info('onConfirm');
|
||||
emit('success');
|
||||
formRef.value?.submit();
|
||||
},
|
||||
onCancel() {
|
||||
|
@ -257,12 +263,11 @@ const [Modal, modalApi] = useVbenModal({
|
|||
});
|
||||
</script>
|
||||
<template>
|
||||
<Modal :title="title" :showConfirmButton="false" cancelText="关闭">
|
||||
<div class="h-full flex flex-col">
|
||||
<fs-search ref="searchRef" v-bind="searchBinding"> </fs-search>
|
||||
<div class="flex-1 min-h-300px">
|
||||
<VxeGrid ref="xGridRef" class="h-420px" v-bind="gridOptions">
|
||||
</VxeGrid>
|
||||
<Modal :show-confirm-button="false" :title="title" cancel-text="关闭">
|
||||
<div class="flex h-full flex-col">
|
||||
<fs-search ref="searchRef" v-bind="searchBinding" />
|
||||
<div class="min-h-300px flex-1">
|
||||
<VxeGrid ref="xGridRef" class="h-420px" v-bind="gridOptions" />
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, reactive, ref, defineAsyncComponent } from "vue";
|
||||
import type { VxeGridInstance, VxeGridProps } from "vxe-table";
|
||||
import { Page, useVbenModal } from "@vben/common-ui";
|
||||
import { useVxeTable } from "#/hooks/vxeTable";
|
||||
import dayjs from "dayjs";
|
||||
import { getColumns } from './crud.tsx';
|
||||
import recipeSyncModal from "./recipe-sync-modal.vue";
|
||||
import Apis from "#/api";
|
||||
import { SolarDay } from "tyme4ts";
|
||||
import isoWeek from 'dayjs/plugin/isoWeek'
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
|
||||
import { message, Modal } from "ant-design-vue";
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { message } from 'ant-design-vue';
|
||||
import { logger } from 'common-utils';
|
||||
import dayjs from 'dayjs';
|
||||
import { SolarDay } from 'tyme4ts';
|
||||
|
||||
import Apis from '#/api';
|
||||
import { useVxeTable } from '#/hooks/vxeTable';
|
||||
|
||||
import { getColumns } from './crud.tsx';
|
||||
import recipeSyncModal from './recipe-sync-modal.vue';
|
||||
// import AutoPeople from "./components/auto-people/AutoPeople.vue";
|
||||
|
||||
// /** 异步加载的组件,用到的时候再加载组件 */
|
||||
|
@ -29,101 +31,111 @@ import { message, Modal } from "ant-design-vue";
|
|||
// return import("./components/delivery-address/delivery-address.vue");
|
||||
// });
|
||||
|
||||
const { xGridRef, gridProps, triggerProxy } = useVxeTable({ ref: "xGridRef" });
|
||||
const { xGridRef, gridProps, triggerProxy } = useVxeTable({ ref: 'xGridRef' });
|
||||
|
||||
const [RecipeSyncModal, recipeSyncModalApi] = useVbenModal({
|
||||
connectedComponent: recipeSyncModal,
|
||||
});
|
||||
|
||||
const searchParams = reactive<any>({
|
||||
recipeDate: dayjs().format('YYYY-MM'),
|
||||
});
|
||||
|
||||
/** Hooks - 表格 */
|
||||
const gridOptions = reactive(gridProps({
|
||||
columns: getColumns(),
|
||||
proxyConfig: {
|
||||
autoLoad: true,
|
||||
ajax: {
|
||||
query: async ({ page }) => {
|
||||
let data = await Apis.recipe.get_page({ params: { pageNum: page.currentPage, pageSize: page.pageSize } })
|
||||
const gridOptions = reactive(
|
||||
gridProps({
|
||||
columns: getColumns(),
|
||||
proxyConfig: {
|
||||
autoLoad: true,
|
||||
ajax: {
|
||||
query: async ({ page }) => {
|
||||
const data = await Apis.recipe.get_page({
|
||||
params: { pageNum: page.currentPage, pageSize: page.pageSize },
|
||||
});
|
||||
|
||||
// 生成当前年月的每一天,组成数组
|
||||
var start = dayjs(searchParams.recipeDate).startOf("month").date();
|
||||
var end = dayjs(searchParams.recipeDate).endOf("month").date();
|
||||
let arr = [];
|
||||
// 生成当前年月的每一天,组成数组
|
||||
const start = dayjs(searchParams.recipeDate).startOf('month').date();
|
||||
const end = dayjs(searchParams.recipeDate).endOf('month').date();
|
||||
const arr = [];
|
||||
|
||||
for (let i = start; i <= end; i++) {
|
||||
let obj = {
|
||||
recipeDate: searchParams.recipeDate + "-" + (i < 10 ? "0" + i : i),
|
||||
week: "",
|
||||
remarks: "",
|
||||
};
|
||||
for (let i = start; i <= end; i++) {
|
||||
const obj = {
|
||||
recipeDate: `${searchParams.recipeDate}-${i < 10 ? `0${i}` : i}`,
|
||||
week: '',
|
||||
remarks: '',
|
||||
};
|
||||
|
||||
const solar = SolarDay.fromYmd(
|
||||
dayjs(searchParams.recipeDate).year(),
|
||||
dayjs(searchParams.recipeDate).month() + 1,
|
||||
i
|
||||
);
|
||||
const holiday = solar.getLegalHoliday();
|
||||
const solar = SolarDay.fromYmd(
|
||||
dayjs(searchParams.recipeDate).year(),
|
||||
dayjs(searchParams.recipeDate).month() + 1,
|
||||
i,
|
||||
);
|
||||
const holiday = solar.getLegalHoliday();
|
||||
|
||||
var datas = dayjs(obj.recipeDate).day();
|
||||
var week = ["日", "一", "二", "三", "四", "五", "六"];
|
||||
obj.week = "星期" + week[datas];
|
||||
obj.eatinOpen = true;
|
||||
obj.deliveryOpen = true;
|
||||
if (holiday) {
|
||||
obj.week = obj.week + "(" + holiday.name + ")";
|
||||
}
|
||||
if (datas == 0 || datas == 6 || holiday) {
|
||||
obj.eatinOpen = false;
|
||||
obj.deliveryOpen = false;
|
||||
const datas = dayjs(obj.recipeDate).day();
|
||||
const week = ['日', '一', '二', '三', '四', '五', '六'];
|
||||
obj.week = `星期${week[datas]}`;
|
||||
obj.eatinOpen = true;
|
||||
obj.deliveryOpen = true;
|
||||
if (holiday) {
|
||||
obj.week = `${obj.week}(${holiday.name})`;
|
||||
}
|
||||
if (datas == 0 || datas == 6 || holiday) {
|
||||
obj.eatinOpen = false;
|
||||
obj.deliveryOpen = false;
|
||||
}
|
||||
|
||||
arr.push(obj);
|
||||
}
|
||||
|
||||
arr.push(obj);
|
||||
}
|
||||
|
||||
for (let m of arr) {
|
||||
for (const item of data.rows) {
|
||||
item.recipeDate = dayjs(item.recipeDate).format("YYYY-MM-DD");
|
||||
if (item.recipeDate === m.recipeDate) {
|
||||
if (["0", "1"].includes(item.deliveryOpen)) {
|
||||
item.deliveryOpen = Boolean(Number(item.deliveryOpen));
|
||||
for (const m of arr) {
|
||||
for (const item of data.rows) {
|
||||
item.recipeDate = dayjs(item.recipeDate).format('YYYY-MM-DD');
|
||||
if (item.recipeDate === m.recipeDate) {
|
||||
if (['0', '1'].includes(item.deliveryOpen)) {
|
||||
item.deliveryOpen = Boolean(Number(item.deliveryOpen));
|
||||
}
|
||||
if (['0', '1'].includes(item.eatinOpen)) {
|
||||
item.eatinOpen = Boolean(Number(item.eatinOpen));
|
||||
}
|
||||
Object.assign(m, item);
|
||||
// m = item
|
||||
}
|
||||
if (["0", "1"].includes(item.eatinOpen)) {
|
||||
item.eatinOpen = Boolean(Number(item.eatinOpen));
|
||||
}
|
||||
Object.assign(m, item);
|
||||
// m = item
|
||||
}
|
||||
}
|
||||
}
|
||||
data.rows = arr;
|
||||
return data
|
||||
data.rows = arr;
|
||||
return data;
|
||||
},
|
||||
},
|
||||
},
|
||||
rowStyle({ row, rowIndex }) {
|
||||
if (
|
||||
(row && ['星期六', '星期日'].includes(row.week)) ||
|
||||
row.week.length > 3
|
||||
) {
|
||||
return {
|
||||
backgroundColor: '#f6fbfb',
|
||||
};
|
||||
}
|
||||
},
|
||||
},
|
||||
rowStyle({ row, rowIndex }) {
|
||||
if ((row && ["星期六", "星期日"].includes(row.week)) || row.week.length > 3) {
|
||||
return {
|
||||
backgroundColor: "#f6fbfb",
|
||||
};
|
||||
}
|
||||
},
|
||||
pagerConfig: {
|
||||
enabled: true
|
||||
},
|
||||
toolbarConfig: {
|
||||
enabled: true
|
||||
},
|
||||
}));
|
||||
pagerConfig: {
|
||||
enabled: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
enabled: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
const currYear = ref(`${dayjs().year()}`);
|
||||
|
||||
const currYear = ref(dayjs().year() + '');
|
||||
|
||||
/**生成最近年份数组 */
|
||||
/** 生成最近年份数组 */
|
||||
const yearArr = computed<string[]>(() => {
|
||||
const currentYear = dayjs().year();
|
||||
const years: string[] = [];
|
||||
|
||||
for (let i = -1; i < 2; i++) {
|
||||
years.push(currentYear + i + "");
|
||||
years.push(`${currentYear + i}`);
|
||||
}
|
||||
|
||||
return years;
|
||||
|
@ -138,24 +150,20 @@ const monthArr = computed(() => {
|
|||
|
||||
// 生成指定年份的12个月的月份,并以 yyyy-mm 格式排列
|
||||
for (let i = 0; i < 12; i++) {
|
||||
const month = today.month(i).format("YYYY-MM");
|
||||
const month = today.month(i).format('YYYY-MM');
|
||||
months.push(month);
|
||||
}
|
||||
|
||||
return months.reverse();
|
||||
});
|
||||
|
||||
const searchParams = reactive<any>({
|
||||
recipeDate: dayjs().format("YYYY-MM")
|
||||
});
|
||||
|
||||
function handleExport() {
|
||||
const $grid = xGridRef.value;
|
||||
if ($grid) {
|
||||
$grid.exportData({
|
||||
type: "xlsx",
|
||||
type: 'xlsx',
|
||||
});
|
||||
message.success("导出成功");
|
||||
message.success('导出成功');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,47 +173,57 @@ function handleSync() {
|
|||
|
||||
function handleMonthChange(month) {
|
||||
searchParams.recipeDate = month;
|
||||
triggerProxy("reload");
|
||||
triggerProxy('reload');
|
||||
}
|
||||
|
||||
function handleOpenStatusChecked(e, row, type) {
|
||||
console.log(e, row, type);
|
||||
// row[type] = e;
|
||||
// row.eatinOpen = row.eatinOpen == true ? 1 : 0;
|
||||
// row.deliveryOpen = row.deliveryOpen == true ? 1 : 0;
|
||||
async function handleOpenStatusChecked(e, row) {
|
||||
const hideLoading = message.loading('加载中', 0);
|
||||
Apis.recipe.post_save({
|
||||
data: {
|
||||
...row,
|
||||
eatinOpen: row.eatinOpen == true ? 1 : 0,
|
||||
deliveryOpen: row.deliveryOpen == true ? 1 : 0,
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
triggerProxy('reload');
|
||||
}).finally(() => hideLoading());
|
||||
try {
|
||||
await Apis.recipe.post_save({
|
||||
data: {
|
||||
...row,
|
||||
eatinOpen: row.eatinOpen === true ? 1 : 0,
|
||||
deliveryOpen: row.deliveryOpen === true ? 1 : 0,
|
||||
},
|
||||
});
|
||||
triggerProxy('reload');
|
||||
} catch (error) {
|
||||
logger.error('会议修改推送状态失败', error);
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page contentClass="h-full">
|
||||
<RecipeSyncModal class="w-[950px] max-w-[80vw]" @success="triggerProxy('reload')" />
|
||||
<Page content-class="h-full">
|
||||
<RecipeSyncModal
|
||||
class="w-[950px] max-w-[80vw]"
|
||||
@success="triggerProxy('reload')"
|
||||
/>
|
||||
|
||||
<a-row class="h-full">
|
||||
<a-col :span="4" class="min-w-[200px]">
|
||||
|
||||
<a-tabs v-model:activeKey="currYear">
|
||||
<a-tab-pane v-for="year in yearArr" :key="year" :tab="year"> </a-tab-pane>
|
||||
<a-tabs v-model:active-key="currYear">
|
||||
<a-tab-pane v-for="year in yearArr" :key="year" :tab="year" />
|
||||
</a-tabs>
|
||||
|
||||
<a-list item-layout="horizontal" :data-source="monthArr" size="small">
|
||||
<a-list :data-source="monthArr" item-layout="horizontal" size="small">
|
||||
<template #renderItem="{ item }">
|
||||
<a-list-item class="cursor-pointer list-item" :class="{ active: searchParams.recipeDate === item }"
|
||||
@click="handleMonthChange(item)">
|
||||
<a-list-item
|
||||
:class="{ active: searchParams.recipeDate === item }"
|
||||
class="list-item cursor-pointer"
|
||||
@click="handleMonthChange(item)"
|
||||
>
|
||||
<a-list-item-meta>
|
||||
<template #title>
|
||||
<span> {{ item == dayjs().format("YYYY-MM") ? item + "(当月)" : item }}</span>
|
||||
<span>
|
||||
{{
|
||||
item == dayjs().format('YYYY-MM')
|
||||
? `${item}(当月)`
|
||||
: item
|
||||
}}</span
|
||||
>
|
||||
</template>
|
||||
</a-list-item-meta>
|
||||
</a-list-item>
|
||||
|
@ -213,19 +231,25 @@ function handleOpenStatusChecked(e, row, type) {
|
|||
</a-list>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="20" class="flex flex-col ">
|
||||
<a-alert message="点击下方表格中的任意行,即可维护对应日期的食谱信息。当某天没有开放堂食和保温派送时,该天会停止订餐供应,否则会正常允许订餐,可在【备注】一栏说明不供餐的原因。" />
|
||||
<a-col :span="20" class="flex flex-col">
|
||||
<a-alert
|
||||
message="点击下方表格中的任意行,即可维护对应日期的食谱信息。当某天没有开放堂食和保温派送时,该天会停止订餐供应,否则会正常允许订餐,可在【备注】一栏说明不供餐的原因。"
|
||||
/>
|
||||
|
||||
<div class="flex-1 min-h-300px">
|
||||
<vxe-grid ref="xGridRef" v-bind="gridOptions" @cell-click="handleCellClick">
|
||||
<div class="min-h-300px flex-1">
|
||||
<vxe-grid
|
||||
ref="xGridRef"
|
||||
v-bind="gridOptions"
|
||||
@cell-click="handleCellClick"
|
||||
>
|
||||
<template #toolbar_buttons>
|
||||
<a-space>
|
||||
<vben-button variant="primary" @click="handleExport()">
|
||||
<MdiAdd class="text-lg mr-0.5" />
|
||||
<MdiAdd class="mr-0.5 text-lg" />
|
||||
导出
|
||||
</vben-button>
|
||||
<vben-button variant="primary" @click="handleSync()">
|
||||
<MdiUpdate class="text-lg mr-0.5" />
|
||||
<MdiUpdate class="mr-0.5 text-lg" />
|
||||
同步指定周菜谱
|
||||
</vben-button>
|
||||
</a-space>
|
||||
|
@ -233,19 +257,21 @@ function handleOpenStatusChecked(e, row, type) {
|
|||
|
||||
<template #openTsSlot="{ row }">
|
||||
<div>
|
||||
<a-checkbox v-model:checked="row.eatinOpen" @change="handleOpenStatusChecked($event, row, 'eatinOpen')">
|
||||
</a-checkbox>
|
||||
<a-checkbox
|
||||
v-model:checked="row.eatinOpen"
|
||||
@change="handleOpenStatusChecked($event, row)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #openDcSlot="{ row }">
|
||||
<div>
|
||||
<a-checkbox v-model:checked="row.deliveryOpen"
|
||||
@change="handleOpenStatusChecked($event, row, 'deliveryOpen')">
|
||||
</a-checkbox>
|
||||
<a-checkbox
|
||||
v-model:checked="row.deliveryOpen"
|
||||
@change="handleOpenStatusChecked($event, row)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</vxe-grid>
|
||||
</div>
|
||||
</a-col>
|
||||
|
|
|
@ -384,8 +384,7 @@ const searchForm = ref({
|
|||
component: {
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: true,
|
||||
format: 'YYYY-MM-DD',
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
|
@ -398,7 +397,7 @@ const searchForm = ref({
|
|||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: true,
|
||||
format: 'YYYY-MM-DD',
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
|
|
|
@ -1,20 +1,23 @@
|
|||
import type { VxeGridPropTypes } from 'vxe-table';
|
||||
import { useRender } from '#/hooks/useRender';
|
||||
import dayjs from 'dayjs';
|
||||
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
||||
|
||||
import { dict } from '@fast-crud/fast-crud';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
||||
|
||||
export const PrimaryKey = 'guid';
|
||||
|
||||
export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
||||
let columns: VxeGridPropTypes.Columns = [
|
||||
const columns: VxeGridPropTypes.Columns = [
|
||||
{
|
||||
field: 'isConfirm',
|
||||
title: '会议是否落实',
|
||||
width: 100,
|
||||
field: 'meetingDate',
|
||||
title: '会议时间',
|
||||
width: 200,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return useRender.renderTag(row.isConfirm === 1 ? '是' : '否', row.isConfirm === 1 ? 'success' : 'warning');
|
||||
return (
|
||||
<div>{dayjs(row.meetingDate).format('YYYY-M-D H:m (dddd)')}</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -46,16 +49,7 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
|||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'otherEquipment',
|
||||
title: '其它设备',
|
||||
width: 200,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return useRender.renderDict((row.otherEquipment || '').split(','), DICT_TYPE.meeting_facilities);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
field: 'meetingSpeakersCount',
|
||||
title: '发言人数',
|
||||
|
@ -68,6 +62,11 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
|||
},
|
||||
},
|
||||
{ field: 'conferee', title: '参会人员', minWidth: 200 },
|
||||
{
|
||||
field: 'otherEquipment',
|
||||
title: '备注',
|
||||
width: 200,
|
||||
},
|
||||
{ field: 'creator', title: '登记人', minWidth: 120 },
|
||||
{ field: 'createTime', title: '登记时间', minWidth: 150 },
|
||||
];
|
||||
|
@ -80,15 +79,28 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
|||
align: 'center',
|
||||
fixed: 'left',
|
||||
});
|
||||
columns.push({
|
||||
field: 'operation',
|
||||
title: '操作',
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
slots: {
|
||||
default: 'operation_cell',
|
||||
columns.push(
|
||||
{
|
||||
field: 'isConfirm',
|
||||
title: '是否落实',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
slots: {
|
||||
default: 'isconfirm_cell',
|
||||
},
|
||||
},
|
||||
});
|
||||
{
|
||||
field: 'operation2',
|
||||
title: '是否推送门户',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
slots: {
|
||||
default: 'operation2_cell',
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
return columns;
|
||||
}
|
||||
|
@ -96,7 +108,7 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
|||
export function getFormSchema(_params: any = {}) {
|
||||
return {
|
||||
initialForm: {
|
||||
startDate: dayjs().startOf('month').format("YYYY-MM-DD"),
|
||||
startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
|
||||
},
|
||||
columns: {
|
||||
startDate: {
|
||||
|
@ -107,7 +119,7 @@ export function getFormSchema(_params: any = {}) {
|
|||
vModel: 'value',
|
||||
allowClear: true,
|
||||
props: {
|
||||
format: 'YYYY-MM-DD',
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
},
|
||||
|
@ -122,7 +134,7 @@ export function getFormSchema(_params: any = {}) {
|
|||
vModel: 'value',
|
||||
allowClear: true,
|
||||
props: {
|
||||
format: 'YYYY-MM-DD',
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
},
|
||||
|
@ -149,7 +161,7 @@ export function getFormSchema(_params: any = {}) {
|
|||
class: 'min-w-[180px]',
|
||||
allowClear: true,
|
||||
dict: dict({
|
||||
data: getDictOptions(DICT_TYPE.meeting_room)
|
||||
data: getDictOptions(DICT_TYPE.meeting_room),
|
||||
}),
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
|
@ -164,7 +176,7 @@ export function getFormSchema(_params: any = {}) {
|
|||
class: 'min-w-[180px]',
|
||||
allowClear: true,
|
||||
dict: dict({
|
||||
data: getDictOptions(DICT_TYPE.meeting_type)
|
||||
data: getDictOptions(DICT_TYPE.meeting_type),
|
||||
}),
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
|
|
|
@ -1,30 +1,196 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import {
|
||||
MdiAdd,
|
||||
MdiDelete,
|
||||
MdiExport,
|
||||
MdiRadioChecked,
|
||||
MdiRadioUnchecked,
|
||||
MdiUpdate,
|
||||
} from '@vben/icons';
|
||||
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { logger } from 'common-utils';
|
||||
|
||||
import Apis from '#/api';
|
||||
import { useVxeTable } from '#/hooks/vxeTable';
|
||||
|
||||
import { getColumns, getFormSchema } from './crud.tsx';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const searchRef = ref();
|
||||
|
||||
const { xGridRef, triggerProxy, gridProps } = useVxeTable({ ref: 'xGridRef' });
|
||||
|
||||
/** Hooks - 表格 */
|
||||
const gridOptions = reactive(
|
||||
gridProps({
|
||||
columns: getColumns(),
|
||||
proxyConfig: {
|
||||
autoLoad: false,
|
||||
ajax: {
|
||||
query: async ({ page }) => {
|
||||
const data = await Apis.meeting.get_page({
|
||||
params: {
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...searchRef.value?.formData,
|
||||
},
|
||||
});
|
||||
data.rows.forEach((item) => {
|
||||
if (['0', '1'].includes(item.isPush)) {
|
||||
item.isPush = Boolean(Number(item.isPush));
|
||||
}
|
||||
if (['0', '1'].includes(item.isConfirm)) {
|
||||
item.isConfirm = Boolean(Number(item.isConfirm));
|
||||
}
|
||||
});
|
||||
return data;
|
||||
},
|
||||
},
|
||||
},
|
||||
pagerConfig: {
|
||||
enabled: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
enabled: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
async function handleOpenStatusChecked(row) {
|
||||
const hideLoading = message.loading('加载中', 0);
|
||||
try {
|
||||
await Apis.meeting.post_save({
|
||||
data: {
|
||||
...row,
|
||||
isPush: row.isPush === true ? '1' : '0',
|
||||
isConfirm: row.isConfirm === true ? '1' : '0',
|
||||
},
|
||||
});
|
||||
triggerProxy('reload');
|
||||
} catch (error) {
|
||||
logger.error('会议修改推送状态失败', error);
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
router.push('/meeting/edit');
|
||||
}
|
||||
|
||||
function handleUpdate(row) {
|
||||
router.push(`/meeting/edit/${row.guid}`);
|
||||
}
|
||||
|
||||
function handleDelete(row) {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '是否确认删除该条记录?',
|
||||
okType: 'danger',
|
||||
onOk: async () => {
|
||||
await Apis.meeting.post_deletes({ params: { ids: row.guid } });
|
||||
message.success('删除成功');
|
||||
triggerProxy('reload');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
const $grid = xGridRef.value;
|
||||
if ($grid) {
|
||||
$grid.exportData({
|
||||
type: 'xlsx',
|
||||
});
|
||||
message.success('导出成功');
|
||||
}
|
||||
}
|
||||
|
||||
/** 选中数据 */
|
||||
const selectRow: any = computed(() => {
|
||||
return xGridRef.value?.getRadioRecord() || null;
|
||||
});
|
||||
|
||||
/** 单选框选中事件 */
|
||||
const setSelectRow = (row: any) => {
|
||||
if (selectRow.value && selectRow.value.guid === row.guid) {
|
||||
xGridRef.value?.clearRadioRow();
|
||||
} else {
|
||||
xGridRef.value?.setRadioRow(row);
|
||||
}
|
||||
};
|
||||
|
||||
/** 表格单元格单击事件 */
|
||||
function handleCellClick({ row }) {
|
||||
setSelectRow(row);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
triggerProxy('reload');
|
||||
});
|
||||
|
||||
const searchForm = ref({
|
||||
...getFormSchema(),
|
||||
onSearch(_context: any) {
|
||||
triggerProxy('reload');
|
||||
},
|
||||
});
|
||||
|
||||
function toPage() {
|
||||
window.open('/iframe/meeting/standing-book', '_blank');
|
||||
}
|
||||
|
||||
function toDetail(row) {
|
||||
const c = router.resolve({
|
||||
path: `/iframe/meeting/start/${row.guid}`,
|
||||
});
|
||||
window.open(c.href, '_blank');
|
||||
// window.open("/iframe/meeting/start/" + row.guid, "_blank");
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page contentClass="h-full flex flex-col">
|
||||
<fs-search ref="searchRef" v-bind="searchForm"> </fs-search>
|
||||
<div class="flex-1 min-h-300px">
|
||||
<vxe-grid ref="xGridRef" v-bind="gridOptions" @cell-click="handleCellClick">
|
||||
<Page content-class="h-full flex flex-col">
|
||||
<fs-search ref="searchRef" v-bind="searchForm" />
|
||||
<div class="min-h-300px flex-1">
|
||||
<vxe-grid
|
||||
ref="xGridRef"
|
||||
v-bind="gridOptions"
|
||||
@cell-click="handleCellClick"
|
||||
>
|
||||
<template #toolbar_buttons>
|
||||
<a-space>
|
||||
<vben-button variant="primary" @click="handleAdd()">
|
||||
<MdiAdd class="text-lg mr-0.5" />
|
||||
<MdiAdd class="mr-0.5 text-lg" />
|
||||
新增
|
||||
</vben-button>
|
||||
<vben-button variant="warning" :disabled="!selectRow || !selectRow['guid']"
|
||||
@click="handleUpdate(selectRow)">
|
||||
<MdiUpdate class="text-lg mr-0.5" />
|
||||
<vben-button
|
||||
:disabled="!selectRow || !selectRow.guid"
|
||||
variant="warning"
|
||||
@click="handleUpdate(selectRow)"
|
||||
>
|
||||
<MdiUpdate class="mr-0.5 text-lg" />
|
||||
修改
|
||||
</vben-button>
|
||||
<vben-button variant="primary" @click="handleExport()">
|
||||
<MdiExport class="text-lg mr-0.5" />
|
||||
<MdiExport class="mr-0.5 text-lg" />
|
||||
导出
|
||||
</vben-button>
|
||||
<vben-button variant="destructive" :disabled="!selectRow || !selectRow['guid']"
|
||||
@click="handleDelete(selectRow)">
|
||||
<MdiDelete class="text-lg mr-0.5" />
|
||||
<vben-button
|
||||
:disabled="!selectRow || !selectRow.guid"
|
||||
variant="destructive"
|
||||
@click="handleDelete(selectRow)"
|
||||
>
|
||||
<MdiDelete class="mr-0.5 text-lg" />
|
||||
删除
|
||||
</vben-button>
|
||||
<vben-button variant="primary" @click="toPage()">
|
||||
<span class="icon-[mdi--run] text-lg mr-0.5"></span>
|
||||
<span class="icon-[mdi--run] mr-0.5 text-lg"></span>
|
||||
前往会议台账
|
||||
</vben-button>
|
||||
</a-space>
|
||||
|
@ -43,212 +209,38 @@
|
|||
</template>
|
||||
|
||||
<template #meetingThemeSlot="{ row }">
|
||||
<span class="cursor-pointer text-blue-500 hover:underline" @click="toDetail(row)">
|
||||
<span
|
||||
v-if="row.meetingType === '生产会议'"
|
||||
class="cursor-pointer text-blue-500 hover:underline"
|
||||
@click="toDetail(row)"
|
||||
>
|
||||
{{ row.meetingTheme }}
|
||||
</span>
|
||||
<span v-else class="">
|
||||
{{ row.meetingTheme }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #operation_cell="{ row }">
|
||||
<a-button v-if="row.isConfirm == 1" type="text" class="text-orange-500"
|
||||
@click="handleConfirm(row.guid, 0)">取消落实</a-button>
|
||||
<a-button v-else type="text" class="text-blue-500" @click="handleConfirm(row.guid, 1)">落实会议</a-button>
|
||||
<template #isconfirm_cell="{ row }">
|
||||
<div class="flex items-center justify-center">
|
||||
<a-checkbox
|
||||
v-model:checked="row.isConfirm"
|
||||
@change="handleOpenStatusChecked(row)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #operation2_cell="{ row }">
|
||||
<div class="flex items-center justify-center">
|
||||
<a-checkbox
|
||||
v-model:checked="row.isPush"
|
||||
@change="handleOpenStatusChecked(row)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</vxe-grid>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineComponent, ref, computed, reactive, onMounted } from 'vue';
|
||||
import { FsCrud } from '@fast-crud/fast-crud';
|
||||
import { type VxeGridProps } from 'vxe-table'
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { useVxeTable } from '#/hooks/vxeTable';
|
||||
import {
|
||||
type CreateCrudOptionsProps,
|
||||
useColumns,
|
||||
useFormWrapper,
|
||||
useFs,
|
||||
utils,
|
||||
} from '@fast-crud/fast-crud';
|
||||
import { MdiAdd, MdiUpdate, MdiDelete, MdiImport, MdiExport, MdiRadioUnchecked, MdiRadioChecked } from '@vben/icons';
|
||||
import { getFormSchema, getColumns } from './crud.tsx';
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
import { getMonthStartAndEnd } from '#/utils/time'
|
||||
import Apis from '#/api'
|
||||
import dayjs from 'dayjs';
|
||||
import { message } from "ant-design-vue";
|
||||
import { Modal } from 'ant-design-vue';
|
||||
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const checkedValue = ref('all')
|
||||
const exportSearchParams = ref<any>({
|
||||
daterange: getMonthStartAndEnd(),
|
||||
});
|
||||
const radioStyle = reactive({
|
||||
display: 'flex',
|
||||
height: '30px',
|
||||
lineHeight: '30px',
|
||||
});
|
||||
|
||||
const searchRef = ref()
|
||||
let isConfirmLoading = ref(false)
|
||||
const [_Modal, modalApi] = useVbenModal({
|
||||
async onConfirm() {
|
||||
isConfirmLoading.value = true
|
||||
|
||||
try {
|
||||
let params = {};
|
||||
if (checkedValue.value == "daterange") {
|
||||
params = {
|
||||
startDate: exportSearchParams.value.daterange[0],
|
||||
endDate: exportSearchParams.value.daterange[1],
|
||||
};
|
||||
}
|
||||
let res = await Apis.zbgl.post_export({
|
||||
params: params, config: {
|
||||
meta: {
|
||||
responseType: 'blob'
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
message.success("导出成功");
|
||||
modalApi.close()
|
||||
showExportModal.value = false;
|
||||
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
isConfirmLoading.value = false
|
||||
}
|
||||
|
||||
|
||||
console.info("onConfirm");
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
const { xGridRef, triggerProxy, gridProps } = useVxeTable({ ref: 'xGridRef' });
|
||||
|
||||
const treeData = ref([]);
|
||||
|
||||
/** Hooks - 表格 */
|
||||
const gridOptions = reactive(gridProps({
|
||||
columns: getColumns(),
|
||||
proxyConfig: {
|
||||
autoLoad: false,
|
||||
ajax: {
|
||||
query: ({ page }) => {
|
||||
return Apis.meeting.get_page({ params: { pageNum: page.currentPage, pageSize: page.pageSize, ...searchRef.value?.formData } })
|
||||
}
|
||||
},
|
||||
},
|
||||
pagerConfig: {
|
||||
enabled: true
|
||||
},
|
||||
toolbarConfig: {
|
||||
enabled: true
|
||||
},
|
||||
}));
|
||||
|
||||
function handleAdd() {
|
||||
router.push('/meeting/edit')
|
||||
}
|
||||
|
||||
function handleUpdate(row) {
|
||||
router.push('/meeting/edit/' + row['guid'])
|
||||
}
|
||||
|
||||
async function handleConfirm(id, isConfirm) {
|
||||
let hideLoading = message.loading("正在保存中...");
|
||||
try {
|
||||
await Apis.meeting.post_save({ data: { guid: id, isConfirm: isConfirm } }).send();
|
||||
message.success("保存成功");
|
||||
triggerProxy("reload");
|
||||
} catch (error) {
|
||||
console.log("[ error ] >", error);
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
function handleDelete(row) {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: "是否确认删除该条记录?",
|
||||
okType: 'danger',
|
||||
onOk: async () => {
|
||||
await Apis.meeting.post_deletes({ params: { ids: row['guid'] } })
|
||||
message.success("删除成功");
|
||||
triggerProxy("reload");
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
const $grid = xGridRef.value;
|
||||
if ($grid) {
|
||||
$grid.exportData({
|
||||
type: "xlsx",
|
||||
});
|
||||
message.success("导出成功");
|
||||
}
|
||||
}
|
||||
|
||||
/** 选中数据 */
|
||||
const selectRow: Recordable = computed(() => {
|
||||
return xGridRef.value?.getRadioRecord() || null;
|
||||
});
|
||||
|
||||
/** 单选框选中事件 */
|
||||
const setSelectRow = (row: Recordable) => {
|
||||
if (selectRow.value && selectRow.value['guid'] === row['guid']) {
|
||||
xGridRef.value?.clearRadioRow();
|
||||
} else {
|
||||
xGridRef.value?.setRadioRow(row);
|
||||
}
|
||||
};
|
||||
|
||||
/** 表格单元格单击事件 */
|
||||
function handleCellClick({ row }) {
|
||||
setSelectRow(row);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
triggerProxy('reload')
|
||||
})
|
||||
|
||||
let searchParams = reactive({})
|
||||
const searchForm = ref({
|
||||
...getFormSchema(),
|
||||
onSearch(context: any) {
|
||||
console.log(searchRef.value)
|
||||
triggerProxy('reload')
|
||||
},
|
||||
onReset(context: any) {
|
||||
searchParams = context.form
|
||||
},
|
||||
});
|
||||
|
||||
function toPage() {
|
||||
window.open("/iframe/meeting/standing-book", "_blank");
|
||||
}
|
||||
|
||||
|
||||
function toDetail(row) {
|
||||
const c = router.resolve({
|
||||
path: "/iframe/meeting/start/" + row.guid,
|
||||
});
|
||||
window.open(c.href, "_blank");
|
||||
// window.open("/iframe/meeting/start/" + row.guid, "_blank");
|
||||
}
|
||||
// 页面打开后获取列表数据
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
|
|
@ -0,0 +1,187 @@
|
|||
import type { VxeGridPropTypes } from 'vxe-table';
|
||||
|
||||
import { dict } from '@fast-crud/fast-crud';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
||||
|
||||
export const PrimaryKey = 'guid';
|
||||
|
||||
export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
||||
const columns: VxeGridPropTypes.Columns = [
|
||||
{
|
||||
field: 'meetingDate',
|
||||
title: '会议时间',
|
||||
width: 200,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return (
|
||||
<div>{dayjs(row.meetingDate).format('YYYY-M-D H:m (dddd)')}</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'meetingTheme',
|
||||
title: '会议主题',
|
||||
minWidth: 300,
|
||||
slots: {
|
||||
default: 'meetingThemeSlot',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'meetingDate',
|
||||
title: '会议信息',
|
||||
width: 200,
|
||||
slots: { default: 'meetingInfoSlot' },
|
||||
},
|
||||
{ field: 'meetingType', title: '会议类型', width: 120 },
|
||||
// { field: 'gznr', title: '工作内容', width: 120 },
|
||||
{ field: 'compere', title: '主持人', width: 80 },
|
||||
{
|
||||
field: 'isEmployeeRepresentatives',
|
||||
title: '职工代表',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return row.isEmployeeRepresentatives ? '是' : '否';
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
field: 'meetingSpeakersCount',
|
||||
title: '发言人数',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return row.meetingSpeakersCount || 0;
|
||||
},
|
||||
},
|
||||
},
|
||||
{ field: 'conferee', title: '参会人员', minWidth: 200 },
|
||||
{
|
||||
field: 'otherEquipment',
|
||||
title: '备注',
|
||||
width: 200,
|
||||
},
|
||||
{ field: 'creator', title: '登记人', minWidth: 120 },
|
||||
{ field: 'createTime', title: '登记时间', minWidth: 150 },
|
||||
];
|
||||
|
||||
if (params.type !== 'taizhang') {
|
||||
columns.unshift({
|
||||
type: 'radio',
|
||||
width: 40,
|
||||
slots: { radio: 'radio_cell' },
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
});
|
||||
columns.push(
|
||||
{
|
||||
field: 'isConfirm',
|
||||
title: '是否落实',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
slots: {
|
||||
default: 'isconfirm_cell',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'operation2',
|
||||
title: '是否推送门户',
|
||||
width: 100,
|
||||
align: 'center',
|
||||
fixed: 'right',
|
||||
slots: {
|
||||
default: 'operation2_cell',
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
return columns;
|
||||
}
|
||||
|
||||
export function getFormSchema(_params: any = {}) {
|
||||
return {
|
||||
initialForm: {
|
||||
startDate: dayjs().startOf('month').format('YYYY-MM-DD'),
|
||||
},
|
||||
columns: {
|
||||
startDate: {
|
||||
title: '开始日期',
|
||||
key: 'startDate',
|
||||
component: {
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: true,
|
||||
props: {
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
show: true,
|
||||
},
|
||||
endDate: {
|
||||
title: '截止日期',
|
||||
key: 'endDate',
|
||||
component: {
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: true,
|
||||
props: {
|
||||
format: 'YYYY-M-D',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
show: true,
|
||||
},
|
||||
meetingTheme: {
|
||||
title: '会议主题',
|
||||
key: 'meetingTheme',
|
||||
component: {
|
||||
name: 'a-input',
|
||||
vModel: 'value',
|
||||
allowClear: true,
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
show: true,
|
||||
},
|
||||
meetingId: {
|
||||
title: '会议室',
|
||||
key: 'meetingId',
|
||||
component: {
|
||||
name: 'fs-dict-select',
|
||||
vModel: 'value',
|
||||
class: 'min-w-[180px]',
|
||||
allowClear: true,
|
||||
dict: dict({
|
||||
data: getDictOptions(DICT_TYPE.meeting_room),
|
||||
}),
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
show: true,
|
||||
},
|
||||
meetingType: {
|
||||
title: '会议类型',
|
||||
key: 'meetingType',
|
||||
component: {
|
||||
name: 'fs-dict-select',
|
||||
vModel: 'value',
|
||||
class: 'min-w-[180px]',
|
||||
allowClear: true,
|
||||
dict: dict({
|
||||
data: getDictOptions(DICT_TYPE.meeting_type),
|
||||
}),
|
||||
},
|
||||
autoSearchTrigger: 'enter',
|
||||
show: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
|
@ -0,0 +1,287 @@
|
|||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { Page } from '@vben/common-ui';
|
||||
import {
|
||||
MdiAdd,
|
||||
MdiDelete,
|
||||
MdiExport,
|
||||
MdiRadioChecked,
|
||||
MdiRadioUnchecked,
|
||||
MdiUpdate,
|
||||
} from '@vben/icons';
|
||||
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { logger } from 'common-utils';
|
||||
|
||||
import Apis from '#/api';
|
||||
import { useVxeTable } from '#/hooks/vxeTable';
|
||||
|
||||
import { getColumns, getFormSchema } from './crud.tsx';
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const searchRef = ref();
|
||||
|
||||
const { xGridRef, triggerProxy, gridProps } = useVxeTable({ ref: 'xGridRef' });
|
||||
|
||||
/** Hooks - 表格 */
|
||||
const gridOptions = reactive(
|
||||
gridProps({
|
||||
columns: getColumns(),
|
||||
proxyConfig: {
|
||||
autoLoad: false,
|
||||
ajax: {
|
||||
query: async ({ page }) => {
|
||||
const data = await Apis.meeting.get_page({
|
||||
params: {
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...searchRef.value?.formData,
|
||||
},
|
||||
});
|
||||
data.rows.forEach((item) => {
|
||||
if (['0', '1'].includes(item.isPush)) {
|
||||
item.isPush = Boolean(Number(item.isPush));
|
||||
}
|
||||
if (['0', '1'].includes(item.isConfirm)) {
|
||||
item.isConfirm = Boolean(Number(item.isConfirm));
|
||||
}
|
||||
});
|
||||
return data;
|
||||
},
|
||||
},
|
||||
},
|
||||
pagerConfig: {
|
||||
enabled: true,
|
||||
},
|
||||
toolbarConfig: {
|
||||
enabled: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
async function handleOpenStatusChecked(e, row) {
|
||||
const hideLoading = message.loading('加载中', 0);
|
||||
try {
|
||||
await Apis.meeting.post_save({
|
||||
data: {
|
||||
...row,
|
||||
isPush: row.isPush === true ? '1' : '0',
|
||||
isConfirm: row.isConfirm === true ? '1' : '0',
|
||||
},
|
||||
});
|
||||
triggerProxy('reload');
|
||||
} catch (error) {
|
||||
logger.error('会议修改推送状态失败', error);
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
router.push('/meeting/edit');
|
||||
}
|
||||
|
||||
function handleUpdate(row) {
|
||||
router.push(`/meeting/edit/${row.guid}`);
|
||||
}
|
||||
|
||||
async function handleConfirm(id, isConfirm) {
|
||||
const hideLoading = message.loading('正在保存中...');
|
||||
try {
|
||||
await Apis.meeting.post_save({ data: { guid: id, isConfirm } }).send();
|
||||
message.success('保存成功');
|
||||
triggerProxy('reload');
|
||||
} catch (error) {
|
||||
console.log('[ error ] >', error);
|
||||
} finally {
|
||||
hideLoading();
|
||||
}
|
||||
}
|
||||
|
||||
function handleDelete(row) {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '是否确认删除该条记录?',
|
||||
okType: 'danger',
|
||||
onOk: async () => {
|
||||
await Apis.meeting.post_deletes({ params: { ids: row.guid } });
|
||||
message.success('删除成功');
|
||||
triggerProxy('reload');
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleExport() {
|
||||
const $grid = xGridRef.value;
|
||||
if ($grid) {
|
||||
$grid.exportData({
|
||||
type: 'xlsx',
|
||||
});
|
||||
message.success('导出成功');
|
||||
}
|
||||
}
|
||||
|
||||
/** 选中数据 */
|
||||
const selectRow: any = computed(() => {
|
||||
return xGridRef.value?.getRadioRecord() || null;
|
||||
});
|
||||
|
||||
/** 单选框选中事件 */
|
||||
const setSelectRow = (row: any) => {
|
||||
if (selectRow.value && selectRow.value.guid === row.guid) {
|
||||
xGridRef.value?.clearRadioRow();
|
||||
} else {
|
||||
xGridRef.value?.setRadioRow(row);
|
||||
}
|
||||
};
|
||||
|
||||
/** 表格单元格单击事件 */
|
||||
function handleCellClick({ row }) {
|
||||
setSelectRow(row);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
triggerProxy('reload');
|
||||
});
|
||||
|
||||
let searchParams = reactive({});
|
||||
const searchForm = ref({
|
||||
...getFormSchema(),
|
||||
onSearch(context: any) {
|
||||
console.log(searchRef.value);
|
||||
triggerProxy('reload');
|
||||
},
|
||||
onReset(context: any) {
|
||||
searchParams = context.form;
|
||||
},
|
||||
});
|
||||
|
||||
function toPage() {
|
||||
window.open('/iframe/meeting/standing-book', '_blank');
|
||||
}
|
||||
|
||||
function toDetail(row) {
|
||||
const c = router.resolve({
|
||||
path: `/iframe/meeting/start/${row.guid}`,
|
||||
});
|
||||
window.open(c.href, '_blank');
|
||||
// window.open("/iframe/meeting/start/" + row.guid, "_blank");
|
||||
}
|
||||
// 页面打开后获取列表数据
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Page content-class="h-full flex flex-col">
|
||||
<fs-search ref="searchRef" v-bind="searchForm" />
|
||||
<div class="min-h-300px flex-1">
|
||||
<vxe-grid
|
||||
ref="xGridRef"
|
||||
v-bind="gridOptions"
|
||||
@cell-click="handleCellClick"
|
||||
>
|
||||
<template #toolbar_buttons>
|
||||
<a-space>
|
||||
<vben-button variant="primary" @click="handleAdd()">
|
||||
<MdiAdd class="mr-0.5 text-lg" />
|
||||
新增
|
||||
</vben-button>
|
||||
<vben-button
|
||||
:disabled="!selectRow || !selectRow.guid"
|
||||
variant="warning"
|
||||
@click="handleUpdate(selectRow)"
|
||||
>
|
||||
<MdiUpdate class="mr-0.5 text-lg" />
|
||||
修改
|
||||
</vben-button>
|
||||
<vben-button variant="primary" @click="handleExport()">
|
||||
<MdiExport class="mr-0.5 text-lg" />
|
||||
导出
|
||||
</vben-button>
|
||||
<vben-button
|
||||
:disabled="!selectRow || !selectRow.guid"
|
||||
variant="destructive"
|
||||
@click="handleDelete(selectRow)"
|
||||
>
|
||||
<MdiDelete class="mr-0.5 text-lg" />
|
||||
删除
|
||||
</vben-button>
|
||||
<vben-button variant="primary" @click="toPage()">
|
||||
<span class="icon-[mdi--run] mr-0.5 text-lg"></span>
|
||||
前往会议台账
|
||||
</vben-button>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<template #radio_cell="{ row, checked }">
|
||||
<span class="text-base" @click.stop="setSelectRow(row)">
|
||||
<MdiRadioChecked v-if="checked" />
|
||||
<MdiRadioUnchecked v-else />
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #meetingInfoSlot="{ row }">
|
||||
<p>会议室:{{ row.meeting }}</p>
|
||||
<p>参会时间:{{ row.meetingDate }}</p>
|
||||
</template>
|
||||
|
||||
<template #meetingThemeSlot="{ row }">
|
||||
<span
|
||||
v-if="row.meetingType === '生产会议'"
|
||||
class="cursor-pointer text-blue-500 hover:underline"
|
||||
@click="toDetail(row)"
|
||||
>
|
||||
{{ row.meetingTheme }}
|
||||
</span>
|
||||
<span v-else class="">
|
||||
{{ row.meetingTheme }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<template #isconfirm_cell="{ row }">
|
||||
<div class="flex items-center justify-center">
|
||||
<a-checkbox
|
||||
v-model:checked="row.isConfirm"
|
||||
@change="handleOpenStatusChecked($event, row)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #operation2_cell="{ row }">
|
||||
<div class="flex items-center justify-center">
|
||||
<a-checkbox
|
||||
v-model:checked="row.isPush"
|
||||
@change="handleOpenStatusChecked($event, row)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #operation_cell="{ row }">
|
||||
<a-button
|
||||
v-if="row.isConfirm == 1"
|
||||
class="text-orange-500"
|
||||
type="text"
|
||||
@click="handleConfirm(row.guid, 0)"
|
||||
>
|
||||
取消落实
|
||||
</a-button>
|
||||
<a-button
|
||||
v-else
|
||||
class="text-blue-500"
|
||||
type="text"
|
||||
@click="handleConfirm(row.guid, 1)"
|
||||
>
|
||||
落实会议
|
||||
</a-button>
|
||||
</template>
|
||||
</vxe-grid>
|
||||
</div>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<style></style>
|
|
@ -1,77 +1,49 @@
|
|||
import type { VxeGridPropTypes } from 'vxe-table';
|
||||
import { useRender } from '#/hooks/useRender';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import { DICT_TYPE } from '#/utils/dict';
|
||||
|
||||
export const PrimaryKey = 'guid';
|
||||
|
||||
export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
||||
let columns = [
|
||||
export function getColumns(_params?: any): VxeGridPropTypes.Columns {
|
||||
const columns: VxeGridPropTypes.Columns = [
|
||||
{ type: 'seq', width: 50, align: 'center', fixed: 'left' },
|
||||
{
|
||||
field: 'isConfirm', title: '会议是否落实', width: 100,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return useRender.renderTag(row.isConfirm === 1 ? '是' : '否', row.isConfirm === 1 ? 'success' : 'warning');
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'meetingTheme', title: '会议主题', minWidth: 300, slots: {
|
||||
default: "meetingThemeSlot"
|
||||
}
|
||||
},
|
||||
{ field: 'meetingDate', title: '会议信息', width: 200, slots: { default: 'meetingInfoSlot' } },
|
||||
{ field: 'meetingType', title: '会议类型', width: 120 },
|
||||
// { field: 'gznr', title: '工作内容', width: 120 },
|
||||
{ field: 'compere', title: '主持人', width: 80 },
|
||||
{
|
||||
field: 'isEmployeeRepresentatives', title: '职工代表', width: 100, align: 'center',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return row.isEmployeeRepresentatives ? '是' : '否'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'otherEquipment',
|
||||
title: '其它设备',
|
||||
field: 'meetingDate',
|
||||
title: '会议时间',
|
||||
width: 200,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return useRender.renderDict((row.otherEquipment || '').split(','), DICT_TYPE.meeting_facilities);
|
||||
}
|
||||
}
|
||||
return (
|
||||
<div>{dayjs(row.meetingDate).format('YYYY-M-D H:m (dddd)')}</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'meetingSpeakersCount', title: '发言人数', width: 100, align: 'center',
|
||||
field: 'meetingTheme',
|
||||
title: '会议主题',
|
||||
minWidth: 300,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return row.meetingSpeakersCount || 0
|
||||
}
|
||||
}
|
||||
default: 'meetingThemeSlot',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'meeting',
|
||||
title: '会议地点',
|
||||
width: 150,
|
||||
},
|
||||
{ field: 'compere', title: '主持人', width: 80 },
|
||||
{ field: 'conferee', title: '参会人员', minWidth: 200 },
|
||||
{ field: 'creator', title: '登记人', minWidth: 120 },
|
||||
{ field: 'createTime', title: '登记时间', minWidth: 150 },
|
||||
|
||||
{ field: 'meetingType', title: '会议类型', width: 120 },
|
||||
{
|
||||
field: 'otherEquipment',
|
||||
title: '备注',
|
||||
minWidth: 200,
|
||||
},
|
||||
];
|
||||
|
||||
if (params.type != 'taizhang') {
|
||||
columns.unshift(
|
||||
{ type: 'radio', width: 40, slots: { radio: 'radio_cell' }, align: 'center', fixed: 'left' },
|
||||
)
|
||||
columns.push(
|
||||
{
|
||||
field: 'operation',
|
||||
title: '操作',
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
slots: {
|
||||
default: 'operation_cell'
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
return columns
|
||||
return columns;
|
||||
}
|
||||
|
||||
export function getFormSchema(_params: any = {}) {
|
||||
|
|
|
@ -29,6 +29,7 @@ const gridOptions = reactive(
|
|||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
...searchRef.value?.formData,
|
||||
isPush: '1',
|
||||
},
|
||||
});
|
||||
},
|
||||
|
@ -89,9 +90,9 @@ const searchForm = ref({
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="mx-auto flex h-[100vh] w-[90vw] flex-col">
|
||||
<div class="mx-auto flex h-[100vh] w-[92vw] flex-col">
|
||||
<p class="my-4 text-center text-2xl font-bold" style="color: #001428">
|
||||
供热公司网络生产会议系统 - 会议查询篇
|
||||
热力公司会议管理系统
|
||||
</p>
|
||||
|
||||
<fs-search ref="searchRef" v-bind="searchForm" />
|
||||
|
@ -124,11 +125,15 @@ const searchForm = ref({
|
|||
|
||||
<template #meetingThemeSlot="{ row }">
|
||||
<span
|
||||
v-if="row.meetingType === '生产会议'"
|
||||
class="cursor-pointer text-blue-500 hover:underline"
|
||||
@click="toDetail(row)"
|
||||
>
|
||||
{{ row.meetingTheme }}
|
||||
</span>
|
||||
<span v-else class="">
|
||||
{{ row.meetingTheme }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-grid>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,276 @@
|
|||
import type { Dayjs } from 'dayjs';
|
||||
import type { VxeGridPropTypes } from 'vxe-table';
|
||||
|
||||
import { dict } from '@fast-crud/fast-crud';
|
||||
import { message } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import { DICT_TYPE, getDictObj, getDictOptions } from '#/utils/dict';
|
||||
|
||||
export const PrimaryKey = 'guid';
|
||||
|
||||
export function getColumns(_params: any = {}): VxeGridPropTypes.Columns {
|
||||
return [
|
||||
{ type: 'seq', width: 50 },
|
||||
{ field: 'feedbackContent', title: '反馈内容', minWidth: 200 },
|
||||
{ field: 'finishStatus', title: '完成情况', width: 120 },
|
||||
{ field: 'principal', title: '负责人', width: 120 },
|
||||
{ field: 'feedbackTime', title: '反馈时间', width: 150 },
|
||||
{ field: 'lasttime', title: '修改时间', width: 150 },
|
||||
// { field: 'principalDepartment', title: '负责部门', width: 120 },
|
||||
{ field: 'executeDepartmentName', title: '执行部门', width: 120 },
|
||||
// { title: '操作', width: 120, fixed: 'right', slots: { default: 'operate' } }
|
||||
];
|
||||
}
|
||||
|
||||
function handleUpdateFormattedValue(formRef) {
|
||||
const { starttime, endtime } = formRef.value.form;
|
||||
|
||||
if (starttime && endtime && endtime <= starttime) {
|
||||
message.error('截止时间不能早于开始时间');
|
||||
formRef.value.setFormData({
|
||||
starttime: '',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function getFormSchema(params: any = {}) {
|
||||
const {
|
||||
formRef,
|
||||
chooseUserModalApi,
|
||||
selectUsers,
|
||||
readOnly = false,
|
||||
} = params || {};
|
||||
return {
|
||||
col: { span: 24 },
|
||||
initialForm: {},
|
||||
labelCol: { style: { width: '120px' } },
|
||||
columns: {
|
||||
taskName: {
|
||||
title: '任务标题',
|
||||
key: 'taskName',
|
||||
col: { span: 24 },
|
||||
component: {
|
||||
name: 'a-input',
|
||||
vModel: 'value',
|
||||
},
|
||||
conditionalRender: {
|
||||
match(_context) {
|
||||
return readOnly;
|
||||
},
|
||||
render({ form }) {
|
||||
return <span>{form.taskName}</span>;
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: '请输入任务标题' }],
|
||||
},
|
||||
taskType: {
|
||||
title: '任务类别',
|
||||
key: 'taskType',
|
||||
col: { span: 12 },
|
||||
component: {
|
||||
name: 'fs-dict-radio',
|
||||
vModel: 'value',
|
||||
dict: dict({
|
||||
data: getDictOptions(DICT_TYPE.supervise_task_type),
|
||||
}),
|
||||
},
|
||||
conditionalRender: {
|
||||
match(_context) {
|
||||
return readOnly;
|
||||
},
|
||||
render({ form }) {
|
||||
return (
|
||||
<span>
|
||||
{getDictObj(DICT_TYPE.supervise_task_type, form.taskType)
|
||||
?.label || ''}
|
||||
</span>
|
||||
);
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: '请选择任务类别' }],
|
||||
},
|
||||
urgentDegree: {
|
||||
title: '紧急程度',
|
||||
key: 'urgentDegree',
|
||||
col: { span: 12 },
|
||||
component: {
|
||||
name: 'fs-dict-radio',
|
||||
vModel: 'value',
|
||||
dict: dict({
|
||||
data: getDictOptions(DICT_TYPE.supervise_emergency_level),
|
||||
}),
|
||||
},
|
||||
conditionalRender: {
|
||||
match(_context) {
|
||||
return readOnly;
|
||||
},
|
||||
render({ form }) {
|
||||
return (
|
||||
<span>
|
||||
{getDictObj(
|
||||
DICT_TYPE.supervise_emergency_level,
|
||||
form.urgentDegree,
|
||||
)?.label || ''}
|
||||
</span>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
starttime: {
|
||||
title: '开始时间',
|
||||
key: 'starttime',
|
||||
col: { span: 12 },
|
||||
component: {
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: false,
|
||||
showTime: { format: 'HH:mm' },
|
||||
// disabledDate: (current) => current && current < dayjs().endOf("day"),
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm',
|
||||
onChange: () => {
|
||||
handleUpdateFormattedValue(formRef);
|
||||
},
|
||||
},
|
||||
conditionalRender: {
|
||||
match(_context) {
|
||||
return readOnly;
|
||||
},
|
||||
render({ form }) {
|
||||
return <span>{form.starttime}</span>;
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: '请选择开始时间' }],
|
||||
},
|
||||
endtime: {
|
||||
title: '截止时间',
|
||||
key: 'endtime',
|
||||
col: { span: 12 },
|
||||
component: {
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: false,
|
||||
showTime: { format: 'HH:mm' },
|
||||
disabledDate: (current: Dayjs) => {
|
||||
const form = formRef.value.form;
|
||||
return current < dayjs(form.starttime);
|
||||
},
|
||||
onChange: () => {
|
||||
handleUpdateFormattedValue(formRef);
|
||||
},
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm',
|
||||
},
|
||||
conditionalRender: {
|
||||
match(_context) {
|
||||
return readOnly;
|
||||
},
|
||||
render({ form }) {
|
||||
return <span>{form.endtime}</span>;
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: '请选择截止时间' }],
|
||||
},
|
||||
planFinishTime: {
|
||||
title: '预计完成时间',
|
||||
key: 'endtime',
|
||||
component: {
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: false,
|
||||
showTime: { format: 'HH:mm' },
|
||||
disabledDate: (current: Dayjs) => {
|
||||
const form = formRef.value.form;
|
||||
return current < dayjs(form.starttime);
|
||||
},
|
||||
onChange: () => {
|
||||
handleUpdateFormattedValue(formRef);
|
||||
},
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm',
|
||||
},
|
||||
conditionalRender: {
|
||||
match(_context) {
|
||||
return readOnly;
|
||||
},
|
||||
render({ form }) {
|
||||
return <span>{form.planFinishTime}</span>;
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: '请选择预计完成时间' }],
|
||||
},
|
||||
taskContent: {
|
||||
title: '任务内容',
|
||||
key: 'taskContent',
|
||||
col: { span: 24 },
|
||||
component: {
|
||||
name: 'a-textarea',
|
||||
vModel: 'value',
|
||||
autoSize: { minRows: 4, maxRows: 6 },
|
||||
},
|
||||
conditionalRender: {
|
||||
match(_context) {
|
||||
return readOnly;
|
||||
},
|
||||
render({ form }) {
|
||||
return <span>{form.taskContent}</span>;
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: '请输入任务内容' }],
|
||||
},
|
||||
taskProgress: {
|
||||
title: '任务进度',
|
||||
key: 'taskProgress',
|
||||
col: { span: 24 },
|
||||
component: {
|
||||
name: 'a-textarea',
|
||||
vModel: 'value',
|
||||
autoSize: { minRows: 4, maxRows: 6 },
|
||||
},
|
||||
conditionalRender: {
|
||||
match(_context) {
|
||||
return readOnly;
|
||||
},
|
||||
render({ form }) {
|
||||
return <span>{form.taskContent}</span>;
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: '请输入任务进度' }],
|
||||
},
|
||||
fileList: {
|
||||
title: '相关附件',
|
||||
key: 'fileList',
|
||||
},
|
||||
people: {
|
||||
title: '相关执行人',
|
||||
key: 'people',
|
||||
component: {
|
||||
name: 'a-select',
|
||||
vModel: 'value',
|
||||
open: false,
|
||||
mode: 'multiple',
|
||||
disabled: readOnly,
|
||||
onClick: () => {
|
||||
if (!readOnly) {
|
||||
chooseUserModalApi.setData({
|
||||
title: '选择执行人',
|
||||
limitMultipleNum: 10,
|
||||
userIds: selectUsers.value.map((row) => row.value) || [],
|
||||
});
|
||||
chooseUserModalApi.open();
|
||||
}
|
||||
},
|
||||
onChange: () => {
|
||||
// 同步 selectUsers 变量的值
|
||||
selectUsers.value = formRef.value.form.people.map((item1) => {
|
||||
const value = item1.split('-')[1];
|
||||
return selectUsers.value.find((item2) => item2.value === value);
|
||||
});
|
||||
},
|
||||
},
|
||||
// rules: [{ required: true, message: '请选择相关执行人' }],
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
|
@ -1,20 +1,19 @@
|
|||
<script setup lang="tsx">
|
||||
import { nextTick, onMounted, ref } from 'vue';
|
||||
import { computed, nextTick, onMounted, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { MdiUpload } from '@vben/icons';
|
||||
|
||||
import { dict } from '@fast-crud/fast-crud';
|
||||
import { message, Modal, type UploadChangeParam } from 'ant-design-vue';
|
||||
import { logger } from 'common-utils';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
|
||||
import Apis from '#/api';
|
||||
import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
||||
import { FileUploader } from '#/utils/file';
|
||||
import chooseUserModal from '#/views/system/user/choose-user-modal.vue';
|
||||
|
||||
import { getFormSchema } from './curd';
|
||||
|
||||
const fileUploader = new FileUploader({});
|
||||
|
||||
const [ChooseUserModal, chooseUserModalApi] = useVbenModal({
|
||||
|
@ -29,172 +28,22 @@ const containerRef = ref();
|
|||
const formRef = ref();
|
||||
|
||||
const isLoading = ref(false);
|
||||
function handleUpdateFormattedValue() {
|
||||
const { starttime, endtime } = formRef.value.form;
|
||||
|
||||
if (starttime && endtime && endtime <= starttime) {
|
||||
message.error('截止时间不能早于开始时间');
|
||||
nextTick(() => {
|
||||
formRef.value.setFormData({
|
||||
starttime: '',
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
const currData = ref<any>({});
|
||||
|
||||
const selectUsers = ref<any>([]);
|
||||
const disabledDate = (current: Dayjs) => {
|
||||
// Can not select days before today and today
|
||||
const form = formRef.value.form;
|
||||
return current < dayjs(form.starttime);
|
||||
};
|
||||
|
||||
const readOnly = computed(() => {
|
||||
return !id.value || (id.value && currData.value.status !== '已创建');
|
||||
});
|
||||
|
||||
const formBinding = ref({
|
||||
col: { span: 24 },
|
||||
initialForm: {},
|
||||
labelCol: { style: { width: '120px' } },
|
||||
columns: {
|
||||
taskName: {
|
||||
title: '任务标题',
|
||||
key: 'taskName',
|
||||
col: { span: 24 },
|
||||
component: {
|
||||
name: 'a-input',
|
||||
vModel: 'value',
|
||||
},
|
||||
rules: [{ required: true, message: '请输入任务标题' }],
|
||||
},
|
||||
taskType: {
|
||||
title: '任务类别',
|
||||
key: 'taskType',
|
||||
col: { span: 12 },
|
||||
component: {
|
||||
name: 'fs-dict-radio',
|
||||
vModel: 'value',
|
||||
dict: dict({
|
||||
data: getDictOptions(DICT_TYPE.supervise_task_type),
|
||||
}),
|
||||
},
|
||||
rules: [{ required: true, message: '请选择任务类别' }],
|
||||
},
|
||||
urgentDegree: {
|
||||
title: '紧急程度',
|
||||
key: 'urgentDegree',
|
||||
col: { span: 12 },
|
||||
component: {
|
||||
name: 'fs-dict-radio',
|
||||
vModel: 'value',
|
||||
dict: dict({
|
||||
data: getDictOptions(DICT_TYPE.supervise_emergency_level),
|
||||
}),
|
||||
},
|
||||
},
|
||||
starttime: {
|
||||
title: '开始时间',
|
||||
key: 'starttime',
|
||||
col: { span: 12 },
|
||||
component: {
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: false,
|
||||
showTime: { format: 'HH:mm' },
|
||||
// disabledDate: (current) => current && current < dayjs().endOf("day"),
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm',
|
||||
onChange: () => {
|
||||
handleUpdateFormattedValue();
|
||||
},
|
||||
},
|
||||
rules: [{ required: true, message: '请选择开始时间' }],
|
||||
},
|
||||
endtime: {
|
||||
title: '截止时间',
|
||||
key: 'endtime',
|
||||
col: { span: 12 },
|
||||
component: {
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: false,
|
||||
showTime: { format: 'HH:mm' },
|
||||
disabledDate,
|
||||
onChange: () => {
|
||||
handleUpdateFormattedValue();
|
||||
},
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm',
|
||||
},
|
||||
rules: [{ required: true, message: '请选择截止时间' }],
|
||||
},
|
||||
planFinishTime: {
|
||||
title: '预计完成时间',
|
||||
key: 'endtime',
|
||||
component: {
|
||||
name: 'a-date-picker',
|
||||
vModel: 'value',
|
||||
allowClear: false,
|
||||
showTime: { format: 'HH:mm' },
|
||||
disabledDate,
|
||||
onChange: () => {
|
||||
handleUpdateFormattedValue();
|
||||
},
|
||||
format: 'YYYY-MM-DD HH:mm',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm',
|
||||
},
|
||||
rules: [{ required: true, message: '请选择预计完成时间' }],
|
||||
},
|
||||
taskContent: {
|
||||
title: '任务内容',
|
||||
key: 'taskContent',
|
||||
col: { span: 24 },
|
||||
component: {
|
||||
name: 'a-textarea',
|
||||
vModel: 'value',
|
||||
autoSize: { minRows: 4, maxRows: 6 },
|
||||
},
|
||||
rules: [{ required: true, message: '请输入任务内容' }],
|
||||
},
|
||||
taskProgress: {
|
||||
title: '任务进度',
|
||||
key: 'taskProgress',
|
||||
col: { span: 24 },
|
||||
component: {
|
||||
name: 'a-textarea',
|
||||
vModel: 'value',
|
||||
autoSize: { minRows: 4, maxRows: 6 },
|
||||
},
|
||||
rules: [{ required: true, message: '请输入任务进度' }],
|
||||
},
|
||||
fileList: {
|
||||
title: '相关附件',
|
||||
key: 'fileList',
|
||||
},
|
||||
people: {
|
||||
title: '相关执行人',
|
||||
key: 'people',
|
||||
component: {
|
||||
name: 'a-select',
|
||||
vModel: 'value',
|
||||
open: false,
|
||||
mode: 'multiple',
|
||||
onClick: () => {
|
||||
chooseUserModalApi.setData({
|
||||
title: '选择执行人',
|
||||
limitMultipleNum: 10,
|
||||
userIds: selectUsers.value.map((row) => row.value) || [],
|
||||
});
|
||||
chooseUserModalApi.open();
|
||||
},
|
||||
onChange: () => {
|
||||
// 同步 selectUsers 变量的值
|
||||
selectUsers.value = formRef.value.form.people.map((item1) => {
|
||||
const value = item1.split('-')[1];
|
||||
return selectUsers.value.find((item2) => item2.value === value);
|
||||
});
|
||||
},
|
||||
},
|
||||
// rules: [{ required: true, message: '请选择相关执行人' }],
|
||||
},
|
||||
},
|
||||
...getFormSchema({
|
||||
formRef,
|
||||
chooseUserModalApi,
|
||||
selectUsers,
|
||||
readOnly: readOnly.value,
|
||||
}),
|
||||
});
|
||||
|
||||
function handleBack() {
|
||||
|
@ -336,8 +185,6 @@ async function handleSubmit() {
|
|||
}
|
||||
}
|
||||
|
||||
const currData = ref({});
|
||||
|
||||
onMounted(async () => {
|
||||
isLoading.value = true;
|
||||
try {
|
||||
|
@ -359,6 +206,12 @@ onMounted(async () => {
|
|||
});
|
||||
}
|
||||
}
|
||||
formBinding.value.columns = getFormSchema({
|
||||
formRef,
|
||||
chooseUserModalApi,
|
||||
selectUsers,
|
||||
readOnly: readOnly.value,
|
||||
}).columns;
|
||||
} catch (error) {
|
||||
logger.error('当前立项信息不存在', error);
|
||||
|
||||
|
@ -388,13 +241,26 @@ onMounted(async () => {
|
|||
/>
|
||||
<a-spin :spinning="isLoading">
|
||||
<a-space>
|
||||
<vben-button variant="primary" @click="handleSave()">
|
||||
<vben-button
|
||||
v-if="!id || ['已创建', '退回'].includes(currData.status)"
|
||||
variant="primary"
|
||||
@click="handleSave()"
|
||||
>
|
||||
保存
|
||||
</vben-button>
|
||||
<vben-button variant="primary" @click="handleSubmit()">
|
||||
<vben-button
|
||||
v-if="!id || ['已创建', '退回'].includes(currData.status)"
|
||||
:disabled="!id"
|
||||
variant="primary"
|
||||
@click="handleSubmit()"
|
||||
>
|
||||
提交
|
||||
</vben-button>
|
||||
<vben-button variant="destructive" @click="handleDelete()">
|
||||
<vben-button
|
||||
v-if="!isLoading && id && ['已创建'].includes(currData.status)"
|
||||
variant="destructive"
|
||||
@click="handleDelete()"
|
||||
>
|
||||
删除
|
||||
</vben-button>
|
||||
<vben-button variant="secondary" @click="handleBack()">
|
||||
|
@ -414,7 +280,7 @@ onMounted(async () => {
|
|||
name="file"
|
||||
@change="handleChange"
|
||||
>
|
||||
<a-button>
|
||||
<a-button v-if="!readOnly">
|
||||
<MdiUpload />
|
||||
点击上传
|
||||
</a-button>
|
||||
|
|
|
@ -7,7 +7,7 @@ import { DICT_TYPE, getDictOptions } from '#/utils/dict';
|
|||
|
||||
export const PrimaryKey = 'guid';
|
||||
|
||||
export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
||||
export function getColumns(_params: any = {}): VxeGridPropTypes.Columns {
|
||||
return [
|
||||
{
|
||||
type: 'radio',
|
||||
|
@ -85,7 +85,7 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
|||
width: 120,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return useRender.renderDate(row.starttime, 'YYYY-MM-DD');
|
||||
return useRender.renderDate(row.starttime, 'YYYY-M-D');
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -95,7 +95,7 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
|||
width: 120,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return useRender.renderDate(row.endtime, 'YYYY-MM-DD');
|
||||
return useRender.renderDate(row.endtime, 'YYYY-M-D');
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -105,7 +105,7 @@ export function getColumns(params: any = {}): VxeGridPropTypes.Columns {
|
|||
width: 120,
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return useRender.renderDate(row.planFinishTime, 'YYYY-MM-DD');
|
||||
return useRender.renderDate(row.planFinishTime, 'YYYY-M-D');
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue