This commit is contained in:
FLL 2025-07-19 14:02:58 +08:00
parent 5f19bb22a8
commit e10f22a4d0
10 changed files with 129 additions and 136 deletions

View File

@ -1,11 +0,0 @@
<script setup lang="ts">
</script>
<template>
节假日
</template>
<style scoped lang="scss">
</style>

View File

@ -1,11 +0,0 @@
<script setup lang="ts">
</script>
<template>
打卡记录
</template>
<style scoped lang="scss">
</style>

View File

@ -1,11 +0,0 @@
<script setup lang="ts">
</script>
<template>
每日统计
</template>
<style scoped lang="scss">
</style>

View File

@ -1,11 +0,0 @@
<script setup lang="ts">
</script>
<template>
假期类型
</template>
<style scoped lang="scss">
</style>

View File

@ -93,80 +93,17 @@ export const modalSchema: FormSchemaGetter = () => [
triggerFields: [''],
},
},
{
label: '房屋收费id',
fieldName: 'houseChargeId',
component: 'Input',
rules: 'required',
},
{
label: '费用项目id',
fieldName: 'itemId',
component: 'Input',
rules: 'required',
},
{
label: '缴费开始时间',
fieldName: 'startTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '缴费结束时间',
fieldName: 'endTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '实付金额',
fieldName: 'receivedAmount',
component: 'Input',
},
{
label: '应收金额',
fieldName: 'receivableAmount',
component: 'Input',
rules: 'required',
},
{
label: '缴费时间',
fieldName: 'payTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '审核状态',
fieldName: 'state',
component: 'Select',
component: 'RadioGroup',
componentProps: {
// 可选从DictEnum中获取 DictEnum.COST_REVIEW_STATUS 便于维护
options: getDictOptions('cost_review_status'),
options: [
{ label: '已审核', value: '1' },
{ label: '已驳回', value: '2' },
],
// options: getDictOptions('cost_review_status'),
},
rules: 'selectRequired',
},
{
label: '备注',
fieldName: 'remark',
component: 'Textarea',
},
{
label: '搜索值',
fieldName: 'searchValue',
component: 'Input',
rules: 'required',
},
];

View File

@ -1,16 +1,15 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Popconfirm, Space } from 'ant-design-vue';
import { Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
paymentReviewList,
paymentReviewRemove,
} from '#/api/property/costManagement/paymentReview';
import type { PaymentReviewForm } from '#/api/property/costManagement/paymentReview/model';
import paymentReviewModal from './paymentReview-modal.vue';
import paymentReviewDetail from './paymentReview-detail.vue';
import { columns, querySchema } from './data';
@ -34,8 +33,6 @@ const gridOptions: VxeGridProps = {
//
// trigger: 'row',
},
// 使i18ngetter
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
@ -54,7 +51,6 @@ const gridOptions: VxeGridProps = {
rowConfig: {
keyField: 'id',
},
//
id: 'property-paymentReview-index'
};
@ -63,6 +59,10 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
gridOptions,
});
const [PaymentReviewModal, modalApi] = useVbenModal({
connectedComponent: paymentReviewModal,
});
const [paymentReviewDetailModal, paymentReviewDetailApi] = useVbenModal({
connectedComponent: paymentReviewDetail,
});
@ -72,9 +72,9 @@ async function handleInfo(row: Required<PaymentReviewForm>) {
paymentReviewDetailApi.open();
}
async function handleDelete(row: Required<PaymentReviewForm>) {
await paymentReviewRemove(row.id);
await tableApi.query();
async function handleEdit(row: Required<PaymentReviewForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
</script>
@ -84,22 +84,16 @@ async function handleDelete(row: Required<PaymentReviewForm>) {
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认审核?"
@confirm="handleDelete(row)"
<ghost-button
:disabled="row.state!=='0'"
@click.stop="handleEdit(row)"
>
<ghost-button
@click.stop=""
>
{{ '审核' }}
</ghost-button>
</Popconfirm>
{{ '审核' }}
</ghost-button>
</Space>
</template>
</BasicTable>

View File

@ -36,7 +36,7 @@ async function handleOpenChange(open: boolean) {
<BasicModal :footer="false" :fullscreen-button="false" title="缴费审核详情" class="w-[70%]">
<Descriptions v-if="paymentReviewDetail" size="small" :column="2" bordered
:labelStyle="{width:'120px'}">
<DescriptionsItem label="房屋收费">
<DescriptionsItem label="房屋">
{{ paymentReviewDetail.roomNumber }}
</DescriptionsItem>
<DescriptionsItem label="费用项目">

View File

@ -0,0 +1,106 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { paymentReviewAdd, paymentReviewInfo, paymentReviewUpdate } from '#/api/property/costManagement/paymentReview';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
import type {PaymentReviewVO} from "#/api/property/costManagement/paymentReview/model";
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
//
formItemClass: 'col-span-2',
// label px
labelWidth: 80,
//
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const record = ref<PaymentReviewVO>({
state:'1'
})
const [BasicModal, modalApi] = useVbenModal({
//
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
record.value = await paymentReviewInfo(id);
record.value.state = '1'
await formApi.setValues(record.value);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValuesreadonly
const data = cloneDeep(await formApi.getValues());
record.value.state=data.state
await (isUpdate.value ? paymentReviewUpdate(record.value) : paymentReviewAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>