费用管理

This commit is contained in:
FLL
2025-07-18 19:48:05 +08:00
parent 355d14ab9e
commit b81c30696b
8 changed files with 750 additions and 23 deletions

View File

@@ -1,23 +1,22 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import {useAccess} from "@vben/access";
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
costItemSettingList,
costItemSettingRemove,
costItemSettingRemove, costItemSettingUpdate,
} from '#/api/property/costManagement/costItemSetting';
import type { CostItemSettingForm } from '#/api/property/costManagement/costItemSetting/model';
import costItemSettingModal from './costItemSetting-modal.vue';
import costItemSettingDetal from './costItemSetting-detail.vue';
import { columns, querySchema } from './data';
import {TableSwitch} from "#/components/table";
const formOptions: VbenFormProps = {
commonConfig: {
@@ -77,6 +76,15 @@ function handleAdd() {
modalApi.open();
}
const [costItemSettingDetalModal, costItemSettingDetalApi] = useVbenModal({
connectedComponent: costItemSettingDetal,
});
async function handleInfo(row: Required<CostItemSettingForm>) {
costItemSettingDetalApi.setData({ id: row.id });
costItemSettingDetalApi.open();
}
async function handleEdit(row: Required<CostItemSettingForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
@@ -100,6 +108,7 @@ function handleMultiDelete() {
},
});
}
const { hasAccessByCodes } = useAccess();
</script>
<template>
@@ -124,8 +133,24 @@ function handleMultiDelete() {
</a-button>
</Space>
</template>
<!-- 冒号数字类型没冒号字符串-->
<template #state="{ row }">
<TableSwitch
checkedValue="1"
unCheckedValue="0"
v-model:value="row.state"
:api="() => costItemSettingUpdate(row)"
:disabled=" !hasAccessByCodes(['property:unit:edit'])"
@reload="() => tableApi.query()"
/>
</template>
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<ghost-button
v-access:code="['property:costItemSetting:edit']"
@click.stop="handleEdit(row)"
@@ -150,5 +175,6 @@ function handleMultiDelete() {
</template>
</BasicTable>
<CostItemSettingModal @reload="tableApi.query()" />
<costItemSettingDetalModal/>
</Page>
</template>