fix
This commit is contained in:
parent
9022d9dc90
commit
b1e639e2a8
@ -1,4 +1,3 @@
|
||||
import { rulesHelper } from '@/common';
|
||||
import {
|
||||
ProColumns,
|
||||
ProFormCascader,
|
||||
@ -46,9 +45,9 @@ export const Address = {
|
||||
return accumulator;
|
||||
}, {} as Record<string, string>);
|
||||
},
|
||||
formItemProps: {
|
||||
...(required ? rulesHelper.array : {}),
|
||||
},
|
||||
// formItemProps: {
|
||||
// ...(required ? rulesHelper.array : {}),
|
||||
// },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
changeOnSelect: true,
|
||||
|
||||
@ -110,7 +110,42 @@ export const Selects = {
|
||||
},
|
||||
};
|
||||
},
|
||||
// 单元下拉框
|
||||
GridUnits(props?: PropsType): ReturnType {
|
||||
const {
|
||||
title = '单元',
|
||||
key = 'asset_buildings_id',
|
||||
required = false,
|
||||
hideInTable = true,
|
||||
...rest
|
||||
} = props ?? {};
|
||||
|
||||
return {
|
||||
title: title,
|
||||
key: key,
|
||||
valueType: 'select',
|
||||
hideInTable: hideInTable,
|
||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||
request: async (params) =>
|
||||
(
|
||||
await Apis.Asset.AssetUnits.GridSelect({
|
||||
keywords: params?.KeyWords,
|
||||
asset_projects_id: params?.asset_projects_id,
|
||||
asset_buildings_id: params?.asset_buildings_id,
|
||||
...params,
|
||||
})
|
||||
).data,
|
||||
...rest,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
},
|
||||
...rest?.fieldProps,
|
||||
},
|
||||
};
|
||||
},
|
||||
//网格标识
|
||||
GetGridMark(props?: PropsType): ReturnType {
|
||||
const {
|
||||
@ -194,7 +229,7 @@ export const Selects = {
|
||||
return {
|
||||
title: title,
|
||||
key: key,
|
||||
valueType: 'treeSelect',
|
||||
valueType: 'cascader',
|
||||
hideInTable: hideInTable,
|
||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||
request: async (params) =>
|
||||
@ -208,6 +243,7 @@ export const Selects = {
|
||||
...rest,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
changeOnSelect: true,
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
value: 'id',
|
||||
@ -319,6 +355,39 @@ export const Selects = {
|
||||
},
|
||||
};
|
||||
},
|
||||
ProjectAccounts(props?: PropsType): ReturnType {
|
||||
const {
|
||||
title = '收款账户',
|
||||
key = 'company_receipt_accounts_id',
|
||||
required = false,
|
||||
hideInTable = true,
|
||||
...rest
|
||||
} = props ?? {};
|
||||
|
||||
return {
|
||||
title: title,
|
||||
key: key,
|
||||
valueType: 'select',
|
||||
hideInTable: hideInTable,
|
||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||
request: async (params) =>
|
||||
(
|
||||
await Apis.Company.CompanyProjectReceiptAccounts.Select({
|
||||
keywords: params?.KeyWords,
|
||||
...params,
|
||||
})
|
||||
).data,
|
||||
...rest,
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
},
|
||||
...rest?.fieldProps,
|
||||
},
|
||||
};
|
||||
},
|
||||
//房屋
|
||||
AssetHouses(props?: PropsType): ReturnType {
|
||||
const {
|
||||
|
||||
37
src/gen/ApiTypes.d.ts
vendored
37
src/gen/ApiTypes.d.ts
vendored
@ -5,9 +5,30 @@ declare namespace ApiTypes {
|
||||
"asset_houses_id"?: number; // 资产房屋ID
|
||||
"status"?: string; // 状态,[enum:HouseOccupantsStatusEnum]
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"name": string; // 客户姓名
|
||||
"phone": string; // 客户手机号
|
||||
"reserve_phone"?: string; // 备用电话
|
||||
"card_type"?: string; // 证件类型,[enum:HouseOccupantsCardTypeEnum]
|
||||
"id_card"?: string; // 客户身份证号
|
||||
"card_front_image"?: string[]; // 身份证正面图片
|
||||
"card_back_image"?: string[]; // 身份证反面图片
|
||||
"address"?: string; // 客户地址
|
||||
"ownership_info"?: string[]; // 产权信息
|
||||
"house_relation"?: string; // 房客关系,[enum:HouseOccupantsHouseRelationEnum]
|
||||
"relation_with_owner"?: string; // 与产权人关系,[enum:HouseOccupantsRelationWithOwnerEnum]
|
||||
"is_live_in"?: number; // 是否在居住中
|
||||
"move_in_date"?: Date; // 入住时间
|
||||
"status"?: string; // 状态,[enum:HouseOccupantsStatusEnum]
|
||||
"unbound_time"?: Date; // 解绑时间
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
}
|
||||
namespace HouseRegisters {
|
||||
type List = {
|
||||
@ -28,13 +49,18 @@ declare namespace ApiTypes {
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"type": string; // 类型,[enum:HouseRegistersTypeEnum]
|
||||
"status"?: string; // 状态,[enum:HouseRegistersStatusEnum]
|
||||
"house_status"?: string; // 房屋状态,[enum:HouseRegistersHouseStatusEnum]
|
||||
"usage_plan"?: string; // 使用计划,[enum:HouseRegistersUsagePlanEnum]
|
||||
"customer_type"?: string; // 客户类型,[enum:HouseRegistersCustomerTypeEnum]
|
||||
"customer_info"?: string[]; // 客户信息
|
||||
"ownership_info"?: string[]; // 产权信息
|
||||
};
|
||||
type MoveOut = {
|
||||
"house_occupants_id": number; // 房客id
|
||||
};
|
||||
type RemoveOwner = {
|
||||
"house_occupants_id": number; // 房客id
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
@ -255,6 +281,11 @@ declare namespace ApiTypes {
|
||||
"asset_buildings_id"?: number; // 所属楼栋id,[ref:asset_buildings]
|
||||
"keywords"?: string; // 关键词
|
||||
};
|
||||
type GridSelect = {
|
||||
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||
"asset_buildings_id"?: number; // 所属楼栋id,[ref:asset_buildings]
|
||||
"keywords"?: string; // 关键词
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Bill {
|
||||
@ -513,6 +544,10 @@ declare namespace ApiTypes {
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Select = {
|
||||
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||
"projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||
};
|
||||
}
|
||||
namespace CompanyReceiptAccounts {
|
||||
type List = {
|
||||
|
||||
@ -7,9 +7,15 @@ export const Apis = {
|
||||
List(data?: ApiTypes.Archive.HouseOccupants.List): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_occupants/list', { data });
|
||||
},
|
||||
Update(data: ApiTypes.Archive.HouseOccupants.Update): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_occupants/update', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Archive.HouseOccupants.Show): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_occupants/show', { data });
|
||||
},
|
||||
Delete(data: ApiTypes.Archive.HouseOccupants.Delete): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_occupants/delete', { data });
|
||||
},
|
||||
},
|
||||
HouseRegisters: {
|
||||
List(data?: ApiTypes.Archive.HouseRegisters.List): Promise<MyResponseType> {
|
||||
@ -21,6 +27,12 @@ export const Apis = {
|
||||
Update(data: ApiTypes.Archive.HouseRegisters.Update): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/update', { data });
|
||||
},
|
||||
MoveOut(data: ApiTypes.Archive.HouseRegisters.MoveOut): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/move_out', { data });
|
||||
},
|
||||
RemoveOwner(data: ApiTypes.Archive.HouseRegisters.RemoveOwner): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/remove_owner', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Archive.HouseRegisters.Show): Promise<MyResponseType> {
|
||||
return request('admin/archive/house_registers/show', { data });
|
||||
},
|
||||
@ -127,6 +139,9 @@ export const Apis = {
|
||||
Select(data?: ApiTypes.Asset.AssetUnits.Select): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_units/select', { data });
|
||||
},
|
||||
GridSelect(data?: ApiTypes.Asset.AssetUnits.GridSelect): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_units/grid_select', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
Bill: {
|
||||
@ -285,6 +300,9 @@ export const Apis = {
|
||||
Delete(data: ApiTypes.Company.CompanyProjectReceiptAccounts.Delete): Promise<MyResponseType> {
|
||||
return request('admin/company/company_project_receipt_accounts/delete', { data });
|
||||
},
|
||||
Select(data?: ApiTypes.Company.CompanyProjectReceiptAccounts.Select): Promise<MyResponseType> {
|
||||
return request('admin/company/company_project_receipt_accounts/select', { data });
|
||||
},
|
||||
},
|
||||
CompanyReceiptAccounts: {
|
||||
List(data?: ApiTypes.Company.CompanyReceiptAccounts.List): Promise<MyResponseType> {
|
||||
|
||||
@ -96,7 +96,7 @@ export const AssetUnitsBuildingTypeEnum= {
|
||||
|
||||
// 缓存类型
|
||||
export const CacheTypeEnum= {
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#50ae15","value":"MobilePhoneVerificationCode"},
|
||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#6c905c","value":"MobilePhoneVerificationCode"},
|
||||
};
|
||||
|
||||
// CompaniesMerchantTypeEnum
|
||||
@ -223,6 +223,13 @@ export const HouseRegistersHouseStatusEnum= {
|
||||
'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"},
|
||||
};
|
||||
|
||||
// 房屋登记身份类型
|
||||
export const HouseRegistersIdentityTypeEnum= {
|
||||
'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"},
|
||||
'Tenant': {"text":"租客","color":"#87d068","value":"Tenant"},
|
||||
'CoResident': {"text":"同住人(亲属)","color":"#108ee9","value":"CoResident"},
|
||||
};
|
||||
|
||||
// HouseRegistersStatusEnum
|
||||
export const HouseRegistersStatusEnum= {
|
||||
'Pending': {"text":"待审","color":"#faad14","value":"Pending"},
|
||||
|
||||
@ -79,7 +79,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
columns: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_relation',
|
||||
title: '住户类型',
|
||||
title: '房客关系',
|
||||
colProps: { span: 4 },
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
|
||||
@ -8,6 +8,7 @@ import {
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsCardTypeEnum,
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseRegistersCustomerTypeEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
@ -44,6 +45,20 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_relation',
|
||||
title: '住户类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseOccupantsHouseRelationEnum),
|
||||
);
|
||||
delete obj.Resident;
|
||||
delete obj.Tenant;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'customer_type',
|
||||
title: '客户类型',
|
||||
145
src/pages/archive/asset_house/modals/OccupantsUpdate.tsx
Normal file
145
src/pages/archive/asset_house/modals/OccupantsUpdate.tsx
Normal file
@ -0,0 +1,145 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
HouseOccupantsHouseRelationEnum,
|
||||
HouseOccupantsRelationWithOwnerEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseOccupants.Update>
|
||||
{...MyModalFormProps.props}
|
||||
form={form}
|
||||
title={`编辑`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="600px"
|
||||
trigger={<MyButtons.Default title={`编辑`} size="small" type="link" />}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseOccupants.Update({
|
||||
...values,
|
||||
id: props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('楼栋编辑成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'house_relation',
|
||||
title: '住户类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseOccupantsHouseRelationEnum),
|
||||
);
|
||||
delete obj.Owner;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
name: ['house_relation'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ house_relation }: any) => {
|
||||
return house_relation === 'Resident'
|
||||
? [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'relation_with_owner',
|
||||
title: '与产权人关系',
|
||||
colProps: { span: 18 },
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseOccupantsRelationWithOwnerEnum),
|
||||
);
|
||||
delete obj.Self;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
]
|
||||
: [
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'relation_with_owner',
|
||||
title: '与租客关系',
|
||||
colProps: { span: 18 },
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(
|
||||
JSON.stringify(HouseOccupantsRelationWithOwnerEnum),
|
||||
);
|
||||
delete obj.ContactPerson;
|
||||
return obj;
|
||||
},
|
||||
required: true,
|
||||
}),
|
||||
];
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone',
|
||||
colProps: { span: 12 },
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
{
|
||||
title: '是否入住',
|
||||
dataIndex: 'is_live_in',
|
||||
colProps: { span: 12 },
|
||||
valueType: 'switch',
|
||||
},
|
||||
{
|
||||
name: ['is_live_in'],
|
||||
valueType: 'dependency',
|
||||
columns: ({ is_live_in }: any) => {
|
||||
return is_live_in
|
||||
? [
|
||||
{
|
||||
title: '入住日期',
|
||||
dataIndex: 'move_in_date',
|
||||
valueType: 'date',
|
||||
colProps: { span: 12 },
|
||||
fieldProps: {
|
||||
style: { width: '100%' },
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
]
|
||||
: [,];
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -1,151 +0,0 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Address } from '@/components/Address';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetProjectsChargeEnum,
|
||||
AssetProjectsEntrustTypeEnum,
|
||||
AssetProjectsPropertyTypeEnum,
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
trigger={<MyButtons.Default title="编辑" type="primary" size="small" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
request={() =>
|
||||
Promise.resolve({
|
||||
...props.item,
|
||||
casacader: [
|
||||
props.item?.province_id || '',
|
||||
props.item?.city_id || '',
|
||||
props.item?.area_id || '',
|
||||
props.item?.street_id || '',
|
||||
],
|
||||
})
|
||||
}
|
||||
onFinish={async (values) =>
|
||||
Apis.Archive.HouseRegisters.Update({
|
||||
...values,
|
||||
id: props.item?.id ?? 0,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'name',
|
||||
title: '项目名称',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'alias_name',
|
||||
title: '项目别名',
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
Selects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
// {
|
||||
// key: 'code',
|
||||
// title: '项目编码',
|
||||
// colProps: { span: 8 },
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// },
|
||||
Address.Cascader({
|
||||
key: 'casacader',
|
||||
title: '选择地址',
|
||||
colProps: { span: 12 },
|
||||
keys: ['province', 'city', 'area', 'street'],
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'address',
|
||||
title: '详细地址',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'longitude',
|
||||
title: '经度',
|
||||
colProps: { span: 3 },
|
||||
},
|
||||
{
|
||||
key: 'latitude',
|
||||
title: '纬度',
|
||||
colProps: { span: 3 },
|
||||
},
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'property_type',
|
||||
title: '项目类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'status',
|
||||
title: '项目状态',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetProjectsStatusEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'entrust_type',
|
||||
title: '委托类型',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetProjectsEntrustTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'charge',
|
||||
title: '收费方式',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetProjectsChargeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
{
|
||||
key: 'takeover_date',
|
||||
title: '接管日期',
|
||||
valueType: 'date',
|
||||
fieldProps: {
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'closure_date',
|
||||
title: '封园日期',
|
||||
valueType: 'date',
|
||||
fieldProps: {
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -8,10 +8,11 @@ import {
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import Add from '../modals/Add';
|
||||
import AddOccupant from '../modals/AddOccupant';
|
||||
import AddOwner from '../modals/AddOwner';
|
||||
import MoveIn from '../modals/MoveIn';
|
||||
import MoveOut from '../modals/MoveOut';
|
||||
import OccupantsUpdate from '../modals/OccupantsUpdate';
|
||||
import Transfer from '../modals/Transfer';
|
||||
|
||||
export default function Index({ ...rest }) {
|
||||
@ -37,7 +38,7 @@ export default function Index({ ...rest }) {
|
||||
)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<Add
|
||||
<AddOwner
|
||||
key="add"
|
||||
item={rest.item}
|
||||
reload={action?.reload}
|
||||
@ -65,7 +66,7 @@ export default function Index({ ...rest }) {
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '与产权人关系',
|
||||
title: '关系说明',
|
||||
dataIndex: 'relation_with_owner',
|
||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||
search: false,
|
||||
@ -103,7 +104,9 @@ export default function Index({ ...rest }) {
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
{/* <GridCreateUpdate item={item} reload={action?.reload} /> */}
|
||||
{item?.house_relation !== 'Owner' && (
|
||||
<OccupantsUpdate item={item} reload={action?.reload} />
|
||||
)}
|
||||
{item?.is_live_in && (
|
||||
<MoveIn item={item} reload={action?.reload} title="入住" />
|
||||
)}
|
||||
|
||||
@ -36,8 +36,11 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||
]}
|
||||
// options={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
|
||||
{
|
||||
title: '配置id',
|
||||
dataIndex: 'id',
|
||||
// width: 360,
|
||||
},
|
||||
{
|
||||
title: '收款账号名称',
|
||||
dataIndex: ['receipt_account', 'company_name'],
|
||||
|
||||
@ -59,7 +59,7 @@ export default function Index({ ...rest }) {
|
||||
<GridMannger item={item} reload={action?.reload} />
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(() =>
|
||||
Apis.Grid.Grids.Delete({ id: item.id }).then(() =>
|
||||
action?.reload(),
|
||||
)
|
||||
}
|
||||
|
||||
@ -5,12 +5,7 @@ import {
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetProjectsChargeEnum,
|
||||
AssetProjectsEntrustTypeEnum,
|
||||
AssetProjectsPropertyTypeEnum,
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { AssetProjectsPropertyTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
@ -41,14 +36,9 @@ export default function Index({ title = '项目管理' }) {
|
||||
title: '项目名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '项目别名',
|
||||
dataIndex: 'alias_name',
|
||||
},
|
||||
// {
|
||||
// title: '项目编码',
|
||||
// dataIndex: 'code',
|
||||
// search: false,
|
||||
// title: '项目别名',
|
||||
// dataIndex: 'alias_name',
|
||||
// },
|
||||
{
|
||||
title: '地址',
|
||||
@ -59,25 +49,24 @@ export default function Index({ title = '项目管理' }) {
|
||||
},
|
||||
search: false,
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '项目状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: AssetProjectsStatusEnum,
|
||||
search: false,
|
||||
}),
|
||||
|
||||
MyColumns.EnumTag({
|
||||
title: '委托类型',
|
||||
dataIndex: 'entrust_type',
|
||||
valueEnum: AssetProjectsEntrustTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '收费方式',
|
||||
dataIndex: 'charge',
|
||||
valueEnum: AssetProjectsChargeEnum,
|
||||
search: false,
|
||||
}),
|
||||
// MyColumns.EnumTag({
|
||||
// title: '项目状态',
|
||||
// dataIndex: 'status',
|
||||
// valueEnum: AssetProjectsStatusEnum,
|
||||
// search: false,
|
||||
// }),
|
||||
// MyColumns.EnumTag({
|
||||
// title: '委托类型',
|
||||
// dataIndex: 'entrust_type',
|
||||
// valueEnum: AssetProjectsEntrustTypeEnum,
|
||||
// search: false,
|
||||
// }),
|
||||
// MyColumns.EnumTag({
|
||||
// title: '收费方式',
|
||||
// dataIndex: 'charge',
|
||||
// valueEnum: AssetProjectsChargeEnum,
|
||||
// search: false,
|
||||
// }),
|
||||
MyColumns.SoftDelete({
|
||||
title: '启/禁用',
|
||||
onRestore: Apis.Asset.AssetProjects.Restore,
|
||||
|
||||
@ -14,17 +14,18 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
const [selectedProjectsIds, setSelectedProjectsIds] = useState<any>([]);
|
||||
const onShowContactPhone = () => {
|
||||
Apis.Company.CompanyProjectReceiptAccounts.Store({
|
||||
companies_id: props?.item?.id ?? 0,
|
||||
companies_id: props?.item?.companies_id ?? 0,
|
||||
projects_id: props?.item?.id,
|
||||
receipt_accounts_id: selectedProjectsIds[0],
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('添加成功!');
|
||||
message.success('收款账号添加成功!');
|
||||
// todo 关闭页面
|
||||
})
|
||||
.catch(() => false);
|
||||
};
|
||||
|
||||
console.log(props?.item, '0000');
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
@ -44,6 +45,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
||||
{
|
||||
...params,
|
||||
companies_id: props?.item?.companies_id,
|
||||
projects_id: props?.item?.id,
|
||||
},
|
||||
sort,
|
||||
Apis.Company.CompanyReceiptAccounts.List,
|
||||
|
||||
@ -35,7 +35,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
message.success('网格创建成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
@ -105,7 +105,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
},
|
||||
},
|
||||
}),
|
||||
Selects?.AssetUnits({
|
||||
Selects?.GridUnits({
|
||||
key: 'asset_units_id',
|
||||
title: '选择单元',
|
||||
params: {
|
||||
|
||||
@ -13,7 +13,6 @@ export default function Create(
|
||||
props: { buttonProps?: ButtonProps } & MyBetaModalFormProps,
|
||||
) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Grid.Grids.AddManager>
|
||||
{...MyModalFormProps.props}
|
||||
@ -27,13 +26,10 @@ export default function Create(
|
||||
if (open && props.item) {
|
||||
// 获取详情数据
|
||||
Apis.Grid.Grids.Show({
|
||||
id: props?.item?.companies_id,
|
||||
id: props?.item?.id,
|
||||
}).then((res) => {
|
||||
form.setFieldsValue({
|
||||
...res.data,
|
||||
company_employees_id: res.data.company_has_managements?.map(
|
||||
(item: any) => item.company_employees_id,
|
||||
),
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@ -11,11 +11,11 @@ import { Form, message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
console.log(props.item, 'pppp');
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑`}
|
||||
title={`网格编辑`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="700px"
|
||||
trigger={<MyButtons.Default title={`编辑`} size="small" type="link" />}
|
||||
@ -37,7 +37,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('单元编辑成功');
|
||||
message.success('网格编辑成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false);
|
||||
@ -93,7 +93,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
},
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
@ -107,11 +107,11 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
},
|
||||
},
|
||||
}),
|
||||
Selects?.AssetUnits({
|
||||
Selects?.GridUnits({
|
||||
key: 'asset_units_id',
|
||||
title: '选择单元',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
asset_buildings_id: asset_buildings_id,
|
||||
},
|
||||
colProps: { span: 12 },
|
||||
|
||||
@ -8,6 +8,7 @@ import { Apis } from '@/gen/Apis';
|
||||
import { OrganizationsTypeEnum } from '@/gen/Enums';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import OrganizationsChange from '../modals/OrganizationsChange';
|
||||
import OrganizationsCreate from '../modals/OrganizationsCreate';
|
||||
import OrganizationsUpdate from '../modals/OrganizationsUpdate';
|
||||
|
||||
@ -72,11 +73,17 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<OrganizationsChange
|
||||
item={{ ...item, companies_id: props?.item?.id }}
|
||||
reload={action?.reload}
|
||||
title="组织"
|
||||
/>
|
||||
<OrganizationsUpdate
|
||||
item={{ ...item, companies_id: props?.item?.id }}
|
||||
reload={action?.reload}
|
||||
title="组织"
|
||||
/>
|
||||
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Company.Organizations.Delete({ id: item.id }).then(
|
||||
|
||||
@ -71,7 +71,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
maxLength: 11,
|
||||
},
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
formItemProps: { ...rulesHelper.phone },
|
||||
},
|
||||
{
|
||||
key: 'contact_email',
|
||||
|
||||
@ -76,6 +76,9 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
params: { companies_id: props?.item?.companies_id },
|
||||
key: 'positions_id',
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
},
|
||||
}),
|
||||
// {
|
||||
// key: 'password',
|
||||
|
||||
49
src/pages/company/companies/modals/OrganizationsChange.tsx
Normal file
49
src/pages/company/companies/modals/OrganizationsChange.tsx
Normal file
@ -0,0 +1,49 @@
|
||||
import { MyBetaModalFormProps, MyButtons, MyModalFormProps } from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Update(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Company.Organizations.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`调整上级${props.title}`}
|
||||
form={form}
|
||||
trigger={
|
||||
<MyButtons.Default title="组织调整" type="primary" size="small" />
|
||||
}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
onOpenChange={(open: any) => {
|
||||
if (open && props.item) {
|
||||
form.setFieldsValue(props.item);
|
||||
}
|
||||
}}
|
||||
onFinish={async (values: any) =>
|
||||
Apis.Company.Organizations.Update({
|
||||
...values,
|
||||
id: props.item?.id ?? 0,
|
||||
name: props.item?.name,
|
||||
type: props.item?.type,
|
||||
parent_id: values?.parent_id?.[values.parent_id.length - 1],
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success(props.title + '成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
Selects?.OrganizationsTree({
|
||||
title: '选择新的上级组织',
|
||||
key: 'parent_id',
|
||||
params: { companies_id: props?.item?.companies_id },
|
||||
colProps: { span: 24 },
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -27,10 +27,11 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
onFinish={async (values: any) =>
|
||||
Apis.Company.Organizations.Store({
|
||||
...values,
|
||||
companies_id: props?.item?.id,
|
||||
parent_id: values?.parent_id?.[values.parent_id.length - 1],
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
|
||||
@ -5,7 +5,6 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Selects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { OrganizationsTypeEnum } from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
@ -30,7 +29,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
Apis.Company.Organizations.Update({
|
||||
...values,
|
||||
id: props.item?.id ?? 0,
|
||||
parent_id: values?.parent_id ?? 0,
|
||||
// parent_id: values?.parent_id ?? 0,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -53,12 +52,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
valueEnum: OrganizationsTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
Selects?.OrganizationsTree({
|
||||
title: '上级组织',
|
||||
key: 'parent_id',
|
||||
params: { companies_id: props?.item?.companies_id },
|
||||
colProps: { span: 24 },
|
||||
}),
|
||||
// Selects?.OrganizationsTree({
|
||||
// title: '上级组织',
|
||||
// key: 'parent_id',
|
||||
// params: { companies_id: props?.item?.companies_id },
|
||||
// colProps: { span: 24 },
|
||||
// }),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -6,16 +6,23 @@ import {
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { message } from 'antd';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
export default function Create(props: MyBetaModalFormProps) {
|
||||
const [form] = Form.useForm();
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Company.CompanyPositions.Store>
|
||||
{...MyModalFormProps.props}
|
||||
title={`添加岗位`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
form={form}
|
||||
trigger={<MyButtons.Create title={`添加岗位`} />}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Company.CompanyPositions.Store({
|
||||
...values,
|
||||
@ -37,13 +44,13 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
{
|
||||
key: 'name',
|
||||
title: '岗位名称',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'code',
|
||||
title: '岗位编号',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 24 },
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
// {
|
||||
|
||||
@ -40,13 +40,13 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
{
|
||||
key: 'name',
|
||||
title: '岗位名称',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'code',
|
||||
title: '岗位编号',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 24 },
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
// {
|
||||
|
||||
@ -1,13 +1,11 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Address } from '@/components/Address';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { CompaniesMerchantTypeEnum } from '@/gen/Enums';
|
||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||
import { Form, message } from 'antd';
|
||||
|
||||
@ -18,13 +16,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
form={form}
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
title="编辑"
|
||||
type="primary"
|
||||
size="small"
|
||||
/>
|
||||
}
|
||||
trigger={<MyButtons.Default title="编辑" type="primary" size="small" />}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
onOpenChange={(open: any) => {
|
||||
@ -104,14 +96,14 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
Address.Cascader({
|
||||
key: 'casacader',
|
||||
title: '选择地址',
|
||||
colProps: { span:16 },
|
||||
colProps: { span: 16 },
|
||||
keys: ['province', 'city', 'area', 'street'],
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'address',
|
||||
title: '详细地址',
|
||||
colProps: { span:8 },
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@ -149,7 +149,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
fieldProps: {
|
||||
picker: 'month',
|
||||
format: 'YYYY-MM',
|
||||
valueFormat: 'YYYY-MM',
|
||||
valueFormat: 'YYYY-MM-01',
|
||||
style: {
|
||||
width: '100%',
|
||||
},
|
||||
@ -178,7 +178,40 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
width: '100%',
|
||||
},
|
||||
},
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_projects_id'],
|
||||
columns: ({ asset_projects_id }) => {
|
||||
return [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
Selects?.ProjectAccounts({
|
||||
key: 'company_receipt_accounts_id',
|
||||
title: '选择收款账户',
|
||||
params: {
|
||||
projects_id: asset_projects_id,
|
||||
},
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
onChange: () => {
|
||||
form.setFieldsValue({
|
||||
asset_units_id: undefined,
|
||||
asset_floors_id: undefined,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
key: 'late_start_date',
|
||||
title: '滞纳金起算日期',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user