diff --git a/gencode.json b/gencode.json index f9cf29c..28807af 100644 --- a/gencode.json +++ b/gencode.json @@ -1,5 +1,4 @@ { "url": "http://10.39.13.80:8003/api/docs/openapi", - // "url": "http://we6f9c65.natappfree.cc/api/docs/openapi", "module": "Admin" } diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index 337c698..d2fe834 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -22,6 +22,10 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type Select = { + "asset_projects_id"?: number; // 所属项目id,[ref:asset_projects] + "keywords"?: string; // 关键词 + }; } namespace AssetHouses { type List = { @@ -35,7 +39,6 @@ declare namespace ApiTypes { "asset_buildings_id": number; // 所属楼栋id,[ref:asset_buildings] "asset_units_id": number; // 所属单元id,[ref:asset_units] "name": string; // 房屋名称 - "full_name": string; // 房屋全称 "floor"?: number; // 楼层 "built_area"?: number; // 建筑面积 "inside_area"?: number; // 套内面积 @@ -81,13 +84,14 @@ declare namespace ApiTypes { } namespace AssetProjects { type List = { + "companies_id"?: number; // 所属机构id,[ref:companies] "name"?: string; // 模糊搜索:名称 }; type Store = { "name": string; // 项目名称 "alias_name"?: string; // 项目别名 "code"?: string; // 项目编码 - "companies_id": number; // 所属机构id,[ref:companies] + "companies_id"?: number; // 所属机构id,[ref:companies] "province"?: string; // 省 "city"?: string; // 市 "area"?: string; // 区 @@ -111,7 +115,7 @@ declare namespace ApiTypes { "name": string; // 项目名称 "alias_name"?: string; // 项目别名 "code"?: string; // 项目编码 - "companies_id": number; // 所属机构id,[ref:companies] + "companies_id"?: number; // 所属机构id,[ref:companies] "province"?: string; // 省 "city"?: string; // 市 "area"?: string; // 区 @@ -142,6 +146,9 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type Select = { + "keywords"?: string; // 关键词 + }; } namespace AssetUnits { type List = { @@ -178,6 +185,11 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type Select = { + "asset_projects_id"?: number; // 所属项目id,[ref:asset_projects] + "asset_buildings_id"?: number; // 所属楼栋id,[ref:asset_buildings] + "keywords"?: string; // 关键词 + }; } } namespace Common { @@ -249,7 +261,7 @@ declare namespace ApiTypes { "business_license_image"?: string[]; // 营业执照图片 "_lft"?: number; // "_rgt"?: number; // - "parent_id"?: number; // + "parent_id"?: number; // 上级 ID }; type Update = { "id": number; // id @@ -273,11 +285,7 @@ declare namespace ApiTypes { "business_license_image"?: string[]; // 营业执照图片 "_lft"?: number; // "_rgt"?: number; // - "parent_id"?: number; // - }; - type Move = { - "id": number; // ID - "type": string; // 类型:up 升级,down 降级 + "parent_id"?: number; // 上级 ID }; type Show = { "id": number; // id @@ -294,9 +302,90 @@ declare namespace ApiTypes { type Select = { "keywords"?: string; // 关键词 }; - type SelectTree = { - "keywords"?: string; // - - "parent_id"?: number; // - + } + namespace CompanyReceiptAccounts { + type List = { + "name"?: string; // 模糊搜索:名称 + }; + type Store = { + "companies_id": number; // 所属机构id,[ref:companies] + "company_name": string; // 企业名称 + "company_bank": string; // 企业开户行 + "company_account": string; // 企业账户 + "pay_channel": string; // 收款渠道,[enum:CompanyReceiptAccountsPayChannelEnum] + "merchant_id"?: string; // 第三方支付的商户ID + "is_default"?: number; // 是否默认收款账号 + }; + type Update = { + "id": number; // id + "companies_id": number; // 所属机构id,[ref:companies] + "company_name": string; // 企业名称 + "company_bank": string; // 企业开户行 + "company_account": string; // 企业账户 + "pay_channel": string; // 收款渠道,[enum:CompanyReceiptAccountsPayChannelEnum] + "merchant_id"?: string; // 第三方支付的商户ID + "is_default"?: number; // 是否默认收款账号 + }; + type Show = { + "id": number; // id + }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + } + namespace Organizations { + type List = { + "name"?: string; // 模糊搜索:名称 + "companies_id"?: number; // 机构ID[ref:companies] + }; + type Store = { + "companies_id": number; // 所属机构id,[ref:companies] + "type": string; // 类型,[enum:OrganizationsTypeEnum] + "name": string; // 名称 + "managers_id": number; // 负责人IDid,[ref:company_employees] + "manager_phone"?: string; // 负责人电话 + "manager_email"?: string; // 负责人邮箱 + "status"?: number; // 状态 + "sort"?: number; // 排序 + "_lft"?: number; // + "_rgt"?: number; // + "parent_id"?: number; // + }; + type Update = { + "id": number; // id + "companies_id": number; // 所属机构id,[ref:companies] + "type": string; // 类型,[enum:OrganizationsTypeEnum] + "name": string; // 名称 + "managers_id": number; // 负责人IDid,[ref:company_employees] + "manager_phone"?: string; // 负责人电话 + "manager_email"?: string; // 负责人邮箱 + "status"?: number; // 状态 + "sort"?: number; // 排序 + "_lft"?: number; // + "_rgt"?: number; // + "parent_id"?: number; // 上级 ID + }; + type Move = { + "id": number; // ID + "type": string; // 类型:up 升级,down 降级 + }; + type Show = { + "id": number; // id + }; + type SoftDelete = { + "id": number; // id + }; + type Restore = { + "id": number; // id + }; + type Delete = { + "id": number; // id }; } } diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index 9f280f6..661125e 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -19,6 +19,9 @@ export const Apis = { Delete(data: ApiTypes.Asset.AssetBuildings.Delete): Promise { return request('admin/asset/asset_buildings/delete', { data }); }, + Select(data?: ApiTypes.Asset.AssetBuildings.Select): Promise { + return request('admin/asset/asset_buildings/select', { data }); + }, }, AssetHouses: { List(data?: ApiTypes.Asset.AssetHouses.List): Promise { @@ -59,6 +62,9 @@ export const Apis = { Delete(data: ApiTypes.Asset.AssetProjects.Delete): Promise { return request('admin/asset/asset_projects/delete', { data }); }, + Select(data?: ApiTypes.Asset.AssetProjects.Select): Promise { + return request('admin/asset/asset_projects/select', { data }); + }, }, AssetUnits: { List(data?: ApiTypes.Asset.AssetUnits.List): Promise { @@ -76,6 +82,9 @@ export const Apis = { Delete(data: ApiTypes.Asset.AssetUnits.Delete): Promise { return request('admin/asset/asset_units/delete', { data }); }, + Select(data?: ApiTypes.Asset.AssetUnits.Select): Promise { + return request('admin/asset/asset_units/select', { data }); + }, }, }, Common: { @@ -131,9 +140,6 @@ export const Apis = { Update(data: ApiTypes.Company.Companies.Update): Promise { return request('admin/company/companies/update', { data }); }, - Move(data: ApiTypes.Company.Companies.Move): Promise { - return request('admin/company/companies/move', { data }); - }, Show(data: ApiTypes.Company.Companies.Show): Promise { return request('admin/company/companies/show', { data }); }, @@ -149,8 +155,54 @@ export const Apis = { Select(data?: ApiTypes.Company.Companies.Select): Promise { return request('admin/company/companies/select', { data }); }, - SelectTree(data?: ApiTypes.Company.Companies.SelectTree): Promise { - return request('admin/company/companies/select_tree', { data }); + }, + CompanyReceiptAccounts: { + List(data?: ApiTypes.Company.CompanyReceiptAccounts.List): Promise { + return request('admin/company/company_receipt_accounts/list', { data }); + }, + Store(data: ApiTypes.Company.CompanyReceiptAccounts.Store): Promise { + return request('admin/company/company_receipt_accounts/store', { data }); + }, + Update(data: ApiTypes.Company.CompanyReceiptAccounts.Update): Promise { + return request('admin/company/company_receipt_accounts/update', { data }); + }, + Show(data: ApiTypes.Company.CompanyReceiptAccounts.Show): Promise { + return request('admin/company/company_receipt_accounts/show', { data }); + }, + SoftDelete(data: ApiTypes.Company.CompanyReceiptAccounts.SoftDelete): Promise { + return request('admin/company/company_receipt_accounts/soft_delete', { data }); + }, + Restore(data: ApiTypes.Company.CompanyReceiptAccounts.Restore): Promise { + return request('admin/company/company_receipt_accounts/restore', { data }); + }, + Delete(data: ApiTypes.Company.CompanyReceiptAccounts.Delete): Promise { + return request('admin/company/company_receipt_accounts/delete', { data }); + }, + }, + Organizations: { + List(data?: ApiTypes.Company.Organizations.List): Promise { + return request('admin/company/organizations/list', { data }); + }, + Store(data: ApiTypes.Company.Organizations.Store): Promise { + return request('admin/company/organizations/store', { data }); + }, + Update(data: ApiTypes.Company.Organizations.Update): Promise { + return request('admin/company/organizations/update', { data }); + }, + Move(data: ApiTypes.Company.Organizations.Move): Promise { + return request('admin/company/organizations/move', { data }); + }, + Show(data: ApiTypes.Company.Organizations.Show): Promise { + return request('admin/company/organizations/show', { data }); + }, + SoftDelete(data: ApiTypes.Company.Organizations.SoftDelete): Promise { + return request('admin/company/organizations/soft_delete', { data }); + }, + Restore(data: ApiTypes.Company.Organizations.Restore): Promise { + return request('admin/company/organizations/restore', { data }); + }, + Delete(data: ApiTypes.Company.Organizations.Delete): Promise { + return request('admin/company/organizations/delete', { data }); }, }, }, diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index d3d2010..a9ad84d 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -53,7 +53,7 @@ export const AssetProjectsChargeEnum= { // AssetProjectsEntrustTypeEnum export const AssetProjectsEntrustTypeEnum= { - 'DeveloperJointEntrust': {"text":"开发商合委","color":"#007bff","value":"DeveloperJointEntrust"}, + 'DeveloperJointEntrust': {"text":"开发商全委","color":"#007bff","value":"DeveloperJointEntrust"}, 'OwnersFullEntrust': {"text":"业委会全委","color":"#28a745","value":"OwnersFullEntrust"}, 'GovernmentFullEntrust': {"text":"政府类全委","color":"#ffc107","value":"GovernmentFullEntrust"}, }; @@ -100,6 +100,22 @@ export const CompaniesMerchantTypeEnum= { 'ServiceProvider': {"text":"服务商","color":"#28a745","value":"ServiceProvider"}, }; +// 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"}, +}; + +// 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"}, +}; + // SysModuleEnum export const SysModuleEnum= { 'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"}, diff --git a/src/pages/company/companies/$id.tsx b/src/pages/company/companies/$id.tsx new file mode 100644 index 0000000..ae34d05 --- /dev/null +++ b/src/pages/company/companies/$id.tsx @@ -0,0 +1,38 @@ +import { MyPageContainer } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { ProCard } from '@ant-design/pro-components'; +import { useParams } from '@umijs/max'; +import { Tabs } from 'antd'; +import { useEffect, useState } from 'react'; +import Organizations from './components/Organizations'; + +export default function Show({ title = '机构详情' }) { + const { id } = useParams<{ id: string }>(); + const [data, setShow] = useState({}); + + const loadShow = () => { + let paramsId: any = { id: id ?? 0 }; + Apis.Company.Companies.Show(paramsId).then((res) => { + setShow(res?.data); + }); + }; + useEffect(() => { + loadShow(); + }, [id]); + + let items = [ + { + label: '组织', + key: '1', + closable: false, + children: , + }, + ]; + return ( + + + + + + ); +} diff --git a/src/pages/company/companies/components/Organizations.tsx b/src/pages/company/companies/components/Organizations.tsx new file mode 100644 index 0000000..41fe6aa --- /dev/null +++ b/src/pages/company/companies/components/Organizations.tsx @@ -0,0 +1,38 @@ +import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { ProTable } from '@ant-design/pro-components'; +import OrganizationsCreate from '../modals/OrganizationsCreate'; + +export default function Organizations(props: MyBetaModalFormProps) { + return ( + <> + + MyProTableProps.request( + { ...params, companies_id: props?.item?.id }, + sort, + Apis.Company.Organizations.List, + ) + } + toolBarRender={(action) => [ + , + ]} + options={false} + columns={[ + MyColumns.ID(), + { + title: '楼栋', + width: '250px', + dataIndex: 'name', + }, + ]} + /> + + ); +} diff --git a/src/pages/company/companies/index.tsx b/src/pages/company/companies/index.tsx index a43f983..ea59db9 100644 --- a/src/pages/company/companies/index.tsx +++ b/src/pages/company/companies/index.tsx @@ -7,11 +7,12 @@ import { import { Apis } from '@/gen/Apis'; import { CompaniesMerchantTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; import { Space } from 'antd'; import Create from './modals/Create'; -import Update from './modals/Update'; export default function Index({ title = '机构管理' }) { + const navigate = useNavigate(); return ( ( - + {/* */} + { + navigate(`/company/companies/${item.id}`); + }} + /> Apis.Common.Admins.Delete({ id: item.id }).then(() => diff --git a/src/pages/company/companies/modals/OrganizationsCreate.tsx b/src/pages/company/companies/modals/OrganizationsCreate.tsx new file mode 100644 index 0000000..5304c94 --- /dev/null +++ b/src/pages/company/companies/modals/OrganizationsCreate.tsx @@ -0,0 +1,98 @@ +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 { message } from 'antd'; + +export default function Create(props: MyBetaModalFormProps) { + return ( + + {...MyModalFormProps.props} + title={`添加${props.title}`} + wrapperCol={{ span: 24 }} + width="800px" + trigger={} + onFinish={async (values) => + Apis.Company.Companies.Store(values) + .then(() => { + props.reload?.(); + message.success(props.title + '成功'); + return true; + }) + .catch(() => false) + } + columns={[ + { + key: 'name', + title: '机构名称', + colProps: { span: 8 }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'short_name', + title: '机构简称', + colProps: { span: 8 }, + }, + { + key: 'business_license_number', + title: '营业执照号', + colProps: { span: 8 }, + formItemProps: { ...rulesHelper.text }, + }, + + { + key: 'contact_name', + title: '联系人姓名', + colProps: { span: 8 }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'contact_phone', + title: '联系人手机', + colProps: { span: 8 }, + valueType: 'number', + fieldProps: { + maxLength: 11, + }, + formItemProps: { ...rulesHelper.number }, + }, + { + key: 'contact_email', + title: '联系人邮箱', + colProps: { span: 8 }, + }, + { + key: 'contact_address', + title: '联系人地址', + colProps: { span: 24 }, + }, + MyFormItems.EnumRadio({ + key: 'merchant_type', + title: '商户类型', + colProps: { span: 24 }, + valueEnum: CompaniesMerchantTypeEnum, + required: true, + }), + Address.Cascader({ + key: 'casacader', + title: '选择地址', + colProps: { span: 24 }, + keys: ['province', 'city', 'area', 'street'], + required: true, + }), + { + key: 'address', + title: '详细地址', + colProps: { span: 24 }, + }, + ]} + /> + ); +}