diff --git a/.umirc.ts b/.umirc.ts index 318fa17..2aa773e 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -15,9 +15,9 @@ export default defineConfig({ proxy: { '/api/': { // target: 'http://yt:8003', - // target: 'http://10.39.13.78:8001/', + target: 'http://10.39.13.78:8001/', // target: 'https://test-admin.linyikj.com.cn/', - target: 'https://admin.linyikj.com.cn/', + // target: 'https://admin.linyikj.com.cn/', // target: 'http://c789629c.natappfree.cc', changeOrigin: true, diff --git a/gencode.json b/gencode.json index 38a8029..b5fb778 100644 --- a/gencode.json +++ b/gencode.json @@ -1,4 +1,4 @@ { - "url": "http://v79683c9.natappfree.cc/api/docs/openapi", + "url": "http://10.39.13.78:8001/api/docs/openapi", "module": "Admin" } diff --git a/src/common/libs/umi/layoutConfig.tsx b/src/common/libs/umi/layoutConfig.tsx index 88c1335..a575bd6 100644 --- a/src/common/libs/umi/layoutConfig.tsx +++ b/src/common/libs/umi/layoutConfig.tsx @@ -41,9 +41,10 @@ export const LayoutConfig: RuntimeConfig['layout'] = () => { avatarProps: { render: () => , }, - waterMarkProps: { - content: snap.session.user?.username, - }, + //水印设置 + // waterMarkProps: { + // content: snap.session.user?.username, + // }, collapsedButtonRender: false, token: { bgLayout: '#eef0f3', diff --git a/src/components/MyModal.tsx b/src/components/MyModal.tsx index f13b3f7..c43bccb 100644 --- a/src/components/MyModal.tsx +++ b/src/components/MyModal.tsx @@ -10,7 +10,7 @@ export function MyModal(props?: any) { useEffect(() => { if (open) { - props?.onOpen(true); + props?.onOpen?.(true); } }, [open]); diff --git a/src/components/Select.tsx b/src/components/Select.tsx index d956e28..364cbe6 100644 --- a/src/components/Select.tsx +++ b/src/components/Select.tsx @@ -585,15 +585,16 @@ export const Selects = { formItemProps: { ...(required ? rulesHelper.number : {}) }, request: async (params) => { + console.log(params, '1111'); let res = await Apis.Meter.HouseMeters.List({ - keywords: params?.KeyWords, + ...params, asset_projects_id: params?.asset_projects_id, charge_standards_id: params?.house_charge_standards_id, - ...params, + name: params?.keyWords || undefined, }); res?.data?.map((l: any) => { l.label = l.id + ':' + l.name; - l.value = l.house_meter_has_houses[0].asset_houses_id; + l.value = l.id; }); return res?.data; }, diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index 9307e20..a8a8ab1 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -154,7 +154,7 @@ export const BannersTypeEnum= { // 缓存类型 export const CacheTypeEnum= { - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#b2685c","value":"MobilePhoneVerificationCode"}, + 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#ad9561","value":"MobilePhoneVerificationCode"}, }; // CompaniesMerchantTypeEnum diff --git a/src/pages/archive/components/SummaryInfo.tsx b/src/pages/archive/components/SummaryInfo.tsx index f801d88..24b5028 100644 --- a/src/pages/archive/components/SummaryInfo.tsx +++ b/src/pages/archive/components/SummaryInfo.tsx @@ -1,49 +1,56 @@ -import { MyBetaModalFormProps, MyProTableProps } from '@/common'; +import { MyBetaModalFormProps, MyButtons } from '@/common'; import { Apis } from '@/gen/Apis'; -import { ProCard, ProTable } from '@ant-design/pro-components'; +import { ProCard, ProDescriptions } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; +import { useEffect, useState } from 'react'; + +export default function Info(props: MyBetaModalFormProps) { + const [getShow, setDataShow] = useState({}); + const navigate = useNavigate(); + + useEffect(() => { + Apis.Bill.HouseBills.SummaryShow({ + asset_houses_id: props?.item?.id, + }) + .then((res) => { + console.log(res); + setDataShow(JSON.parse(JSON.stringify(res?.data))); + return false; + }) + .catch(() => false); + }, [props?.item?.id]); -export default function info(props: MyBetaModalFormProps) { - const { item } = props; return ( - - MyProTableProps.request( - { - ...params, - asset_houses_id: item?.asset_houses_id, - }, - sort, - Apis.Bill.HouseBills.SummaryBillList, - ) - } - search={false} - options={false} - pagination={false} - columns={[ - { - title: '账单金额合计', - dataIndex: 'payable_amount_sum', - search: false, - }, - { - title: '滞纳金合计', - dataIndex: 'late_fee_sum', - search: false, - }, - { - title: '优惠金额合计', - dataIndex: 'discount_amount_sum', - search: false, - }, - { - title: '应付合计', - dataIndex: 'total_payable_sum', - search: false, - }, - ]} - /> + + {/* + {getShow?.payable_amount_sum || '-'} + + + {getShow?.late_fee_sum || '-'} + + + {getShow?.discount_amount_sum || '-'} + */} + + + {getShow?.total_payable_sum || ''} + {getShow?.payable_amount_sum ? ( + { + navigate(`/bills/summary/show/${props?.item?.id || 0}`); + }} + /> + ) : ( + '无账单' + )} + + + ); } diff --git a/src/pages/archive/index.tsx b/src/pages/archive/index.tsx index 2d06536..7079765 100644 --- a/src/pages/archive/index.tsx +++ b/src/pages/archive/index.tsx @@ -126,7 +126,6 @@ export default function Index({ title = '房客关系' }) { }, search: false, }, - MyColumns.Option({ render: (_, item: any, index, action) => ( diff --git a/src/pages/archive/show/$id.tsx b/src/pages/archive/show/$id.tsx index eb9bdcb..6e22862 100644 --- a/src/pages/archive/show/$id.tsx +++ b/src/pages/archive/show/$id.tsx @@ -9,7 +9,6 @@ import SummaryInfo from '../components/SummaryInfo'; import OccupantsHistory from '../table/OccupantsHistory'; import OccupantsNow from '../table/OccupantsNow'; import RegistersList from '../table/RegistersList'; -import UnpaidBill from '../table/UnpaidBill'; export default function Show({ title = '房屋档案' }) { const { id } = useParams<{ id: string }>(); @@ -90,18 +89,18 @@ export default function Show({ title = '房屋档案' }) { /> ), }, - { - label: '欠费账单', - key: '4', - closable: false, - children: , - }, + // { + // label: '欠费账单', + // key: '4', + // closable: false, + // children: , + // }, ]; return ( - + {id && } diff --git a/src/pages/asset/activities/index.tsx b/src/pages/asset/activities/index.tsx index 880d7c9..6e6ad53 100644 --- a/src/pages/asset/activities/index.tsx +++ b/src/pages/asset/activities/index.tsx @@ -100,14 +100,14 @@ export default function Index({ title = '项目活动' }) { render: (_, item: any, index, action) => ( - {(!item.end_time || new Date(item.end_time) > new Date()) && ( - - )} - {(!item.end_time || new Date(item.end_time) > new Date()) && ( + {/* {(!item.end_time || new Date(item.end_time) > new Date()) && ( + )} */} + + {/* {(!item.end_time || new Date(item.end_time) > new Date()) && ( action?.reload()); }} /> - )} - + )} */} + { + let newStatus; + if ( + item.publish_status === + ActivitiesPublishStatusEnum.Unpublished.value + ) { + newStatus = ActivitiesPublishStatusEnum.Published.value; + } else if ( + item.publish_status === + ActivitiesPublishStatusEnum.Published.value + ) { + newStatus = ActivitiesPublishStatusEnum.Unlisted.value; + } else { + newStatus = ActivitiesPublishStatusEnum.Published.value; + } + Apis.Activity.Activities.ChangePublishStatus({ + id: item.id, + publish_status: newStatus, + }).then(() => action?.reload()); + }} + /> {item.is_enroll === 1 && ( getShow()} node={ diff --git a/src/pages/asset/grids/index.tsx b/src/pages/asset/grids/index.tsx index c1adcb7..f2a69cd 100644 --- a/src/pages/asset/grids/index.tsx +++ b/src/pages/asset/grids/index.tsx @@ -39,6 +39,7 @@ export default function Index({ title = '楼栋范围' }) { , ]} columns={[ + MyColumns.ID(), { title: '关联项目', dataIndex: ['asset_project', 'name'], @@ -48,23 +49,15 @@ export default function Index({ title = '楼栋范围' }) { }, }, }, - { - title: 'ID', - dataIndex: 'id', - }, { title: '板块名称', dataIndex: 'name', }, - { - title: '标识', - dataIndex: 'grid_mark', - }, { title: '楼栋管家', dataIndex: ['company_employee', 'name'], render: (_, item: any) => - `${item?.company_employee?.name || ''}-${ + `${item?.company_employee?.name || ''}:${ item?.company_employee?.phone || '' }`, }, diff --git a/src/pages/asset/grids/modals/GridMannger.tsx b/src/pages/asset/grids/modals/GridMannger.tsx index 5aff682..b498148 100644 --- a/src/pages/asset/grids/modals/GridMannger.tsx +++ b/src/pages/asset/grids/modals/GridMannger.tsx @@ -16,12 +16,12 @@ export default function Create( return ( {...MyModalFormProps.props} - title={`设置管理员`} + title={`设置楼栋管家`} wrapperCol={{ span: 24 }} width="500px" form={form} key={new Date().getTime()} - trigger={} + trigger={} request={() => Promise.resolve(props.item)} onOpenChange={(open: any) => { if (open && props.item) { @@ -49,7 +49,7 @@ export default function Create( } columns={[ Selects?.Employees({ - title: '设置网格员', + title: '设置楼栋管家', dataIndex: 'company_employees_id', colProps: { span: 24 }, formItemProps: { ...rulesHelper.text }, diff --git a/src/pages/asset/grids/modals/GridShow.tsx b/src/pages/asset/grids/modals/GridShow.tsx index e772375..6912151 100644 --- a/src/pages/asset/grids/modals/GridShow.tsx +++ b/src/pages/asset/grids/modals/GridShow.tsx @@ -1,12 +1,6 @@ -import { MyBetaModalFormProps, renderTextHelper } from '@/common'; +import { MyBetaModalFormProps } from '@/common'; import { MyModal } from '@/components/MyModal'; import { Apis } from '@/gen/Apis'; -import { - AssetHousesOrientationEnum, - AssetHousesOwnershipTypeEnum, - AssetHousesStatusEnum, - AssetHousesUsageEnum, -} from '@/gen/Enums'; import { ProCard, ProDescriptions } from '@ant-design/pro-components'; import { Space } from 'antd'; import { useState } from 'react'; @@ -14,12 +8,10 @@ import { useState } from 'react'; export default function Info(props: MyBetaModalFormProps) { const [getShow, setDataShow] = useState({}); - // 只在弹窗打开时获取数据 - return ( { if (e) { return Apis.Grid.Grids.Show({ @@ -37,60 +29,25 @@ export default function Info(props: MyBetaModalFormProps) { node={ <> - - - - 【{getShow?.id}】 - {getShow?.name} - + + + {getShow?.name} - - {getShow?.name} + + + {getShow?.grid_ranges + ?.map( + (item: any) => + item?.asset_building?.name + item?.asset_unit?.name, + ) + .join(';')} - - {getShow?.floor} + + + {getShow?.created_at} - - - - - - - - {getShow?.built_area}m² - - - {getShow?.inside_area}m² - - - {getShow?.chargeable_area}m² - - - - - - {getShow?.room || ''}房{getShow?.hall || ''}厅 - {getShow?.bathroom || ''}卫{getShow?.kitchen || ''}厨 - {getShow?.balcony || ''}阳台 - - - + + {getShow?.updated_at} diff --git a/src/pages/asset/list/index.tsx b/src/pages/asset/list/index.tsx index 189762b..4653d17 100644 --- a/src/pages/asset/list/index.tsx +++ b/src/pages/asset/list/index.tsx @@ -131,7 +131,7 @@ export default function Index({ title = '项目列表' }) { /> - Apis.Common.Admins.Delete({ id: item.id }).then(() => + Apis.Asset.AssetProjects.Delete({ id: item.id }).then(() => action?.reload(), ) } diff --git a/src/pages/bills/list/index.tsx b/src/pages/bills/list/index.tsx index 7ee7b6c..c417148 100644 --- a/src/pages/bills/list/index.tsx +++ b/src/pages/bills/list/index.tsx @@ -113,7 +113,7 @@ export default function Index({ title = '账单明细' }) { - Apis.Common.Admins.Delete({ id: item.id }).then(() => + Apis.Bill.HouseBills.Delete({ id: item.id }).then(() => action?.reload(), ) } diff --git a/src/pages/bills/list/modals/BillCreate.tsx b/src/pages/bills/list/modals/BillCreate.tsx index d2343a2..5c6ed53 100644 --- a/src/pages/bills/list/modals/BillCreate.tsx +++ b/src/pages/bills/list/modals/BillCreate.tsx @@ -201,12 +201,6 @@ export default function Create(props: MyBetaModalFormProps) { formItemProps: { ...rulesHelper.number }, fieldProps: { showSearch: true, - onChange: () => { - form.setFieldsValue({ - asset_units_id: undefined, - asset_floors_id: undefined, - }); - }, }, }), ], diff --git a/src/pages/bills/list/modals/BillUpdate.tsx b/src/pages/bills/list/modals/BillUpdate.tsx index f018b93..c55727e 100644 --- a/src/pages/bills/list/modals/BillUpdate.tsx +++ b/src/pages/bills/list/modals/BillUpdate.tsx @@ -147,12 +147,6 @@ export default function Update(props: MyBetaModalFormProps) { formItemProps: { ...rulesHelper.number }, fieldProps: { showSearch: true, - onChange: () => { - form.setFieldsValue({ - asset_units_id: undefined, - asset_floors_id: undefined, - }); - }, }, }), ], diff --git a/src/pages/bills/summary/show/$id.tsx b/src/pages/bills/summary/show/$id.tsx index 634dbcd..0c7442f 100644 --- a/src/pages/bills/summary/show/$id.tsx +++ b/src/pages/bills/summary/show/$id.tsx @@ -13,6 +13,7 @@ export default function Show({ title = '账单详情' }) { const { id } = useParams<{ id: string }>(); const [data, setShow] = useState({}); + console.log(data, 'pppp'); // 注册标签页 const { addTab } = usePageTabs({ tabKey: `bill-detail-${id}`, @@ -43,27 +44,19 @@ export default function Show({ title = '账单详情' }) { label: '欠费账单', key: '1', closable: false, - children: ( - - ), + children: , }, { label: '已付账单', key: '2', closable: false, - children: ( - - ), + children: , }, { label: '作废账单', key: '3', closable: false, - children: ( - - ), + children: , }, ]; diff --git a/src/pages/charge/standard/components/HasHouse.tsx b/src/pages/charge/standard/components/HasHouse.tsx index b44764a..973b4d7 100644 --- a/src/pages/charge/standard/components/HasHouse.tsx +++ b/src/pages/charge/standard/components/HasHouse.tsx @@ -1,6 +1,7 @@ import { MyButtons, MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; +import { HouseBillsTypeEnum } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import { useEffect, useRef } from 'react'; @@ -28,11 +29,15 @@ export default function Index({ ...rest }) { ) } toolBarRender={(action) => [ - , + (rest?.item.charge_type === HouseBillsTypeEnum.PropertyFee.value || + rest?.item.charge_type === + HouseBillsTypeEnum.MaintenanceFund.value) && ( + + ), ]} search={false} columns={[ diff --git a/src/pages/charge/standard/index.tsx b/src/pages/charge/standard/index.tsx index 3056a3d..d2f4356 100644 --- a/src/pages/charge/standard/index.tsx +++ b/src/pages/charge/standard/index.tsx @@ -69,6 +69,11 @@ export default function Index({ title = '收费标准' }) { dataIndex: 'name', search: false, }, + { + title: '关联房屋数', + dataIndex: 'house_charge_has_houses_count', + search: false, + }, MyColumns.EnumTag({ title: '收费项', dataIndex: 'charge_type', @@ -148,11 +153,16 @@ export default function Index({ title = '收费标准' }) { reload={action?.reload} title="编辑" /> - + {(item.charge_type === HouseBillsTypeEnum.PropertyFee.value || + item.charge_type === + HouseBillsTypeEnum.MaintenanceFund.value) && ( + + )} + Apis.HouseCharage.HouseChargeStandards.Delete({ diff --git a/src/pages/charge/tasks/index.tsx b/src/pages/charge/tasks/index.tsx index 9ffcc4d..27296b6 100644 --- a/src/pages/charge/tasks/index.tsx +++ b/src/pages/charge/tasks/index.tsx @@ -55,11 +55,6 @@ export default function Index({ title = '账单任务' }) { dataIndex: ['asset_project', 'name'], search: false, }, - { - title: '任务ID', - dataIndex: 'id', - search: false, - }, MyColumns.EnumTag({ title: '创建类型', dataIndex: 'type', @@ -118,7 +113,11 @@ export default function Index({ title = '账单任务' }) { ( @@ -63,6 +64,7 @@ export default function AssetInfo(props: MyBetaModalFormProps) { '0', )}`; }, + search: false, }, { title: '计费周期', diff --git a/src/pages/common/positions/index.tsx b/src/pages/common/positions/index.tsx index d600319..5ea94a6 100644 --- a/src/pages/common/positions/index.tsx +++ b/src/pages/common/positions/index.tsx @@ -12,7 +12,7 @@ import { Space } from 'antd'; import Create from './modals/Create'; import Update from './modals/Update'; -export default function Index({ title = '岗位管理' }) { +export default function Index({ title = '岗位库' }) { const navigate = useNavigate(); // 注册当前页面为标签页 diff --git a/src/pages/company/brand/index.tsx b/src/pages/company/brand/index.tsx index 2379d1f..2352d79 100644 --- a/src/pages/company/brand/index.tsx +++ b/src/pages/company/brand/index.tsx @@ -45,10 +45,12 @@ export default function Index({ title = '品牌管理' }) { { title: '机构', dataIndex: ['company', 'name'], + width: 300, }, { title: '品牌名称', dataIndex: 'name', + width: 200, }, { title: 'logo', @@ -66,7 +68,9 @@ export default function Index({ title = '品牌管理' }) { ); }, + width: 100, }, + MyColumns.UpdatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( diff --git a/src/pages/company/employees/index.tsx b/src/pages/company/employees/index.tsx index 84c63d2..e36788d 100644 --- a/src/pages/company/employees/index.tsx +++ b/src/pages/company/employees/index.tsx @@ -92,8 +92,8 @@ export default function Index({ title = '员工管理' }) { - Apis.Common.Admins.Delete({ id: item.id }).then(() => - action?.reload(), + Apis.Company.CompanyEmployees.Delete({ id: item.id }).then( + () => action?.reload(), ) } /> diff --git a/src/pages/complaint/components/WorkLogsCreate.tsx b/src/pages/complaint/components/WorkLogsCreate.tsx new file mode 100644 index 0000000..da6119e --- /dev/null +++ b/src/pages/complaint/components/WorkLogsCreate.tsx @@ -0,0 +1,82 @@ +import { + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseWorkOrdersStatusEnum } from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +interface WorkLogsCreateProps { + workOrderId: number; + reload?: () => void; +} + +export default function WorkLogsCreate({ + workOrderId, + reload, +}: WorkLogsCreateProps) { + const [form] = Form.useForm(); + + return ( + + {...MyModalFormProps.props} + title={`添加处理记录`} + wrapperCol={{ span: 24 }} + width="600px" + trigger={} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); // 清空表单数据 + } + }} + key={new Date().getTime()} + form={form} + onFinish={async (values) => { + try { + await Apis.WorkOrder.HouseWorkLogs.Store({ + ...values, + house_work_orders_id: workOrderId, + }); + reload?.(); + message.success('添加处理记录成功'); + return true; + } catch (error) { + message.error('添加处理记录失败'); + return false; + } + }} + columns={[ + MyFormItems.EnumRadio({ + key: 'status', + title: '工单状态', + colProps: { span: 24 }, + valueEnum: HouseWorkOrdersStatusEnum, + required: true, + formItemProps: { ...rulesHelper.text }, + }), + { + key: 'description', + title: '进度描述', + valueType: 'textarea', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + fieldProps: { + rows: 4, + placeholder: '请输入处理进度描述', + }, + }, + MyFormItems.UploadImages({ + key: 'attachments', + title: '相关图片', + uploadType: 'file', + max: 5, + colProps: { span: 24 }, + formItemProps: { required: false }, + }), + ]} + /> + ); +} diff --git a/src/pages/complaint/components/WorkLogsLIst.tsx b/src/pages/complaint/components/WorkLogsLIst.tsx new file mode 100644 index 0000000..1cdf755 --- /dev/null +++ b/src/pages/complaint/components/WorkLogsLIst.tsx @@ -0,0 +1,143 @@ +import { MyButtons, MyColumns, MyProTableProps } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseWorkOrdersStatusEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { Image, Space } from 'antd'; +import { useEffect, useRef } from 'react'; +import WorkLogsCreate from './WorkLogsCreate'; + +interface WorkLogsListProps { + workOrderId: number; + reload?: () => void; +} + +export default function WorkLogsList({ + workOrderId, + reload, +}: WorkLogsListProps) { + const actionRef = useRef(); + + useEffect(() => { + actionRef?.current?.reload(); + }, [workOrderId]); + + return ( + <> + > + {...MyProTableProps.props} + actionRef={actionRef} + request={async (params, sort) => + MyProTableProps.request( + { + ...params, + house_work_orders_id: workOrderId, + }, + sort, + Apis.WorkOrder.HouseWorkLogs.List, + ) + } + toolBarRender={(action) => [ + { + action?.reload(); + reload?.(); + }} + />, + ]} + search={false} + pagination={{ + pageSize: 10, + showSizeChanger: false, + }} + columns={[ + MyColumns.ID(), + MyColumns.EnumTag({ + title: '工单状态', + dataIndex: 'status', + valueEnum: HouseWorkOrdersStatusEnum, + search: false, + }), + { + title: '进度描述', + dataIndex: 'description', + search: false, + ellipsis: true, + }, + + { + title: '附件', + dataIndex: 'attachments', + search: false, + render: (_, record) => { + if ( + !Array.isArray(record.attachments) || + record.attachments.length === 0 + ) { + return '无附件'; + } + return ( + + {record.attachments.map((item: any, index: number) => { + if (item.type && item.type.includes('image')) { + return ( + + ); + } else if (item.type && item.type.includes('video')) { + return ( + + ); + } + return null; + })} + + ); + }, + }, + { + title: '创建时间', + dataIndex: 'created_at', + valueType: 'dateTime', + search: false, + width: 160, + }, + MyColumns.UpdatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + Apis.WorkOrder.HouseWorkLogs.Delete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + > + ); +} diff --git a/src/pages/complaint/index.tsx b/src/pages/complaint/index.tsx new file mode 100644 index 0000000..b40fc41 --- /dev/null +++ b/src/pages/complaint/index.tsx @@ -0,0 +1,186 @@ +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, + usePageTabs, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + HouseWorkOrdersAssignStatusEnum, + HouseWorkOrdersLevelEnum, + HouseWorkOrdersStatusEnum, + HouseWorkOrdersTypeEnum, +} from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Image, Space } from 'antd'; +import ComplaintAssign from './modals/ComplaintAssign'; + +import ComplaintShow from './modals/ComplaintShow'; + +export default function Index({ title = '投诉列表' }) { + const navigate = useNavigate(); + + // 注册当前页面为标签页 + usePageTabs({ + tabKey: 'complaint', + tabLabel: title, + }); + + return ( + + + MyProTableProps.request( + { + ...params, + type: [HouseWorkOrdersTypeEnum.Complaint.value], + }, + sort, + Apis.WorkOrder.HouseWorkOrders.List, + ) + } + // toolBarRender={(action) => [ + // , + // ]} + columns={[ + MyColumns.ID(), + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: HouseWorkOrdersStatusEnum, + }), + { + title: '描述', + dataIndex: 'content', + width: 120, // 关键:固定列宽(若父容器过窄,可设 minWidth: 200 优先保证列宽) + search: false, + render: (text) => ( + + {text} + + ), + }, + { + title: '附件', + dataIndex: 'attachments', + search: false, + render: (_, record) => { + if ( + !Array.isArray(record.attachments) || + record.attachments.length === 0 + ) { + return '无附件'; + } + return ( + + {record.attachments.map((item: any, index: number) => { + if (item.type && item.type.includes('image')) { + return ( + + ); + } else if (item.type && item.type.includes('video')) { + return ( + + ); + } + return null; + })} + + ); + }, + }, + MyColumns.EnumTag({ + title: '分配状态', + dataIndex: 'assign_status', + valueEnum: HouseWorkOrdersAssignStatusEnum, + }), + MyColumns.EnumTag({ + title: '优先级', + dataIndex: 'level', + valueEnum: HouseWorkOrdersLevelEnum, + }), + { + title: '处理人', + dataIndex: ['assign_employee', 'name'], + search: false, + render: (_, record) => { + return `${record?.assign_employee?.name || ''}-${ + record?.assign_employee?.phone || '' + }`; + }, + }, + MyColumns.CreatedAt(), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + {item.assign_status === 'Unassigned' && ( + + )} + + Apis.WorkOrder.HouseWorkOrders.SoftDelete({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/complaint/modals/ComplaintAssign.tsx b/src/pages/complaint/modals/ComplaintAssign.tsx new file mode 100644 index 0000000..301e096 --- /dev/null +++ b/src/pages/complaint/modals/ComplaintAssign.tsx @@ -0,0 +1,88 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyFormItems, + MyModalFormProps, + rulesHelper, +} from '@/common'; +import { Selects } from '@/components/Select'; +import { Apis } from '@/gen/Apis'; +import { HouseWorkOrdersLevelEnum } from '@/gen/Enums'; +import { BetaSchemaForm } from '@ant-design/pro-components'; +import { Form, message } from 'antd'; + +export default function WorkOrderAssign( + props: MyBetaModalFormProps & { item: any }, +) { + const [form] = Form.useForm(); + return ( + + {...MyModalFormProps.props} + title={`派发工单`} + wrapperCol={{ span: 24 }} + width="500px" + trigger={} + key={new Date().getTime()} + form={form} + request={async () => { + const res = await Apis.WorkOrder.HouseWorkOrders.Show({ + id: props.item.id, + }); + return { + title: res.data.title, + assign_employee_id: res.data.assign_employee_id, + }; + }} + onFinish={async (values) => + Apis.WorkOrder.HouseWorkOrders.Assign({ + ...values, + id: props.item.id, + }) + .then(() => { + props.reload?.(); + message.success('指派工单成功'); + return true; + }) + .catch(() => false) + } + columns={[ + { + key: 'content', + title: '工单描述', + colProps: { span: 24 }, + readonly: true, + fieldProps: { + disabled: true, + }, + }, + MyFormItems.EnumRadio({ + key: 'level', + title: '优先级', + colProps: { span: 24 }, + valueEnum: HouseWorkOrdersLevelEnum, + required: true, + }), + Selects?.Employees({ + title: '选择处理人', + key: 'assign_employees_id', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + params: { + companies_id: props.item.companies_id, + }, + required: true, + }), + { + key: 'assign_remark', + title: '指派备注', + valueType: 'textarea', + colProps: { span: 24 }, + fieldProps: { + rows: 3, + placeholder: '请输入指派备注(可选)', + }, + }, + ]} + /> + ); +} diff --git a/src/pages/complaint/modals/ComplaintShow.tsx b/src/pages/complaint/modals/ComplaintShow.tsx new file mode 100644 index 0000000..2f0f936 --- /dev/null +++ b/src/pages/complaint/modals/ComplaintShow.tsx @@ -0,0 +1,251 @@ +import { MyButtons } from '@/common'; +import { Apis } from '@/gen/Apis'; +import { + HouseWorkOrdersAssignStatusEnum, + HouseWorkOrdersLevelEnum, + HouseWorkOrdersStatusEnum, +} from '@/gen/Enums'; +import { ProDescriptions } from '@ant-design/pro-components'; +import { Image, Modal, Space, Tag } from 'antd'; +import { useState } from 'react'; +import WorkLogsList from '../components/WorkLogsLIst'; +import WorkOrderAssign from './ComplaintAssign'; + +interface WorkOrderShowProps { + item: any; + title?: string; + reload?: () => void; +} + +export default function ComplaintShow({ + item, + title = '投诉详情', + reload, +}: WorkOrderShowProps) { + const [open, setOpen] = useState(false); + const [data, setData] = useState(null); + + const handleOpen = async () => { + try { + const res = await Apis.WorkOrder.HouseWorkOrders.Show({ id: item.id }); + setData(res.data); + setOpen(true); + } catch (error) { + console.error('获取投诉详情失败:', error); + } + }; + + return ( + <> + + setOpen(false)} + footer={null} + width={800} + > + {data && ( + <> + ( + // + // {HouseWorkOrdersTypeEnum[ + // record.type as keyof typeof HouseWorkOrdersTypeEnum + // ]?.text || record.type} + // + // ), + // }, + // { + // title: '报修位置', + // dataIndex: 'location', + // span: 1, + // render: (_, record) => { + // const locationConfig = + // HouseWorkOrdersLocationEnum[ + // record.location as keyof typeof HouseWorkOrdersLocationEnum + // ]; + + // return {locationConfig?.text || record.location}; + // }, + // }, + + { + title: 'ID', + dataIndex: 'id', + span: 1, + }, + + { + title: '投诉描述', + dataIndex: 'content', + span: 2, + }, + + { + title: '投诉状态', + dataIndex: 'status', + span: 1, + render: (_, record) => { + const statusConfig = + HouseWorkOrdersStatusEnum[ + record.status as keyof typeof HouseWorkOrdersStatusEnum + ]; + const color = + record.status === 'Completed' + ? 'green' + : record.status === 'InProgress' + ? 'blue' + : 'default'; + return ( + + {statusConfig?.text || record.status} + + ); + }, + }, + { + title: '分配状态', + dataIndex: 'assign_status', + span: 1, + render: (_, record) => { + const assignConfig = + HouseWorkOrdersAssignStatusEnum[ + record.assign_status as keyof typeof HouseWorkOrdersAssignStatusEnum + ]; + const color = + record.assign_status === 'Assigned' ? 'green' : 'orange'; + return ( + + {assignConfig?.text || record.assign_status} + + ); + }, + }, + { + title: '优先级', + dataIndex: 'level', + span: 1, + render: (_, record) => { + const levelConfig = + HouseWorkOrdersLevelEnum[ + record.level as keyof typeof HouseWorkOrdersLevelEnum + ]; + return {levelConfig?.text || record.level}; + }, + }, + { + title: '处理人', + dataIndex: 'assign_employee_name', + span: 1, + render: (_, record) => { + const assigneeInfo = record?.assign_employee + ? `${record.assign_employee.name || ''}-${ + record.assign_employee.phone || '' + }` + : '未分配'; + return ( + + {assigneeInfo} + + + ); + }, + }, + + { + title: '创建时间', + dataIndex: 'created_at', + span: 1, + valueType: 'dateTime', + }, + { + title: '更新时间', + dataIndex: 'updated_at', + span: 1, + valueType: 'dateTime', + }, + { + title: '相关附件', + dataIndex: 'attachments', + span: 2, + render: (_, record) => { + // 检查attachments是否为数组且有数据 + if ( + !Array.isArray(record.attachments) || + record.attachments.length === 0 + ) { + return '无附件'; + } + return ( + + {record.attachments.map((item: any, index: number) => { + if (item.type && item.type.includes('image')) { + return ( + + ); + } else if (item.type && item.type.includes('video')) { + return ( + + ); + } + return null; + })} + + ); + }, + }, + ]} + /> + {/* 处理记录 */} + { + handleOpen(); + reload?.(); + }} + /> + > + )} + + > + ); +} diff --git a/src/pages/customer/components/CustomerHouse.tsx b/src/pages/customer/components/CustomerHouse.tsx index e7d94e4..d04175b 100644 --- a/src/pages/customer/components/CustomerHouse.tsx +++ b/src/pages/customer/components/CustomerHouse.tsx @@ -1,6 +1,10 @@ import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common'; import { Apis } from '@/gen/Apis'; -import { HouseMeterReadingsOperationTypeEnum } from '@/gen/Enums'; +import { + HouseOccupantsHouseRelationEnum, + HouseOccupantsRelationWithOwnerEnum, + HouseOccupantsStatusEnum, +} from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; export default function Index(props: MyBetaModalFormProps) { @@ -16,45 +20,49 @@ export default function Index(props: MyBetaModalFormProps) { Apis.Archive.HouseOccupants.CustomerHouseByPhone, ) } - // search={false} - // options={false} + search={false} + options={false} columns={[ + { + title: '关联房屋', + dataIndex: ['asset_house', 'full_name'], + + search: false, + }, MyColumns.EnumTag({ - title: '操作类型', - dataIndex: 'operation_type', - valueEnum: HouseMeterReadingsOperationTypeEnum, + title: '状态', + dataIndex: 'status', + valueEnum: HouseOccupantsStatusEnum, + }), + MyColumns.EnumTag({ + title: '房客关系', + dataIndex: 'house_relation', + valueEnum: HouseOccupantsHouseRelationEnum, + search: false, + }), + MyColumns.EnumTag({ + title: '与产权人关系', + dataIndex: 'relation_with_owner', + valueEnum: HouseOccupantsRelationWithOwnerEnum, + search: false, }), { - title: '抄表读数', - dataIndex: 'current_reading', + title: '入住日期', + dataIndex: 'is_live_in', + render(_, record) { + return `${record?.move_in_date || '未入住'}`; + }, search: false, }, { - title: '抄表用量', - dataIndex: 'usage_amount', - search: false, - }, - { - title: '抄表时间', - dataIndex: 'reading_time', - search: false, - }, - { - title: '抄表人', - dataIndex: ['company_employee', 'name'], - search: false, - }, - { - title: '备注', - dataIndex: 'remark', - search: false, - }, - { - title: '账单状态', - dataIndex: 'bill_status', - render: (value) => (value ? '已生成' : '未生成'), + title: '退房日期', + dataIndex: 'move_out_date', + render(_, record) { + return `${record?.move_out_date || '-'}`; + }, search: false, }, + // MyColumns.Option({ // render: (_, item: any, index, action) => ( // diff --git a/src/pages/customer/show/$id.tsx b/src/pages/customer/show/$id.tsx index 86c1fdc..094f3a9 100644 --- a/src/pages/customer/show/$id.tsx +++ b/src/pages/customer/show/$id.tsx @@ -14,7 +14,7 @@ export default function Show({ title = '客户档案' }) { // 注册标签页 const { addTab } = usePageTabs({ tabKey: `customer-detail-${id}`, - tabLabel: `${data?.name}档案` || title, + tabLabel: `客户:${data?.name}` || title, }); const loadShow = () => { @@ -56,7 +56,12 @@ export default function Show({ title = '客户档案' }) { - + ); diff --git a/src/pages/meter/bills/index.tsx b/src/pages/meter/bills/index.tsx new file mode 100644 index 0000000..99e78d4 --- /dev/null +++ b/src/pages/meter/bills/index.tsx @@ -0,0 +1,111 @@ +import { + MyButtons, + MyColumns, + MyPageContainer, + MyProTableProps, + usePageTabs, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; + +export default function Index({ title = '仪表账单' }) { + const navigate = useNavigate(); + + // 注册当前页面为标签页 + usePageTabs({ + tabKey: 'house_meter_bills', + tabLabel: title, + }); + + return ( + + + MyProTableProps.request( + params, + sort, + Apis.Meter.HouseMeterTaskDetails.List, + ) + } + // toolBarRender={(action) => [ + // , + // ]} + columns={[ + MyColumns.ID(), + { + title: '仪表名称', + dataIndex: ['meter_data', 'name'], + search: false, + }, + { + title: '关联房屋', + dataIndex: 'full_name', + search: false, + render: (_, record) => ( + { + navigate(`/bills/summary/show/${record.asset_houses_id}`); + }} + /> + ), + }, + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: HouseChargeTaskDetailsStatusEnum, + }), + + { + title: '收费标准', + dataIndex: ['charge_standard', 'name'], + render: (_, record) => { + return `【${record.charge_standard.id}】${record.charge_standard.name}`; + }, + search: false, + }, + { + title: '账单月份', + render: (_, record) => { + return `${record.year}-${String(record.month).padStart(2, '0')}`; + }, + search: false, + }, + { + title: '完成时间', + dataIndex: 'processed_time', + search: false, + }, + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + Apis.Meter.HouseMeterTaskDetails.CreateMeterBill({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/meter/list/index.tsx b/src/pages/meter/list/index.tsx index c40dd5c..29b53d4 100644 --- a/src/pages/meter/list/index.tsx +++ b/src/pages/meter/list/index.tsx @@ -44,17 +44,36 @@ export default function Index({ title = '仪表管理' }) { toolBarRender={(action) => [ , + , , ]} columns={[ MyColumns.ID(), + { + title: '机构', + dataIndex: ['company', 'name'], + search: false, + }, + { + title: '项目', + dataIndex: ['asset_project', 'name'], + search: false, + }, MyColumns.EnumTag({ title: '类型', dataIndex: 'meter_type', @@ -76,6 +95,11 @@ export default function Index({ title = '仪表管理' }) { dataIndex: ['charge_standard', 'name'], search: false, }, + { + title: '关联房屋数', + dataIndex: 'house_meter_has_houses_count', + search: false, + }, { title: '初始抄表读数', dataIndex: 'initial_value', @@ -96,6 +120,7 @@ export default function Index({ title = '仪表管理' }) { dataIndex: 'latest_time', search: false, }, + { title: '备注', dataIndex: 'remark', diff --git a/src/pages/meter/readings/show/$id.tsx b/src/pages/meter/readings/show/$id.tsx index cef7e4e..8178d99 100644 --- a/src/pages/meter/readings/show/$id.tsx +++ b/src/pages/meter/readings/show/$id.tsx @@ -7,6 +7,7 @@ import { useEffect, useState } from 'react'; import MeteInfo from '../components/MeteInfo'; import HasHouse from '../table/HasHouse'; import ReadingLIst from '../table/ReadingLIst'; +import Tasks from '../table/Tasks'; export default function Show({ title = '仪表详情' }) { const { id } = useParams<{ id: string }>(); @@ -58,6 +59,12 @@ export default function Show({ title = '仪表详情' }) { closable: false, children: , }, + { + label: '仪表任务', + key: '3', + closable: false, + children: , + }, ]; return ( diff --git a/src/pages/meter/readings/table/HasHouse.tsx b/src/pages/meter/readings/table/HasHouse.tsx index f8aeb0e..075229c 100644 --- a/src/pages/meter/readings/table/HasHouse.tsx +++ b/src/pages/meter/readings/table/HasHouse.tsx @@ -10,7 +10,6 @@ import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; import MeterHasHouse from '../../list/modals/MeterHasHouse'; import MeterHasOne from '../../list/modals/MeterHasOne'; -import NormalReading from '../modals/NormalReading'; export default function Index(props: MyBetaModalFormProps) { return ( @@ -25,12 +24,6 @@ export default function Index(props: MyBetaModalFormProps) { ) } toolBarRender={(action) => [ - , ...(props?.item?.meter_type === HouseMetersMeterTypeEnum.HouseMeter.value ? [ diff --git a/src/pages/meter/readings/table/Tasks.tsx b/src/pages/meter/readings/table/Tasks.tsx new file mode 100644 index 0000000..dd08fd6 --- /dev/null +++ b/src/pages/meter/readings/table/Tasks.tsx @@ -0,0 +1,111 @@ +import { + MyBetaModalFormProps, + MyButtons, + MyColumns, + MyProTableProps, +} from '@/common'; +import { Apis } from '@/gen/Apis'; +import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; +import { Space } from 'antd'; + +export default function Index(props: MyBetaModalFormProps) { + const navigate = useNavigate(); + return ( + <> + + MyProTableProps.request( + { ...params, id: props?.item?.id }, + sort, + Apis.Meter.HouseMeterTaskDetails.List, + ) + } + // toolBarRender={(action) => [ + // , + // , + // ]} + // search={false} + // options={false} + columns={[ + MyColumns.ID(), + { + title: '仪表名称', + dataIndex: ['meter_data', 'name'], + search: false, + }, + { + title: '关联房屋', + dataIndex: 'full_name', + search: false, + render: (_, record) => ( + { + navigate(`/bills/summary/show/${record.asset_houses_id}`); + }} + /> + ), + }, + MyColumns.EnumTag({ + title: '状态', + dataIndex: 'status', + valueEnum: HouseChargeTaskDetailsStatusEnum, + }), + + { + title: '收费标准', + dataIndex: ['charge_standard', 'name'], + render: (_, record) => { + return `【${record.charge_standard.id}】${record.charge_standard.name}`; + }, + search: false, + }, + { + title: '账单月份', + render: (_, record) => { + return `${record.year}-${String(record.month).padStart(2, '0')}`; + }, + search: false, + }, + { + title: '完成时间', + dataIndex: 'processed_time', + search: false, + }, + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + Apis.HouseCharage.HouseChargeTaskDetails.CreateHouseBill({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), + ]} + /> + > + ); +} diff --git a/src/pages/meter/tasks/index.tsx b/src/pages/meter/tasks/index.tsx index 42c09d1..b5f86d4 100644 --- a/src/pages/meter/tasks/index.tsx +++ b/src/pages/meter/tasks/index.tsx @@ -15,7 +15,7 @@ import { Space } from 'antd'; import TaskCreate from './modals/TaskCreate'; import TaskShow from './modals/TaskShow'; -export default function Index({ title = '仪表账单' }) { +export default function Index({ title = '仪表任务' }) { // 注册当前页面为标签页 usePageTabs({ tabKey: 'house_meter_tasks', @@ -35,7 +35,7 @@ export default function Index({ title = '仪表账单' }) { MyProTableProps.request(params, sort, Apis.Meter.HouseMeterTasks.List) } toolBarRender={(action) => [ - , + , ]} columns={[ MyColumns.ID(), @@ -95,7 +95,6 @@ export default function Index({ title = '仪表账单' }) { render: (_, item: any, index, action) => ( - ( + { + navigate(`/bills/summary/show/${record.asset_houses_id}`); + }} + /> + ), }, MyColumns.EnumTag({ title: '状态', @@ -35,7 +58,10 @@ export default function AssetInfo(props: MyBetaModalFormProps) { { title: '收费标准', - dataIndex: ['house_charge_task', 'house_charge_standard', 'name'], + dataIndex: ['charge_standard', 'name'], + render: (_, record) => { + return `【${record.charge_standard.id}】${record.charge_standard.name}`; + }, search: false, }, { @@ -46,14 +72,6 @@ export default function AssetInfo(props: MyBetaModalFormProps) { '0', )}`; }, - }, - { - title: '计费周期', - render: (_, record) => { - return `${record.house_charge_task.start_date} 至 ${String( - record.house_charge_task.end_date, - ).padStart(2, '0')}`; - }, search: false, }, { @@ -61,6 +79,24 @@ export default function AssetInfo(props: MyBetaModalFormProps) { dataIndex: 'processed_time', search: false, }, + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + Apis.HouseCharage.HouseChargeTaskDetails.CreateHouseBill({ + id: item.id, + }).then(() => action?.reload()) + } + /> + + ), + }), ]} /> } diff --git a/src/pages/moments/classification/index.tsx b/src/pages/moments/classification/index.tsx index 3f3b7b6..8e6234d 100644 --- a/src/pages/moments/classification/index.tsx +++ b/src/pages/moments/classification/index.tsx @@ -11,7 +11,7 @@ import { Space } from 'antd'; import Create from './modals/Create'; import Update from './modals/Update'; -export default function Index({ title = '朋友圈分类' }) { +export default function Index({ title = '内容分类' }) { // 注册当前页面为标签页 usePageTabs({ tabKey: 'moments-classification', diff --git a/src/pages/moments/classification/modals/Create.tsx b/src/pages/moments/classification/modals/Create.tsx index edbcfa5..a1de6d4 100644 --- a/src/pages/moments/classification/modals/Create.tsx +++ b/src/pages/moments/classification/modals/Create.tsx @@ -7,8 +7,9 @@ import { import { MomentSelect } from '@/components/MomentCategories'; 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 ( {...MyModalFormProps.props} @@ -16,6 +17,12 @@ export default function Create(props: MyBetaModalFormProps) { wrapperCol={{ span: 24 }} width="500px" trigger={} + key={new Date().getTime()} + onOpenChange={(open: any) => { + if (open) { + form.resetFields(); // 清空表单数据 + } + }} onFinish={async (values) => Apis.Customer.CustomerMomentCategories.Store(values) .then(() => { diff --git a/src/pages/moments/list/components/infoPreview.tsx b/src/pages/moments/list/components/infoPreview.tsx index 77332bc..0277462 100644 --- a/src/pages/moments/list/components/infoPreview.tsx +++ b/src/pages/moments/list/components/infoPreview.tsx @@ -12,8 +12,8 @@ export default function infoPreview(props: MyBetaModalFormProps) { 员工头像 - 员工的名字 - 此处显示“发送文案”输入的文案 + 员工名字 + 此处显示“发送文案” @@ -31,8 +31,8 @@ export default function infoPreview(props: MyBetaModalFormProps) { 员工头像 - 员工的名字 - 此处显示“发送文案”输入的文案 + 员工名字 + 此处显示“发送文案” @@ -55,9 +55,9 @@ export default function infoPreview(props: MyBetaModalFormProps) { - 封面图 + 封面 - 此处显示“链接标题”输入的文案,文案字数多时可以换行显示 + 此处显示“链接标题”,字数较多时自动换行显示 diff --git a/src/pages/moments/list/components/style.scss b/src/pages/moments/list/components/style.scss index 437de62..04764c3 100644 --- a/src/pages/moments/list/components/style.scss +++ b/src/pages/moments/list/components/style.scss @@ -2,7 +2,7 @@ background-color: #f8f8f8; width: 400px; padding: 15px; - margin-left: 10px; + margin-left: 60px; border-radius: 10px; .title { border-left: 3px solid #1890ff; diff --git a/src/pages/moments/list/index.tsx b/src/pages/moments/list/index.tsx index 50741b9..2c42651 100644 --- a/src/pages/moments/list/index.tsx +++ b/src/pages/moments/list/index.tsx @@ -9,6 +9,7 @@ import { Apis } from '@/gen/Apis'; import { CustomerMomentsChannelEnum, CustomerMomentsContentTypeEnum, + CustomerMomentsPushStatusEnum, CustomerMomentsPushTypeEnum, CustomerMomentsTaskEndTypeEnum, } from '@/gen/Enums'; @@ -16,7 +17,7 @@ import { ProTable } from '@ant-design/pro-components'; import { Card, Space } from 'antd'; import Create from './modals/Create'; -export default function Index({ title = '推送任务' }) { +export default function Index({ title = '创建内容' }) { // 注册当前页面为标签页 usePageTabs({ tabKey: 'moments-list', @@ -47,15 +48,29 @@ export default function Index({ title = '推送任务' }) { ]} columns={[ MyColumns.ID(), + MyColumns.EnumTag({ + title: '任务推送', + dataIndex: 'push_status', + valueEnum: CustomerMomentsPushStatusEnum, + search: false, + }), { - title: '名称', + title: '标题', dataIndex: 'title', render: (_, i: any) => { return ( - {i?.title} + 0 + ? i?.cover_image[0]?.url + : i?.attachments[0]?.url + } + width={45} + height={45} + /> ); @@ -77,7 +92,7 @@ export default function Index({ title = '推送任务' }) { valueEnum: CustomerMomentsPushTypeEnum, }), { - title: '定时发送时间', + title: '推送时间', dataIndex: 'scheduled_time', search: false, }, @@ -89,15 +104,16 @@ export default function Index({ title = '推送任务' }) { search: false, }), { - title: '任务结束天数', + title: '任务结束时间', dataIndex: 'task_days', search: false, + render: (_, record: any) => { + return record?.task_end_type === 'AfterNDays' + ? `任务发送后:${record?.task_days}天` + : '${record?.task_end_time}'; + }, }, - { - title: '定时结束', - dataIndex: 'task_end_time', - search: false, - }, + MyColumns.UpdatedAt(), MyColumns.CreatedAt(), MyColumns.Option({ diff --git a/src/pages/moments/list/modals/Create.tsx b/src/pages/moments/list/modals/Create.tsx index dfe9a85..00fb1b2 100644 --- a/src/pages/moments/list/modals/Create.tsx +++ b/src/pages/moments/list/modals/Create.tsx @@ -40,7 +40,7 @@ export default function Create(props: MyBetaModalFormProps) { }), Selects?.Companies({ key: 'companies_id', - title: '公司', + title: '选择机构', colProps: { span: 24 }, required: true, }), @@ -54,10 +54,11 @@ export default function Create(props: MyBetaModalFormProps) { columns: [ MyFormItems.EnumRadio({ key: 'push_type', - title: '推送类型', + title: '任务推送方式', + tooltip: '内容穿创建后,推送任务给员工的方式', valueEnum: CustomerMomentsPushTypeEnum, required: true, - colProps: { span: 9 }, + colProps: { span: 12 }, }), { name: ['push_type'], @@ -67,9 +68,9 @@ export default function Create(props: MyBetaModalFormProps) { ? [ { key: 'scheduled_time', - title: '定时发送时间', + title: '定时推送时间', valueType: 'dateTime', - colProps: { span: 10 }, + colProps: { span: 12 }, }, ] : []; @@ -86,7 +87,7 @@ export default function Create(props: MyBetaModalFormProps) { title: '任务结束类型', valueEnum: CustomerMomentsTaskEndTypeEnum, required: true, - colProps: { span: 9 }, + colProps: { span: 12 }, }), { name: ['task_end_type'], @@ -96,7 +97,7 @@ export default function Create(props: MyBetaModalFormProps) { ? [ { key: 'task_days', - title: '任务结束天数', + title: ' ', colProps: { span: 10 }, valueType: 'digit', formItemProps: { ...rulesHelper.number }, @@ -123,7 +124,7 @@ export default function Create(props: MyBetaModalFormProps) { }, MyFormItems.EnumSelect({ key: 'range_type', - title: '范围类型', + title: '推送范围', valueEnum: CustomerMomentsRangeTypeEnum, required: true, }), @@ -150,6 +151,12 @@ export default function Create(props: MyBetaModalFormProps) { { title: '创建内容', columns: [ + { + key: 'title', + title: '标题', + formItemProps: { ...rulesHelper.text }, + colProps: { span: 24 }, + }, MyFormItems.EnumRadio({ key: 'content_type', title: '内容类型', @@ -157,29 +164,111 @@ export default function Create(props: MyBetaModalFormProps) { required: true, colProps: { span: 24 }, }), - - { - key: 'skip_url', - title: '链接', - formItemProps: { ...rulesHelper.text }, - colProps: { span: 12 }, - }, - { - key: 'title', - title: '标题', - formItemProps: { ...rulesHelper.text }, - colProps: { span: 12 }, - }, { name: ['content_type'], valueType: 'dependency', columns: ({ content_type }: any) => { - setContentType(content_type); - return content_type === 'MiniProgram' + return content_type === CustomerMomentsContentTypeEnum.Image.value ? [ { - key: 'mini_program_app_id', - title: '小程序APPID', + key: 'content', + title: '发送文案', + valueType: 'textarea', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + MyFormItems.UploadImages({ + key: 'attachments', + title: '上传图片', + // uploadType: 'file', + required: true, + tooltip: '限9张图片', + max: 9, + colProps: { span: 24 }, + }), + ] + : content_type === CustomerMomentsContentTypeEnum.Video.value + ? [ + { + key: 'content', + title: '发送文案', + valueType: 'textarea', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + MyFormItems.UploadImages({ + key: 'attachments', + title: '上传视频', + required: true, + tooltip: '限1个视频', + // uploadType: 'file', + max: 1, + colProps: { span: 24 }, + }), + ] + : content_type === CustomerMomentsContentTypeEnum.Link.value || + content_type === + CustomerMomentsContentTypeEnum.MiniProgram.value + ? [ + { + key: 'content', + title: '发送文案', + valueType: 'textarea', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + { + name: ['content_type'], + valueType: 'dependency', + columns: ({ content_type }: any) => { + setContentType(content_type); + return content_type === 'MiniProgram' + ? [ + { + key: 'mini_program_app_id', + title: '小程序APPID', + formItemProps: { ...rulesHelper.text }, + colProps: { span: 12 }, + }, + { + key: 'skip_url', + title: '链接地址', + formItemProps: { ...rulesHelper.text }, + colProps: { span: 12 }, + }, + ] + : [ + { + key: 'skip_url', + title: '链接地址', + formItemProps: { ...rulesHelper.text }, + colProps: { span: 24 }, + }, + ]; + }, + }, + + { + key: 'desc', + title: '链接标题', + colProps: { span: 24 }, + formItemProps: { ...rulesHelper.text }, + }, + MyFormItems.UploadImages({ + key: 'cover_image', + tooltip: '限1张图片', + title: '设置封面', + required: true, + max: 1, + }), + ] + : content_type === CustomerMomentsContentTypeEnum.Link.value || + content_type === + CustomerMomentsContentTypeEnum.MiniProgram.value + ? [ + { + key: 'skip_url', + title: '链接', formItemProps: { ...rulesHelper.text }, colProps: { span: 24 }, }, @@ -187,31 +276,6 @@ export default function Create(props: MyBetaModalFormProps) { : []; }, }, - { - key: 'content', - title: '内容', - valueType: 'textarea', - colProps: { span: 24 }, - formItemProps: { ...rulesHelper.text }, - }, - { - key: 'desc', - title: '描述', - valueType: 'textarea', - colProps: { span: 24 }, - }, - MyFormItems.UploadImages({ - key: 'cover_image', - title: '封面', - max: 1, - }), - MyFormItems.UploadImages({ - key: 'attachments', - title: '附件', - uploadType: 'file', - max: 100, - colProps: { span: 12 }, - }), ], }, ]; @@ -236,23 +300,23 @@ export default function Create(props: MyBetaModalFormProps) { type="primary" size={'middle'} myRef={modalRef} - width="1200px" + width="580px" node={ - + - + {...MyModalFormProps.props} title={`添加${props.title}`} wrapperCol={{ span: 24 }} - width="800px" + // width="1200px" form={form} layoutType="Form" trigger={} diff --git a/src/pages/order/index.tsx b/src/pages/order/list/index.tsx similarity index 71% rename from src/pages/order/index.tsx rename to src/pages/order/list/index.tsx index 51cca7e..66d76d2 100644 --- a/src/pages/order/index.tsx +++ b/src/pages/order/list/index.tsx @@ -1,4 +1,5 @@ import { + MyButtons, MyColumns, MyPageContainer, MyProTableProps, @@ -10,8 +11,10 @@ import { HouseOrdersPaymentMethodEnum, } from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; +import { Space } from 'antd'; +import Payments from './modals/Payments'; -export default function Index({ title = '支付明细' }) { +export default function Index({ title = '支付订单' }) { // 注册当前页面为标签页 usePageTabs({ tabKey: 'house_order', @@ -44,10 +47,10 @@ export default function Index({ title = '支付明细' }) { // importApi={Apis.Bill.HouseBills.Import} // reload={action?.reload} // />, - // , // ]} columns={[ - // MyColumns.ID(), + MyColumns.ID(), + { title: '订单号', dataIndex: 'order_code', @@ -63,32 +66,22 @@ export default function Index({ title = '支付明细' }) { dataIndex: 'order_status', valueEnum: HouseOrdersOrderStatusEnum, }), - - // { - // title: '支付单号', - // dataIndex: 'payment_no', - // search: false, - // }, { title: '应收金额', + dataIndex: 'amount', + search: false, + }, + { + title: '实收金额', dataIndex: 'actual_paid_amount', search: false, }, { - title: '滞纳金', - dataIndex: 'late_fee', - search: false, - }, - { - title: '退款总金额', + title: '退款金额', dataIndex: 'refund_amount', search: false, }, - { - title: '实缴金额', - dataIndex: 'actual_paid_amount', - search: false, - }, + { title: '收款账号', dataIndex: ['house_order_items', 'receipt_account'], @@ -114,20 +107,20 @@ export default function Index({ title = '支付明细' }) { }, // MyColumns.CreatedAt(), - // MyColumns.Option({ - // render: (_, item: any, index, action) => ( - // - // - // - // Apis.Common.Admins.Delete({ id: item.id }).then(() => - // action?.reload(), - // ) - // } - // /> - // - // ), - // }), + MyColumns.Option({ + render: (_, item: any, index, action) => ( + + + + Apis.HouseOrder.HouseOrders.Delete({ id: item.id }).then( + () => action?.reload(), + ) + } + /> + + ), + }), ]} /> diff --git a/src/pages/order/list/modals/Payments.tsx b/src/pages/order/list/modals/Payments.tsx new file mode 100644 index 0000000..7038b7e --- /dev/null +++ b/src/pages/order/list/modals/Payments.tsx @@ -0,0 +1,79 @@ +import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common'; +import { MyModal } from '@/components/MyModal'; +import { Apis } from '@/gen/Apis'; +import { + HouseOrdersOrderStatusEnum, + HouseOrdersPaymentMethodEnum, +} from '@/gen/Enums'; +import { ProTable } from '@ant-design/pro-components'; +import { useNavigate } from '@umijs/max'; + +export default function TaskShow(props: MyBetaModalFormProps) { + const navigate = useNavigate(); + return ( + + MyProTableProps.request( + { ...params, house_orders_id: props?.item?.id }, + sort, + Apis.HouseOrder.HouseOrderPayments.List, + ) + } + // options={false} + columns={[ + MyColumns.ID(), + MyColumns.EnumTag({ + title: '支付状态', + dataIndex: 'payment_status', + valueEnum: HouseOrdersOrderStatusEnum, + }), + MyColumns.EnumTag({ + title: '支付方式', + dataIndex: 'payment_method', + valueEnum: HouseOrdersPaymentMethodEnum, + }), + { + title: '账单金额', + dataIndex: 'amount', + render: (value: any) => `${value / 100}元`, + search: false, + }, + { + title: '实际金额', + dataIndex: 'actual_amount', + render: (value: any) => `${value / 100}元`, + search: false, + }, + + { + title: '支付人', + render: (record: any) => + `${record?.customer?.name || ''}${ + record?.customer?.phone || '' + }`, + + search: false, + }, + { + title: '备注', + dataIndex: 'remark', + search: false, + }, + { + title: '支付单号', + dataIndex: 'payment_no', + search: false, + }, + MyColumns.UpdatedAt(), + ]} + /> + } + /> + ); +} diff --git a/src/pages/order/payments/index.tsx b/src/pages/order/pay/index.tsx similarity index 57% rename from src/pages/order/payments/index.tsx rename to src/pages/order/pay/index.tsx index e29c361..af1a54b 100644 --- a/src/pages/order/payments/index.tsx +++ b/src/pages/order/pay/index.tsx @@ -5,6 +5,10 @@ import { usePageTabs, } from '@/common'; import { Apis } from '@/gen/Apis'; +import { + HouseOrdersOrderStatusEnum, + HouseOrdersPaymentMethodEnum, +} from '@/gen/Enums'; import { ProTable } from '@ant-design/pro-components'; export default function Index({ title = '支付明细' }) { @@ -18,7 +22,7 @@ export default function Index({ title = '支付明细' }) { , - // , // ]} columns={[ MyColumns.ID(), + + MyColumns.EnumTag({ + title: '支付状态', + dataIndex: 'payment_status', + valueEnum: HouseOrdersOrderStatusEnum, + }), + MyColumns.EnumTag({ + title: '支付方式', + dataIndex: 'payment_method', + valueEnum: HouseOrdersPaymentMethodEnum, + }), { - title: '房屋', - dataIndex: ['asset_house', 'full_name'], - search: { - transform: (value) => { - return { full_name: value }; - }, - }, + title: '账单金额', + dataIndex: 'amount', + render: (value: any) => `${value / 100}元`, + search: false, + }, + { + title: '实际金额', + dataIndex: 'actual_amount', + render: (value: any) => `${value / 100}元`, + search: false, + }, + + { + title: '支付人', + render: (record: any) => + `${record?.customer?.name || ''}${record?.customer?.phone || ''}`, + + search: false, + }, + { + title: '备注', + dataIndex: 'remark', + search: false, }, { title: '支付单号', dataIndex: 'payment_no', search: false, }, - { - title: '交易单号', - dataIndex: 'transaction_id', - search: false, - }, - { - title: '第三方交易号', - dataIndex: 'hird_trade_no', - search: false, - }, - MyColumns.CreatedAt(), - // MyColumns.Option({ - // render: (_, item: any, index, action) => ( - // - // - // - // Apis.Common.Admins.Delete({ id: item.id }).then(() => - // action?.reload(), - // ) - // } - // /> - // - // ), - // }), + MyColumns.UpdatedAt(), ]} /> diff --git a/src/pages/work_order/index.tsx b/src/pages/work_order/index.tsx index ecf4225..7095fa8 100644 --- a/src/pages/work_order/index.tsx +++ b/src/pages/work_order/index.tsx @@ -41,7 +41,13 @@ export default function Index({ title = '工单管理' }) { {...MyProTableProps.props} request={async (params, sort) => MyProTableProps.request( - params, + { + ...params, + type: [ + HouseWorkOrdersTypeEnum.Repair.value, + HouseWorkOrdersTypeEnum.Incident.value, + ], + }, sort, Apis.WorkOrder.HouseWorkOrders.List, )