diff --git a/src/components/MyModal.tsx b/src/components/MyModal.tsx index a064364..a201dae 100644 --- a/src/components/MyModal.tsx +++ b/src/components/MyModal.tsx @@ -6,10 +6,14 @@ export function MyModal(props?: any) { const [open, setOpen] = useState(false); return ( <> - setOpen(true)} - /> + {props?.trigger ? ( +
setOpen(true)}>{props?.trigger}
+ ) : ( + setOpen(true)} + /> + )} - ( - await Apis.Asset.AssetBuildings.GetBuildingTree({ - keywords: params?.KeyWords, - asset_projects_id: params?.asset_projects_id, - ...params, - }) - ).data, - ...rest, - fieldProps: { - showSearch: true, - fieldNames: { - label: 'name', - value: 'id', - children: 'children', - }, - ...rest?.fieldProps, - }, - }; - }, //组织 Organizations(props?: PropsType): ReturnType { const { @@ -202,6 +166,7 @@ export const Selects = { ( await Apis.Company.Organizations.Select({ keywords: params?.KeyWords, + companies_id: params?.companies_id, ...params, }) ).data, @@ -216,11 +181,47 @@ export const Selects = { }, }; }, + //组织树 + OrganizationsTree(props?: PropsType): ReturnType { + const { + title = '组织', + key = 'organizations_id', + required = false, + hideInTable = true, + ...rest + } = props ?? {}; + + return { + title: title, + key: key, + valueType: 'treeSelect', + hideInTable: hideInTable, + formItemProps: { ...(required ? rulesHelper.number : {}) }, + request: async (params) => + ( + await Apis.Company.Organizations.SelectTree({ + keywords: params?.KeyWords, + companies_id: params?.companies_id, + ...params, + }) + ).data, + ...rest, + fieldProps: { + showSearch: true, + fieldNames: { + label: 'name', + value: 'id', + children: 'children', + }, + ...rest?.fieldProps, + }, + }; + }, //员工 Employees(props?: PropsType): ReturnType { const { title = '员工', - key = 'managers_id', + key = 'company_employees_id', required = false, hideInTable = true, ...rest diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index 48f4343..02bcd9c 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -265,24 +265,28 @@ declare namespace ApiTypes { }; type Store = { "asset_houses_id": number; // 资产房屋id,[ref:asset_houses] + "company_receipt_accounts_id": number; // 公司收款账户id,[ref:company_receipt_accounts] "type": string; // 账单类型,[enum:HouseBillsTypeEnum] "amount": number; // 金额 "discount_amount"?: number; // 优惠金额 "late_fee"?: number; // 滞纳金 "start_date": Date; // 计费开始日期 "end_date": Date; // 计费结束日期 + "month": string; // 月份 "late_start_date"?: Date; // 滞纳金起算日期 "collected_late_fee_days"?: number; // 已收滞纳金天数 "remark"?: string; // 备注 }; type Update = { "id": number; // id + "company_receipt_accounts_id": number; // 公司收款账户id,[ref:company_receipt_accounts] "type": string; // 账单类型,[enum:HouseBillsTypeEnum] "amount": number; // 金额 "discount_amount"?: number; // 优惠金额 "late_fee"?: number; // 滞纳金 "start_date": Date; // 计费开始日期 "end_date": Date; // 计费结束日期 + "month": string; // 月份 "late_start_date"?: Date; // 滞纳金起算日期 "collected_late_fee_days"?: number; // 已收滞纳金天数 "remark"?: string; // 备注 @@ -487,9 +491,33 @@ declare namespace ApiTypes { "keywords"?: string; // 关键词 }; } + namespace CompanyProjectReceiptAccounts { + type List = { + "companies_id": number; // 所属机构id,[ref:companies] + "projects_id": number; // 所属项目id,[ref:asset_projects] + }; + type Store = { + "companies_id": number; // 所属机构id,[ref:companies] + "projects_id": number; // 所属项目id,[ref:asset_projects] + "receipt_accounts_id": number; // 机构收款账号id,[ref:company_receipt_accounts] + }; + type Update = { + "id": number; // id + "companies_id": number; // 所属机构id,[ref:companies] + "projects_id": number; // 所属项目id,[ref:asset_projects] + "receipt_accounts_id": number; // 机构收款账号id,[ref:company_receipt_accounts] + }; + type Show = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } namespace CompanyReceiptAccounts { type List = { "name"?: string; // 模糊搜索:名称 + "companies_id"?: number; // 所属机构id,[ref:companies] }; type Store = { "companies_id": number; // 所属机构id,[ref:companies] @@ -527,6 +555,7 @@ declare namespace ApiTypes { type List = { "name"?: string; // 模糊搜索:名称 "companies_id"?: number; // 机构ID[ref:companies] + "parent_id"?: number; // 父级ID }; type Store = { "companies_id": number; // 所属机构id,[ref:companies] @@ -586,6 +615,7 @@ declare namespace ApiTypes { namespace Grids { type List = { "name"?: string; // 模糊搜索:名称 + "asset_projects_id"?: number; // 所属项目id,[ref:asset_projects] }; type Store = { "asset_projects_id": number; // 所属项目id,[ref:asset_projects] diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index 912d9da..54770a5 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -269,6 +269,23 @@ export const Apis = { return request('admin/company/company_positions/select', { data }); }, }, + CompanyProjectReceiptAccounts: { + List(data: ApiTypes.Company.CompanyProjectReceiptAccounts.List): Promise { + return request('admin/company/company_project_receipt_accounts/list', { data }); + }, + Store(data: ApiTypes.Company.CompanyProjectReceiptAccounts.Store): Promise { + return request('admin/company/company_project_receipt_accounts/store', { data }); + }, + Update(data: ApiTypes.Company.CompanyProjectReceiptAccounts.Update): Promise { + return request('admin/company/company_project_receipt_accounts/update', { data }); + }, + Show(data: ApiTypes.Company.CompanyProjectReceiptAccounts.Show): Promise { + return request('admin/company/company_project_receipt_accounts/show', { data }); + }, + Delete(data: ApiTypes.Company.CompanyProjectReceiptAccounts.Delete): Promise { + return request('admin/company/company_project_receipt_accounts/delete', { data }); + }, + }, CompanyReceiptAccounts: { List(data?: ApiTypes.Company.CompanyReceiptAccounts.List): Promise { return request('admin/company/company_receipt_accounts/list', { data }); diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index 69946e7..e701d18 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -1,371 +1,283 @@ // AssetHousesOrientationEnum -export const AssetHousesOrientationEnum = { - East: { text: '东', color: '#007bff', value: 'East' }, - South: { text: '南', color: '#28a745', value: 'South' }, - West: { text: '西', color: '#ffc107', value: 'West' }, - North: { text: '北', color: '#dc3545', value: 'North' }, - Southeast: { text: '东南', color: '#20c997', value: 'Southeast' }, - Northeast: { text: '东北', color: '#6f42c1', value: 'Northeast' }, - Southwest: { text: '西南', color: '#fd7e14', value: 'Southwest' }, - Northwest: { text: '西北', color: '#17a2b8', value: 'Northwest' }, - EastWest: { text: '东西', color: '#6610f2', value: 'EastWest' }, - SouthNorth: { text: '南北', color: '#e83e8c', value: 'SouthNorth' }, +export const AssetHousesOrientationEnum= { + 'East': {"text":"东","color":"#007bff","value":"East"}, + 'South': {"text":"南","color":"#28a745","value":"South"}, + 'West': {"text":"西","color":"#ffc107","value":"West"}, + 'North': {"text":"北","color":"#dc3545","value":"North"}, + 'Southeast': {"text":"东南","color":"#20c997","value":"Southeast"}, + 'Northeast': {"text":"东北","color":"#6f42c1","value":"Northeast"}, + 'Southwest': {"text":"西南","color":"#fd7e14","value":"Southwest"}, + 'Northwest': {"text":"西北","color":"#17a2b8","value":"Northwest"}, + 'EastWest': {"text":"东西","color":"#6610f2","value":"EastWest"}, + 'SouthNorth': {"text":"南北","color":"#e83e8c","value":"SouthNorth"}, }; // AssetHousesOwnershipTypeEnum -export const AssetHousesOwnershipTypeEnum = { - CommodityHousing: { - text: '商品房', - color: '#007bff', - value: 'CommodityHousing', - }, - FundedHousing: { text: '集资房', color: '#28a745', value: 'FundedHousing' }, - MilitaryHousing: { - text: '军产房', - color: '#17a2b8', - value: 'MilitaryHousing', - }, - AffordableHousing: { - text: '保障房', - color: '#ffc107', - value: 'AffordableHousing', - }, - RuralHousing: { text: '农民房', color: '#6f42c1', value: 'RuralHousing' }, - CommercialOffice: { - text: '商业写字楼', - color: '#fd7e14', - value: 'CommercialOffice', - }, - CommercialComplex: { - text: '商业综合体', - color: '#dc3545', - value: 'CommercialComplex', - }, - ResettlementHousing: { - text: '回迁房', - color: '#20c997', - value: 'ResettlementHousing', - }, +export const AssetHousesOwnershipTypeEnum= { + 'CommodityHousing': {"text":"商品房","color":"#007bff","value":"CommodityHousing"}, + 'FundedHousing': {"text":"集资房","color":"#28a745","value":"FundedHousing"}, + 'MilitaryHousing': {"text":"军产房","color":"#17a2b8","value":"MilitaryHousing"}, + 'AffordableHousing': {"text":"保障房","color":"#ffc107","value":"AffordableHousing"}, + 'RuralHousing': {"text":"农民房","color":"#6f42c1","value":"RuralHousing"}, + 'CommercialOffice': {"text":"商业写字楼","color":"#fd7e14","value":"CommercialOffice"}, + 'CommercialComplex': {"text":"商业综合体","color":"#dc3545","value":"CommercialComplex"}, + 'ResettlementHousing': {"text":"回迁房","color":"#20c997","value":"ResettlementHousing"}, }; // AssetHousesStatusEnum -export const AssetHousesStatusEnum = { - Unsold: { text: '未售', color: '#6c757d', value: 'Unsold' }, - SoldNotDelivered: { - text: '已售未交房', - color: '#ffc107', - value: 'SoldNotDelivered', - }, - SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' }, - Rented: { text: '出租', color: '#007bff', value: 'Rented' }, - Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' }, +export const AssetHousesStatusEnum= { + 'Unsold': {"text":"未售","color":"#6c757d","value":"Unsold"}, + 'SoldNotDelivered': {"text":"已售未交房","color":"#ffc107","value":"SoldNotDelivered"}, + 'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"}, + 'Rented': {"text":"出租","color":"#007bff","value":"Rented"}, + 'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"}, }; // AssetHousesUsageEnum -export const AssetHousesUsageEnum = { - Residence: { text: '住宅', color: '#007bff', value: 'Residence' }, - Apartment: { text: '公寓', color: '#28a745', value: 'Apartment' }, - Villa: { text: '别墅', color: '#17a2b8', value: 'Villa' }, - Shop: { text: '商铺', color: '#ffc107', value: 'Shop' }, - ParkingSpace: { text: '车位', color: '#6c757d', value: 'ParkingSpace' }, - Office: { text: '写字楼', color: '#6610f2', value: 'Office' }, - Clubhouse: { text: '会所', color: '#fd7e14', value: 'Clubhouse' }, - PropertyRoom: { text: '物业用房', color: '#dc3545', value: 'PropertyRoom' }, +export const AssetHousesUsageEnum= { + 'Residence': {"text":"住宅","color":"#007bff","value":"Residence"}, + 'Apartment': {"text":"公寓","color":"#28a745","value":"Apartment"}, + 'Villa': {"text":"别墅","color":"#17a2b8","value":"Villa"}, + 'Shop': {"text":"商铺","color":"#ffc107","value":"Shop"}, + 'ParkingSpace': {"text":"车位","color":"#6c757d","value":"ParkingSpace"}, + 'Office': {"text":"写字楼","color":"#6610f2","value":"Office"}, + 'Clubhouse': {"text":"会所","color":"#fd7e14","value":"Clubhouse"}, + 'PropertyRoom': {"text":"物业用房","color":"#dc3545","value":"PropertyRoom"}, }; // AssetProjectsChargeEnum -export const AssetProjectsChargeEnum = { - Contract: { text: '包干制', color: '#007bff', value: 'Contract' }, - Commission: { text: '酬金制', color: '#28a745', value: 'Commission' }, +export const AssetProjectsChargeEnum= { + 'Contract': {"text":"包干制","color":"#007bff","value":"Contract"}, + 'Commission': {"text":"酬金制","color":"#28a745","value":"Commission"}, }; // AssetProjectsEntrustTypeEnum -export const AssetProjectsEntrustTypeEnum = { - DeveloperJointEntrust: { - text: '开发商全委', - color: '#007bff', - value: 'DeveloperJointEntrust', - }, - OwnersFullEntrust: { - text: '业委会全委', - color: '#28a745', - value: 'OwnersFullEntrust', - }, - GovernmentFullEntrust: { - text: '政府类全委', - color: '#ffc107', - value: 'GovernmentFullEntrust', - }, +export const AssetProjectsEntrustTypeEnum= { + 'DeveloperJointEntrust': {"text":"开发商全委","color":"#007bff","value":"DeveloperJointEntrust"}, + 'OwnersFullEntrust': {"text":"业委会全委","color":"#28a745","value":"OwnersFullEntrust"}, + 'GovernmentFullEntrust': {"text":"政府类全委","color":"#ffc107","value":"GovernmentFullEntrust"}, }; // AssetProjectsPropertyTypeEnum -export const AssetProjectsPropertyTypeEnum = { - Residence: { text: '住宅', color: '#ff0000', value: 'Residence' }, - Commercial: { text: '商业', color: '#ff6600', value: 'Commercial' }, - Office: { text: '办公', color: '#ffcc00', value: 'Office' }, - IndustrialPark: { text: '产业园', color: '#00cc66', value: 'IndustrialPark' }, - Complex: { text: '综合体', color: '#0099ff', value: 'Complex' }, - Municipal: { text: '市政设施', color: '#6633cc', value: 'Municipal' }, - Venue: { text: '场馆', color: '#9966ff', value: 'Venue' }, - Education: { text: '教育', color: '#339999', value: 'Education' }, - Medical: { text: '医疗', color: '#cc3366', value: 'Medical' }, +export const AssetProjectsPropertyTypeEnum= { + 'Residence': {"text":"住宅","color":"#ff0000","value":"Residence"}, + 'Commercial': {"text":"商业","color":"#ff6600","value":"Commercial"}, + 'Office': {"text":"办公","color":"#ffcc00","value":"Office"}, + 'IndustrialPark': {"text":"产业园","color":"#00cc66","value":"IndustrialPark"}, + 'Complex': {"text":"综合体","color":"#0099ff","value":"Complex"}, + 'Municipal': {"text":"市政设施","color":"#6633cc","value":"Municipal"}, + 'Venue': {"text":"场馆","color":"#9966ff","value":"Venue"}, + 'Education': {"text":"教育","color":"#339999","value":"Education"}, + 'Medical': {"text":"医疗","color":"#cc3366","value":"Medical"}, }; // AssetProjectsStatusEnum -export const AssetProjectsStatusEnum = { - SignedNotDelivered: { - text: '签约未交付', - color: '#6c757d', - value: 'SignedNotDelivered', - }, - RollingDevelopment: { - text: '滚动开发', - color: '#007bff', - value: 'RollingDevelopment', - }, - ManagedAndClosed: { - text: '在管封园', - color: '#ffc107', - value: 'ManagedAndClosed', - }, - Exited: { text: '退出', color: '#dc3545', value: 'Exited' }, +export const AssetProjectsStatusEnum= { + 'SignedNotDelivered': {"text":"签约未交付","color":"#6c757d","value":"SignedNotDelivered"}, + 'RollingDevelopment': {"text":"滚动开发","color":"#007bff","value":"RollingDevelopment"}, + 'ManagedAndClosed': {"text":"在管封园","color":"#ffc107","value":"ManagedAndClosed"}, + 'Exited': {"text":"退出","color":"#dc3545","value":"Exited"}, }; // AssetUnitsBuildingStructureEnum -export const AssetUnitsBuildingStructureEnum = { - SteelConcrete: { text: '钢混', color: '#007bff', value: 'SteelConcrete' }, - SteelStructure: { text: '钢结构', color: '#28a745', value: 'SteelStructure' }, - BrickConcrete: { text: '砖混', color: '#ffc107', value: 'BrickConcrete' }, - BrickWood: { text: '砖木', color: '#dc3545', value: 'BrickWood' }, +export const AssetUnitsBuildingStructureEnum= { + 'SteelConcrete': {"text":"钢混","color":"#007bff","value":"SteelConcrete"}, + 'SteelStructure': {"text":"钢结构","color":"#28a745","value":"SteelStructure"}, + 'BrickConcrete': {"text":"砖混","color":"#ffc107","value":"BrickConcrete"}, + 'BrickWood': {"text":"砖木","color":"#dc3545","value":"BrickWood"}, }; // AssetUnitsBuildingTypeEnum -export const AssetUnitsBuildingTypeEnum = { - SlabAndTower: { text: '板塔结合', color: '#007bff', value: 'SlabAndTower' }, - Slab: { text: '板楼', color: '#28a745', value: 'Slab' }, - Tower: { text: '塔楼', color: '#ffc107', value: 'Tower' }, +export const AssetUnitsBuildingTypeEnum= { + 'SlabAndTower': {"text":"板塔结合","color":"#007bff","value":"SlabAndTower"}, + 'Slab': {"text":"板楼","color":"#28a745","value":"Slab"}, + 'Tower': {"text":"塔楼","color":"#ffc107","value":"Tower"}, }; // 缓存类型 -export const CacheTypeEnum = { - MobilePhoneVerificationCode: { - text: '手机验证码', - color: '#3be235', - value: 'MobilePhoneVerificationCode', - }, +export const CacheTypeEnum= { + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#50ae15","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum -export const CompaniesMerchantTypeEnum = { - PropertyManagement: { - text: '物业公司', - color: '#007bff', - value: 'PropertyManagement', - }, - ServiceProvider: { - text: '服务商', - color: '#28a745', - value: 'ServiceProvider', - }, +export const CompaniesMerchantTypeEnum= { + 'PropertyManagement': {"text":"物业公司","color":"#007bff","value":"PropertyManagement"}, + 'ServiceProvider': {"text":"服务商","color":"#28a745","value":"ServiceProvider"}, }; // CompanyAppsAppTypeEnum -export const CompanyAppsAppTypeEnum = { - MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' }, - MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' }, - WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' }, +export const CompanyAppsAppTypeEnum= { + 'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"}, + 'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"}, + 'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"}, }; // CompanyAppsModuleEnum -export const CompanyAppsModuleEnum = { - Employee: { text: '员工端', color: '#3b82f6', value: 'Employee' }, - Customer: { text: '客户端', color: '#10b981', value: 'Customer' }, +export const CompanyAppsModuleEnum= { + 'Employee': {"text":"员工端","color":"#3b82f6","value":"Employee"}, + 'Customer': {"text":"客户端","color":"#10b981","value":"Customer"}, }; // CompanyReceiptAccountsPayChannelEnum -export const CompanyReceiptAccountsPayChannelEnum = { - WeChat: { text: '微信', color: '#07c160', value: 'WeChat' }, - Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' }, - BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' }, - TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' }, +export const CompanyReceiptAccountsPayChannelEnum= { + 'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"}, + 'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, + 'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"}, + 'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"}, +}; + +// CustomerBacklogsStatusEnum +export const CustomerBacklogsStatusEnum= { + 'Pending': {"text":"待办","color":"#faad14","value":"Pending"}, + 'Done': {"text":"已办","color":"#52c41a","value":"Done"}, +}; + +// CustomerBacklogsTypeEnum +export const CustomerBacklogsTypeEnum= { + 'RegisterApply': {"text":"登记申请","color":"#2db7f5","value":"RegisterApply"}, + 'PaymentPending': {"text":"费用待缴","color":"#faad14","value":"PaymentPending"}, + 'ContractTodo': {"text":"合同待办","color":"#722ed1","value":"ContractTodo"}, }; // 账单状态枚举 -export const HouseBillsBillStatusEnum = { - PendingPayment: { text: '待支付', color: '#facc15', value: 'PendingPayment' }, - PartiallyPaid: { text: '部分支付', color: '#60a5fa', value: 'PartiallyPaid' }, - Paid: { text: '已支付', color: '#10b981', value: 'Paid' }, - Overdue: { text: '已逾期', color: '#ef4444', value: 'Overdue' }, - Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' }, +export const HouseBillsBillStatusEnum= { + 'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"}, + 'PartiallyPaid': {"text":"部分支付","color":"#60a5fa","value":"PartiallyPaid"}, + 'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, + 'Overdue': {"text":"已逾期","color":"#ef4444","value":"Overdue"}, + 'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, }; // 房屋账单类型枚举 -export const HouseBillsTypeEnum = { - PropertyFee: { text: '物业费', color: '#3b82f6', value: 'PropertyFee' }, - MaintenanceFund: { - text: '维修基金', - color: '#10b981', - value: 'MaintenanceFund', - }, - WaterFee: { text: '水费', color: '#06b6d4', value: 'WaterFee' }, - ElectricityFee: { text: '电费', color: '#f59e0b', value: 'ElectricityFee' }, - SharedWaterFee: { - text: '公摊水费', - color: '#8b5cf6', - value: 'SharedWaterFee', - }, - SharedElectricityFee: { - text: '公摊电费', - color: '#ec4899', - value: 'SharedElectricityFee', - }, +export const HouseBillsTypeEnum= { + 'PropertyFee': {"text":"物业费","color":"#3b82f6","value":"PropertyFee"}, + 'MaintenanceFund': {"text":"维修基金","color":"#10b981","value":"MaintenanceFund"}, + 'WaterFee': {"text":"水费","color":"#06b6d4","value":"WaterFee"}, + 'ElectricityFee': {"text":"电费","color":"#f59e0b","value":"ElectricityFee"}, + 'SharedWaterFee': {"text":"公摊水费","color":"#8b5cf6","value":"SharedWaterFee"}, + 'SharedElectricityFee': {"text":"公摊电费","color":"#ec4899","value":"SharedElectricityFee"}, }; // HouseOccupantsCardTypeEnum -export const HouseOccupantsCardTypeEnum = { - MainlandID: { - text: '中国大陆居民身份证', - color: '#2db7f5', - value: 'MainlandID', - }, - HKPermit: { - text: '香港来往大陆通行证(回乡证)', - color: '#fa8c16', - value: 'HKPermit', - }, - MOPermit: { - text: '澳门来往大陆通行证(回乡证)', - color: '#faad14', - value: 'MOPermit', - }, - TWPermit: { - text: '台湾来往大陆通行证(台胞证)', - color: '#87d068', - value: 'TWPermit', - }, - Passport: { text: '护照', color: '#108ee9', value: 'Passport' }, - BusinessLicense: { - text: '营业执照', - color: '#f5222d', - value: 'BusinessLicense', - }, +export const HouseOccupantsCardTypeEnum= { + 'MainlandID': {"text":"中国大陆居民身份证","color":"#2db7f5","value":"MainlandID"}, + 'HKPermit': {"text":"香港来往大陆通行证(回乡证)","color":"#fa8c16","value":"HKPermit"}, + 'MOPermit': {"text":"澳门来往大陆通行证(回乡证)","color":"#faad14","value":"MOPermit"}, + 'TWPermit': {"text":"台湾来往大陆通行证(台胞证)","color":"#87d068","value":"TWPermit"}, + 'Passport': {"text":"护照","color":"#108ee9","value":"Passport"}, + 'BusinessLicense': {"text":"营业执照","color":"#f5222d","value":"BusinessLicense"}, }; // HouseOccupantsHouseRelationEnum -export const HouseOccupantsHouseRelationEnum = { - Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' }, - Resident: { text: '住户', color: '#87d068', value: 'Resident' }, - Tenant: { text: '租客', color: '#fa8c16', value: 'Tenant' }, +export const HouseOccupantsHouseRelationEnum= { + 'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"}, + 'Resident': {"text":"住户","color":"#87d068","value":"Resident"}, + 'Tenant': {"text":"租客","color":"#fa8c16","value":"Tenant"}, }; // HouseOccupantsRelationWithOwnerEnum -export const HouseOccupantsRelationWithOwnerEnum = { - Self: { text: '本人', color: '#52c41a', value: 'Self' }, - Spouse: { text: '夫妻', color: '#2db7f5', value: 'Spouse' }, - FatherSon: { text: '父子', color: '#faad14', value: 'FatherSon' }, - MotherSon: { text: '母子', color: '#fa8c16', value: 'MotherSon' }, - Children: { text: '子女', color: '#87d068', value: 'Children' }, - ContactPerson: { - text: '指定联系人', - color: '#f5222d', - value: 'ContactPerson', - }, +export const HouseOccupantsRelationWithOwnerEnum= { + 'Self': {"text":"本人","color":"#52c41a","value":"Self"}, + 'Spouse': {"text":"夫妻","color":"#2db7f5","value":"Spouse"}, + 'FatherSon': {"text":"父子","color":"#faad14","value":"FatherSon"}, + 'MotherSon': {"text":"母子","color":"#fa8c16","value":"MotherSon"}, + 'Children': {"text":"子女","color":"#87d068","value":"Children"}, + 'ContactPerson': {"text":"指定联系人","color":"#f5222d","value":"ContactPerson"}, }; // HouseOccupantsStatusEnum -export const HouseOccupantsStatusEnum = { - Normal: { text: '正常', color: '#52c41a', value: 'Normal' }, - Unbound: { text: '已解除', color: '#f5222d', value: 'Unbound' }, +export const HouseOccupantsStatusEnum= { + 'Normal': {"text":"正常","color":"#52c41a","value":"Normal"}, + 'Unbound': {"text":"已解除","color":"#f5222d","value":"Unbound"}, }; // 订单状态枚举 -export const HouseOrdersOrderStatusEnum = { - Pending: { text: '待支付', color: '#facc15', value: 'Pending' }, - Paid: { text: '已支付', color: '#10b981', value: 'Paid' }, - Refunded: { text: '已退款', color: '#60a5fa', value: 'Refunded' }, - Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' }, +export const HouseOrdersOrderStatusEnum= { + 'Pending': {"text":"待支付","color":"#facc15","value":"Pending"}, + 'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, + 'Refunded': {"text":"已退款","color":"#60a5fa","value":"Refunded"}, + 'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, + 'Failed': {"text":"支付失败","color":"#ef4444","value":"Failed"}, }; // HouseOrdersPaymentMethodEnum -export const HouseOrdersPaymentMethodEnum = { - WeChat: { text: '微信', color: '#07c160', value: 'WeChat' }, - Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' }, - BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' }, - TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' }, +export const HouseOrdersPaymentMethodEnum= { + 'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"}, + 'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, + 'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"}, + 'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"}, }; // HouseRegistersCustomerTypeEnum -export const HouseRegistersCustomerTypeEnum = { - Individual: { text: '个人客户', color: '#2db7f5', value: 'Individual' }, - Enterprise: { text: '普通企业', color: '#87d068', value: 'Enterprise' }, - Developer: { text: '开发企业', color: '#fa8c16', value: 'Developer' }, - Government: { text: '政府组织', color: '#f5222d', value: 'Government' }, +export const HouseRegistersCustomerTypeEnum= { + 'Individual': {"text":"个人客户","color":"#2db7f5","value":"Individual"}, + 'Enterprise': {"text":"普通企业","color":"#87d068","value":"Enterprise"}, + 'Developer': {"text":"开发企业","color":"#fa8c16","value":"Developer"}, + 'Government': {"text":"政府组织","color":"#f5222d","value":"Government"}, }; // HouseRegistersHouseStatusEnum -export const HouseRegistersHouseStatusEnum = { - SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' }, - Rented: { text: '出租', color: '#007bff', value: 'Rented' }, - Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' }, +export const HouseRegistersHouseStatusEnum= { + 'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"}, + 'Rented': {"text":"出租","color":"#007bff","value":"Rented"}, + 'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"}, }; // HouseRegistersStatusEnum -export const HouseRegistersStatusEnum = { - Pending: { text: '待审', color: '#faad14', value: 'Pending' }, - Approved: { text: '已审', color: '#52c41a', value: 'Approved' }, - Rejected: { text: '驳回', color: '#f5222d', value: 'Rejected' }, +export const HouseRegistersStatusEnum= { + 'Pending': {"text":"待审","color":"#faad14","value":"Pending"}, + 'Approved': {"text":"已审","color":"#52c41a","value":"Approved"}, + 'Rejected': {"text":"驳回","color":"#f5222d","value":"Rejected"}, }; // HouseRegistersTypeEnum -export const HouseRegistersTypeEnum = { - Delivery: { text: '交付登记', color: '#2db7f5', value: 'Delivery' }, - Transfer: { text: '过户登记', color: '#87d068', value: 'Transfer' }, - AddOccupant: { text: '添加住户', color: '#108ee9', value: 'AddOccupant' }, - MoveOut: { text: '搬离登记', color: '#f50', value: 'MoveOut' }, +export const HouseRegistersTypeEnum= { + 'Delivery': {"text":"交付登记","color":"#2db7f5","value":"Delivery"}, + 'Transfer': {"text":"过户登记","color":"#87d068","value":"Transfer"}, + 'AddOccupant': {"text":"添加住户","color":"#108ee9","value":"AddOccupant"}, + 'MoveOut': {"text":"搬离登记","color":"#f50","value":"MoveOut"}, + 'RemoveOwner': {"text":"减少产权人","color":"#d9363e","value":"RemoveOwner"}, }; // HouseRegistersUsagePlanEnum -export const HouseRegistersUsagePlanEnum = { - Permanent: { text: '常住', color: '#52c41a', value: 'Permanent' }, - Vacation: { text: '度假', color: '#faad14', value: 'Vacation' }, - Rental: { text: '出租', color: '#2db7f5', value: 'Rental' }, - Commercial: { text: '商用', color: '#f5222d', value: 'Commercial' }, +export const HouseRegistersUsagePlanEnum= { + 'Permanent': {"text":"常住","color":"#52c41a","value":"Permanent"}, + 'Vacation': {"text":"度假","color":"#faad14","value":"Vacation"}, + 'Rental': {"text":"出租","color":"#2db7f5","value":"Rental"}, + 'Commercial': {"text":"商用","color":"#f5222d","value":"Commercial"}, }; // OrganizationsTypeEnum -export const OrganizationsTypeEnum = { - Group: { text: '集团', color: '#007bff', value: 'Group' }, - Company: { text: '公司', color: '#28a745', value: 'Company' }, - ManagementOffice: { - text: '管理处', - color: '#ffc107', - value: 'ManagementOffice', - }, - Department: { text: '部门', color: '#dc3545', value: 'Department' }, +export const OrganizationsTypeEnum= { + 'Group': {"text":"集团","color":"#007bff","value":"Group"}, + 'Company': {"text":"公司","color":"#28a745","value":"Company"}, + 'ManagementOffice': {"text":"管理处","color":"#ffc107","value":"ManagementOffice"}, + 'Department': {"text":"部门","color":"#dc3545","value":"Department"}, }; // 性别 -export const SexEnum = { - Male: { text: '男', color: '#0000ff', value: 'Male' }, - FeMale: { text: '女', color: '#ff0000', value: 'FeMale' }, +export const SexEnum= { + 'Male': {"text":"男","color":"#0000ff","value":"Male"}, + 'FeMale': {"text":"女","color":"#ff0000","value":"FeMale"}, }; // SysModuleEnum -export const SysModuleEnum = { - Admin: { text: '管理员', color: '#cf1322', value: 'Admin' }, - Customer: { text: '客户', color: '#d4b106', value: 'Customer' }, +export const SysModuleEnum= { + 'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"}, + 'Customer': {"text":"客户","color":"#d4b106","value":"Customer"}, }; // SysPermissionsTypeEnum -export const SysPermissionsTypeEnum = { - Directory: { text: '目录', color: '#6d7e14', value: 'Directory' }, - Page: { text: '页面', color: '#4d9a13', value: 'Page' }, - Button: { text: '按钮', color: '#97224f', value: 'Button' }, +export const SysPermissionsTypeEnum= { + 'Directory': {"text":"目录","color":"#6d7e14","value":"Directory"}, + 'Page': {"text":"页面","color":"#4d9a13","value":"Page"}, + 'Button': {"text":"按钮","color":"#97224f","value":"Button"}, }; // WechatAuthsPlatformEnum -export const WechatAuthsPlatformEnum = { - MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' }, - MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' }, - WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' }, +export const WechatAuthsPlatformEnum= { + 'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"}, + 'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"}, + 'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"}, }; + diff --git a/src/pages/archive/asset_house/$id.tsx b/src/pages/archive/asset_house/$id.tsx index 6b514e4..0f39e41 100644 --- a/src/pages/archive/asset_house/$id.tsx +++ b/src/pages/archive/asset_house/$id.tsx @@ -22,13 +22,18 @@ export default function Show({ title = '房屋详情' }) { let items = [ { - label: '当前信息', + label: '当前档案', key: '1', closable: false, - children: loadShow()} />, + children: ( + loadShow()} + /> + ), }, { - label: '历史信息', + label: '历史档案', key: '2', closable: false, // children: , diff --git a/src/pages/archive/asset_house/index.tsx b/src/pages/archive/asset_house/index.tsx index 0374cc7..5e913d4 100644 --- a/src/pages/archive/asset_house/index.tsx +++ b/src/pages/archive/asset_house/index.tsx @@ -91,24 +91,21 @@ export default function Index({ title = '房屋档案' }) { MyColumns.Option({ render: (_, item: any, index, action) => ( - {/* - */} - { - navigate(`/archive/asset_house/${item.id}`); - }} - /> - {!item?.house_occupants?.length && ( - + {item?.house_occupants?.length !== 0 && ( + { + navigate(`/archive/asset_house/${item.id}`); + }} + /> + )} + {!item?.house_occupants?.length && ( + )} - - Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } - /> ), }), diff --git a/src/pages/archive/asset_house/modals/Add.tsx b/src/pages/archive/asset_house/modals/Add.tsx new file mode 100644 index 0000000..776332e --- /dev/null +++ b/src/pages/archive/asset_house/modals/Add.tsx @@ -0,0 +1,157 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + HouseOccupantsCardTypeEnum, + HouseRegistersCustomerTypeEnum, +} from '@/gen/Enums'; +import { BetaSchemaForm, ProCard } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function Create(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + return ( + + {...MyModalFormProps.props} + title={`添加${props.title}`} + wrapperCol={{ span: 24 }} + width="900px" + form={form} + trigger={ + + } + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); // 清空表单数据 + } + }} + onFinish={async (values) => + Apis.Archive.HouseRegisters.Store({ + ...values, + asset_houses_id: props?.item?.asset_houses_id, + type: 'Delivery', + }) + .then(() => { + props.reload?.(); + message.success(props.title + '成功'); + return true; + }) + .catch(() => false) + } + columns={[ + MyFormItems.EnumRadio({ + key: 'customer_type', + title: '客户类型', + colProps: { span: 12 }, + valueEnum: HouseRegistersCustomerTypeEnum, + }), + { + valueType: 'formList', + dataIndex: 'customer_info', + colProps: { span: 24 }, + fieldProps: { + copyIconProps: false, + creatorButtonProps: { + creatorButtonText: '增加产权人', + style: { color: 'red' }, + danger: true, + }, + itemRender: ( + { listDom, action }: any, + { index }: { index: number }, + ) => { + return ( + + {listDom} + + ); + }, + }, + columns: [ + { + valueType: 'group', + columns: [ + { + title: '姓名', + dataIndex: 'name', + colProps: { span: 12 }, + formItemProps: { ...rulesHelper.text }, + }, + { + title: '手机号', + dataIndex: 'phone', + colProps: { span: 6 }, + fieldProps: { + maxLength: 11, + }, + formItemProps: { ...rulesHelper.text }, + }, + { + title: '备用手机号', + dataIndex: 'reserve_phone', + colProps: { span: 6 }, + fieldProps: { + maxLength: 11, + }, + }, + MyFormItems.EnumSelect({ + key: 'card_type', + title: '证件类型', + colProps: { span: 12 }, + valueEnum: HouseOccupantsCardTypeEnum, + required: true, + }), + { + title: '证件号码', + dataIndex: 'id_card', + colProps: { span: 12 }, + fieldProps: { + maxLength: 18, + }, + formItemProps: { ...rulesHelper.text }, + }, + + // { + // title: '是否在居住中', + // dataIndex: 'is_live_in', + // colProps: { span: 8 }, + // valueType: 'switch', + // }, + { + valueType: 'group', + columns: [ + MyFormItems.UploadImages({ + key: 'card_front_image', + title: '证件正面', + max: 1, + colProps: { span: 4 }, + formItemProps: { ...rulesHelper.text }, + }), + MyFormItems.UploadImages({ + key: 'card_back_image', + title: '证件反面', + max: 1, + colProps: { span: 4 }, + formItemProps: { ...rulesHelper.text }, + }), + ], + }, + ], + }, + ], + }, + ]} + /> + ); +} diff --git a/src/pages/archive/asset_house/modals/MoveIn.tsx b/src/pages/archive/asset_house/modals/MoveIn.tsx new file mode 100644 index 0000000..fc66a39 --- /dev/null +++ b/src/pages/archive/asset_house/modals/MoveIn.tsx @@ -0,0 +1,53 @@ +import { MyBetaModalFormProps, MyButtons, MyModalFormProps } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function Create(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + return ( + + {...MyModalFormProps.props} + title={`添加${props.title}`} + wrapperCol={{ span: 24 }} + width="500px" + form={form} + onOpenChange={(open: any) => { + if (open && props.item) { + form.setFieldsValue(props.item); + } + }} + trigger={ + + } + onFinish={async (values) => + Apis.Archive.HouseRegisters.Update({ + ...values, + id: props?.item?.id ?? 0, + is_live_in: 1, + customer_info: props?.item?.id, + }) + .then(() => { + props.reload?.(); + message.success(props.title + '成功'); + return true; + }) + .catch(() => false) + } + columns={[ + { + title: '入住日期', + valueType: 'date', + dataIndex: 'move_in_date', + colProps: { span: 24 }, + fieldProps: { + maxLength: 11, + style: { + width: '100%', + }, + }, + }, + ]} + /> + ); +} diff --git a/src/pages/archive/asset_house/table/OccupantsNow.tsx b/src/pages/archive/asset_house/table/OccupantsNow.tsx index d1d839e..efe1722 100644 --- a/src/pages/archive/asset_house/table/OccupantsNow.tsx +++ b/src/pages/archive/asset_house/table/OccupantsNow.tsx @@ -8,7 +8,9 @@ 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 MoveIn from '../modals/MoveIn'; import MoveOut from '../modals/MoveOut'; import Transfer from '../modals/Transfer'; @@ -27,7 +29,7 @@ export default function Index({ ...rest }) { MyProTableProps.request( { ...params, - asset_houses_id: rest.item?.id, + asset_houses_id: rest.item?.asset_houses_id, status: 'Normal', }, sort, @@ -35,6 +37,12 @@ export default function Index({ ...rest }) { ) } toolBarRender={(action) => [ + , {/* */} {item?.is_live_in && ( + + )} + {item?.move_in_date && ( )} + {/* {item?.HouseOccupantsHouseRelationEnum === 'Owner' && ( + + )} */} ), }), diff --git a/src/pages/asset/asset_projects/$id.tsx b/src/pages/asset/asset_projects/$id.tsx index 2134e1f..6649f4a 100644 --- a/src/pages/asset/asset_projects/$id.tsx +++ b/src/pages/asset/asset_projects/$id.tsx @@ -4,6 +4,7 @@ import { ProCard } from '@ant-design/pro-components'; import { useParams } from '@umijs/max'; import { Tabs } from 'antd'; import { useEffect, useState } from 'react'; +import AssetAccounts from './components/AssetAccounts'; import MyAssetBuildings from './components/AssetBuildings'; import AssetGrid from './components/AssetGrid'; import AssetInfo from './components/AssetInfo'; @@ -41,6 +42,12 @@ export default function Show({ title = '项目详情' }) { closable: false, children: , }, + { + label: '收款账号', + key: 'asset_accounts', + closable: false, + children: , + }, // { // label: '车位管理', // key: 'carport', diff --git a/src/pages/asset/asset_projects/components/AssetAccounts.tsx b/src/pages/asset/asset_projects/components/AssetAccounts.tsx new file mode 100644 index 0000000..a8c1a61 --- /dev/null +++ b/src/pages/asset/asset_projects/components/AssetAccounts.tsx @@ -0,0 +1,85 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyColumns, + MyProTableProps, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { ProTable } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import AssetAccountsSelect from '../modals/AssetAccountsSelect'; + +export default function ReceiptAccounts(props: MyBetaModalFormProps) { + return ( + <> + + MyProTableProps.request( + { + ...params, + companies_id: props?.item?.companies_id, + projects_id: props?.item?.id, + }, + sort, + Apis.Company.CompanyProjectReceiptAccounts.List, + ) + } + toolBarRender={(action) => [ + , + ]} + // options={false} + columns={[ + MyColumns.ID(), + + { + title: '收款账号名称', + dataIndex: ['receipt_account', 'company_name'], + // width: 360, + }, + { + title: '开户行', + dataIndex: ['receipt_account', 'company_bank'], + search: false, + // width: 200, + }, + { + title: '收款账号', + dataIndex: ['receipt_account', 'company_account'], + search: false, + // width: 200, + }, + // { + // title: '是否默认', + // dataIndex: 'is_default', + // search: false, + // render(_, record) { + // return `${record?.is_default ? '是' : '否'} `; + // }, + // }, + // MyColumns.UpdatedAt(), + // MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + Apis.Company.CompanyProjectReceiptAccounts.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/asset/asset_projects/components/AssetGrid.tsx b/src/pages/asset/asset_projects/components/AssetGrid.tsx index 9871751..aba40f6 100644 --- a/src/pages/asset/asset_projects/components/AssetGrid.tsx +++ b/src/pages/asset/asset_projects/components/AssetGrid.tsx @@ -1,14 +1,13 @@ import { MyButtons, MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; -import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; import { useEffect, useRef } from 'react'; import GridCreate from '../modals/GridCreate'; +import GridMannger from '../modals/GridMannger'; import GridCreateUpdate from '../modals/GridUpdate'; export default function Index({ ...rest }) { - const navigate = useNavigate(); const actionLooks = useRef(); useEffect(() => { actionLooks?.current.reloadAndRest(); @@ -21,7 +20,7 @@ export default function Index({ ...rest }) { actionRef={actionLooks} request={async (params, sort) => MyProTableProps.request( - { ...params, asset_projects_id: rest.item?.asset_projects_id }, + { ...params, asset_projects_id: rest.item?.id }, sort, Apis.Grid.Grids.List, ) @@ -43,12 +42,21 @@ export default function Index({ ...rest }) { title: '网格标识', dataIndex: 'grid_mark', }, - MyColumns.CreatedAt(), + { + title: '网格员', + dataIndex: ['company_employee', 'name'], + render: (_, item: any) => + `${item?.company_employee?.name || ''}-${ + item?.company_employee?.phone || '' + }`, + }, + // MyColumns.CreatedAt(), MyColumns.UpdatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( + Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(() => diff --git a/src/pages/asset/asset_projects/modals/AssetAccountsSelect.tsx b/src/pages/asset/asset_projects/modals/AssetAccountsSelect.tsx new file mode 100644 index 0000000..e1f3662 --- /dev/null +++ b/src/pages/asset/asset_projects/modals/AssetAccountsSelect.tsx @@ -0,0 +1,91 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyColumns, + MyProTableProps, +} from '@/common'; +import { MyModal } from '@/components/MyModal'; +import { Apis } from '@/gen/Apis'; +import { ProTable } from '@ant-design/pro-components'; +import { message } from 'antd'; +import { useState } from 'react'; + +export default function Index(props: MyBetaModalFormProps) { + const [selectedProjectsIds, setSelectedProjectsIds] = useState([]); + const onShowContactPhone = () => { + Apis.Company.CompanyProjectReceiptAccounts.Store({ + companies_id: props?.item?.id ?? 0, + projects_id: props?.item?.id, + receipt_accounts_id: selectedProjectsIds[0], + }) + .then(() => { + props.reload?.(); + message.success('添加成功!'); + }) + .catch(() => false); + }; + + return ( + + } + node={ + + MyProTableProps.request( + { + ...params, + companies_id: props?.item?.companies_id, + }, + sort, + Apis.Company.CompanyReceiptAccounts.List, + ) + } + rowSelection={{ + type: 'radio', + onChange: (selectedRowKeys) => { + setSelectedProjectsIds(selectedRowKeys); + }, + }} + tableAlertOptionRender={() => { + return ( + onShowContactPhone()} + /> + ); + }} + search={false} + options={false} + columns={[ + MyColumns.ID(), + { + title: '收款户名', + dataIndex: 'company_name', + }, + { + title: '开户行', + dataIndex: 'company_bank', + search: false, + }, + { + title: '收款账号', + dataIndex: 'company_account', + search: false, + }, + ]} + /> + } + /> + ); +} diff --git a/src/pages/asset/asset_projects/modals/GridMannger.tsx b/src/pages/asset/asset_projects/modals/GridMannger.tsx new file mode 100644 index 0000000..6f444be --- /dev/null +++ b/src/pages/asset/asset_projects/modals/GridMannger.tsx @@ -0,0 +1,64 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { ButtonProps, Form, message } from 'antd'; + +export default function Create( + props: { buttonProps?: ButtonProps } & MyBetaModalFormProps, +) { + const [form] = Form.useForm(); + + return ( + + {...MyModalFormProps.props} + title={`设置网格员`} + wrapperCol={{ span: 24 }} + width="500px" + form={form} + trigger={} + request={() => Promise.resolve(props.item)} + onOpenChange={(open: any) => { + if (open && props.item) { + // 获取详情数据 + Apis.Grid.Grids.Show({ + id: props?.item?.companies_id, + }).then((res) => { + form.setFieldsValue({ + ...res.data, + company_employees_id: res.data.company_has_managements?.map( + (item: any) => item.company_employees_id, + ), + }); + }); + } + }} + onFinish={async (values: any) => + Apis.Grid.Grids.AddManager({ + ...values, + id: props?.item?.id, + }) + .then(() => { + props.reload?.(); + message.success('成功'); + return true; + }) + .catch(() => false) + } + columns={[ + Selects?.Employees({ + title: '设置网格员', + dataIndex: 'company_employees_id', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + required: true, + }), + ]} + /> + ); +} diff --git a/src/pages/asset/asset_projects/modals/GridUpdate.tsx b/src/pages/asset/asset_projects/modals/GridUpdate.tsx index c279cb2..5d83314 100644 --- a/src/pages/asset/asset_projects/modals/GridUpdate.tsx +++ b/src/pages/asset/asset_projects/modals/GridUpdate.tsx @@ -61,7 +61,7 @@ export default function Update(props: MyBetaModalFormProps) { fieldProps: { copyIconProps: false, creatorButtonProps: { - creatorButtonText: '添加楼栋-单元', + creatorButtonText: '添加楼栋单元', }, itemRender: ( { listDom, action }: any, diff --git a/src/pages/company/companies/$id.tsx b/src/pages/company/companies/$id.tsx index d2c90bc..63841a2 100644 --- a/src/pages/company/companies/$id.tsx +++ b/src/pages/company/companies/$id.tsx @@ -9,6 +9,7 @@ import Employees from './components/Employees'; import Organizations from './components/Organizations'; import Positions from './components/Positions'; import Projects from './components/Projects'; +import ReceiptAccounts from './components/ReceiptAccounts'; export default function Show({ title = '机构详情' }) { const { id } = useParams<{ id: string }>(); const [data, setShow] = useState({}); @@ -54,6 +55,12 @@ export default function Show({ title = '机构详情' }) { closable: false, children: , }, + { + label: '收款账号', + key: '6', + closable: false, + children: , + }, ]; return ( diff --git a/src/pages/company/companies/components/Organizations.tsx b/src/pages/company/companies/components/Organizations.tsx index c6592dc..ec6b387 100644 --- a/src/pages/company/companies/components/Organizations.tsx +++ b/src/pages/company/companies/components/Organizations.tsx @@ -34,6 +34,16 @@ export default function Organizations(props: MyBetaModalFormProps) { ]} options={false} columns={[ + MyColumns.EnumTag({ + title: '组织类型', + dataIndex: 'type', + valueEnum: OrganizationsTypeEnum, + search: false, + }), + { + title: '组织名称', + dataIndex: 'name', + }, { title: '组织ID', dataIndex: 'id', @@ -45,15 +55,11 @@ export default function Organizations(props: MyBetaModalFormProps) { search: false, }, { - title: '组织名称', - dataIndex: 'name', - }, - MyColumns.EnumTag({ - title: '组织类型', - dataIndex: 'type', - valueEnum: OrganizationsTypeEnum, + title: '上级组织ID', + dataIndex: ['organization_parent', 'id'], search: false, - }), + }, + // { // title: '负责人', // dataIndex: ['manager', 'name'], diff --git a/src/pages/company/companies/components/Positions.tsx b/src/pages/company/companies/components/Positions.tsx index e22ccac..191d8c3 100644 --- a/src/pages/company/companies/components/Positions.tsx +++ b/src/pages/company/companies/components/Positions.tsx @@ -38,11 +38,13 @@ export default function Organizations(props: MyBetaModalFormProps) { { title: '岗位名称', dataIndex: 'name', + width: 200, }, { title: '岗位编号', dataIndex: 'code', search: false, + width: 200, }, // { // title: '岗位排序', @@ -53,6 +55,7 @@ export default function Organizations(props: MyBetaModalFormProps) { title: '岗位备注', dataIndex: 'remark', search: false, + width: 200, }, MyColumns.UpdatedAt(), // MyColumns.CreatedAt(), diff --git a/src/pages/company/companies/components/ReceiptAccounts.tsx b/src/pages/company/companies/components/ReceiptAccounts.tsx new file mode 100644 index 0000000..79d2e38 --- /dev/null +++ b/src/pages/company/companies/components/ReceiptAccounts.tsx @@ -0,0 +1,87 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyColumns, + MyProTableProps, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { ProTable } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import ReceiptAccountsCreate from '../modals/ReceiptAccountsCreate'; +import ReceiptAccountsUpdate from '../modals/ReceiptAccountsUpdate'; + +export default function ReceiptAccounts(props: MyBetaModalFormProps) { + return ( + <> + + MyProTableProps.request( + { ...params, companies_id: props?.item?.id }, + sort, + Apis.Company.CompanyReceiptAccounts.List, + ) + } + toolBarRender={(action) => [ + , + ]} + // options={false} + columns={[ + MyColumns.ID(), + + { + title: '收款账号名称', + dataIndex: 'company_name', + // width: 360, + }, + { + title: '开户行', + dataIndex: 'company_bank', + search: false, + // width: 200, + }, + { + title: '收款账号', + dataIndex: 'company_account', + search: false, + // width: 200, + }, + { + title: '是否默认', + dataIndex: 'is_default', + search: false, + render(_, record) { + return `${record?.is_default ? '是' : '否'} `; + }, + }, + // MyColumns.UpdatedAt(), + // MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + Apis.Company.CompanyReceiptAccounts.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/company/companies/modals/OrganizationsCreate.tsx b/src/pages/company/companies/modals/OrganizationsCreate.tsx index c9938f2..69b597b 100644 --- a/src/pages/company/companies/modals/OrganizationsCreate.tsx +++ b/src/pages/company/companies/modals/OrganizationsCreate.tsx @@ -9,16 +9,24 @@ import { Selects } from '@/components/Select'; import { Apis } from '@/gen/Apis'; import { OrganizationsTypeEnum } from '@/gen/Enums'; 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 ( {...MyModalFormProps.props} title={`添加${props.title}`} wrapperCol={{ span: 24 }} - width="800px" + width="500px" trigger={} + form={form} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); // 清空表单数据 + } + }} onFinish={async (values) => Apis.Company.Organizations.Store({ ...values, @@ -32,7 +40,7 @@ export default function Create(props: MyBetaModalFormProps) { .catch(() => false) } columns={[ - Selects?.Organizations({ + Selects?.OrganizationsTree({ title: '上级组织', key: 'parent_id', params: { companies_id: props?.item?.id }, @@ -46,29 +54,29 @@ export default function Create(props: MyBetaModalFormProps) { }, MyFormItems.EnumRadio({ key: 'type', - title: '类型', + title: '组织类型', colProps: { span: 24 }, valueEnum: OrganizationsTypeEnum, required: true, }), - Selects?.Employees({ - title: '负责人', - colProps: { span: 8 }, - }), - { - key: 'manager_phone', - title: '负责人手机', - colProps: { span: 8 }, - valueType: 'number', - fieldProps: { - maxLength: 11, - }, - }, - { - key: 'manager_email', - title: '负责人邮箱', - colProps: { span: 8 }, - }, + // Selects?.Employees({ + // title: '负责人', + // colProps: { span: 8 }, + // }), + // { + // key: 'manager_phone', + // title: '负责人手机', + // colProps: { span: 8 }, + // valueType: 'number', + // fieldProps: { + // maxLength: 11, + // }, + // }, + // { + // key: 'manager_email', + // title: '负责人邮箱', + // colProps: { span: 8 }, + // }, ]} /> ); diff --git a/src/pages/company/companies/modals/OrganizationsUpdate.tsx b/src/pages/company/companies/modals/OrganizationsUpdate.tsx index 86f6a82..67ab696 100644 --- a/src/pages/company/companies/modals/OrganizationsUpdate.tsx +++ b/src/pages/company/companies/modals/OrganizationsUpdate.tsx @@ -20,7 +20,7 @@ export default function Update(props: MyBetaModalFormProps) { form={form} trigger={} wrapperCol={{ span: 24 }} - width="800px" + width="500px" onOpenChange={(open: any) => { if (open && props.item) { form.setFieldsValue(props.item); @@ -30,6 +30,7 @@ export default function Update(props: MyBetaModalFormProps) { Apis.Company.Organizations.Update({ ...values, id: props.item?.id ?? 0, + parent_id: values?.parent_id ?? 0, }) .then(() => { props.reload?.(); @@ -39,12 +40,6 @@ export default function Update(props: MyBetaModalFormProps) { .catch(() => false) } columns={[ - Selects?.Organizations({ - title: '上级组织', - key: 'parent_id', - params: { companies_id: props?.item?.companies_id }, - colProps: { span: 24 }, - }), { key: 'name', title: '组织名称', @@ -58,24 +53,12 @@ export default function Update(props: MyBetaModalFormProps) { valueEnum: OrganizationsTypeEnum, required: true, }), - Selects?.Employees({ - title: '负责人', - colProps: { span: 8 }, + Selects?.OrganizationsTree({ + title: '上级组织', + key: 'parent_id', + params: { companies_id: props?.item?.companies_id }, + colProps: { span: 24 }, }), - { - key: 'manager_phone', - title: '负责人手机', - colProps: { span: 8 }, - valueType: 'number', - fieldProps: { - maxLength: 11, - }, - }, - { - key: 'manager_email', - title: '负责人邮箱', - colProps: { span: 8 }, - }, ]} /> ); diff --git a/src/pages/company/companies/modals/ReceiptAccountsCreate.tsx b/src/pages/company/companies/modals/ReceiptAccountsCreate.tsx new file mode 100644 index 0000000..df70dcd --- /dev/null +++ b/src/pages/company/companies/modals/ReceiptAccountsCreate.tsx @@ -0,0 +1,77 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { CompanyReceiptAccountsPayChannelEnum } from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function Create(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + + return ( + + {...MyModalFormProps.props} + title={`添加收款账号`} + wrapperCol={{ span: 24 }} + width="500px" + trigger={} + form={form} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); // 清空表单数据 + } + }} + onFinish={async (values) => + Apis.Company.CompanyReceiptAccounts.Store({ + ...values, + companies_id: props?.item?.id, + is_default: values.is_default ? 1 : 0, + }) + .then(() => { + props.reload?.(); + message.success(props.title + '成功'); + return true; + }) + .catch(() => false) + } + columns={[ + { + key: 'company_name', + title: '收款账户名称', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'company_bank', + title: '开户行', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'company_account', + title: '收款账户', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + MyFormItems.EnumRadio({ + key: 'pay_channel', + title: '收款渠道', + colProps: { span: 24 }, + valueEnum: CompanyReceiptAccountsPayChannelEnum, + required: true, + }), + { + key: 'is_default', + title: '是否设为默认账号', + valueType: 'switch', + colProps: { span: 24 }, + }, + ]} + /> + ); +} diff --git a/src/pages/company/companies/modals/ReceiptAccountsUpdate.tsx b/src/pages/company/companies/modals/ReceiptAccountsUpdate.tsx new file mode 100644 index 0000000..fdd0498 --- /dev/null +++ b/src/pages/company/companies/modals/ReceiptAccountsUpdate.tsx @@ -0,0 +1,76 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; + +import { Apis } from '@/gen/Apis'; +import { CompanyReceiptAccountsPayChannelEnum } 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 ( + + {...MyModalFormProps.props} + title={`编辑${props.title}`} + trigger={} + wrapperCol={{ span: 24 }} + width="500px" + form={form} + onOpenChange={(open: any) => { + if (open && props.item) { + form.setFieldsValue(props.item); + } + }} + onFinish={async (values) => + Apis.Company.CompanyReceiptAccounts.Update({ + ...values, + companies_id: props?.item?.companies_id, + id: props.item?.id ?? 0, + }) + .then(() => { + props.reload?.(); + message.success(props.title + '成功'); + return true; + }) + .catch(() => false) + } + columns={[ + { + key: 'company_name', + title: '收款账户名称', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'company_bank', + title: '开户行', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'company_account', + title: '收款账户', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + MyFormItems.EnumRadio({ + key: 'pay_channel', + title: '收款渠道', + colProps: { span: 24 }, + valueEnum: CompanyReceiptAccountsPayChannelEnum, + required: true, + }), + { + key: 'is_default', + title: '是否设为默认账号', + valueType: 'switch', + colProps: { span: 24 }, + }, + ]} + /> + ); +} diff --git a/src/pages/employees/modals/Update.tsx b/src/pages/employees/modals/Update.tsx index 292d71b..65d5ff1 100644 --- a/src/pages/employees/modals/Update.tsx +++ b/src/pages/employees/modals/Update.tsx @@ -91,6 +91,9 @@ export default function Update(props: MyBetaModalFormProps) { params: { companies_id: companies_id }, key: 'positions_id', formItemProps: { ...rulesHelper.text }, + fieldProps: { + showSearch: true, + }, }), ], }, diff --git a/src/pages/house_bills/index.tsx b/src/pages/house_bills/index.tsx index 408479c..892976f 100644 --- a/src/pages/house_bills/index.tsx +++ b/src/pages/house_bills/index.tsx @@ -44,7 +44,7 @@ export default function Index({ title = '账单' }) { width: 100, }, { - title: '金额', + title: '账单金额', dataIndex: 'amount', search: false, width: 100, @@ -62,18 +62,18 @@ export default function Index({ title = '账单' }) { width: 100, }, - { - title: '计费开始日期', - dataIndex: 'start_date', - search: false, - width: 120, - }, - { - title: '计费结束日期', - dataIndex: 'end_date', - search: false, - width: 120, - }, + // { + // title: '计费开始日期', + // dataIndex: 'start_date', + // search: false, + // width: 120, + // }, + // { + // title: '计费结束日期', + // dataIndex: 'end_date', + // search: false, + // width: 120, + // }, // { // title: '滞纳金起算日期', // dataIndex: 'late_start_date', diff --git a/src/pages/house_bills/modals/Create.tsx b/src/pages/house_bills/modals/Create.tsx index 4aaa20c..0a424c0 100644 --- a/src/pages/house_bills/modals/Create.tsx +++ b/src/pages/house_bills/modals/Create.tsx @@ -29,7 +29,7 @@ export default function Create(props: MyBetaModalFormProps) { Apis.Bill.HouseBills.Store(values) .then(() => { props.reload?.(); - message.success(props.title + '成功'); + message.success(props.title + '账单添加成功'); return true; }) .catch(() => false)