Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
This commit is contained in:
@@ -13,52 +13,63 @@ export function getIndexCount() {
|
||||
export function getStatisticsCurrDay() {
|
||||
return requestClient.get<any>('/sis/alarmEvents/query/statistics/currDay');
|
||||
}
|
||||
|
||||
// 所有预警信息分类统计
|
||||
export function getStatistics() {
|
||||
return requestClient.get<any>('/sis/alarmEvents/query/statistics');
|
||||
}
|
||||
|
||||
// 工单
|
||||
export function getworkOrder() {
|
||||
return requestClient.get<any>('/property/screen/typeWorkOrderHistogram');
|
||||
return requestClient.get<any>(
|
||||
'/property/cockpit/screen/typeWorkOrderHistogram',
|
||||
);
|
||||
}
|
||||
|
||||
// 会议室
|
||||
export function getTodayMeetCount() {
|
||||
return requestClient.get<any>('/property/screen/todayMeetCount');
|
||||
return requestClient.get<any>('/property/cockpit/screen/todayMeetCount');
|
||||
}
|
||||
|
||||
// 水电
|
||||
export function getHydropower() {
|
||||
return requestClient.get<any>('/property/meterInfo/statusCount');
|
||||
}
|
||||
|
||||
// 门禁
|
||||
export function getAccessControl() {
|
||||
return requestClient.get<any>('/sis/e8/door/online');
|
||||
}
|
||||
|
||||
// 摄像头状态
|
||||
export function getCamera() {
|
||||
return requestClient.get<any>('/sis/deviceManage/online');
|
||||
}
|
||||
|
||||
// 访客
|
||||
export function getVisitorCount() {
|
||||
return requestClient.get<any>('/property/screen/todayVisitorCount');
|
||||
return requestClient.get<any>('/property/cockpit/screen/todayVisitorCount');
|
||||
}
|
||||
|
||||
//车流
|
||||
export async function queryTwentyfourRunningDatasByPlNos() {
|
||||
let params = {
|
||||
"orgId": "10012",
|
||||
"plNos": [
|
||||
"PFN000000012",
|
||||
"PFN000000025"
|
||||
]
|
||||
orgId: '10012',
|
||||
plNos: ['PFN000000012', 'PFN000000025'],
|
||||
};
|
||||
const response = await fetch('https://server.cqnctc.com:6081/web/thirdParty/queryTwentyfourRunningDatasByPlNos', {
|
||||
method: 'POST', // 指定请求方法为POST
|
||||
headers: {
|
||||
'Content-Type': 'application/json', // 设置内容类型为JSON
|
||||
const response = await fetch(
|
||||
'https://server.cqnctc.com:6081/web/thirdParty/queryTwentyfourRunningDatasByPlNos',
|
||||
{
|
||||
method: 'POST', // 指定请求方法为POST
|
||||
headers: {
|
||||
'Content-Type': 'application/json', // 设置内容类型为JSON
|
||||
},
|
||||
body: JSON.stringify(params), // 将参数对象转换为JSON字符串并作为请求体发送
|
||||
},
|
||||
body: JSON.stringify(params), // 将参数对象转换为JSON字符串并作为请求体发送
|
||||
});
|
||||
);
|
||||
return response.json();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 导出资产管理列表
|
||||
// * @param params
|
||||
|
@@ -65,6 +65,10 @@ export interface OrderChargeVO {
|
||||
* 收费状态
|
||||
*/
|
||||
chargeStatus: string | number;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
residentUnitId: string;
|
||||
}
|
||||
|
||||
export interface OrderChargeForm extends BaseEntity {
|
||||
@@ -196,8 +200,8 @@ export interface OrderChargeQuery extends PageQuery {
|
||||
chargeStatus?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
@@ -266,4 +270,8 @@ export interface orderChargeDetailForm extends BaseEntity {
|
||||
* 收费状态
|
||||
*/
|
||||
chargeStatus?: string | number;
|
||||
/**
|
||||
* 租赁单位
|
||||
*/
|
||||
residentUnitText?: string;
|
||||
}
|
||||
|
@@ -7,14 +7,22 @@ import { commonExport } from '#/api/helper';
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
/**
|
||||
* 查询绿植租赁-订单管理列表
|
||||
* @param params
|
||||
* @returns 绿植租赁-订单管理列表
|
||||
*/
|
||||
* 查询绿植租赁-订单管理列表
|
||||
* @param params
|
||||
* @returns 绿植租赁-订单管理列表
|
||||
*/
|
||||
export function rentalOrderList(params?: RentalOrderQuery) {
|
||||
return requestClient.get<PageResult<RentalOrderVO>>('/property/rentalOrder/list', { params });
|
||||
return requestClient.get<PageResult<RentalOrderVO>>(
|
||||
'/property/rentalOrder/list',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
export function rentalNotSelectList(params?: RentalOrderQuery) {
|
||||
return requestClient.get<PageResult<RentalOrderVO>>(
|
||||
'/property/rentalOrder/notSelectList',
|
||||
{ params },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出绿植租赁-订单管理列表
|
||||
* @param params
|
||||
|
@@ -86,6 +86,10 @@ export interface RentalOrderVO {
|
||||
*/
|
||||
signTime: string;
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
residentUnitText: string;
|
||||
}
|
||||
|
||||
export interface RentalOrderForm extends BaseEntity {
|
||||
@@ -173,7 +177,6 @@ export interface RentalOrderForm extends BaseEntity {
|
||||
* 签署时间
|
||||
*/
|
||||
signTime?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface RentalOrderQuery extends PageQuery {
|
||||
@@ -257,7 +260,7 @@ export interface RentalOrderQuery extends PageQuery {
|
||||
signTime?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
@@ -246,4 +246,9 @@ export interface Unit extends BaseEntity {
|
||||
*/
|
||||
area?: string;
|
||||
|
||||
/**
|
||||
* 房间数量
|
||||
*/
|
||||
roomNumber: number;
|
||||
|
||||
}
|
||||
|
@@ -88,7 +88,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
slots: {default: 'state'},
|
||||
slots: { default: 'state' },
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
@@ -158,15 +158,15 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
placeholder: '请输入(如:元)',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '手机缴费',
|
||||
fieldName: 'isMobilePay',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_mobile_payment'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
// {
|
||||
// label: '付费方式',
|
||||
// fieldName: 'paymentMode',
|
||||
// component: 'Select',
|
||||
// componentProps: {
|
||||
// options: getDictOptions('wy_fffs'),
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// },
|
||||
{
|
||||
label: '进位方式',
|
||||
fieldName: 'roundingMode',
|
||||
@@ -202,7 +202,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
options: getDictOptions('pro_calculation_formula'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
formItemClass:'col-span-2',
|
||||
},
|
||||
{
|
||||
label: '计费单价',
|
||||
|
@@ -1,17 +1,18 @@
|
||||
import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {costItemSettingList} from "#/api/property/costManagement/costItemSetting";
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
import { costItemSettingList } from '#/api/property/costManagement/costItemSetting';
|
||||
import { h } from 'vue';
|
||||
|
||||
import { resident_unitList } from '#/api/property/resident/unit';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api:async ()=>{
|
||||
return (await costItemSettingList({pageSize: 1000, pageNum: 1}))?.rows
|
||||
api: async () => {
|
||||
return (await costItemSettingList({ pageSize: 1000, pageNum: 1 }))
|
||||
?.rows;
|
||||
},
|
||||
afterFetch: (data: { chargeItem: string; id: string }[]) => {
|
||||
return data.map((item: any) => ({
|
||||
@@ -28,12 +29,29 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
fieldName: 'chargeStatus',
|
||||
label: '缴费状态',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_fyshzt')
|
||||
options: getDictOptions('wy_fyshzt'),
|
||||
},
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const rows = await resident_unitList({
|
||||
pageSize: 1000000000,
|
||||
pageNum: 1,
|
||||
});
|
||||
return rows;
|
||||
},
|
||||
resultField: 'rows',
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
},
|
||||
fieldName: 'residentUnitId',
|
||||
label: '单位',
|
||||
},
|
||||
];
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{type: 'checkbox', width: 60},
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '单位',
|
||||
field: 'residentUnitText',
|
||||
@@ -41,7 +59,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
{
|
||||
title: '收费项目',
|
||||
field: 'costItemsId',
|
||||
field: 'chargeItemText',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
@@ -53,21 +71,23 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '计费开始时间',
|
||||
field: 'startTime',
|
||||
width: 150,
|
||||
slots: { default: 'startTime' },
|
||||
},
|
||||
{
|
||||
title: '计费结束时间',
|
||||
field: 'endTime',
|
||||
width: 150,
|
||||
slots: { default: 'endTime' },
|
||||
},
|
||||
{
|
||||
title: '缴费状态',
|
||||
field: 'chargeStatus',
|
||||
width: 150,
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.chargeStatus, 'wy_fyshzt')
|
||||
}
|
||||
}
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.chargeStatus, 'wy_fyshzt');
|
||||
},
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '状态',
|
||||
@@ -87,7 +107,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: {default: 'action'},
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
width: 180,
|
||||
},
|
||||
@@ -107,8 +127,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '单位',
|
||||
fieldName: 'residentUnitId',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
componentProps: {},
|
||||
rules: 'selectRequired',
|
||||
formItemClass: 'col-span-2',
|
||||
},
|
||||
@@ -136,16 +155,14 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '业主',
|
||||
fieldName: 'personId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
},
|
||||
componentProps: {},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '费用类型',
|
||||
fieldName: 'costType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
},
|
||||
componentProps: {},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
@@ -201,7 +218,7 @@ export const modalSchemaUpdate: FormSchemaGetter = () => [
|
||||
fieldName: 'payType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options:getDictOptions('wy_zffs')
|
||||
options: getDictOptions('wy_zffs'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
@@ -210,14 +227,15 @@ export const modalSchemaUpdate: FormSchemaGetter = () => [
|
||||
fieldName: 'chargeCycle',
|
||||
component: 'InputNumber',
|
||||
componentProps: {
|
||||
min:1,
|
||||
precision:0,
|
||||
placeholder:'请输入缴费周期(月)'
|
||||
min: 1,
|
||||
precision: 0,
|
||||
placeholder: '请输入缴费周期(月)',
|
||||
},
|
||||
suffix: () => h('span', { style: {fontSize: '0.875rem',fontWeight:500,} }, '月'),
|
||||
suffix: () =>
|
||||
h('span', { style: { fontSize: '0.875rem', fontWeight: 500 } }, '月'),
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
]
|
||||
];
|
||||
export const modalSchemaRefund: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键',
|
||||
@@ -233,6 +251,6 @@ export const modalSchemaRefund: FormSchemaGetter = () => [
|
||||
fieldName: 'reason',
|
||||
component: 'Textarea',
|
||||
formItemClass: 'col-span-2',
|
||||
rules:'required'
|
||||
rules: 'required',
|
||||
},
|
||||
]
|
||||
];
|
||||
|
@@ -39,6 +39,11 @@ async function handleOpenChange(open: boolean) {
|
||||
}
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
function formatDate(dateString: string) {
|
||||
if (!dateString) return '';
|
||||
const date = new Date(dateString);
|
||||
return date.toISOString().split('T')[0];
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -57,7 +62,7 @@ async function handleOpenChange(open: boolean) {
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="计费时间">
|
||||
{{ houseChargeDetail.startTime + ' 至 ' + houseChargeDetail.endTime }}
|
||||
{{ formatDate(houseChargeDetail.startTime) + ' 至 ' + formatDate(houseChargeDetail.endTime) }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单位">
|
||||
{{ houseChargeDetail?.residentUnitText }}
|
||||
|
@@ -125,7 +125,11 @@ function handleMultiDelete() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function formatDate(dateString: string) {
|
||||
if (!dateString) return '';
|
||||
const date = new Date(dateString);
|
||||
return date.toISOString().split('T')[0];
|
||||
}
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(houseChargeExport, '房屋收费数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
@@ -161,6 +165,14 @@ function handleDownloadExcel() {
|
||||
</a-button>
|
||||
</Space>
|
||||
</template>
|
||||
<template #startTime="{row}">
|
||||
{{ formatDate(row.startTime) }}
|
||||
|
||||
</template>
|
||||
<template #endTime="{row}">
|
||||
{{ formatDate(row.endTime) }}
|
||||
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
|
@@ -2,7 +2,8 @@ import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
import {rentalOrderList} from "#/api/property/rentalOrder";
|
||||
import { rentalOrderList } from '#/api/property/rentalOrder';
|
||||
import { resident_unitList } from '#/api/property/resident/unit';
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@@ -70,47 +71,47 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '订单号',
|
||||
field: 'orderId',
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '租赁合同编号',
|
||||
field: 'userId',
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '租赁人',
|
||||
field: 'userName',
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '租金',
|
||||
field: 'rent',
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '押金',
|
||||
field: 'deposit',
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '违约金',
|
||||
field: 'penalty',
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '总金额',
|
||||
field: 'totalAmount',
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '收费日期',
|
||||
field: 'chargeDate',
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '支付方式',
|
||||
@@ -120,7 +121,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.paymentMethod, 'pro_payment_method');
|
||||
},
|
||||
},
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '开票状态',
|
||||
@@ -130,7 +131,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.invoiceStatus, 'pro_invoice_status');
|
||||
},
|
||||
},
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '发票类型',
|
||||
@@ -140,7 +141,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.invoiceType, 'pro_invoice_type');
|
||||
},
|
||||
},
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '收费状态',
|
||||
@@ -150,12 +151,12 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return renderDict(row.chargeStatus, 'pro_charging_status');
|
||||
},
|
||||
},
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
minWidth: '120'
|
||||
minWidth: '120',
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
@@ -184,54 +185,61 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
api: rentalOrderList,
|
||||
resultField: 'rows',
|
||||
labelField: 'orderNo',
|
||||
valueField: 'id',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
// {
|
||||
// label: '租赁人ID',
|
||||
// fieldName: 'userId',
|
||||
// component: 'ApiSelect',
|
||||
// componentProps: {
|
||||
// api: rentalOrderList,
|
||||
// resultField: 'rows',
|
||||
// labelField: 'customerName',
|
||||
// valueField: 'id',
|
||||
// },
|
||||
// rules: 'required',
|
||||
// },
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'residentUnitId',
|
||||
label: '租赁单位',
|
||||
componentProps: () => ({
|
||||
api: getUnitList,
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
immediate: true,
|
||||
debounceTime: 500,
|
||||
allowClear: true,
|
||||
placeholder: '',
|
||||
filterOption: true,
|
||||
}),
|
||||
|
||||
rules: 'selectRequired',
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
label: '租赁人',
|
||||
fieldName: 'userName',
|
||||
component: "Select",
|
||||
component: 'Select',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
|
||||
{
|
||||
label: '租金',
|
||||
fieldName: 'rent',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
precision: 2,
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '押金',
|
||||
fieldName: 'deposit',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
precision: 2,
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '违约金',
|
||||
fieldName: 'penalty',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps:{
|
||||
componentProps: {
|
||||
precision: 2,
|
||||
}
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '总金额',
|
||||
@@ -287,3 +295,21 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'required',
|
||||
},
|
||||
];
|
||||
export async function getUnitList(): Promise<
|
||||
{ value: number; label: string }[]
|
||||
> {
|
||||
const queryParam = {
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
};
|
||||
const res = await resident_unitList(queryParam);
|
||||
const data: { value: number; label: string }[] = [];
|
||||
|
||||
res.rows.forEach((r: any) => {
|
||||
data.push({
|
||||
value: r.id,
|
||||
label: r.name,
|
||||
});
|
||||
});
|
||||
return data;
|
||||
}
|
||||
|
@@ -1,13 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import type {orderChargeDetailForm} from '#/api/property/chargeManagement/model';
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import type { orderChargeDetailForm } from '#/api/property/chargeManagement/model';
|
||||
import { shallowRef } from 'vue';
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { Descriptions, DescriptionsItem } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {orderChargeInfo} from '#/api/property/chargeManagement';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import { orderChargeInfo } from '#/api/property/chargeManagement';
|
||||
import { renderDict } from '#/utils/render';
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
@@ -25,7 +25,7 @@ async function handleOpenChange(open: boolean) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const { id } = modalApi.getData() as { id: number | string };
|
||||
const response = await orderChargeInfo(id);
|
||||
orderChargeDetail.value = response;
|
||||
modalApi.modalLoading(false);
|
||||
@@ -33,8 +33,19 @@ async function handleOpenChange(open: boolean) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="查看收费" class="w-[70%]">
|
||||
<Descriptions v-if="orderChargeDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||
<BasicModal
|
||||
:footer="false"
|
||||
:fullscreen-button="false"
|
||||
title="查看收费"
|
||||
class="w-[70%]"
|
||||
>
|
||||
<Descriptions
|
||||
v-if="orderChargeDetail"
|
||||
size="small"
|
||||
:column="2"
|
||||
bordered
|
||||
:labelStyle="{ width: '100px' }"
|
||||
>
|
||||
<DescriptionsItem label="订单号">
|
||||
{{ orderChargeDetail.orderId }}
|
||||
</DescriptionsItem>
|
||||
@@ -42,7 +53,10 @@ async function handleOpenChange(open: boolean) {
|
||||
{{ orderChargeDetail.rentalOrder.contractCode }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租赁人">
|
||||
{{ orderChargeDetail.userName}}
|
||||
{{ orderChargeDetail.userName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租赁单位">
|
||||
{{ orderChargeDetail.residentUnitText }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租金">
|
||||
{{ orderChargeDetail.rent }}
|
||||
@@ -53,32 +67,53 @@ async function handleOpenChange(open: boolean) {
|
||||
<DescriptionsItem label="违约金">
|
||||
{{ orderChargeDetail.penalty }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="开票状态" v-if="orderChargeDetail.invoiceStatus!=null">
|
||||
<DescriptionsItem
|
||||
label="开票状态"
|
||||
v-if="orderChargeDetail.invoiceStatus != null"
|
||||
>
|
||||
<component
|
||||
:is="renderDict(orderChargeDetail.invoiceStatus,'pro_invoice_status')"
|
||||
:is="
|
||||
renderDict(orderChargeDetail.invoiceStatus, 'pro_invoice_status')
|
||||
"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="发票类型" v-if="orderChargeDetail.invoiceType!=null">
|
||||
<DescriptionsItem
|
||||
label="发票类型"
|
||||
v-if="orderChargeDetail.invoiceType != null"
|
||||
>
|
||||
<component
|
||||
:is="renderDict(orderChargeDetail.invoiceType,'pro_invoice_type')"
|
||||
:is="renderDict(orderChargeDetail.invoiceType, 'pro_invoice_type')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="收费状态" v-if="orderChargeDetail.chargeStatus!=null">
|
||||
<DescriptionsItem
|
||||
label="收费状态"
|
||||
v-if="orderChargeDetail.chargeStatus != null"
|
||||
>
|
||||
<component
|
||||
:is="renderDict(orderChargeDetail.chargeStatus,'pro_charging_status')"
|
||||
:is="
|
||||
renderDict(orderChargeDetail.chargeStatus, 'pro_charging_status')
|
||||
"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="产品编号">
|
||||
{{ orderChargeDetail.rentalOrder.productList.map(item => item.plantCode).join('、') }}
|
||||
{{
|
||||
orderChargeDetail.rentalOrder.productList
|
||||
.map((item) => item.plantCode)
|
||||
.join('、')
|
||||
}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="购买植物">
|
||||
{{ orderChargeDetail.rentalOrder.productList.map(item => item.plantName).join('、') }}
|
||||
{{
|
||||
orderChargeDetail.rentalOrder.productList
|
||||
.map((item) => item.plantName)
|
||||
.join('、')
|
||||
}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="总金额">
|
||||
{{ orderChargeDetail.totalAmount }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="产品图片">
|
||||
<img :src="orderChargeDetail.createTime" alt="">
|
||||
<img :src="orderChargeDetail.createTime" alt="" />
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
|
@@ -1,13 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import {computed, reactive, ref} from 'vue';
|
||||
import { computed, reactive, 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 {
|
||||
orderChargeAdd,
|
||||
orderChargeInfo,
|
||||
orderChargeUpdate,
|
||||
} from '#/api/property/chargeManagement';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import { modalSchema } from './data';
|
||||
import QueryUserList from "#/views/property/greenPlantRentalManagement/chargeManagement/query-user-list.vue";
|
||||
// import { modalSchema } from './data';
|
||||
import QueryUserList from '#/views/property/greenPlantRentalManagement/chargeManagement/query-user-list.vue';
|
||||
import { resident_unitList } from '#/api/property/resident/unit';
|
||||
import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import { rentalNotSelectList } from '#/api/property/rentalOrder';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
const isUpdate = ref(false);
|
||||
@@ -15,16 +23,167 @@ const isUpdate = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : '添加收费';
|
||||
});
|
||||
const modalSchema = [
|
||||
{
|
||||
label: '主键',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '订单号',
|
||||
fieldName: 'orderId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: rentalNotSelectList,
|
||||
resultField: 'rows',
|
||||
labelField: 'orderNo',
|
||||
valueField: 'id',
|
||||
onChange: async (value: string, option: any) => {
|
||||
await formApi.setValues({
|
||||
residentUnitId: option.residentUnitId, // 假设订单数据中有 residentUnitId 字段
|
||||
// 其他需要自动填充的字段
|
||||
});
|
||||
},
|
||||
},
|
||||
disabled: isUpdate.value ? true : false,
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'residentUnitId',
|
||||
label: '租赁单位',
|
||||
componentProps: () => ({
|
||||
api: getUnitList,
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
immediate: true,
|
||||
debounceTime: 500,
|
||||
allowClear: true,
|
||||
placeholder: '',
|
||||
filterOption: true,
|
||||
}),
|
||||
|
||||
rules: 'selectRequired',
|
||||
disabled: true,
|
||||
},
|
||||
{
|
||||
label: '租赁人',
|
||||
fieldName: 'userName',
|
||||
component: 'Select',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
|
||||
{
|
||||
label: '租金',
|
||||
fieldName: 'rent',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
precision: 2,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '押金',
|
||||
fieldName: 'deposit',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
precision: 2,
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '违约金',
|
||||
fieldName: 'penalty',
|
||||
component: 'InputNumber',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
precision: 2,
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '总金额',
|
||||
// fieldName: 'totalAmount',
|
||||
// component: 'Input',
|
||||
// rules: 'required',
|
||||
// },
|
||||
{
|
||||
label: '开票状态',
|
||||
fieldName: 'invoiceStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_invoice_status'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '发票类型',
|
||||
fieldName: 'invoiceType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_invoice_type'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '收费状态',
|
||||
fieldName: 'chargeStatus',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_charging_status'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '支付方式',
|
||||
fieldName: 'paymentMethod',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_payment_method'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '收费日期',
|
||||
fieldName: 'chargeDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
];
|
||||
async function getUnitList() {
|
||||
const queryParam = {
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
};
|
||||
const res = await resident_unitList(queryParam);
|
||||
const data: { value: number; label: string }[] = [];
|
||||
|
||||
res.rows.forEach((r: any) => {
|
||||
data.push({
|
||||
value: r.id,
|
||||
label: r.name,
|
||||
});
|
||||
});
|
||||
return data;
|
||||
}
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
formItemClass: 'col-span-1',
|
||||
labelWidth: 80,
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
},
|
||||
},
|
||||
schema: modalSchema(),
|
||||
schema: modalSchema,
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
@@ -55,6 +214,8 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
record.paymentMethod = record.paymentMethod?.toString();
|
||||
record.invoiceType = record.invoiceType?.toString();
|
||||
record.invoiceStatus = record.invoiceStatus?.toString();
|
||||
record.orderId = record.orderId;
|
||||
record.residentUnitId = record.residentUnitId;
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -71,8 +232,8 @@ async function handleConfirm() {
|
||||
}
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
if (userInfo) {
|
||||
data.userId = userInfo.userId
|
||||
data.userName = userInfo.userName
|
||||
data.userId = userInfo.userId;
|
||||
data.userName = userInfo.userName;
|
||||
}
|
||||
await (isUpdate.value ? orderChargeUpdate(data) : orderChargeAdd(data));
|
||||
resetInitialized();
|
||||
@@ -102,9 +263,13 @@ async function handleClosed() {
|
||||
<BasicModal :title="title">
|
||||
<BasicForm>
|
||||
<template #userName="slotProps">
|
||||
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :isUpdate="isUpdate" :userName="userName"/>
|
||||
<QueryUserList
|
||||
@update:userInfo="getUserInfo"
|
||||
v-bind="slotProps"
|
||||
:isUpdate="isUpdate"
|
||||
:userName="userName"
|
||||
/>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
|
@@ -1,24 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, shallowRef } from 'vue';
|
||||
|
||||
import {ref, shallowRef} from 'vue';
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import { Descriptions, DescriptionsItem } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
import {renderDict} from "#/utils/render";
|
||||
import type {RentalOrderVO} from "#/api/property/rentalOrder/model";
|
||||
import {rentalOrderInfo} from "#/api/property/rentalOrder";
|
||||
import {rentalColumns} from "./data";
|
||||
import {Table} from "ant-design-vue";
|
||||
import { renderDict } from '#/utils/render';
|
||||
import type { RentalOrderVO } from '#/api/property/rentalOrder/model';
|
||||
import { rentalOrderInfo } from '#/api/property/rentalOrder';
|
||||
import { rentalColumns } from './data';
|
||||
import { Table } from 'ant-design-vue';
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const planProducts=ref([]);
|
||||
const planProducts = ref([]);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
@@ -27,7 +26,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
},
|
||||
});
|
||||
|
||||
const orderDetail = shallowRef<null |RentalOrderVO>(null);
|
||||
const orderDetail = shallowRef<null | RentalOrderVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
@@ -35,73 +34,90 @@ async function handleOpenChange(open: boolean) {
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const { id } = modalApi.getData() as { id: number | string };
|
||||
// 赋值
|
||||
orderDetail.value = await rentalOrderInfo(id);
|
||||
planProducts.value=orderDetail.value?.productList
|
||||
planProducts.value = orderDetail.value?.productList;
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="租赁订单信息" class="w-[70%]">
|
||||
<Descriptions v-if="orderDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||
<BasicModal
|
||||
:footer="false"
|
||||
:fullscreen-button="false"
|
||||
title="租赁订单信息"
|
||||
class="w-[70%]"
|
||||
>
|
||||
<Descriptions
|
||||
v-if="orderDetail"
|
||||
size="small"
|
||||
:column="2"
|
||||
bordered
|
||||
:labelStyle="{ width: '100px' }"
|
||||
>
|
||||
<DescriptionsItem label="订单号">
|
||||
{{ orderDetail.orderNo }}
|
||||
{{ orderDetail.orderNo }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="客户名称">
|
||||
{{ orderDetail.customerName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="客户类型" v-if="orderDetail.type!=null">
|
||||
<component
|
||||
:is="renderDict(orderDetail.customerType,'wy_khlx')"
|
||||
/>
|
||||
<DescriptionsItem label="客户类型" v-if="orderDetail.type != null">
|
||||
<component :is="renderDict(orderDetail.customerType, 'wy_khlx')" />
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租赁单位">
|
||||
{{ orderDetail.residentUnitText }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租赁周期">
|
||||
{{ orderDetail.rentalPeriod}}
|
||||
{{ orderDetail.rentalPeriod }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租赁时间" :span="2">
|
||||
{{dayjs(orderDetail.startTime).format("YYYY-MM-DD")+' 至 '+dayjs(orderDetail.endTime).format("YYYY-MM-DD")}}
|
||||
{{
|
||||
dayjs(orderDetail.startTime).format('YYYY-MM-DD') +
|
||||
' 至 ' +
|
||||
dayjs(orderDetail.endTime).format('YYYY-MM-DD')
|
||||
}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="总金额">
|
||||
{{ orderDetail.totalAmount +"元"}}
|
||||
{{ orderDetail.totalAmount + '元' }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租赁方式">
|
||||
<component
|
||||
:is="renderDict(orderDetail.rentalType,'wy_zlfs')"
|
||||
/>
|
||||
<component :is="renderDict(orderDetail.rentalType, 'wy_zlfs')" />
|
||||
</DescriptionsItem>
|
||||
<!-- <DescriptionsItem label="支付状态">-->
|
||||
<!-- <component-->
|
||||
<!-- :is="renderDict(orderDetail.paymentStatus,'pro_charging_status')"-->
|
||||
<!-- />-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<!-- <DescriptionsItem label="支付状态">-->
|
||||
<!-- <component-->
|
||||
<!-- :is="renderDict(orderDetail.paymentStatus,'pro_charging_status')"-->
|
||||
<!-- />-->
|
||||
<!-- </DescriptionsItem>-->
|
||||
<DescriptionsItem label="是否续租">
|
||||
<component
|
||||
:is="renderDict(orderDetail.isRelet,'wy_sf')"
|
||||
/>
|
||||
<component :is="renderDict(orderDetail.isRelet, 'wy_sf')" />
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="合同状态">
|
||||
<component
|
||||
:is="renderDict(orderDetail.contractStatus,'wy_htzt')"
|
||||
/>
|
||||
<component :is="renderDict(orderDetail.contractStatus, 'wy_htzt')" />
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="合同编号" v-if="orderDetail.contractStatus!='1'">
|
||||
<DescriptionsItem
|
||||
label="合同编号"
|
||||
v-if="orderDetail.contractStatus != '1'"
|
||||
>
|
||||
{{ orderDetail.contractCode ?? '无' }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="签署时间" v-if="orderDetail.contractStatus!='1'">
|
||||
<DescriptionsItem
|
||||
label="签署时间"
|
||||
v-if="orderDetail.contractStatus != '1'"
|
||||
>
|
||||
{{ orderDetail.signTime ?? '无' }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
<div v-if="planProducts.length">
|
||||
<div style="margin: 10px 0;font-weight: 500">
|
||||
订单产品详情
|
||||
</div>
|
||||
<Table :dataSource="planProducts" :columns="rentalColumns" :pagination="false"
|
||||
bordered size="small">
|
||||
<div style="margin: 10px 0; font-weight: 500">订单产品详情</div>
|
||||
<Table
|
||||
:dataSource="planProducts"
|
||||
:columns="rentalColumns"
|
||||
:pagination="false"
|
||||
bordered
|
||||
size="small"
|
||||
>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.field === 'id'">
|
||||
{{ index + 1 }}
|
||||
|
@@ -1,25 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
import {computed, ref} from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {$t} from '@vben/locales';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
rentalOrderAdd,
|
||||
rentalOrderInfo,
|
||||
rentalOrderUpdate
|
||||
rentalOrderUpdate,
|
||||
} from '#/api/property/rentalOrder';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
|
||||
import {plantsProductList} from "#/api/property/productManagement";
|
||||
import {rentalPlanInfo, rentalPlanList} from "#/api/property/rentalPlan";
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import type {PropertyVO} from "#/api/property/productManagement/model";
|
||||
import type {RentalPlanVO} from "#/api/property/rentalPlan/model";
|
||||
import {planInfoColumns} from './data';
|
||||
import {Table} from "ant-design-vue";
|
||||
import { plantsProductList } from '#/api/property/productManagement';
|
||||
import { rentalPlanInfo, rentalPlanList } from '#/api/property/rentalPlan';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import type { PropertyVO } from '#/api/property/productManagement/model';
|
||||
import type { RentalPlanVO } from '#/api/property/rentalPlan/model';
|
||||
import { planInfoColumns } from './data';
|
||||
import { Table } from 'ant-design-vue';
|
||||
import { resident_unitList } from '#/api/property/resident/unit';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -54,7 +55,24 @@ const modalSchema = [
|
||||
fieldName: 'customerType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_khlx')
|
||||
options: getDictOptions('wy_khlx'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
component: 'ApiSelect',
|
||||
fieldName: 'residentUnitId',
|
||||
label: '租赁单位',
|
||||
componentProps: {
|
||||
api: getUnitList,
|
||||
resultField: 'data',
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
immediate: true,
|
||||
debounceTime: 500,
|
||||
allowClear: true,
|
||||
placeholder: '请选择租赁单位',
|
||||
filterOption: true,
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
@@ -63,7 +81,7 @@ const modalSchema = [
|
||||
fieldName: 'rentalPeriod',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_time_unit')
|
||||
options: getDictOptions('wy_time_unit'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
@@ -83,10 +101,10 @@ const modalSchema = [
|
||||
fieldName: 'rentalType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_zlfs')
|
||||
options: getDictOptions('wy_zlfs'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
formItemClass: 'col-span-2'
|
||||
formItemClass: 'col-span-2',
|
||||
},
|
||||
{
|
||||
label: '租赁方案',
|
||||
@@ -101,29 +119,34 @@ const modalSchema = [
|
||||
formItemClass: 'col-span-2',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const res = await rentalPlanList({pageNum: 1, pageSize: 1000, state: 1});
|
||||
const res = await rentalPlanList({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
state: 1,
|
||||
});
|
||||
planList.value = res.rows || [];
|
||||
return planList.value.map(item => ({
|
||||
return planList.value.map((item) => ({
|
||||
label: item.planName,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
onChange: async (value: string) => {
|
||||
await getPlanProducts(value)
|
||||
await getPlanProducts(value);
|
||||
},
|
||||
showSearch: true,
|
||||
filterOption: (input: any, option: any) =>
|
||||
option.label.toLowerCase().includes(input.toLowerCase()),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '方案详情',
|
||||
fieldName: 'planInfo',
|
||||
component: 'Input',
|
||||
slots: {default: 'planInfo'},
|
||||
slots: { default: 'planInfo' },
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 2(套餐) 时显示
|
||||
show: (formValues: any) => formValues.rentalType === '2' && formValues.planId != null,
|
||||
show: (formValues: any) =>
|
||||
formValues.rentalType === '2' && formValues.planId != null,
|
||||
triggerFields: ['planId', 'rentalType'],
|
||||
},
|
||||
formItemClass: 'col-span-2',
|
||||
@@ -141,36 +164,51 @@ const modalSchema = [
|
||||
formItemClass: 'col-span-2',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const res = await plantsProductList({pageNum: 1, pageSize: 1000, inventory: 0});
|
||||
const res = await plantsProductList({
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
inventory: 0,
|
||||
});
|
||||
plantsList.value = res.rows || [];
|
||||
return plantsList.value.map(item => ({
|
||||
label: item.plantName + '-' + item.plantCode + '\xa0\xa0租金(元):' + item.rent + '\xa0\xa0库存数量:' + item.inventory,
|
||||
return plantsList.value.map((item) => ({
|
||||
label:
|
||||
item.plantName +
|
||||
'-' +
|
||||
item.plantCode +
|
||||
'\xa0\xa0租金(元):' +
|
||||
item.rent +
|
||||
'\xa0\xa0库存数量:' +
|
||||
item.inventory,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
onChange: async (value: string) => {
|
||||
plantInfo.value = plantsList.value.find(item => item.id === value);
|
||||
plantInfo.value = plantsList.value.find((item) => item.id === value);
|
||||
if (plantInfo.value) {
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
min: 1,
|
||||
max: plantInfo.value?.inventory,
|
||||
precision: 0,
|
||||
onChange: async () => {
|
||||
const formValues = await formApi.getValues();
|
||||
if (formValues.productNum && plantInfo.value?.rent) {
|
||||
singleAmount.value = (plantInfo.value.rent * formValues.productNum).toFixed(2);
|
||||
}
|
||||
},
|
||||
}),
|
||||
fieldName: 'productNum',
|
||||
}])
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
min: 1,
|
||||
max: plantInfo.value?.inventory,
|
||||
precision: 0,
|
||||
onChange: async () => {
|
||||
const formValues = await formApi.getValues();
|
||||
if (formValues.productNum && plantInfo.value?.rent) {
|
||||
singleAmount.value = (
|
||||
plantInfo.value.rent * formValues.productNum
|
||||
).toFixed(2);
|
||||
}
|
||||
},
|
||||
}),
|
||||
fieldName: 'productNum',
|
||||
},
|
||||
]);
|
||||
}
|
||||
},
|
||||
showSearch: true,
|
||||
filterOption: (input: any, option: any) =>
|
||||
option.label.toLowerCase().includes(input.toLowerCase()),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '租赁数量',
|
||||
@@ -198,14 +236,17 @@ const modalSchema = [
|
||||
label: '总金额(元)',
|
||||
fieldName: 'totalAmount',
|
||||
component: 'InputNumber',
|
||||
slots: {default: 'totalAmount'},
|
||||
slots: { default: 'totalAmount' },
|
||||
dependencies: {
|
||||
// 仅当 租赁方式 为 1(单点) 时显示
|
||||
show: (formValues: any) => formValues.productNum && formValues.productId && formValues.rentalType === '1',
|
||||
show: (formValues: any) =>
|
||||
formValues.productNum &&
|
||||
formValues.productId &&
|
||||
formValues.rentalType === '1',
|
||||
triggerFields: ['productNum', 'rentalType'],
|
||||
disabled: true,
|
||||
},
|
||||
labelWidth: 110
|
||||
labelWidth: 110,
|
||||
},
|
||||
{
|
||||
label: '是否续租',
|
||||
@@ -216,7 +257,7 @@ const modalSchema = [
|
||||
optionType: 'button',
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
rules: 'required'
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '合同状态',
|
||||
@@ -225,17 +266,18 @@ const modalSchema = [
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_htzt'),
|
||||
},
|
||||
rules: 'selectRequired'
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '合同编号',
|
||||
fieldName: 'contractCode',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: (formValues: any) => formValues.contractStatus != null && formValues.contractStatus != 1,
|
||||
show: (formValues: any) =>
|
||||
formValues.contractStatus != null && formValues.contractStatus != 1,
|
||||
triggerFields: ['contractStatus'],
|
||||
},
|
||||
rules: 'required'
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '签署时间',
|
||||
@@ -247,10 +289,11 @@ const modalSchema = [
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
},
|
||||
dependencies: {
|
||||
show: (formValues: any) => formValues.contractStatus != null && formValues.contractStatus != 1,
|
||||
show: (formValues: any) =>
|
||||
formValues.contractStatus != null && formValues.contractStatus != 1,
|
||||
triggerFields: ['contractStatus'],
|
||||
},
|
||||
rules: 'required'
|
||||
rules: 'required',
|
||||
},
|
||||
];
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
@@ -262,15 +305,14 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
},
|
||||
},
|
||||
schema: modalSchema,
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
@@ -289,7 +331,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
if (isUpdate.value && id) {
|
||||
const record = await rentalOrderInfo(id);
|
||||
@@ -300,11 +342,26 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
async function getUnitList() {
|
||||
const queryParam = {
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
};
|
||||
const res = await resident_unitList(queryParam);
|
||||
const data: { value: number; label: string }[] = [];
|
||||
|
||||
res.rows.forEach((r: any) => {
|
||||
data.push({
|
||||
value: r.id,
|
||||
label: r.name,
|
||||
});
|
||||
});
|
||||
return data;
|
||||
}
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const {valid} = await formApi.validate();
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
@@ -312,18 +369,18 @@ async function handleConfirm() {
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
if (data.rentalType == 1) {
|
||||
data.planId = undefined;
|
||||
data.totalAmount = singleAmount.value
|
||||
data.totalAmount = singleAmount.value;
|
||||
} else {
|
||||
data.productId = undefined;
|
||||
data.productNum = undefined;
|
||||
data.productList = planProducts.value
|
||||
data.totalAmount = totalAmount.value
|
||||
data.productList = planProducts.value;
|
||||
data.totalAmount = totalAmount.value;
|
||||
}
|
||||
if (data.rentalTime) {
|
||||
data.startTime = data.rentalTime[0];
|
||||
data.endTime = data.rentalTime[1];
|
||||
}
|
||||
data.paymentStatus = 0
|
||||
data.paymentStatus = 0;
|
||||
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@@ -337,22 +394,22 @@ async function handleConfirm() {
|
||||
|
||||
//获取有库存的绿植
|
||||
async function getPlanProducts(id: string) {
|
||||
const res = await rentalPlanInfo(id)
|
||||
planProducts.value = res.productList.map(item => ({
|
||||
id:item.productId,
|
||||
const res = await rentalPlanInfo(id);
|
||||
planProducts.value = res.productList.map((item) => ({
|
||||
id: item.productId,
|
||||
plantName: item.product?.plantName,
|
||||
rent: item.product?.rent,
|
||||
inventory: item.productNum,
|
||||
}))
|
||||
totalAmount.value = planProducts.value?.reduce((sum, item: any) => sum + (item.rent * item.inventory), 0).toFixed(2)
|
||||
|
||||
}));
|
||||
totalAmount.value = planProducts.value
|
||||
?.reduce((sum, item: any) => sum + item.rent * item.inventory, 0)
|
||||
.toFixed(2);
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -360,8 +417,13 @@ async function handleClosed() {
|
||||
<BasicForm>
|
||||
<template #planInfo="slotProps">
|
||||
<div v-if="planProducts.length" style="width: 100%" v-bind="slotProps">
|
||||
<Table :dataSource="planProducts" :columns="planInfoColumns" :pagination="false"
|
||||
bordered size="small">
|
||||
<Table
|
||||
:dataSource="planProducts"
|
||||
:columns="planInfoColumns"
|
||||
:pagination="false"
|
||||
bordered
|
||||
size="small"
|
||||
>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.field === 'id'">
|
||||
{{ index + 1 }}
|
||||
@@ -371,7 +433,7 @@ async function handleClosed() {
|
||||
</template>
|
||||
</template>
|
||||
<template #footer>
|
||||
<div style="text-align: right;margin-right: 20px">
|
||||
<div style="text-align: right; margin-right: 20px">
|
||||
<b>总金额(元):</b>
|
||||
{{ totalAmount }}
|
||||
</div>
|
||||
@@ -385,4 +447,3 @@ async function handleClosed() {
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
|
@@ -0,0 +1,141 @@
|
||||
<script setup lang="ts">
|
||||
import type { PropType } from 'vue';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { SyncOutlined } from '@ant-design/icons-vue';
|
||||
import { Empty, InputSearch, Skeleton, Tree } from 'ant-design-vue';
|
||||
import {communityTree} from "#/api/property/community";
|
||||
import type {CommunityVO} from "#/api/property/community/model";
|
||||
|
||||
defineOptions({ inheritAttrs: false });
|
||||
|
||||
withDefaults(defineProps<{ showSearch?: boolean }>(), { showSearch: true });
|
||||
|
||||
const emit = defineEmits<{
|
||||
/**
|
||||
* 点击刷新按钮的事件
|
||||
*/
|
||||
reload: [];
|
||||
/**
|
||||
* 点击节点的事件
|
||||
*/
|
||||
select: [];
|
||||
}>();
|
||||
|
||||
const selectRoomId = defineModel('selectRoomId', {
|
||||
type: Array as PropType<string[]>,
|
||||
default: () => [],
|
||||
});
|
||||
const checkedRoomId = defineModel('checkedRoomId', {
|
||||
type: Array as PropType<string[]>,
|
||||
default: () => [],
|
||||
});
|
||||
const searchValue = defineModel('searchValue', {
|
||||
type: String,
|
||||
default: '',
|
||||
});
|
||||
const checkable = defineModel('checkable', {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
});
|
||||
|
||||
/** 房间数据源 */
|
||||
type RoomTreeArray = CommunityVO[];
|
||||
const roomTreeArray = ref<RoomTreeArray>([]);
|
||||
/** 骨架屏加载 */
|
||||
const showTreeSkeleton = ref<boolean>(true);
|
||||
|
||||
async function loadTree() {
|
||||
showTreeSkeleton.value = true;
|
||||
searchValue.value = '';
|
||||
selectRoomId.value = [];
|
||||
checkedRoomId.value = [];
|
||||
roomTreeArray.value = await communityTree(4);
|
||||
showTreeSkeleton.value = false;
|
||||
}
|
||||
|
||||
async function handleReload() {
|
||||
await loadTree();
|
||||
emit('reload');
|
||||
}
|
||||
|
||||
function selectStyle(id:string){
|
||||
if(selectRoomId.value.includes(id)){
|
||||
return {
|
||||
backgroundColor: '#e6f4ff',
|
||||
padding:'0 10px',
|
||||
borderRadius:'4px',
|
||||
fontWeight:'bold'
|
||||
}
|
||||
}
|
||||
return {}
|
||||
}
|
||||
|
||||
onMounted(loadTree);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="$attrs.class">
|
||||
<Skeleton
|
||||
:loading="showTreeSkeleton"
|
||||
:paragraph="{ rows: 8 }"
|
||||
active
|
||||
class="p-[8px]"
|
||||
>
|
||||
<div
|
||||
class="bg-background flex h-full flex-col overflow-y-auto rounded-lg"
|
||||
>
|
||||
<!-- 固定在顶部 必须加上bg-background背景色 否则会产生'穿透'效果 -->
|
||||
<div
|
||||
v-if="showSearch"
|
||||
class="bg-background z-100 sticky left-0 top-0 p-[8px]"
|
||||
>
|
||||
<InputSearch
|
||||
v-model:value="searchValue"
|
||||
:placeholder="$t('pages.common.search')"
|
||||
size="small"
|
||||
>
|
||||
<template #enterButton>
|
||||
<a-button @click="handleReload">
|
||||
<SyncOutlined class="text-primary" />
|
||||
</a-button>
|
||||
</template>
|
||||
</InputSearch>
|
||||
</div>
|
||||
<div class="h-full overflow-x-hidden px-[8px]">
|
||||
<Tree
|
||||
:checkable="checkable"
|
||||
:selectable="false"
|
||||
v-bind="$attrs"
|
||||
v-if="roomTreeArray.length > 0"
|
||||
v-model:checked-keys="checkedRoomId"
|
||||
:class="$attrs.class"
|
||||
:field-names="{ title: 'label', key: 'id' }"
|
||||
:tree-data="roomTreeArray"
|
||||
:virtual="false"
|
||||
default-expand-all
|
||||
>
|
||||
<template #title="{ label,id }">
|
||||
<span v-if="label.indexOf(searchValue) > -1" :style="selectStyle(id)">
|
||||
{{ label.substring(0, label.indexOf(searchValue)) }}
|
||||
<span style="color: #f50">{{ searchValue }}</span>
|
||||
{{
|
||||
label.substring(
|
||||
label.indexOf(searchValue) + searchValue.length,
|
||||
)
|
||||
}}
|
||||
</span>
|
||||
<span v-else :style="selectStyle(id)">{{ label}}</span>
|
||||
</template>
|
||||
</Tree>
|
||||
<!-- 仅本人数据权限 可以考虑直接不显示 -->
|
||||
<div v-else class="mt-5">
|
||||
<Empty
|
||||
:image="Empty.PRESENTED_IMAGE_SIMPLE"
|
||||
description="无部门数据"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Skeleton>
|
||||
</div>
|
||||
</template>
|
@@ -47,12 +47,12 @@ export const columns: VxeGridProps['columns'] = [
|
||||
return row.id
|
||||
}
|
||||
},
|
||||
width: 100
|
||||
width: 180
|
||||
},
|
||||
{
|
||||
title: '单位名称',
|
||||
field: 'name',
|
||||
width: 100
|
||||
minWidth: 180
|
||||
},
|
||||
{
|
||||
title: '单位类型',
|
||||
@@ -72,7 +72,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '联系电话',
|
||||
field: 'phone',
|
||||
width: 100
|
||||
width: 120
|
||||
},
|
||||
// {
|
||||
// title: '入驻位置',
|
||||
@@ -82,8 +82,18 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '入驻时间',
|
||||
field: 'time',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '入驻房间数',
|
||||
field: 'roomNumber',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '入驻面积(㎡)',
|
||||
field: 'area',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
@@ -98,19 +108,22 @@ export const columns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
width: 100,
|
||||
width: 180,
|
||||
slots: { default: ({ row }) => {
|
||||
return row.remark || '-'
|
||||
}, },
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
width: 100,
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
slots: { default: 'action' },
|
||||
title: '操作',
|
||||
minWidth: 180,
|
||||
width: 180,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -155,13 +168,13 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
z.number().int().min(1000000000).max(19999999999, { message: '手机号格式错误' })
|
||||
]).transform(val => val.toString()),
|
||||
},
|
||||
{
|
||||
label: '入驻位置',
|
||||
fieldName: 'locations',
|
||||
component: 'TreeSelect',
|
||||
rules: 'selectRequired',
|
||||
formItemClass: 'col-span-2'
|
||||
},
|
||||
// {
|
||||
// label: '入驻位置',
|
||||
// fieldName: 'locations',
|
||||
// component: 'TreeSelect',
|
||||
// rules: 'selectRequired',
|
||||
// formItemClass: 'col-span-2'
|
||||
// },
|
||||
{
|
||||
label: '入驻时间',
|
||||
fieldName: 'time',
|
||||
@@ -173,11 +186,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '',
|
||||
fieldName: 'Placeholder',
|
||||
component: ''
|
||||
},
|
||||
{
|
||||
label: '授权期限',
|
||||
fieldName: 'authTime',
|
||||
@@ -188,6 +196,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
formItemClass: 'col-span-1'
|
||||
},
|
||||
{
|
||||
label: '通行权限组',
|
||||
|
@@ -12,6 +12,7 @@ import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
import {resident_unitInfo, authGroupList} from '#/api/property/resident/unit';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import RoomTree from "./components/room-tree.vue";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
@@ -39,55 +40,68 @@ async function handleOpenChange(open: boolean) {
|
||||
authGroupName.value = authGroup.find(item => item.id === authGroupId)?.name;
|
||||
// 赋值
|
||||
unitDetail.value = response;
|
||||
if(response.location){
|
||||
selectRoomId.value=response.location.split(',');
|
||||
}
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
const selectRoomId = ref<string[]>([]);
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="入驻单位信息" class="w-[70%]">
|
||||
<Descriptions v-if="unitDetail" size="small" :column="2" bordered :labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="单位编号">
|
||||
{{ unitDetail.id }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单位名称">
|
||||
{{ unitDetail.name }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单位类型" v-if="unitDetail.type!=null">
|
||||
<component
|
||||
:is="renderDict(unitDetail.type,'wy_qylx')"
|
||||
<div class="flex gap-[8px]">
|
||||
<div class="w-[260px]">
|
||||
<RoomTree
|
||||
class="max-h-[calc(100vh-38vh)]"
|
||||
v-model:select-room-id="selectRoomId"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="联系人">
|
||||
{{ unitDetail.contactPerson +'-'+unitDetail.phone}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻位置" :span="2">
|
||||
{{ unitDetail.locationDetail }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻面积(㎡)" :span="2">
|
||||
{{ unitDetail.area }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻时间">
|
||||
{{ unitDetail.time }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="员工数量">
|
||||
{{ unitDetail.number }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="创建时间">
|
||||
{{ unitDetail.createTime ?? '-' }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="状态" v-if="unitDetail.state!=null">
|
||||
<component
|
||||
:is="renderDict(unitDetail.state,'wy_state')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="通行权限组">
|
||||
{{ authGroupName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="备注">
|
||||
{{ unitDetail.remark ?? '-' }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</div>
|
||||
<Descriptions class="flex-1" v-if="unitDetail" size="middle" :column="1" bordered :labelStyle="{width:'120px'}">
|
||||
<DescriptionsItem label="单位编号">
|
||||
{{ unitDetail.id }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单位名称">
|
||||
{{ unitDetail.name }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="单位类型" v-if="unitDetail.type!=null">
|
||||
<component
|
||||
:is="renderDict(unitDetail.type,'wy_qylx')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="联系人">
|
||||
{{ unitDetail.contactPerson +'-'+unitDetail.phone}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻房间数" >
|
||||
{{ unitDetail.roomNumber }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻面积">
|
||||
<span v-if="unitDetail.area">{{ unitDetail.area }}(㎡)</span>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="入驻时间">
|
||||
{{ unitDetail.time }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="员工数量">
|
||||
{{ unitDetail.number }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="创建时间">
|
||||
{{ unitDetail.createTime ?? '-' }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="状态" v-if="unitDetail.state!=null">
|
||||
<component
|
||||
:is="renderDict(unitDetail.state,'wy_state')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="通行权限组">
|
||||
{{ authGroupName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="备注">
|
||||
{{ unitDetail.remark ?? '-' }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -1,20 +1,21 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import {computed, ref} from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep, handleNode } from '@vben/utils';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {$t} from '@vben/locales';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {
|
||||
resident_unitAdd,
|
||||
resident_unitInfo,
|
||||
resident_unitUpdate,
|
||||
} from '#/api/property/resident/unit';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import { communityTree } from '#/api/property/community';
|
||||
import {modalSchema} from './data';
|
||||
import RoomTree from "./components/room-tree.vue";
|
||||
import {message} from "ant-design-vue";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -26,7 +27,7 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-1',
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 100,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
@@ -39,7 +40,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
@@ -59,16 +60,16 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
await initLocationOptions();
|
||||
if (isUpdate.value && id) {
|
||||
const record = await resident_unitInfo(id);
|
||||
let roomIds=record.location.split(',')
|
||||
await formApi.setValues({...record,
|
||||
authTime:[record.authBegDate,record.authEndDate],
|
||||
locations:roomIds
|
||||
let roomIds = record.location.split(',')
|
||||
await formApi.setValues({
|
||||
...record,
|
||||
authTime: [record.authBegDate, record.authEndDate],
|
||||
});
|
||||
checkedRoomId.value = roomIds
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
@@ -79,7 +80,11 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
const {valid} = await formApi.validate();
|
||||
if (!checkedRoomId.value.length) {
|
||||
message.error('请选择入驻位置');
|
||||
return;
|
||||
}
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
@@ -88,7 +93,7 @@ async function handleConfirm() {
|
||||
|
||||
data.authBegDate = data.authTime[0];
|
||||
data.authEndDate = data.authTime[1];
|
||||
data.location=data.locations.join(',')
|
||||
data.location = checkedRoomId.value.join(',')
|
||||
await (isUpdate.value ? resident_unitUpdate(data) : resident_unitAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@@ -99,51 +104,26 @@ async function handleConfirm() {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 入驻位置数据
|
||||
*/
|
||||
async function initLocationOptions() {
|
||||
const locationList = await communityTree(4);
|
||||
const splitStr = '/';
|
||||
handleNode(locationList, 'label', splitStr, function (node: any) {
|
||||
if (node.level != 4) {
|
||||
node.disabled = true;
|
||||
}
|
||||
});
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
class: 'w-full',
|
||||
fieldNames: {
|
||||
key: 'id',
|
||||
label: 'label',
|
||||
value: 'code',
|
||||
children: 'children',
|
||||
},
|
||||
placeholder: '请选择入驻位置',
|
||||
showSearch: true,
|
||||
treeData: locationList,
|
||||
treeDefaultExpandAll: true,
|
||||
treeLine: { showLeafIcon: false },
|
||||
// 筛选的字段
|
||||
treeNodeFilterProp: 'label',
|
||||
// 选中后显示在输入框的值
|
||||
treeNodeLabelProp: 'fullName',
|
||||
multiple:true
|
||||
}),
|
||||
fieldName: 'locations',
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
const checkedRoomId = ref<string[]>([]);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm> </BasicForm>
|
||||
<div class="flex gap-[8px]">
|
||||
<div class="w-[260px]">
|
||||
<RoomTree
|
||||
:checkable="true"
|
||||
class="max-h-[calc(100vh-45vh)]"
|
||||
v-model:checked-room-id="checkedRoomId"
|
||||
/>
|
||||
</div>
|
||||
<BasicForm class="flex-1"></BasicForm>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -13,7 +13,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
fieldName: 'rosterType',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('roster_type'),
|
||||
options: getDictOptions(DictEnum.ROSTER_TYPE, true),
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -25,7 +25,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
getPopupContainer,
|
||||
options: getDictOptions(DictEnum.SYS_USER_SEX),
|
||||
options: getDictOptions(DictEnum.SYS_USER_SEX, true),
|
||||
},
|
||||
fieldName: 'sex',
|
||||
label: '性别',
|
||||
@@ -41,7 +41,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'libCode',
|
||||
},*/
|
||||
{
|
||||
title: '人像名称',
|
||||
title: '人员名称',
|
||||
field: 'imgName',
|
||||
},
|
||||
{
|
||||
@@ -49,7 +49,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'sex',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.sex, 'sys_user_sex');
|
||||
return renderDict(row.sex, DictEnum.SYS_USER_SEX);
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -66,7 +66,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'certificateType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.certificateType, 'sys_certificate_type');
|
||||
return renderDict(row.certificateType, DictEnum.SYS_CERTIFICATE_TYPE);
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -83,7 +83,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'rosterType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
return renderDict(row.rosterType, 'roster_type');
|
||||
return renderDict(row.rosterType, DictEnum.ROSTER_TYPE);
|
||||
},
|
||||
},
|
||||
width: 100,
|
||||
@@ -97,11 +97,6 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
];
|
||||
|
||||
const test = getDictOptions('roster_type');
|
||||
test.forEach((item) => {
|
||||
console.log('item', item);
|
||||
});
|
||||
|
||||
export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '主键',
|
||||
@@ -118,11 +113,12 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Select',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
options: getDictOptions('roster_type'),
|
||||
getPopupContainer,
|
||||
options: getDictOptions(DictEnum.ROSTER_TYPE, true),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '人像名称',
|
||||
label: '人员名称',
|
||||
fieldName: 'imgName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
@@ -133,7 +129,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
getPopupContainer,
|
||||
options: getDictOptions(DictEnum.SYS_USER_SEX),
|
||||
options: getDictOptions(DictEnum.SYS_USER_SEX, true),
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -152,7 +148,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
getPopupContainer,
|
||||
options: getDictOptions(DictEnum.SYS_CERTIFICATE_TYPE),
|
||||
options: getDictOptions(DictEnum.SYS_CERTIFICATE_TYPE, true),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@@ -48,7 +48,7 @@ const gridOptions: VxeGridProps = {
|
||||
return await alarmEventsList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
states: [40,50],
|
||||
states: [40, 50],
|
||||
...formValues,
|
||||
});
|
||||
},
|
||||
@@ -112,7 +112,7 @@ function handleMultiDelete() {
|
||||
</script>
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable class="flex-1 overflow-hidden" table-title="视频预警处理">
|
||||
<BasicTable class="flex-1 overflow-hidden">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
|
@@ -112,7 +112,7 @@ function handleMultiDelete() {
|
||||
</script>
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable class="flex-1 overflow-hidden" table-title="视频预警处理">
|
||||
<BasicTable class="flex-1 overflow-hidden">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
|
@@ -112,7 +112,7 @@ function handleMultiDelete() {
|
||||
</script>
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable class="flex-1 overflow-hidden" table-title="视频预警处理">
|
||||
<BasicTable class="flex-1 overflow-hidden">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
|
@@ -11,6 +11,7 @@ export const DictEnum = {
|
||||
SYS_USER_SEX: 'sys_user_sex', // 性别
|
||||
SYS_YES_NO: 'sys_yes_no', // 是否
|
||||
SYS_CERTIFICATE_TYPE: 'sys_certificate_type', // 证件类型
|
||||
ROSTER_TYPE:"roster_type",
|
||||
WF_BUSINESS_STATUS: 'wf_business_status', // 业务状态
|
||||
WF_FORM_TYPE: 'wf_form_type', // 表单类型
|
||||
WF_TASK_STATUS: 'wf_task_status', // 任务状态
|
||||
|
Reference in New Issue
Block a user