diff --git a/src/gen/ApiTypes.d.ts b/src/gen/ApiTypes.d.ts index 9eb1a3f..3141e45 100644 --- a/src/gen/ApiTypes.d.ts +++ b/src/gen/ApiTypes.d.ts @@ -113,17 +113,20 @@ declare namespace ApiTypes { "status"?: string; // 状态,[enum:HouseRegistersStatusEnum] "customer_info"?: string[]; // 客户信息 "ownership_info"?: string[]; // 产权信息 + "remark"?: string; // 备注 }; type Update = { "id": number; // id "type": string; // 类型,[enum:HouseRegistersTypeEnum] "customer_info"?: string[]; // 客户信息 "ownership_info"?: string[]; // 产权信息 + "remark"?: string; // 备注 }; type MoveOut = { "house_occupants_id": number; // 房客id "move_out_date"?: Date; // 搬离时间 "apply_reason"?: string; // 搬离原因 + "remark"?: string; // 备注 }; type MoveIn = { "house_occupants_id": number; // 房客id @@ -132,6 +135,7 @@ declare namespace ApiTypes { }; type RemoveOwner = { "house_occupants_id": number; // 房客id + "remark"?: string; // 备注 }; type ChangeOccupant = { "house_occupants_id": number; // 房客id @@ -151,6 +155,7 @@ declare namespace ApiTypes { "owners_id"?: number; // 产权人id,[ref:house_occupants] "relation_with_owner"?: string; // 与产权人关系,[enum:HouseOccupantsRelationWithOwnerEnum] "status"?: string; // 状态,[enum:HouseOccupantsStatusEnum] + "remark"?: string; // 备注 }; type Show = { "id": number; // id @@ -356,6 +361,9 @@ declare namespace ApiTypes { "keywords"?: string; // 关键词 "companies_id"?: number; // 机构id }; + type Import = { + "upload_file"?: mimes:xlsx,xls; // 上传的时候必填文件 + }; } namespace AssetUnits { type List = { @@ -475,11 +483,7 @@ declare namespace ApiTypes { "asset_houses_id"?: number; // 资产房屋id,[ref:asset_houses] "full_name"?: string; // 模糊搜索:房屋名称 "company_name"?: string; // 模糊搜索:公司名称 -<<<<<<< HEAD - "bill_status"?: string; // 账单状态,[enum:HouseBillsBillStatusEnum] -======= "bill_status"?: string[]; // 账单状态,[enum:HouseBillsBillStatusEnum] ->>>>>>> 1ee118ed66388333954dd06d50024c67750430d4 }; type SummaryBillList = { "full_name"?: string; // 模糊搜索:房屋名称 @@ -637,6 +641,29 @@ declare namespace ApiTypes { "id": number; // id }; } + namespace Positions { + type List = { + "name"?: string; // 模糊搜索:名称 + }; + type Store = { + "name": string; // 岗位名称 + "is_use"?: number; // 是否启用,1启用,0禁用 + }; + type Update = { + "id": number; // id + "name": string; // 岗位名称 + "is_use"?: number; // 是否启用,1启用,0禁用 + }; + type Show = { + "id": number; // id + }; + type Delete = { + "id": number; // id + }; + type Select = { + "keywords"?: string; // 关键词 + }; + } } namespace Company { namespace Companies { @@ -801,6 +828,10 @@ declare namespace ApiTypes { "status"?: number; // 状态 "remark"?: string; // 备注 }; + type BatchStore = { + "companies_id": number; // 所属机构id,[ref:companies] + "positions_ids": string[]; // 岗位ID + }; type Show = { "id": number; // id }; @@ -1428,6 +1459,9 @@ declare namespace ApiTypes { type Delete = { "id": number; // id }; + type Import = { + "upload_file"?: mimes:xlsx,xls; // 上传的时候必填文件 + }; } } namespace Msg { diff --git a/src/gen/Apis.ts b/src/gen/Apis.ts index f5cb3ed..cf3e4bd 100644 --- a/src/gen/Apis.ts +++ b/src/gen/Apis.ts @@ -185,6 +185,12 @@ export const Apis = { Select(data?: ApiTypes.Asset.AssetProjects.Select): Promise { return request('admin/asset/asset_projects/select', { data }); }, + Import(data?: ApiTypes.Asset.AssetProjects.Import): Promise { + return request('admin/asset/asset_projects/import', { data }); + }, + DownloadTemplate(): Promise { + return request('admin/asset/asset_projects/download_template', {responseType: 'blob',}); + }, }, AssetUnits: { List(data?: ApiTypes.Asset.AssetUnits.List): Promise { @@ -374,6 +380,26 @@ export const Apis = { return request('admin/common/convenience_services/delete', { data }); }, }, + Positions: { + List(data?: ApiTypes.Common.Positions.List): Promise { + return request('admin/common/positions/list', { data }); + }, + Store(data: ApiTypes.Common.Positions.Store): Promise { + return request('admin/common/positions/store', { data }); + }, + Update(data: ApiTypes.Common.Positions.Update): Promise { + return request('admin/common/positions/update', { data }); + }, + Show(data: ApiTypes.Common.Positions.Show): Promise { + return request('admin/common/positions/show', { data }); + }, + Delete(data: ApiTypes.Common.Positions.Delete): Promise { + return request('admin/common/positions/delete', { data }); + }, + Select(data?: ApiTypes.Common.Positions.Select): Promise { + return request('admin/common/positions/select', { data }); + }, + }, }, Company: { Companies: { @@ -461,6 +487,9 @@ export const Apis = { Update(data: ApiTypes.Company.CompanyPositions.Update): Promise { return request('admin/company/company_positions/update', { data }); }, + BatchStore(data: ApiTypes.Company.CompanyPositions.BatchStore): Promise { + return request('admin/company/company_positions/batch_store', { data }); + }, Show(data: ApiTypes.Company.CompanyPositions.Show): Promise { return request('admin/company/company_positions/show', { data }); }, @@ -845,6 +874,12 @@ export const Apis = { Delete(data: ApiTypes.Meter.HouseMeters.Delete): Promise { return request('admin/meter/house_meters/delete', { data }); }, + Import(data?: ApiTypes.Meter.HouseMeters.Import): Promise { + return request('admin/meter/house_meters/import', { data }); + }, + DownloadTemplate(): Promise { + return request('admin/meter/house_meters/download_template', {responseType: 'blob',}); + }, }, }, Msg: { diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index b00adc5..1a7d72a 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -154,11 +154,7 @@ export const BannersTypeEnum= { // 缓存类型 export const CacheTypeEnum= { -<<<<<<< HEAD - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#262025","value":"MobilePhoneVerificationCode"}, -======= - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#b123bc","value":"MobilePhoneVerificationCode"}, ->>>>>>> 1ee118ed66388333954dd06d50024c67750430d4 + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#e3da02","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum @@ -451,11 +447,14 @@ export const HouseOccupantsHouseRelationEnum= { // HouseOccupantsRelationWithOwnerEnum export const HouseOccupantsRelationWithOwnerEnum= { + 'Self': {"text":"本人","color":"#52c41a","value":"Self"}, 'Spouse': {"text":"配偶","color":"#2db7f5","value":"Spouse"}, 'Children': {"text":"子女","color":"#87d068","value":"Children"}, 'Parents': {"text":"父母","color":"#faad14","value":"Parents"}, 'Siblings': {"text":"兄弟姐妹","color":"#fa8c16","value":"Siblings"}, 'OtherRelatives': {"text":"其他亲属","color":"#f5222d","value":"OtherRelatives"}, + 'PrimaryTenant': {"text":"主租客","color":"#722ed1","value":"PrimaryTenant"}, + 'Tenant': {"text":"租客","color":"#1890ff","value":"Tenant"}, }; // HouseOccupantsResidentialRelationEnum @@ -467,8 +466,8 @@ export const HouseOccupantsResidentialRelationEnum= { // HouseOccupantsStatusEnum export const HouseOccupantsStatusEnum= { - 'Normal': {"text":"正常","color":"#52c41a","value":"Normal"}, - 'Unbound': {"text":"已解除","color":"#f5222d","value":"Unbound"}, + 'Normal': {"text":"绑定","color":"#52c41a","value":"Normal"}, + 'Unbound': {"text":"解绑","color":"#f5222d","value":"Unbound"}, }; // 订单状态枚举 diff --git a/src/pages/mete/tasks/index.tsx b/src/pages/mete/tasks/index.tsx new file mode 100644 index 0000000..5c23cda --- /dev/null +++ b/src/pages/mete/tasks/index.tsx @@ -0,0 +1,115 @@ +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, + usePageTabs, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + HouseChargeTasksStatusEnum, + HouseChargeTasksTypeEnum, +} from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import TaskCreate from './modals/TaskCreate'; +import TaskShow from './modals/TaskShow'; + +export default function Index({ title = '账单任务' }) { + // 注册当前页面为标签页 + usePageTabs({ + tabKey: 'house_charge_tasks', + tabLabel: title, + }); + + return ( + + + MyProTableProps.request( + params, + sort, + Apis.HouseCharage.HouseChargeTasks.List, + ) + } + toolBarRender={(action) => [ + , + ]} + columns={[ + { + title: '机构', + dataIndex: ['company', 'name'], + search: false, + }, + { + title: '任务ID', + dataIndex: 'id', + search: false, + }, + MyColumns.EnumTag({ + title: '创建类型', + dataIndex: 'type', + valueEnum: HouseChargeTasksTypeEnum, + }), + MyColumns.EnumTag({ + title: '任务状态', + dataIndex: 'status', + valueEnum: HouseChargeTasksStatusEnum, + }), + { + title: '收费标准', + dataIndex: ['house_charge_standard', 'name'], + search: false, + }, + { + title: '账单月份', + render: (_, record) => { + return `${record.bill_year}-${String(record.bill_month).padStart( + 2, + '0', + )}`; + }, + }, + { + title: '计费周期', + + render: (_, record) => { + return `${record.start_date}-${String(record.end_date).padStart( + 2, + '0', + )}`; + }, + search: false, + }, + { + title: '账单数', + dataIndex: 'task_count', + search: false, + }, + // MyColumns.UpdatedAt(), + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + Apis.HouseCharage.HouseChargeTasks.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/mete/tasks/modals/TaskCreate.tsx b/src/pages/mete/tasks/modals/TaskCreate.tsx new file mode 100644 index 0000000..5a0dff8 --- /dev/null +++ b/src/pages/mete/tasks/modals/TaskCreate.tsx @@ -0,0 +1,122 @@ +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 { Form, message } from 'antd'; + +export default function Create(props: MyBetaModalFormProps) { + const [form] = Form.useForm(); + return ( + + {...MyModalFormProps.props} + title={`创建${props.title}`} + width="480px" + layout="horizontal" + labelCol={{ span: 8 }} + wrapperCol={{ span: 16 }} + labelAlign="left" + trigger={} + key={new Date().getTime()} + form={form} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); // 清空表单数据 + } + }} + onFinish={async (values) => + Apis.HouseCharage.HouseChargeTasks.Store(values) + .then(() => { + props.reload?.(); + message.success(props.title + '账单任务创建成功'); + return true; + }) + .catch(() => false) + } + columns={[ + Selects?.AssetProjects({ + title: '选择项目', + key: 'asset_projects_id', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + onChange: (val: any) => { + form.setFieldsValue({ + house_charge_standards_id: undefined, + }); + }, + }, + }), + { + valueType: 'dependency', + name: ['asset_projects_id'], + columns: ({ asset_projects_id }) => { + return [ + Selects?.ChargeStandard({ + title: '选择收费标准', + key: 'house_charge_standards_id', + params: { + asset_projects_id: asset_projects_id, + }, + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + showSearch: true, + }, + }), + ]; + }, + }, + { + key: 'month', + title: '选择生成月份', + valueType: 'date', + colProps: { span: 24 }, + fieldProps: { + picker: 'month', + format: 'YYYY-MM', + valueFormat: 'YYYY-MM', + style: { + width: '100%', + }, + onChange: (e: any, dateString: string) => { + form.setFieldsValue({ + start_date: rulesHelper.getMonthStartDate(dateString), + end_date: rulesHelper.getMonthEndDate(dateString), + }); + }, + }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'start_date', + title: '计费开始日期', + valueType: 'date', + colProps: { span: 24 }, + fieldProps: { + style: { + width: '100%', + }, + }, + formItemProps: { ...rulesHelper.text }, + }, + { + key: 'end_date', + title: '计费结束日期', + valueType: 'date', + colProps: { span: 24 }, + fieldProps: { + style: { + width: '100%', + }, + }, + formItemProps: { ...rulesHelper.text }, + }, + ]} + /> + ); +} diff --git a/src/pages/mete/tasks/modals/TaskShow.tsx b/src/pages/mete/tasks/modals/TaskShow.tsx new file mode 100644 index 0000000..795010d --- /dev/null +++ b/src/pages/mete/tasks/modals/TaskShow.tsx @@ -0,0 +1,69 @@ +import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import { Apis } from '@/gen/Apis'; +import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; + +export default function AssetInfo(props: MyBetaModalFormProps) { + return ( + + MyProTableProps.request( + { ...params, house_charge_tasks_id: props?.item?.id }, + sort, + Apis.HouseCharage.HouseChargeTaskDetails.List, + ) + } + columns={[ + MyColumns.ID(), + { + title: '对象', + dataIndex: 'full_name', + search: false, + }, + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: HouseChargeTaskDetailsStatusEnum, + }), + + { + title: '收费标准', + dataIndex: ['house_charge_task', 'house_charge_standard', 'name'], + search: false, + }, + { + title: '账单月份', + render: (_, record) => { + return `${record.year}-${String(record.month).padStart( + 2, + '0', + )}`; + }, + }, + { + title: '计费周期', + render: (_, record) => { + return `${record.house_charge_task.start_date} 至 ${String( + record.house_charge_task.end_date, + ).padStart(2, '0')}`; + }, + search: false, + }, + { + title: '完成时间', + dataIndex: 'processed_time', + search: false, + }, + ]} + /> + } + /> + ); +}