费用管理
This commit is contained in:
@@ -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>
|
||||
|
Reference in New Issue
Block a user