Compare commits
2 Commits
ca24234e57
...
4819f881ed
Author | SHA1 | Date | |
---|---|---|---|
4819f881ed | |||
01ddd1174a |
@@ -1,8 +1,6 @@
|
|||||||
import type { BuildingVO, BuildingForm, BuildingQuery } from './model';
|
import type { BuildingVO, BuildingForm, BuildingQuery } from './model';
|
||||||
|
|
||||||
import type { ID, IDS } from '#/api/common';
|
import type { ID, IDS } from '#/api/common';
|
||||||
import type { PageResult } from '#/api/common';
|
import type { PageResult } from '#/api/common';
|
||||||
|
|
||||||
import { commonExport } from '#/api/helper';
|
import { commonExport } from '#/api/helper';
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
@@ -296,10 +296,10 @@ export interface BuildingQuery extends PageQuery {
|
|||||||
*/
|
*/
|
||||||
cqbh?: string;
|
cqbh?: string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日期范围参数
|
* 日期范围参数
|
||||||
*/
|
*/
|
||||||
params?: any;
|
params?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
59
apps/web-antd/src/api/property/chargeManagement/index.ts
Normal file
59
apps/web-antd/src/api/property/chargeManagement/index.ts
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import type { OrderChargeVO, OrderChargeForm, OrderChargeQuery } from './model';
|
||||||
|
import type { ID, IDS } from '#/api/common';
|
||||||
|
import type { PageResult } from '#/api/common';
|
||||||
|
import { commonExport } from '#/api/helper';
|
||||||
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询绿植租赁-订单收费列表
|
||||||
|
* @param params
|
||||||
|
* @returns 绿植租赁-订单收费列表
|
||||||
|
*/
|
||||||
|
export function orderChargeList(params?: OrderChargeQuery) {
|
||||||
|
return requestClient.get<PageResult<OrderChargeVO>>('/system/orderCharge/list', { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出绿植租赁-订单收费列表
|
||||||
|
* @param params
|
||||||
|
* @returns 绿植租赁-订单收费列表
|
||||||
|
*/
|
||||||
|
export function orderChargeExport(params?: OrderChargeQuery) {
|
||||||
|
return commonExport('/system/orderCharge/export', params ?? {});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询绿植租赁-订单收费详情
|
||||||
|
* @param id id
|
||||||
|
* @returns 绿植租赁-订单收费详情
|
||||||
|
*/
|
||||||
|
export function orderChargeInfo(id: ID) {
|
||||||
|
return requestClient.get<OrderChargeVO>(`/system/orderCharge/${id}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增绿植租赁-订单收费
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function orderChargeAdd(data: OrderChargeForm) {
|
||||||
|
return requestClient.postWithMsg<void>('/system/orderCharge', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新绿植租赁-订单收费
|
||||||
|
* @param data
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function orderChargeUpdate(data: OrderChargeForm) {
|
||||||
|
return requestClient.putWithMsg<void>('/system/orderCharge', data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除绿植租赁-订单收费
|
||||||
|
* @param id id
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
export function orderChargeRemove(id: ID | IDS) {
|
||||||
|
return requestClient.deleteWithMsg<void>(`/system/orderCharge/${id}`);
|
||||||
|
}
|
204
apps/web-antd/src/api/property/chargeManagement/model.d.ts
vendored
Normal file
204
apps/web-antd/src/api/property/chargeManagement/model.d.ts
vendored
Normal file
@@ -0,0 +1,204 @@
|
|||||||
|
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||||
|
|
||||||
|
export interface OrderChargeVO {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
id: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单id
|
||||||
|
*/
|
||||||
|
orderId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租赁人id(系统用户)
|
||||||
|
*/
|
||||||
|
userId: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租赁人名称
|
||||||
|
*/
|
||||||
|
userName: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租金
|
||||||
|
*/
|
||||||
|
rent: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 押金
|
||||||
|
*/
|
||||||
|
deposit: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 违约金
|
||||||
|
*/
|
||||||
|
penalty: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总金额
|
||||||
|
*/
|
||||||
|
totalAmount: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费日期
|
||||||
|
*/
|
||||||
|
chargeDate: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式
|
||||||
|
*/
|
||||||
|
paymentMethod: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开票状态
|
||||||
|
*/
|
||||||
|
invoiceStatus: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票类型
|
||||||
|
*/
|
||||||
|
invoiceType: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费状态
|
||||||
|
*/
|
||||||
|
chargeStatus: number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OrderChargeForm extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
id?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单id
|
||||||
|
*/
|
||||||
|
orderId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租赁人id(系统用户)
|
||||||
|
*/
|
||||||
|
userId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租赁人名称
|
||||||
|
*/
|
||||||
|
userName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租金
|
||||||
|
*/
|
||||||
|
rent?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 押金
|
||||||
|
*/
|
||||||
|
deposit?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 违约金
|
||||||
|
*/
|
||||||
|
penalty?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总金额
|
||||||
|
*/
|
||||||
|
totalAmount?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费日期
|
||||||
|
*/
|
||||||
|
chargeDate?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式
|
||||||
|
*/
|
||||||
|
paymentMethod?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开票状态
|
||||||
|
*/
|
||||||
|
invoiceStatus?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票类型
|
||||||
|
*/
|
||||||
|
invoiceType?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费状态
|
||||||
|
*/
|
||||||
|
chargeStatus?: number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OrderChargeQuery extends PageQuery {
|
||||||
|
/**
|
||||||
|
* 订单id
|
||||||
|
*/
|
||||||
|
orderId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租赁人id(系统用户)
|
||||||
|
*/
|
||||||
|
userId?: string | number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租赁人名称
|
||||||
|
*/
|
||||||
|
userName?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租金
|
||||||
|
*/
|
||||||
|
rent?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 押金
|
||||||
|
*/
|
||||||
|
deposit?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 违约金
|
||||||
|
*/
|
||||||
|
penalty?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总金额
|
||||||
|
*/
|
||||||
|
totalAmount?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费日期
|
||||||
|
*/
|
||||||
|
chargeDate?: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付方式
|
||||||
|
*/
|
||||||
|
paymentMethod?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开票状态
|
||||||
|
*/
|
||||||
|
invoiceStatus?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票类型
|
||||||
|
*/
|
||||||
|
invoiceType?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收费状态
|
||||||
|
*/
|
||||||
|
chargeStatus?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期范围参数
|
||||||
|
*/
|
||||||
|
params?: any;
|
||||||
|
}
|
@@ -1,8 +1,6 @@
|
|||||||
import type { CommunityVO, CommunityForm, CommunityQuery } from './model';
|
import type { CommunityVO, CommunityForm, CommunityQuery } from './model';
|
||||||
|
|
||||||
import type { ID, IDS } from '#/api/common';
|
import type { ID, IDS } from '#/api/common';
|
||||||
import type { PageResult } from '#/api/common';
|
import type { PageResult } from '#/api/common';
|
||||||
|
|
||||||
import { commonExport } from '#/api/helper';
|
import { commonExport } from '#/api/helper';
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
@@ -217,6 +217,7 @@ export interface CommunityQuery extends PageQuery {
|
|||||||
*/
|
*/
|
||||||
params?: any;
|
params?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Community extends BaseEntity {
|
export interface Community extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 社区名称
|
* 社区名称
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
import type { FloorVO, FloorForm, FloorQuery } from './model';
|
import type { FloorVO, FloorForm, FloorQuery } from './model';
|
||||||
|
|
||||||
import type { ID, IDS } from '#/api/common';
|
import type { ID, IDS } from '#/api/common';
|
||||||
import type { PageResult } from '#/api/common';
|
import type { PageResult } from '#/api/common';
|
||||||
|
|
||||||
import { commonExport } from '#/api/helper';
|
import { commonExport } from '#/api/helper';
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
import type { PropertyVO, PropertyForm, PropertyQuery } from './model';
|
import type { PropertyVO, PropertyForm, PropertyQuery } from './model';
|
||||||
|
|
||||||
import type { ID, IDS } from '#/api/common';
|
import type { ID, IDS } from '#/api/common';
|
||||||
import type { PageResult } from '#/api/common';
|
import type { PageResult } from '#/api/common';
|
||||||
|
|
||||||
import { commonExport } from '#/api/helper';
|
import { commonExport } from '#/api/helper';
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
import type { RoomVO, RoomForm, RoomQuery } from './model';
|
import type { RoomVO, RoomForm, RoomQuery } from './model';
|
||||||
|
|
||||||
import type { ID, IDS } from '#/api/common';
|
import type { ID, IDS } from '#/api/common';
|
||||||
import type { PageResult } from '#/api/common';
|
import type { PageResult } from '#/api/common';
|
||||||
|
|
||||||
import { commonExport } from '#/api/helper';
|
import { commonExport } from '#/api/helper';
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
|
|
||||||
|
@@ -14,7 +14,6 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const buildingDetail = shallowRef<null | Building>(null);
|
const buildingDetail = shallowRef<null | Building>(null);
|
||||||
|
|
||||||
async function handleOpenChange(open: boolean) {
|
async function handleOpenChange(open: boolean) {
|
||||||
if (!open) {
|
if (!open) {
|
||||||
return null;
|
return null;
|
||||||
@@ -22,7 +21,6 @@ async function handleOpenChange(open: boolean) {
|
|||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
const {id} = modalApi.getData() as { id: number | string };
|
const {id} = modalApi.getData() as { id: number | string };
|
||||||
const response = await buildingInfo(id);
|
const response = await buildingInfo(id);
|
||||||
// 赋值
|
|
||||||
buildingDetail.value = response;
|
buildingDetail.value = response;
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
}
|
}
|
||||||
@@ -31,15 +29,15 @@ async function handleOpenChange(open: boolean) {
|
|||||||
<template>
|
<template>
|
||||||
<BasicModal :footer="false" :fullscreen-button="false" title="建筑管理信息" class="w-[70%]">
|
<BasicModal :footer="false" :fullscreen-button="false" title="建筑管理信息" class="w-[70%]">
|
||||||
<Descriptions v-if="buildingDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
<Descriptions v-if="buildingDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||||
<DescriptionsItem label="园区编码">
|
<DescriptionsItem label="小区/园区">
|
||||||
{{ buildingDetail.communityCode }}
|
{{ buildingDetail.communityCode }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="建筑编码">
|
|
||||||
{{ buildingDetail.buildingCode }}
|
|
||||||
</DescriptionsItem>
|
|
||||||
<DescriptionsItem label="建筑名称">
|
<DescriptionsItem label="建筑名称">
|
||||||
{{ buildingDetail.buildingName }}
|
{{ buildingDetail.buildingName }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="建筑编码">
|
||||||
|
{{ buildingDetail.buildingCode }}
|
||||||
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="省">
|
<DescriptionsItem label="省">
|
||||||
{{ buildingDetail.province }}
|
{{ buildingDetail.province }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
@@ -96,11 +94,6 @@ async function handleOpenChange(open: boolean) {
|
|||||||
<DescriptionsItem label="组织编码">
|
<DescriptionsItem label="组织编码">
|
||||||
{{ buildingDetail.orgCode }}
|
{{ buildingDetail.orgCode }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="数据状态" v-if="buildingDetail.dataState!=null">
|
|
||||||
<component
|
|
||||||
:is="renderDict(buildingDetail.dataState,'wy_qylx')"
|
|
||||||
/>
|
|
||||||
</DescriptionsItem>
|
|
||||||
<DescriptionsItem label="修改时间">
|
<DescriptionsItem label="修改时间">
|
||||||
{{ buildingDetail.modifyTime }}
|
{{ buildingDetail.modifyTime }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
@@ -1,30 +1,24 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { buildingAdd, buildingInfo, buildingUpdate } from '#/api/property/building';
|
import { buildingAdd, buildingInfo, buildingUpdate } from '#/api/property/building';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
|
|
||||||
const title = computed(() => {
|
const title = computed(() => {
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
});
|
});
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-2',
|
||||||
// 默认label宽度 px
|
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
// 通用配置项 会影响到所有表单项
|
|
||||||
componentProps: {
|
componentProps: {
|
||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
}
|
}
|
||||||
@@ -42,7 +36,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
|
||||||
class: 'w-[550px]',
|
class: 'w-[550px]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
@@ -53,16 +46,13 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await buildingInfo(id);
|
const record = await buildingInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -74,7 +64,6 @@ async function handleConfirm() {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
await (isUpdate.value ? buildingUpdate(data) : buildingAdd(data));
|
await (isUpdate.value ? buildingUpdate(data) : buildingAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { getDictOptions } from '#/utils/dict';
|
import { getDictOptions } from '#/utils/dict';
|
||||||
import { renderDict } from '#/utils/render';
|
import { renderDict } from '#/utils/render';
|
||||||
|
|
||||||
@@ -8,46 +7,42 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'communityCode',
|
fieldName: 'communityCode',
|
||||||
label: '园区编码',
|
label: '小区/园区',
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'buildingCode',
|
|
||||||
label: '建筑编码',
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'buildingName',
|
fieldName: 'buildingName',
|
||||||
label: '建筑名称',
|
label: '建筑名称',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'buildingCode',
|
||||||
|
label: '建筑编码',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
// 可选从DictEnum中获取 DictEnum.WY_CQXZ 便于维护
|
|
||||||
options: getDictOptions('wy_cqxz'),
|
options: getDictOptions('wy_cqxz'),
|
||||||
},
|
},
|
||||||
fieldName: 'cqxz',
|
fieldName: 'cqxz',
|
||||||
label: '产权性质',
|
label: '产权性质',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'dataState',
|
|
||||||
label: '数据状态',
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
{
|
||||||
title: '园区编码',
|
title: '序号',
|
||||||
field: 'communityCode',
|
field: 'id',
|
||||||
width: 'auto'
|
slots: {
|
||||||
|
default: ({ rowIndex }) => {
|
||||||
|
return (rowIndex + 1).toString();
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '建筑编码',
|
title: '小区/园区',
|
||||||
field: 'buildingCode',
|
field: 'communityCode',
|
||||||
width: 'auto'
|
width: 'auto'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -55,6 +50,11 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'buildingName',
|
field: 'buildingName',
|
||||||
width: 'auto'
|
width: 'auto'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '建筑编码',
|
||||||
|
field: 'buildingCode',
|
||||||
|
width: 'auto'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '地址',
|
title: '地址',
|
||||||
field: 'addr',
|
field: 'addr',
|
||||||
@@ -66,7 +66,6 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
width: 'auto',
|
width: 'auto',
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }) => {
|
default: ({ row }) => {
|
||||||
// 可选从DictEnum中获取 DictEnum.WY_CQXZ 便于维护
|
|
||||||
return renderDict(row.cqxz, 'wy_cqxz');
|
return renderDict(row.cqxz, 'wy_cqxz');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -121,11 +120,6 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'bzcg',
|
field: 'bzcg',
|
||||||
width: 'auto'
|
width: 'auto'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '数据状态',
|
|
||||||
field: 'dataState',
|
|
||||||
width: 'auto'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '修改时间',
|
title: '修改时间',
|
||||||
field: 'modifyTime',
|
field: 'modifyTime',
|
||||||
@@ -151,17 +145,11 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '园区编码',
|
label: '小区/园区',
|
||||||
fieldName: 'communityCode',
|
fieldName: 'communityCode',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '建筑编码',
|
|
||||||
fieldName: 'buildingCode',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: '建筑名称',
|
label: '建筑名称',
|
||||||
fieldName: 'buildingName',
|
fieldName: 'buildingName',
|
||||||
@@ -169,8 +157,8 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '组织编码',
|
label: '建筑编码',
|
||||||
fieldName: 'orgCode',
|
fieldName: 'buildingCode',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
@@ -215,7 +203,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'cqxz',
|
fieldName: 'cqxz',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
// 可选从DictEnum中获取 DictEnum.WY_CQXZ 便于维护
|
|
||||||
options: getDictOptions('wy_cqxz'),
|
options: getDictOptions('wy_cqxz'),
|
||||||
},
|
},
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
@@ -233,7 +220,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '图地编号',
|
label: '土地编号',
|
||||||
fieldName: 'tdbh',
|
fieldName: 'tdbh',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
@@ -284,20 +271,5 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
label: '排序字段',
|
label: '排序字段',
|
||||||
fieldName: 'sort',
|
fieldName: 'sort',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '数据状态',
|
|
||||||
fieldName: 'dataState',
|
|
||||||
component: 'Input',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '修改时间',
|
|
||||||
fieldName: 'modifyTime',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
showTime: true,
|
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@@ -2,13 +2,11 @@
|
|||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps
|
type VxeGridProps
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
buildingExport,
|
buildingExport,
|
||||||
buildingList,
|
buildingList,
|
||||||
@@ -16,12 +14,9 @@ import {
|
|||||||
} from '#/api/property/building';
|
} from '#/api/property/building';
|
||||||
import type { BuildingForm } from '#/api/property/building/model';
|
import type { BuildingForm } from '#/api/property/building/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import buildingModal from './building-modal.vue';
|
import buildingModal from './building-modal.vue';
|
||||||
import buildingDetail from './building-detail.vue';
|
import buildingDetail from './building-detail.vue';
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
import unitInfoModal from "#/views/property/resident/unit/unit-detail.vue";
|
|
||||||
import type {Resident_unitForm} from "#/api/property/resident/unit/model";
|
|
||||||
|
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@@ -32,28 +27,13 @@ const formOptions: VbenFormProps = {
|
|||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
|
||||||
// 不需要直接删除
|
|
||||||
// fieldMappingTime: [
|
|
||||||
// [
|
|
||||||
// 'createTime',
|
|
||||||
// ['params[beginTime]', 'params[endTime]'],
|
|
||||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
checkboxConfig: {
|
checkboxConfig: {
|
||||||
// 高亮
|
|
||||||
highlight: true,
|
highlight: true,
|
||||||
// 翻页时保留选中状态
|
|
||||||
reserve: true,
|
reserve: true,
|
||||||
// 点击行选中
|
|
||||||
// trigger: 'row',
|
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
@@ -72,7 +52,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
},
|
},
|
||||||
// 表格全局唯一表示 保存列配置需要用到
|
|
||||||
id: 'property-building-index'
|
id: 'property-building-index'
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -84,13 +63,16 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
const [BuildingModal, modalApi] = useVbenModal({
|
const [BuildingModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: buildingModal,
|
connectedComponent: buildingModal,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [buildingDetailModal, buildingDetailApi] = useVbenModal({
|
const [buildingDetailModal, buildingDetailApi] = useVbenModal({
|
||||||
connectedComponent: buildingDetail,
|
connectedComponent: buildingDetail,
|
||||||
});
|
});
|
||||||
|
|
||||||
async function handleInfo(row: Required<BuildingForm>) {
|
async function handleInfo(row: Required<BuildingForm>) {
|
||||||
// buildingDetailApi.setData({ id: row.id });
|
buildingDetailApi.setData({ id: row.id });
|
||||||
buildingDetailApi.open();
|
buildingDetailApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
modalApi.setData({});
|
modalApi.setData({});
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
@@ -153,12 +135,6 @@ function handleDownloadExcel() {
|
|||||||
>
|
>
|
||||||
{{ $t('pages.common.add') }}
|
{{ $t('pages.common.add') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
@click="handleInfo"
|
|
||||||
>
|
|
||||||
{{ $t('pages.common.info') }}
|
|
||||||
</a-button>
|
|
||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
|
@@ -22,7 +22,6 @@ async function handleOpenChange(open: boolean) {
|
|||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
const {id} = modalApi.getData() as { id: number | string };
|
const {id} = modalApi.getData() as { id: number | string };
|
||||||
const response = await communityInfo(id);
|
const response = await communityInfo(id);
|
||||||
// 赋值
|
|
||||||
communityDetail.value = response;
|
communityDetail.value = response;
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
}
|
}
|
||||||
@@ -31,13 +30,13 @@ async function handleOpenChange(open: boolean) {
|
|||||||
<template>
|
<template>
|
||||||
<BasicModal :footer="false" :fullscreen-button="false" title="小区管理信息" class="w-[70%]">
|
<BasicModal :footer="false" :fullscreen-button="false" title="小区管理信息" class="w-[70%]">
|
||||||
<Descriptions v-if="communityDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
<Descriptions v-if="communityDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||||
<DescriptionsItem label="社区名称">
|
<DescriptionsItem label="小区名称">
|
||||||
{{ communityDetail.communityName }}
|
{{ communityDetail.communityName }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="社区编码">
|
<DescriptionsItem label="小区编码">
|
||||||
{{ communityDetail.communityCode }}
|
{{ communityDetail.communityCode }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="社区类型" v-if="communityDetail.communityType!=null">
|
<DescriptionsItem label="小区类型" v-if="communityDetail.communityType!=null">
|
||||||
<component
|
<component
|
||||||
:is="renderDict(communityDetail.communityType,'wy_sqlx')"
|
:is="renderDict(communityDetail.communityType,'wy_sqlx')"
|
||||||
/>
|
/>
|
||||||
@@ -66,11 +65,6 @@ async function handleOpenChange(open: boolean) {
|
|||||||
<DescriptionsItem label="组织编码">
|
<DescriptionsItem label="组织编码">
|
||||||
{{ communityDetail.orgCode }}
|
{{ communityDetail.orgCode }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="数据状态" v-if="communityDetail.dataState!=null">
|
|
||||||
<component
|
|
||||||
:is="renderDict(communityDetail.dataState,'wy_cqxz')"
|
|
||||||
/>
|
|
||||||
</DescriptionsItem>
|
|
||||||
<DescriptionsItem label="修改时间">
|
<DescriptionsItem label="修改时间">
|
||||||
{{ communityDetail.modifyTime }}
|
{{ communityDetail.modifyTime }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
|
@@ -1,30 +1,24 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { communityAdd, communityInfo, communityUpdate } from '#/api/property/community';
|
import { communityAdd, communityInfo, communityUpdate } from '#/api/property/community';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
|
|
||||||
const title = computed(() => {
|
const title = computed(() => {
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
});
|
});
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-2',
|
||||||
// 默认label宽度 px
|
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
// 通用配置项 会影响到所有表单项
|
|
||||||
componentProps: {
|
componentProps: {
|
||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
}
|
}
|
||||||
@@ -42,7 +36,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
|
||||||
class: 'w-[550px]',
|
class: 'w-[550px]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
@@ -53,16 +46,13 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await communityInfo(id);
|
const record = await communityInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -74,7 +64,6 @@ async function handleConfirm() {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
await (isUpdate.value ? communityUpdate(data) : communityAdd(data));
|
await (isUpdate.value ? communityUpdate(data) : communityAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { getDictOptions } from '#/utils/dict';
|
import { getDictOptions } from '#/utils/dict';
|
||||||
import { renderDict } from '#/utils/render';
|
import { renderDict } from '#/utils/render';
|
||||||
|
|
||||||
@@ -8,51 +7,47 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'communityName',
|
fieldName: 'communityName',
|
||||||
label: '社区名称',
|
label: '小区名称',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'communityCode',
|
fieldName: 'communityCode',
|
||||||
label: '社区编码',
|
label: '小区编码',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
|
|
||||||
options: getDictOptions('wy_sqlx'),
|
options: getDictOptions('wy_sqlx'),
|
||||||
},
|
},
|
||||||
fieldName: 'communityType',
|
fieldName: 'communityType',
|
||||||
label: '社区类型',
|
label: '小区类型',
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'dataState',
|
|
||||||
label: '数据状态',
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
{
|
||||||
title: '主键',
|
title: '序号',
|
||||||
field: 'id',
|
field: 'id',
|
||||||
|
slots: {
|
||||||
|
default: ({ rowIndex }) => {
|
||||||
|
return (rowIndex + 1).toString();
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '社区名称',
|
title: '小区名称',
|
||||||
field: 'communityName',
|
field: 'communityName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '社区编码',
|
title: '小区编码',
|
||||||
field: 'communityCode',
|
field: 'communityCode',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '社区类型',
|
title: '小区类型',
|
||||||
field: 'communityType',
|
field: 'communityType',
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }) => {
|
default: ({ row }) => {
|
||||||
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
|
|
||||||
return renderDict(row.communityType, 'wy_sqlx');
|
return renderDict(row.communityType, 'wy_sqlx');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -85,10 +80,6 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
title: '小图图片',
|
title: '小图图片',
|
||||||
field: 'img',
|
field: 'img',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '数据状态',
|
|
||||||
field: 'dataState',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '修改时间',
|
title: '修改时间',
|
||||||
field: 'modifyTime',
|
field: 'modifyTime',
|
||||||
@@ -113,23 +104,22 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '社区名称',
|
label: '小区名称',
|
||||||
fieldName: 'communityName',
|
fieldName: 'communityName',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '社区编码',
|
label: '小区编码',
|
||||||
fieldName: 'communityCode',
|
fieldName: 'communityCode',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '社区类型',
|
label: '小区类型',
|
||||||
fieldName: 'communityType',
|
fieldName: 'communityType',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
// 可选从DictEnum中获取 DictEnum.WY_SQLX 便于维护
|
|
||||||
options: getDictOptions('wy_sqlx'),
|
options: getDictOptions('wy_sqlx'),
|
||||||
},
|
},
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
@@ -175,24 +165,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'img',
|
fieldName: 'img',
|
||||||
component: 'ImageUpload',
|
component: 'ImageUpload',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
// accept: 'image/*', // 可选拓展名或者mime类型 ,拼接
|
|
||||||
// maxCount: 1, // 最大上传文件数 默认为1 为1会绑定为string而非string[]类型
|
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
{
|
|
||||||
label: '数据状态',
|
|
||||||
fieldName: 'dataState',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '修改时间',
|
|
||||||
fieldName: 'modifyTime',
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
showTime: true,
|
|
||||||
format: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
@@ -2,13 +2,11 @@
|
|||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps
|
type VxeGridProps
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
communityExport,
|
communityExport,
|
||||||
communityList,
|
communityList,
|
||||||
@@ -16,7 +14,6 @@ import {
|
|||||||
} from '#/api/property/community';
|
} from '#/api/property/community';
|
||||||
import type { CommunityForm } from '#/api/property/community/model';
|
import type { CommunityForm } from '#/api/property/community/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import communityModal from './community-modal.vue';
|
import communityModal from './community-modal.vue';
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
import communityDetail from "#/views/property/community/community-detail.vue";
|
import communityDetail from "#/views/property/community/community-detail.vue";
|
||||||
@@ -31,28 +28,13 @@ const formOptions: VbenFormProps = {
|
|||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
|
||||||
// 不需要直接删除
|
|
||||||
// fieldMappingTime: [
|
|
||||||
// [
|
|
||||||
// 'createTime',
|
|
||||||
// ['params[beginTime]', 'params[endTime]'],
|
|
||||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
checkboxConfig: {
|
checkboxConfig: {
|
||||||
// 高亮
|
|
||||||
highlight: true,
|
highlight: true,
|
||||||
// 翻页时保留选中状态
|
|
||||||
reserve: true,
|
reserve: true,
|
||||||
// 点击行选中
|
|
||||||
// trigger: 'row',
|
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
@@ -71,7 +53,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
},
|
},
|
||||||
// 表格全局唯一表示 保存列配置需要用到
|
|
||||||
id: 'property-community-index'
|
id: 'property-community-index'
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -83,11 +64,13 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
|||||||
const [CommunityModal, modalApi] = useVbenModal({
|
const [CommunityModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: communityModal,
|
connectedComponent: communityModal,
|
||||||
});
|
});
|
||||||
|
|
||||||
const [communityDetailModal, communityDetailApi] = useVbenModal({
|
const [communityDetailModal, communityDetailApi] = useVbenModal({
|
||||||
connectedComponent: communityDetail,
|
connectedComponent: communityDetail,
|
||||||
});
|
});
|
||||||
async function handleInfo(row: Required<BuildingForm>) {
|
|
||||||
// communityDetailApi.setData({ id: row.id });
|
async function handleInfo(row: Required<CommunityForm>) {
|
||||||
|
communityDetailApi.setData({ id: row.id });
|
||||||
communityDetailApi.open();
|
communityDetailApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,12 +136,6 @@ function handleDownloadExcel() {
|
|||||||
>
|
>
|
||||||
{{ $t('pages.common.add') }}
|
{{ $t('pages.common.add') }}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button
|
|
||||||
type="primary"
|
|
||||||
@click="handleInfo"
|
|
||||||
>
|
|
||||||
{{ $t('pages.common.info') }}
|
|
||||||
</a-button>
|
|
||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
|
@@ -1,12 +1,11 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'communityCode',
|
fieldName: 'communityCode',
|
||||||
label: '社区编码',
|
label: '小区/园区',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
@@ -15,32 +14,34 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'floorCode',
|
fieldName: 'floorName',
|
||||||
label: '楼层编码',
|
label: '楼层名称',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'floorName',
|
fieldName: 'floorCode',
|
||||||
label: '楼层数名称',
|
label: '楼层编码',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'orgCode',
|
fieldName: 'orgCode',
|
||||||
label: '组织编码',
|
label: '组织编码',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'dataState',
|
|
||||||
label: '数据状态',
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
{
|
||||||
title: '社区编码',
|
title: '序号',
|
||||||
|
field: 'id',
|
||||||
|
slots: {
|
||||||
|
default: ({ rowIndex }) => {
|
||||||
|
return (rowIndex + 1).toString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '小区/园区',
|
||||||
field: 'communityCode',
|
field: 'communityCode',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -48,12 +49,12 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'buildingCode',
|
field: 'buildingCode',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '楼层编码',
|
title: '楼层名称',
|
||||||
field: 'floorCode',
|
field: 'floorName',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '楼层数名称',
|
title: '楼层编码',
|
||||||
field: 'floorName',
|
field: 'floorCode',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '组织编码',
|
title: '组织编码',
|
||||||
@@ -79,7 +80,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '社区编码',
|
label: '小区/园区',
|
||||||
fieldName: 'communityCode',
|
fieldName: 'communityCode',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
@@ -91,17 +92,23 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '楼层编码',
|
label: '单元名称',
|
||||||
fieldName: 'floorCode',
|
fieldName: 'buildingCode',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '楼层数名称',
|
label: '楼层名称',
|
||||||
fieldName: 'floorName',
|
fieldName: 'floorName',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '楼层编码',
|
||||||
|
fieldName: 'floorCode',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '组织编码',
|
label: '组织编码',
|
||||||
fieldName: 'orgCode',
|
fieldName: 'orgCode',
|
||||||
|
@@ -1,30 +1,24 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { floorAdd, floorInfo, floorUpdate } from '#/api/property/floor';
|
import { floorAdd, floorInfo, floorUpdate } from '#/api/property/floor';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
|
|
||||||
const title = computed(() => {
|
const title = computed(() => {
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
});
|
});
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-2',
|
||||||
// 默认label宽度 px
|
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
// 通用配置项 会影响到所有表单项
|
|
||||||
componentProps: {
|
componentProps: {
|
||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
}
|
}
|
||||||
@@ -42,7 +36,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
|
||||||
class: 'w-[550px]',
|
class: 'w-[550px]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
@@ -53,16 +46,13 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await floorInfo(id);
|
const record = await floorInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -74,7 +64,6 @@ async function handleConfirm() {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
await (isUpdate.value ? floorUpdate(data) : floorAdd(data));
|
await (isUpdate.value ? floorUpdate(data) : floorAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
|
@@ -7,7 +7,6 @@ import {
|
|||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps
|
type VxeGridProps
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
floorExport,
|
floorExport,
|
||||||
floorList,
|
floorList,
|
||||||
@@ -15,7 +14,6 @@ import {
|
|||||||
} from '#/api/property/floor';
|
} from '#/api/property/floor';
|
||||||
import type { FloorForm } from '#/api/property/floor/model';
|
import type { FloorForm } from '#/api/property/floor/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import floorModal from './floor-modal.vue';
|
import floorModal from './floor-modal.vue';
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
|
|
||||||
@@ -28,28 +26,13 @@ const formOptions: VbenFormProps = {
|
|||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
|
||||||
// 不需要直接删除
|
|
||||||
// fieldMappingTime: [
|
|
||||||
// [
|
|
||||||
// 'createTime',
|
|
||||||
// ['params[beginTime]', 'params[endTime]'],
|
|
||||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
checkboxConfig: {
|
checkboxConfig: {
|
||||||
// 高亮
|
|
||||||
highlight: true,
|
highlight: true,
|
||||||
// 翻页时保留选中状态
|
|
||||||
reserve: true,
|
reserve: true,
|
||||||
// 点击行选中
|
|
||||||
// trigger: 'row',
|
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
@@ -68,7 +51,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
},
|
},
|
||||||
// 表格全局唯一表示 保存列配置需要用到
|
|
||||||
id: 'property-floor-index'
|
id: 'property-floor-index'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -0,0 +1,257 @@
|
|||||||
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
import { getDictOptions } from '#/utils/dict';
|
||||||
|
import { renderDict } from '#/utils/render';
|
||||||
|
|
||||||
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'orderId',
|
||||||
|
label: '订单id',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'userId',
|
||||||
|
label: '租赁人id',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'userName',
|
||||||
|
label: '租赁人名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'rent',
|
||||||
|
label: '租金',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'deposit',
|
||||||
|
label: '押金',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'penalty',
|
||||||
|
label: '违约金',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'totalAmount',
|
||||||
|
label: '总金额',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'DatePicker',
|
||||||
|
componentProps: {
|
||||||
|
showTime: true,
|
||||||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
},
|
||||||
|
fieldName: 'chargeDate',
|
||||||
|
label: '收费日期',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_payment_method'),
|
||||||
|
},
|
||||||
|
fieldName: 'paymentMethod',
|
||||||
|
label: '支付方式',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_invoice_status'),
|
||||||
|
},
|
||||||
|
fieldName: 'invoiceStatus',
|
||||||
|
label: '开票状态',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Input',
|
||||||
|
fieldName: 'invoiceType',
|
||||||
|
label: '发票类型',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_charging_status'),
|
||||||
|
},
|
||||||
|
fieldName: 'chargeStatus',
|
||||||
|
label: '收费状态',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const columns: VxeGridProps['columns'] = [
|
||||||
|
{ type: 'checkbox', width: 60 },
|
||||||
|
{
|
||||||
|
title: '主键',
|
||||||
|
field: 'id',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '订单id',
|
||||||
|
field: 'orderId',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '租赁人id',
|
||||||
|
field: 'userId',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '租赁人名称',
|
||||||
|
field: 'userName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '租金',
|
||||||
|
field: 'rent',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '押金',
|
||||||
|
field: 'deposit',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '违约金',
|
||||||
|
field: 'penalty',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '总金额',
|
||||||
|
field: 'totalAmount',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '收费日期',
|
||||||
|
field: 'chargeDate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '支付方式',
|
||||||
|
field: 'paymentMethod',
|
||||||
|
slots: {
|
||||||
|
default: ({ row }) => {
|
||||||
|
return renderDict(row.paymentMethod, 'pro_payment_method');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '开票状态',
|
||||||
|
field: 'invoiceStatus',
|
||||||
|
slots: {
|
||||||
|
default: ({ row }) => {
|
||||||
|
return renderDict(row.invoiceStatus, 'pro_invoice_status');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '发票类型',
|
||||||
|
field: 'invoiceType',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '收费状态',
|
||||||
|
field: 'chargeStatus',
|
||||||
|
slots: {
|
||||||
|
default: ({ row }) => {
|
||||||
|
return renderDict(row.chargeStatus, 'pro_charging_status');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'action',
|
||||||
|
fixed: 'right',
|
||||||
|
slots: { default: 'action' },
|
||||||
|
title: '操作',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const modalSchema: FormSchemaGetter = () => [
|
||||||
|
{
|
||||||
|
label: '主键',
|
||||||
|
fieldName: 'id',
|
||||||
|
component: 'Input',
|
||||||
|
dependencies: {
|
||||||
|
show: () => false,
|
||||||
|
triggerFields: [''],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '订单id',
|
||||||
|
fieldName: 'orderId',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '租赁人id',
|
||||||
|
fieldName: 'userId',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '租赁人名称',
|
||||||
|
fieldName: 'userName',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '租金',
|
||||||
|
fieldName: 'rent',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '押金',
|
||||||
|
fieldName: 'deposit',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '违约金',
|
||||||
|
fieldName: 'penalty',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '总金额',
|
||||||
|
fieldName: 'totalAmount',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '收费日期',
|
||||||
|
fieldName: 'chargeDate',
|
||||||
|
component: 'DatePicker',
|
||||||
|
componentProps: {
|
||||||
|
showTime: true,
|
||||||
|
format: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||||
|
},
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '支付方式',
|
||||||
|
fieldName: 'paymentMethod',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_payment_method'),
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '开票状态',
|
||||||
|
fieldName: 'invoiceStatus',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_invoice_status'),
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '发票类型',
|
||||||
|
fieldName: 'invoiceType',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '收费状态',
|
||||||
|
fieldName: 'chargeStatus',
|
||||||
|
component: 'Select',
|
||||||
|
componentProps: {
|
||||||
|
options: getDictOptions('pro_charging_status'),
|
||||||
|
},
|
||||||
|
rules: 'selectRequired',
|
||||||
|
},
|
||||||
|
];
|
@@ -1,5 +1,157 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
import {
|
||||||
|
useVbenVxeGrid,
|
||||||
|
vxeCheckboxChecked,
|
||||||
|
type VxeGridProps
|
||||||
|
} from '#/adapter/vxe-table';
|
||||||
|
import {
|
||||||
|
orderChargeExport,
|
||||||
|
orderChargeList,
|
||||||
|
orderChargeRemove,
|
||||||
|
} from '#/api/property/chargeManagement';
|
||||||
|
import type { OrderChargeForm } from '#/api/property/chargeManagement/model';
|
||||||
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
import orderChargeModal from './orderCharge-modal.vue';
|
||||||
|
import { columns, querySchema } from './data';
|
||||||
|
|
||||||
|
const formOptions: VbenFormProps = {
|
||||||
|
commonConfig: {
|
||||||
|
labelWidth: 80,
|
||||||
|
componentProps: {
|
||||||
|
allowClear: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
schema: querySchema(),
|
||||||
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
highlight: true,
|
||||||
|
reserve: true,
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
height: 'auto',
|
||||||
|
keepSource: true,
|
||||||
|
pagerConfig: {},
|
||||||
|
proxyConfig: {
|
||||||
|
ajax: {
|
||||||
|
query: async ({ page }, formValues = {}) => {
|
||||||
|
return await orderChargeList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
keyField: 'id',
|
||||||
|
},
|
||||||
|
id: 'system-orderCharge-index'
|
||||||
|
};
|
||||||
|
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
});
|
||||||
|
|
||||||
|
const [OrderChargeModal, modalApi] = useVbenModal({
|
||||||
|
connectedComponent: orderChargeModal,
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
modalApi.setData({});
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleEdit(row: Required<OrderChargeForm>) {
|
||||||
|
modalApi.setData({ id: row.id });
|
||||||
|
modalApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleDelete(row: Required<OrderChargeForm>) {
|
||||||
|
await orderChargeRemove(row.id);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: Required<OrderChargeForm>) => row.id);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await orderChargeRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleDownloadExcel() {
|
||||||
|
commonDownloadExcel(orderChargeExport, '绿植租赁-订单收费数据', tableApi.formApi.form.values, {
|
||||||
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<Page :auto-content-height="true">
|
||||||
收费管理
|
<BasicTable table-title="绿植租赁-订单收费列表">
|
||||||
</div>
|
<template #toolbar-tools>
|
||||||
|
<Space>
|
||||||
|
<a-button
|
||||||
|
v-access:code="['system:orderCharge:export']"
|
||||||
|
@click="handleDownloadExcel"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.export') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['system:orderCharge:remove']"
|
||||||
|
@click="handleMultiDelete">
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['system:orderCharge:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['system:orderCharge:edit']"
|
||||||
|
@click.stop="handleEdit(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.edit') }}
|
||||||
|
</ghost-button>
|
||||||
|
<Popconfirm
|
||||||
|
:get-popup-container="getVxePopupContainer"
|
||||||
|
placement="left"
|
||||||
|
title="确认删除?"
|
||||||
|
@confirm="handleDelete(row)"
|
||||||
|
>
|
||||||
|
<ghost-button
|
||||||
|
danger
|
||||||
|
v-access:code="['system:orderCharge:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</ghost-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<OrderChargeModal @reload="tableApi.query()" />
|
||||||
|
</Page>
|
||||||
</template>
|
</template>
|
@@ -0,0 +1,90 @@
|
|||||||
|
<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 { orderChargeAdd, orderChargeInfo, orderChargeUpdate } from '#/api/property/chargeManagement';
|
||||||
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
|
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',
|
||||||
|
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 [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) {
|
||||||
|
const record = await orderChargeInfo(id);
|
||||||
|
await formApi.setValues(record);
|
||||||
|
}
|
||||||
|
await markInitialized();
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function handleConfirm() {
|
||||||
|
try {
|
||||||
|
modalApi.lock(true);
|
||||||
|
const { valid } = await formApi.validate();
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const data = cloneDeep(await formApi.getValues());
|
||||||
|
await (isUpdate.value ? orderChargeUpdate(data) : orderChargeAdd(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>
|
||||||
|
|
@@ -1,6 +1,5 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type { FormSchemaGetter } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { getDictOptions } from '#/utils/dict';
|
import { getDictOptions } from '#/utils/dict';
|
||||||
import { renderDict } from '#/utils/render';
|
import { renderDict } from '#/utils/render';
|
||||||
|
|
||||||
@@ -8,26 +7,23 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'plantName',
|
fieldName: 'plantName',
|
||||||
label: '产品名称:',
|
label: '产品名称',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'specification',
|
fieldName: 'specification',
|
||||||
label: '规格:',
|
label: '规格',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
// 可选从DictEnum中获取 DictEnum.PRODUCT_MANAGEMENT_STATUS 便于维护
|
|
||||||
options: getDictOptions('product_management_status'),
|
options: getDictOptions('product_management_status'),
|
||||||
},
|
},
|
||||||
fieldName: 'state',
|
fieldName: 'state',
|
||||||
label: '状态:',
|
label: '状态',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
{
|
||||||
@@ -72,7 +68,6 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'state',
|
field: 'state',
|
||||||
slots: {
|
slots: {
|
||||||
default: ({ row }) => {
|
default: ({ row }) => {
|
||||||
// 可选从DictEnum中获取 DictEnum.PRODUCT_MANAGEMENT_STATUS 便于维护
|
|
||||||
return renderDict(row.state, 'product_management_status');
|
return renderDict(row.state, 'product_management_status');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -153,7 +148,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'state',
|
fieldName: 'state',
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
// 可选从DictEnum中获取 DictEnum.PRODUCT_MANAGEMENT_STATUS 便于维护
|
|
||||||
options: getDictOptions('product_management_status'),
|
options: getDictOptions('product_management_status'),
|
||||||
},
|
},
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
@@ -163,9 +157,4 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'remark',
|
fieldName: 'remark',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// label: '创建时间',
|
|
||||||
// fieldName: 'creatTime',
|
|
||||||
// component: 'Input',
|
|
||||||
// },
|
|
||||||
];
|
];
|
||||||
|
@@ -2,13 +2,11 @@
|
|||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps
|
type VxeGridProps
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
plantsProductExport,
|
plantsProductExport,
|
||||||
plantsProductList,
|
plantsProductList,
|
||||||
@@ -16,12 +14,9 @@ import {
|
|||||||
} from '#/api/property/productManagement';
|
} from '#/api/property/productManagement';
|
||||||
import type { PropertyForm } from '#/api/property/productManagement/model';
|
import type { PropertyForm } from '#/api/property/productManagement/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import PlantsProductModal from './plantsProduct-modal.vue';
|
import PlantsProductModal from './plantsProduct-modal.vue';
|
||||||
import PlantsProductDetail from './plantsProduct-detail.vue';
|
import PlantsProductDetail from './plantsProduct-detail.vue';
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
import unitInfoModal from "#/views/property/resident/unit/unit-detail.vue";
|
|
||||||
import type {Resident_unitForm} from "#/api/property/resident/unit/model";
|
|
||||||
|
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@@ -32,28 +27,13 @@ const formOptions: VbenFormProps = {
|
|||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
|
||||||
// 不需要直接删除
|
|
||||||
// fieldMappingTime: [
|
|
||||||
// [
|
|
||||||
// 'createTime',
|
|
||||||
// ['params[beginTime]', 'params[endTime]'],
|
|
||||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
checkboxConfig: {
|
checkboxConfig: {
|
||||||
// 高亮
|
|
||||||
highlight: true,
|
highlight: true,
|
||||||
// 翻页时保留选中状态
|
|
||||||
reserve: true,
|
reserve: true,
|
||||||
// 点击行选中
|
|
||||||
// trigger: 'row',
|
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
@@ -72,7 +52,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
},
|
},
|
||||||
// 表格全局唯一表示 保存列配置需要用到
|
|
||||||
id: 'property-property-index'
|
id: 'property-property-index'
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -88,6 +67,7 @@ const [PlantsProduct, modalApi] = useVbenModal({
|
|||||||
const [PlantsProductDetailModal, PlantsProductDetailApi] = useVbenModal({
|
const [PlantsProductDetailModal, PlantsProductDetailApi] = useVbenModal({
|
||||||
connectedComponent: PlantsProductDetail,
|
connectedComponent: PlantsProductDetail,
|
||||||
});
|
});
|
||||||
|
|
||||||
async function handleInfo(row: Required<PropertyForm>) {
|
async function handleInfo(row: Required<PropertyForm>) {
|
||||||
PlantsProductDetailApi.setData({ id: row.id });
|
PlantsProductDetailApi.setData({ id: row.id });
|
||||||
PlantsProductDetailApi.open();
|
PlantsProductDetailApi.open();
|
||||||
|
@@ -22,7 +22,6 @@ async function handleOpenChange(open: boolean) {
|
|||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
const {id} = modalApi.getData() as { id: number | string };
|
const {id} = modalApi.getData() as { id: number | string };
|
||||||
const response = await visitorManagementInfo(id);
|
const response = await visitorManagementInfo(id);
|
||||||
// 赋值
|
|
||||||
plantsProductDetail.value = response;
|
plantsProductDetail.value = response;
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
}
|
}
|
||||||
|
@@ -1,30 +1,24 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { plantsProductAdd, plantsProductInfo, plantsProductUpdate } from '#/api/property/productManagement';
|
import { plantsProductAdd, plantsProductInfo, plantsProductUpdate } from '#/api/property/productManagement';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
|
|
||||||
const title = computed(() => {
|
const title = computed(() => {
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
});
|
});
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-2',
|
||||||
// 默认label宽度 px
|
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
// 通用配置项 会影响到所有表单项
|
|
||||||
componentProps: {
|
componentProps: {
|
||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
}
|
}
|
||||||
@@ -42,7 +36,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
|
||||||
class: 'w-[550px]',
|
class: 'w-[550px]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
@@ -53,16 +46,13 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await plantsProductInfo(id);
|
const record = await plantsProductInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -74,7 +64,6 @@ async function handleConfirm() {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
await (isUpdate.value ? plantsProductUpdate(data) : plantsProductAdd(data));
|
await (isUpdate.value ? plantsProductUpdate(data) : plantsProductAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
|
@@ -1,13 +1,12 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter/form';
|
import type {FormSchemaGetter} from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||||
import {getDictOptions} from "#/utils/dict";
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
fieldName: 'floorCode',
|
fieldName: 'floorCode',
|
||||||
label: '所属小区',
|
label: '所属社区',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
@@ -26,13 +25,13 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'roomCode',
|
fieldName: 'roomNumber',
|
||||||
label: '房间编码',
|
label: '房间号',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
fieldName: 'roomNumber',
|
fieldName: 'roomCode',
|
||||||
label: '房间号',
|
label: '房间编码',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
@@ -52,12 +51,19 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// export const columns: () => VxeGridProps['columns'] = () => [
|
|
||||||
export const columns: VxeGridProps['columns'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
{
|
{
|
||||||
title: '所属楼层ID',
|
title: '序号',
|
||||||
|
field: 'id',
|
||||||
|
slots: {
|
||||||
|
default: ({ rowIndex }) => {
|
||||||
|
return (rowIndex + 1).toString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '所属楼层',
|
||||||
field: 'floorCode',
|
field: 'floorCode',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -89,7 +95,7 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
field: 'isForSale',
|
field: 'isForSale',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '房间状态',
|
||||||
field: 'status',
|
field: 'status',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -112,23 +118,41 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '所属楼层ID',
|
label: '所属社区',
|
||||||
fieldName: 'floorCode',
|
fieldName: 'floorCode',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '所属建筑',
|
||||||
|
fieldName: 'floorCode',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '所属单元',
|
||||||
|
fieldName: 'floorCode',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '所属楼层',
|
||||||
|
fieldName: 'floorCode',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: '房间号',
|
||||||
|
fieldName: 'roomNumber',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '房间编码',
|
label: '房间编码',
|
||||||
fieldName: 'roomCode',
|
fieldName: 'roomCode',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: '房间号(如101,202)',
|
|
||||||
fieldName: 'roomNumber',
|
|
||||||
component: 'Input',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: '房间类型',
|
label: '房间类型',
|
||||||
fieldName: 'roomType',
|
fieldName: 'roomType',
|
||||||
@@ -138,12 +162,12 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '面积(平方米)',
|
label: '面积(㎡)',
|
||||||
fieldName: 'area',
|
fieldName: 'area',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '户型(如2室1厅1卫)',
|
label: '户型',
|
||||||
fieldName: 'layout',
|
fieldName: 'layout',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
@@ -158,7 +182,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
label: '是否可售',
|
label: '是否可售',
|
||||||
fieldName: 'isForSale',
|
fieldName: 'isForSale',
|
||||||
component: 'Input',
|
component: 'Select',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '房间状态',
|
label: '房间状态',
|
||||||
|
@@ -1,20 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { Recordable } from '@vben/types';
|
|
||||||
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
type VxeGridProps
|
type VxeGridProps
|
||||||
} from '#/adapter/vxe-table';
|
} from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
roomExport,
|
roomExport,
|
||||||
roomList,
|
roomList,
|
||||||
@@ -22,7 +14,6 @@ import {
|
|||||||
} from '#/api/property/room';
|
} from '#/api/property/room';
|
||||||
import type { RoomForm } from '#/api/property/room/model';
|
import type { RoomForm } from '#/api/property/room/model';
|
||||||
import { commonDownloadExcel } from '#/utils/file/download';
|
import { commonDownloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import roomModal from './room-modal.vue';
|
import roomModal from './room-modal.vue';
|
||||||
import { columns, querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
|
|
||||||
@@ -35,28 +26,13 @@ const formOptions: VbenFormProps = {
|
|||||||
},
|
},
|
||||||
schema: querySchema(),
|
schema: querySchema(),
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
|
||||||
// 不需要直接删除
|
|
||||||
// fieldMappingTime: [
|
|
||||||
// [
|
|
||||||
// 'createTime',
|
|
||||||
// ['params[beginTime]', 'params[endTime]'],
|
|
||||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
|
||||||
// ],
|
|
||||||
// ],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const gridOptions: VxeGridProps = {
|
const gridOptions: VxeGridProps = {
|
||||||
checkboxConfig: {
|
checkboxConfig: {
|
||||||
// 高亮
|
|
||||||
highlight: true,
|
highlight: true,
|
||||||
// 翻页时保留选中状态
|
|
||||||
reserve: true,
|
reserve: true,
|
||||||
// 点击行选中
|
|
||||||
// trigger: 'row',
|
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
@@ -75,7 +51,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
rowConfig: {
|
rowConfig: {
|
||||||
keyField: 'id',
|
keyField: 'id',
|
||||||
},
|
},
|
||||||
// 表格全局唯一表示 保存列配置需要用到
|
|
||||||
id: 'property-room-index'
|
id: 'property-room-index'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -1,30 +1,24 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import { computed, ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import { roomAdd, roomInfo, roomUpdate } from '#/api/property/room';
|
import { roomAdd, roomInfo, roomUpdate } from '#/api/property/room';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
|
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
|
|
||||||
const title = computed(() => {
|
const title = computed(() => {
|
||||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||||
});
|
});
|
||||||
|
|
||||||
const [BasicForm, formApi] = useVbenForm({
|
const [BasicForm, formApi] = useVbenForm({
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
// 默认占满两列
|
|
||||||
formItemClass: 'col-span-2',
|
formItemClass: 'col-span-2',
|
||||||
// 默认label宽度 px
|
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
// 通用配置项 会影响到所有表单项
|
|
||||||
componentProps: {
|
componentProps: {
|
||||||
class: 'w-full',
|
class: 'w-full',
|
||||||
}
|
}
|
||||||
@@ -42,7 +36,6 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
|||||||
);
|
);
|
||||||
|
|
||||||
const [BasicModal, modalApi] = useVbenModal({
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
// 在这里更改宽度
|
|
||||||
class: 'w-[550px]',
|
class: 'w-[550px]',
|
||||||
fullscreenButton: false,
|
fullscreenButton: false,
|
||||||
onBeforeClose,
|
onBeforeClose,
|
||||||
@@ -53,16 +46,13 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
const { id } = modalApi.getData() as { id?: number | string };
|
const { id } = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await roomInfo(id);
|
const record = await roomInfo(id);
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
|
|
||||||
modalApi.modalLoading(false);
|
modalApi.modalLoading(false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -74,7 +64,6 @@ async function handleConfirm() {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
|
||||||
const data = cloneDeep(await formApi.getValues());
|
const data = cloneDeep(await formApi.getValues());
|
||||||
await (isUpdate.value ? roomUpdate(data) : roomAdd(data));
|
await (isUpdate.value ? roomUpdate(data) : roomAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
|
Reference in New Issue
Block a user