This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
|
||||
import {getVxePopupContainer} from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import {Modal, Popconfirm, Space} from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
@@ -16,13 +16,14 @@ import {
|
||||
houseChargeList,
|
||||
houseChargeRemove,
|
||||
} from '#/api/property/costManagement/houseCharge';
|
||||
import type { HouseChargeForm } from '#/api/property/costManagement/houseCharge/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
import type {HouseChargeForm} from '#/api/property/costManagement/houseCharge/model';
|
||||
import {commonDownloadExcel} from '#/utils/file/download';
|
||||
|
||||
import houseChargeAdd from './houseCharge-add.vue';
|
||||
import houseChargeUpdate from './houseCharge-update.vue';
|
||||
import houseChargeDetail from './house-charge-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import houseChargeRefund from './house-charge-refund.vue';
|
||||
import {columns, querySchema} from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -52,7 +53,7 @@ const gridOptions: VxeGridProps = {
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({ page }, formValues = {}) => {
|
||||
query: async ({page}, formValues = {}) => {
|
||||
return await houseChargeList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@@ -82,6 +83,9 @@ const [HouseChargeUpdate, updateApi] = useVbenModal({
|
||||
const [HouseChargeDetail, detailApi] = useVbenModal({
|
||||
connectedComponent: houseChargeDetail,
|
||||
});
|
||||
const [HouseChargeRefund, refundApi] = useVbenModal({
|
||||
connectedComponent: houseChargeRefund,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
@@ -89,11 +93,12 @@ function handleAdd() {
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<HouseChargeForm>) {
|
||||
updateApi.setData({ id: row.id });
|
||||
updateApi.setData({id: row.id});
|
||||
updateApi.open();
|
||||
}
|
||||
|
||||
async function handleInfo(row: Required<HouseChargeForm>) {
|
||||
detailApi.setData({ id: row.id });
|
||||
detailApi.setData({id: row.id});
|
||||
detailApi.open();
|
||||
}
|
||||
|
||||
@@ -102,6 +107,11 @@ async function handleDelete(row: Required<HouseChargeForm>) {
|
||||
await tableApi.query();
|
||||
}
|
||||
|
||||
async function handleRefund(row: Required<HouseChargeForm>) {
|
||||
refundApi.setData({id: row.id});
|
||||
refundApi.open();
|
||||
}
|
||||
|
||||
function handleMultiDelete() {
|
||||
const rows = tableApi.grid.getCheckboxRecords();
|
||||
const ids = rows.map((row: Required<HouseChargeForm>) => row.id);
|
||||
@@ -160,12 +170,22 @@ function handleDownloadExcel() {
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-if="row.chargeStatus=='2'"
|
||||
v-access:code="['property:houseCharge:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
缴费
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-else-if="row.chargeStatus=='4'"
|
||||
danger
|
||||
v-access:code="['property:houseCharge:edit']"
|
||||
@click.stop="handleRefund(row)"
|
||||
>
|
||||
退费
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
v-else
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认取消?"
|
||||
@@ -175,15 +195,17 @@ function handleDownloadExcel() {
|
||||
danger
|
||||
v-access:code="['property:houseCharge:remove']"
|
||||
@click.stop=""
|
||||
:disabled="row.chargeStatus!='1'"
|
||||
>
|
||||
取消
|
||||
取消
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<HouseChargeAdd @reload="tableApi.query()" />
|
||||
<HouseChargeUpdate @reload="tableApi.query()" />
|
||||
<HouseChargeAdd @reload="tableApi.query()"/>
|
||||
<HouseChargeUpdate @reload="tableApi.query()"/>
|
||||
<HouseChargeRefund @reload="tableApi.query()"/>
|
||||
<HouseChargeDetail/>
|
||||
</Page>
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user