185 lines
4.8 KiB
Vue
185 lines
4.8 KiB
Vue
<!--
|
|
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
|
* No deletion without permission, or be held responsible to law.
|
|
* @author gaoxq
|
|
-->
|
|
<template>
|
|
<BasicModal
|
|
v-bind="$attrs"
|
|
:showFooter="true"
|
|
:showOkBtn="false"
|
|
@register="registerModal"
|
|
width="70%"
|
|
>
|
|
<template #title>
|
|
<Icon :icon="getTitle.icon" class="m-1 pr-1" />
|
|
<span> {{ getTitle.value }} </span>
|
|
</template>
|
|
<BasicForm @register="registerForm" >
|
|
<template #remarks>
|
|
<div
|
|
v-html="record?.meetingContent"
|
|
style="border: 1px solid #dcdcdc; max-height: 300px; overflow-y: auto; line-height: 1.8; white-space: pre-wrap; padding: 8px; border-radius: 4px;"
|
|
>
|
|
</div>
|
|
</template>
|
|
</BasicForm>
|
|
</BasicModal>
|
|
</template>
|
|
<script lang="ts" setup name="ViewsBizMeetingInfoForm">
|
|
import { ref, unref, computed } from 'vue';
|
|
import { useI18n } from '@jeesite/core/hooks/web/useI18n';
|
|
import { useMessage } from '@jeesite/core/hooks/web/useMessage';
|
|
import { router } from '@jeesite/core/router';
|
|
import { Icon } from '@jeesite/core/components/Icon';
|
|
import { BasicForm, FormSchema, useForm } from '@jeesite/core/components/Form';
|
|
import { BasicModal, useModalInner } from '@jeesite/core/components/Modal';
|
|
import { BizMeetingInfo, bizMeetingInfoSave, bizMeetingInfoForm } from '@jeesite/biz/api/biz/meetingInfo';
|
|
import { formatToDateTime } from '@jeesite/core/utils/dateUtil';
|
|
|
|
const emit = defineEmits(['success', 'register']);
|
|
|
|
const { t } = useI18n('biz.meetingInfo');
|
|
const { showMessage } = useMessage();
|
|
const { meta } = unref(router.currentRoute);
|
|
const record = ref<BizMeetingInfo>({} as BizMeetingInfo);
|
|
|
|
const WfTimestamp = () => {
|
|
return `WF_AM${Date.now()}`;
|
|
};
|
|
|
|
const getTitle = computed(() => ({
|
|
icon: meta.icon || 'i-ant-design:book-outlined',
|
|
value: t('查看会议信息'),
|
|
}));
|
|
|
|
const inputFormSchemas: FormSchema<BizMeetingInfo>[] = [
|
|
{
|
|
label: t('会议标题'),
|
|
field: 'title',
|
|
component: 'Input',
|
|
componentProps: {
|
|
maxlength: 255,
|
|
},
|
|
dynamicDisabled: true,
|
|
},
|
|
{
|
|
label: t('会议编号'),
|
|
field: 'meetingCode',
|
|
component: 'Input',
|
|
componentProps: {
|
|
maxlength: 64,
|
|
},
|
|
dynamicDisabled: true,
|
|
},
|
|
{
|
|
label: t('会议地点'),
|
|
field: 'meetingLocation',
|
|
component: 'Input',
|
|
componentProps: {
|
|
maxlength: 255,
|
|
},
|
|
dynamicDisabled: true,
|
|
colProps: { md: 24, lg: 24 },
|
|
},
|
|
{
|
|
label: t('本部人员'),
|
|
field: 'meetingUser',
|
|
component: 'Input',
|
|
componentProps: {
|
|
maxlength: 1000,
|
|
},
|
|
dynamicDisabled: true,
|
|
colProps: { md: 24, lg: 24 },
|
|
},
|
|
{
|
|
label: t('其他人员'),
|
|
field: 'otherUser',
|
|
component: 'Input',
|
|
componentProps: {
|
|
maxlength: 1000,
|
|
},
|
|
dynamicDisabled: true,
|
|
colProps: { md: 24, lg: 24 },
|
|
},
|
|
{
|
|
label: t('会议类型'),
|
|
field: 'meetingType',
|
|
component: 'Select',
|
|
componentProps: {
|
|
dictType: 'meeting_type',
|
|
allowClear: true,
|
|
},
|
|
dynamicDisabled: true,
|
|
},
|
|
{
|
|
label: t('会议状态'),
|
|
field: 'ustatus',
|
|
component: 'Select',
|
|
componentProps: {
|
|
dictType: 'meeting_status',
|
|
allowClear: true,
|
|
},
|
|
dynamicDisabled: true,
|
|
},
|
|
{
|
|
label: t('开始时间'),
|
|
field: 'startTime',
|
|
component: 'DatePicker',
|
|
componentProps: {
|
|
format: 'YYYY-MM-DD HH:mm',
|
|
showTime: { format: 'HH:mm' },
|
|
},
|
|
dynamicDisabled: true,
|
|
},
|
|
{
|
|
label: t('结束时间'),
|
|
field: 'endTime',
|
|
component: 'DatePicker',
|
|
componentProps: {
|
|
format: 'YYYY-MM-DD HH:mm',
|
|
showTime: { format: 'HH:mm' },
|
|
},
|
|
dynamicDisabled: true,
|
|
},
|
|
{
|
|
label: t('会议内容'),
|
|
field: 'meetingContent',
|
|
component: 'InputTextArea',
|
|
dynamicDisabled: true,
|
|
colProps: { md: 24, lg: 24 },
|
|
slot: 'remarks',
|
|
},
|
|
{
|
|
label: t('补充说明'),
|
|
field: 'remark',
|
|
component: 'InputTextArea',
|
|
componentProps: {
|
|
maxlength: 500,
|
|
},
|
|
dynamicDisabled: true,
|
|
colProps: { md: 24, lg: 24 },
|
|
},
|
|
];
|
|
|
|
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm<BizMeetingInfo>({
|
|
labelWidth: 120,
|
|
schemas: inputFormSchemas,
|
|
baseColProps: { md: 24, lg: 12 },
|
|
});
|
|
|
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
|
setModalProps({ loading: true });
|
|
await resetFields();
|
|
const res = await bizMeetingInfoForm(data);
|
|
record.value = (res.bizMeetingInfo || {}) as BizMeetingInfo;
|
|
record.value.__t = new Date().getTime();
|
|
if (record.value.isNewRecord) {
|
|
record.value.meetingCode = WfTimestamp();
|
|
}
|
|
await setFieldsValue(record.value);
|
|
setModalProps({ loading: false });
|
|
});
|
|
|
|
</script>
|