Compare commits
No commits in common. "96d9a93420a35809e782d28cd44cc3be2de8d3a0" and "4d4d833f74639c78a3d014951ca93770c6bf1b36" have entirely different histories.
96d9a93420
...
4d4d833f74
@ -15,10 +15,10 @@ export default defineConfig({
|
|||||||
proxy: {
|
proxy: {
|
||||||
'/api/': {
|
'/api/': {
|
||||||
// target: 'http://yt:8003',
|
// 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://test-admin.linyikj.com.cn/',
|
||||||
// target: 'https://admin.linyikj.com.cn/',
|
// target: 'https://admin.linyikj.com.cn/',
|
||||||
// target: 'http://c789629c.natappfree.cc',
|
// target: 'http://cd69cef8.natappfree.cc/',
|
||||||
|
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: { '^': '' },
|
pathRewrite: { '^': '' },
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"url": "http://c789629c.natappfree.cc/api/docs/openapi",
|
"url": "http://10.39.13.78:8001/api/docs/openapi",
|
||||||
"module": "Admin"
|
"module": "Admin"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,10 +6,7 @@
|
|||||||
gap: 8px !important;
|
gap: 8px !important;
|
||||||
align-items: flex-start !important;
|
align-items: flex-start !important;
|
||||||
}
|
}
|
||||||
.ant-upload-list-item-name {
|
|
||||||
width: 300px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.ant-upload-list-item {
|
.ant-upload-list-item {
|
||||||
margin: 0 !important;
|
margin: 0 !important;
|
||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
|
|||||||
@ -151,15 +151,4 @@ export const rulesHelper = {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getDifference(startNum: number, endNum: number) {
|
|
||||||
//获取2 个数据之间的差值 单位:天
|
|
||||||
if (startNum && endNum) {
|
|
||||||
const start = startNum;
|
|
||||||
const end = endNum;
|
|
||||||
const diffDays = end - start;
|
|
||||||
return diffDays;
|
|
||||||
} else {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -570,39 +570,4 @@ export const Selects = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//获取项目仪表
|
|
||||||
AssetMeters(props?: PropsType): ReturnType {
|
|
||||||
const {
|
|
||||||
title = '选择仪表',
|
|
||||||
key = 'id',
|
|
||||||
required = false,
|
|
||||||
hideInTable = true,
|
|
||||||
...rest
|
|
||||||
} = props ?? {};
|
|
||||||
|
|
||||||
return {
|
|
||||||
title: title,
|
|
||||||
key: key,
|
|
||||||
valueType: 'select',
|
|
||||||
hideInTable: hideInTable,
|
|
||||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
|
||||||
request: async (params) =>
|
|
||||||
(
|
|
||||||
await Apis.Meter.HouseMeters.List({
|
|
||||||
keywords: params?.KeyWords,
|
|
||||||
...params,
|
|
||||||
asset_projects_id: params?.asset_projects_id,
|
|
||||||
})
|
|
||||||
).data,
|
|
||||||
...rest,
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
fieldNames: {
|
|
||||||
label: 'label',
|
|
||||||
value: 'value',
|
|
||||||
},
|
|
||||||
...rest?.fieldProps,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|||||||
30
src/gen/ApiTypes.d.ts
vendored
30
src/gen/ApiTypes.d.ts
vendored
@ -67,16 +67,6 @@ declare namespace ApiTypes {
|
|||||||
"asset_houses_id"?: number; // 资产房屋ID
|
"asset_houses_id"?: number; // 资产房屋ID
|
||||||
"status"?: string; // 状态,[enum:HouseOccupantsStatusEnum]
|
"status"?: string; // 状态,[enum:HouseOccupantsStatusEnum]
|
||||||
};
|
};
|
||||||
type CustomerList = {
|
|
||||||
"name"?: string; // 客户姓名
|
|
||||||
"phone"?: string; // 客户手机号
|
|
||||||
"house_relation"?: string; // 房客关系,[enum:HouseOccupantsHouseRelationEnum]
|
|
||||||
"residential_relation"?: string; // 居住关系,[enum:HouseOccupantsResidentialRelationEnum]
|
|
||||||
"relation_with_owner"?: string; // 与产权人关系,[enum:HouseOccupantsRelationWithOwnerEnum]
|
|
||||||
};
|
|
||||||
type CustomerHouseByPhone = {
|
|
||||||
"phone": string; // 客户手机号
|
|
||||||
};
|
|
||||||
type Update = {
|
type Update = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
"name": string; // 客户姓名
|
"name": string; // 客户姓名
|
||||||
@ -654,7 +644,6 @@ declare namespace ApiTypes {
|
|||||||
namespace Positions {
|
namespace Positions {
|
||||||
type List = {
|
type List = {
|
||||||
"name"?: string; // 模糊搜索:名称
|
"name"?: string; // 模糊搜索:名称
|
||||||
"is_use"?: number; // 是否启用,1启用,0禁用
|
|
||||||
};
|
};
|
||||||
type Store = {
|
type Store = {
|
||||||
"name": string; // 岗位名称
|
"name": string; // 岗位名称
|
||||||
@ -1267,9 +1256,6 @@ declare namespace ApiTypes {
|
|||||||
type Delete = {
|
type Delete = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
type CreateHouseBill = {
|
|
||||||
"id": number; // 任务明单id
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
namespace HouseChargeTasks {
|
namespace HouseChargeTasks {
|
||||||
type List = {
|
type List = {
|
||||||
@ -1299,9 +1285,6 @@ declare namespace ApiTypes {
|
|||||||
type Delete = {
|
type Delete = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
type ExecuteTask = {
|
|
||||||
"id": number; // id
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
namespace HouseOrder {
|
namespace HouseOrder {
|
||||||
@ -1361,8 +1344,7 @@ declare namespace ApiTypes {
|
|||||||
}
|
}
|
||||||
namespace HouseMeterReadings {
|
namespace HouseMeterReadings {
|
||||||
type List = {
|
type List = {
|
||||||
"house_meters_id": number; // 仪表id,[ref:house_meters]
|
"name"?: string; // 模糊搜索:名称
|
||||||
"operation_type"?: string; // 操作类型,[enum:HouseMeterReadingsOperationTypeEnum]
|
|
||||||
};
|
};
|
||||||
type Store = {
|
type Store = {
|
||||||
"house_meters_id": number; // 仪表id,[ref:house_meters]
|
"house_meters_id": number; // 仪表id,[ref:house_meters]
|
||||||
@ -1370,7 +1352,7 @@ declare namespace ApiTypes {
|
|||||||
"current_reading": number; // 本次读数
|
"current_reading": number; // 本次读数
|
||||||
"reading_time": Date; // 抄表时间
|
"reading_time": Date; // 抄表时间
|
||||||
"company_employees_id": number; // 抄表人id,[ref:company_employees]
|
"company_employees_id": number; // 抄表人id,[ref:company_employees]
|
||||||
"remark"?: string; // 备注
|
"remark": string; // 备注
|
||||||
};
|
};
|
||||||
type Update = {
|
type Update = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
@ -1382,7 +1364,7 @@ declare namespace ApiTypes {
|
|||||||
"loss_amount"?: number; // 损耗
|
"loss_amount"?: number; // 损耗
|
||||||
"reading_time": Date; // 抄表时间
|
"reading_time": Date; // 抄表时间
|
||||||
"company_employees_id": number; // 抄表人id,[ref:company_employees]
|
"company_employees_id": number; // 抄表人id,[ref:company_employees]
|
||||||
"remark"?: string; // 备注
|
"remark": string; // 备注
|
||||||
};
|
};
|
||||||
type Show = {
|
type Show = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
@ -1403,9 +1385,6 @@ declare namespace ApiTypes {
|
|||||||
type Delete = {
|
type Delete = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
type CreateMeterBill = {
|
|
||||||
"id": number; // 仪表任务明细id
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
namespace HouseMeterTasks {
|
namespace HouseMeterTasks {
|
||||||
type List = {
|
type List = {
|
||||||
@ -1431,9 +1410,6 @@ declare namespace ApiTypes {
|
|||||||
type Delete = {
|
type Delete = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
type ExecuteMeterTasks = {
|
|
||||||
"id": number; // id
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
namespace HouseMeters {
|
namespace HouseMeters {
|
||||||
type List = {
|
type List = {
|
||||||
|
|||||||
@ -46,12 +46,6 @@ export const Apis = {
|
|||||||
List(data?: ApiTypes.Archive.HouseOccupants.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Archive.HouseOccupants.List): Promise<MyResponseType> {
|
||||||
return request('admin/archive/house_occupants/list', { data });
|
return request('admin/archive/house_occupants/list', { data });
|
||||||
},
|
},
|
||||||
CustomerList(data?: ApiTypes.Archive.HouseOccupants.CustomerList): Promise<MyResponseType> {
|
|
||||||
return request('admin/archive/house_occupants/customer_list', { data });
|
|
||||||
},
|
|
||||||
CustomerHouseByPhone(data: ApiTypes.Archive.HouseOccupants.CustomerHouseByPhone): Promise<MyResponseType> {
|
|
||||||
return request('admin/archive/house_occupants/customer_house_by_phone', { data });
|
|
||||||
},
|
|
||||||
Update(data: ApiTypes.Archive.HouseOccupants.Update): Promise<MyResponseType> {
|
Update(data: ApiTypes.Archive.HouseOccupants.Update): Promise<MyResponseType> {
|
||||||
return request('admin/archive/house_occupants/update', { data });
|
return request('admin/archive/house_occupants/update', { data });
|
||||||
},
|
},
|
||||||
@ -743,9 +737,6 @@ export const Apis = {
|
|||||||
Delete(data: ApiTypes.HouseCharage.HouseChargeTaskDetails.Delete): Promise<MyResponseType> {
|
Delete(data: ApiTypes.HouseCharage.HouseChargeTaskDetails.Delete): Promise<MyResponseType> {
|
||||||
return request('admin/house_charage/house_charge_task_details/delete', { data });
|
return request('admin/house_charage/house_charge_task_details/delete', { data });
|
||||||
},
|
},
|
||||||
CreateHouseBill(data: ApiTypes.HouseCharage.HouseChargeTaskDetails.CreateHouseBill): Promise<MyResponseType> {
|
|
||||||
return request('admin/house_charage/house_charge_task_details/create_house_bill', { data });
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
HouseChargeTasks: {
|
HouseChargeTasks: {
|
||||||
List(data?: ApiTypes.HouseCharage.HouseChargeTasks.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.HouseCharage.HouseChargeTasks.List): Promise<MyResponseType> {
|
||||||
@ -766,9 +757,6 @@ export const Apis = {
|
|||||||
Delete(data: ApiTypes.HouseCharage.HouseChargeTasks.Delete): Promise<MyResponseType> {
|
Delete(data: ApiTypes.HouseCharage.HouseChargeTasks.Delete): Promise<MyResponseType> {
|
||||||
return request('admin/house_charage/house_charge_tasks/delete', { data });
|
return request('admin/house_charage/house_charge_tasks/delete', { data });
|
||||||
},
|
},
|
||||||
ExecuteTask(data: ApiTypes.HouseCharage.HouseChargeTasks.ExecuteTask): Promise<MyResponseType> {
|
|
||||||
return request('admin/house_charage/house_charge_tasks/execute_task', { data });
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
HouseOrder: {
|
HouseOrder: {
|
||||||
@ -817,7 +805,7 @@ export const Apis = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
HouseMeterReadings: {
|
HouseMeterReadings: {
|
||||||
List(data: ApiTypes.Meter.HouseMeterReadings.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Meter.HouseMeterReadings.List): Promise<MyResponseType> {
|
||||||
return request('admin/meter/house_meter_readings/list', { data });
|
return request('admin/meter/house_meter_readings/list', { data });
|
||||||
},
|
},
|
||||||
Store(data: ApiTypes.Meter.HouseMeterReadings.Store): Promise<MyResponseType> {
|
Store(data: ApiTypes.Meter.HouseMeterReadings.Store): Promise<MyResponseType> {
|
||||||
@ -843,9 +831,6 @@ export const Apis = {
|
|||||||
Delete(data: ApiTypes.Meter.HouseMeterTaskDetails.Delete): Promise<MyResponseType> {
|
Delete(data: ApiTypes.Meter.HouseMeterTaskDetails.Delete): Promise<MyResponseType> {
|
||||||
return request('admin/meter/house_meter_task_details/delete', { data });
|
return request('admin/meter/house_meter_task_details/delete', { data });
|
||||||
},
|
},
|
||||||
CreateMeterBill(data: ApiTypes.Meter.HouseMeterTaskDetails.CreateMeterBill): Promise<MyResponseType> {
|
|
||||||
return request('admin/meter/house_meter_task_details/create_meter_bill', { data });
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
HouseMeterTasks: {
|
HouseMeterTasks: {
|
||||||
List(data?: ApiTypes.Meter.HouseMeterTasks.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Meter.HouseMeterTasks.List): Promise<MyResponseType> {
|
||||||
@ -866,9 +851,6 @@ export const Apis = {
|
|||||||
Delete(data: ApiTypes.Meter.HouseMeterTasks.Delete): Promise<MyResponseType> {
|
Delete(data: ApiTypes.Meter.HouseMeterTasks.Delete): Promise<MyResponseType> {
|
||||||
return request('admin/meter/house_meter_tasks/delete', { data });
|
return request('admin/meter/house_meter_tasks/delete', { data });
|
||||||
},
|
},
|
||||||
ExecuteMeterTasks(data: ApiTypes.Meter.HouseMeterTasks.ExecuteMeterTasks): Promise<MyResponseType> {
|
|
||||||
return request('admin/meter/house_meter_tasks/execute_meter_tasks', { data });
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
HouseMeters: {
|
HouseMeters: {
|
||||||
List(data?: ApiTypes.Meter.HouseMeters.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Meter.HouseMeters.List): Promise<MyResponseType> {
|
||||||
|
|||||||
@ -154,7 +154,7 @@ export const BannersTypeEnum= {
|
|||||||
|
|
||||||
// 缓存类型
|
// 缓存类型
|
||||||
export const CacheTypeEnum= {
|
export const CacheTypeEnum= {
|
||||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#dc15e2","value":"MobilePhoneVerificationCode"},
|
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#e3da02","value":"MobilePhoneVerificationCode"},
|
||||||
};
|
};
|
||||||
|
|
||||||
// CompaniesMerchantTypeEnum
|
// CompaniesMerchantTypeEnum
|
||||||
@ -452,7 +452,7 @@ export const HouseOccupantsRelationWithOwnerEnum= {
|
|||||||
'Children': {"text":"子女","color":"#87d068","value":"Children"},
|
'Children': {"text":"子女","color":"#87d068","value":"Children"},
|
||||||
'Parents': {"text":"父母","color":"#faad14","value":"Parents"},
|
'Parents': {"text":"父母","color":"#faad14","value":"Parents"},
|
||||||
'Siblings': {"text":"兄弟姐妹","color":"#fa8c16","value":"Siblings"},
|
'Siblings': {"text":"兄弟姐妹","color":"#fa8c16","value":"Siblings"},
|
||||||
'OtherRelatives': {"text":"其他","color":"#f5222d","value":"OtherRelatives"},
|
'OtherRelatives': {"text":"其他亲属","color":"#f5222d","value":"OtherRelatives"},
|
||||||
'PrimaryTenant': {"text":"主租客","color":"#722ed1","value":"PrimaryTenant"},
|
'PrimaryTenant': {"text":"主租客","color":"#722ed1","value":"PrimaryTenant"},
|
||||||
'Tenant': {"text":"租客","color":"#1890ff","value":"Tenant"},
|
'Tenant': {"text":"租客","color":"#1890ff","value":"Tenant"},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import { Apis } from '@/gen/Apis';
|
|||||||
import {
|
import {
|
||||||
HouseOccupantsCardTypeEnum,
|
HouseOccupantsCardTypeEnum,
|
||||||
HouseOccupantsHouseRelationEnum,
|
HouseOccupantsHouseRelationEnum,
|
||||||
HouseOccupantsRelationWithOwnerEnum,
|
|
||||||
HouseRegistersTypeEnum,
|
HouseRegistersTypeEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||||
@ -22,7 +21,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`${props.title}`}
|
title={`${props.title}`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="1000px"
|
width="800px"
|
||||||
trigger={
|
trigger={
|
||||||
<MyButtons.View
|
<MyButtons.View
|
||||||
title={props.title}
|
title={props.title}
|
||||||
@ -46,8 +45,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
return {
|
return {
|
||||||
...res,
|
...res,
|
||||||
house_relation: HouseOccupantsHouseRelationEnum.Owner.value,
|
house_relation: HouseOccupantsHouseRelationEnum.Owner.value,
|
||||||
relation_with_owner:
|
|
||||||
HouseOccupantsRelationWithOwnerEnum.Self.value,
|
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
@ -168,7 +165,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
title: '是否入住',
|
title: '是否入住',
|
||||||
dataIndex: 'is_live_in',
|
dataIndex: 'is_live_in',
|
||||||
colProps: { span: 4 },
|
colProps: { span: 6 },
|
||||||
valueType: 'switch',
|
valueType: 'switch',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -191,11 +188,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
: [];
|
: [];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '备注',
|
|
||||||
dataIndex: 'remark',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
|||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`${props.title}`}
|
title={`${props.title}`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="1000px"
|
width="800px"
|
||||||
trigger={
|
trigger={
|
||||||
<MyButtons.Default title={props.title} size="middle" type="primary" />
|
<MyButtons.Default title={props.title} size="middle" type="primary" />
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
|||||||
form.resetFields(); // 清空表单数据
|
form.resetFields(); // 清空表单数据
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onFinish={async (values: any) =>
|
onFinish={async (values) =>
|
||||||
Apis.Archive.HouseRegisters.Store({
|
Apis.Archive.HouseRegisters.Store({
|
||||||
...values,
|
...values,
|
||||||
asset_houses_id: props?.item?.id,
|
asset_houses_id: props?.item?.id,
|
||||||
@ -43,11 +43,6 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
|||||||
return {
|
return {
|
||||||
...res,
|
...res,
|
||||||
house_relation: HouseOccupantsHouseRelationEnum.NonOwner.value,
|
house_relation: HouseOccupantsHouseRelationEnum.NonOwner.value,
|
||||||
relation_with_owner:
|
|
||||||
values?.residential_relation ===
|
|
||||||
HouseOccupantsResidentialRelationEnum.PrimaryTenant.value
|
|
||||||
? values?.relation_with_owner
|
|
||||||
: values?.residential_relation,
|
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
@ -111,16 +106,16 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
|||||||
name: ['residential_relation'],
|
name: ['residential_relation'],
|
||||||
valueType: 'dependency',
|
valueType: 'dependency',
|
||||||
columns: ({ residential_relation }: any) => {
|
columns: ({ residential_relation }: any) => {
|
||||||
return residential_relation ===
|
return residential_relation !==
|
||||||
HouseOccupantsResidentialRelationEnum.Resident.value
|
HouseOccupantsResidentialRelationEnum.PrimaryTenant
|
||||||
|
.value
|
||||||
? [
|
? [
|
||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'relation_with_owner',
|
key: 'relation_with_owner',
|
||||||
title: '与产权人关系',
|
title:
|
||||||
// title:
|
residential_relation === 'Resident'
|
||||||
// residential_relation === 'Resident'
|
? '与产权人关系'
|
||||||
// ? '与产权人关系'
|
: '与主租人关系',
|
||||||
// : '与主租人关系',
|
|
||||||
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
valueEnum: HouseOccupantsRelationWithOwnerEnum,
|
||||||
colProps: { span: 16 },
|
colProps: { span: 16 },
|
||||||
required: true,
|
required: true,
|
||||||
@ -232,7 +227,6 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
|||||||
key: 'card_front_image',
|
key: 'card_front_image',
|
||||||
title: '证件正面',
|
title: '证件正面',
|
||||||
// uploadType: 'file',
|
// uploadType: 'file',
|
||||||
required: true,
|
|
||||||
max: 1,
|
max: 1,
|
||||||
colProps: { span: 6 },
|
colProps: { span: 6 },
|
||||||
}),
|
}),
|
||||||
@ -240,14 +234,13 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
|||||||
key: 'card_back_image',
|
key: 'card_back_image',
|
||||||
title: '证件反面',
|
title: '证件反面',
|
||||||
// uploadType: 'file',
|
// uploadType: 'file',
|
||||||
required: true,
|
|
||||||
max: 1,
|
max: 1,
|
||||||
colProps: { span: 6 },
|
colProps: { span: 6 },
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
title: '是否入住',
|
title: '是否入住',
|
||||||
dataIndex: 'is_live_in',
|
dataIndex: 'is_live_in',
|
||||||
colProps: { span: 4 },
|
colProps: { span: 6 },
|
||||||
valueType: 'switch',
|
valueType: 'switch',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -270,11 +263,6 @@ export default function AddOccupant(props: MyBetaModalFormProps) {
|
|||||||
: [];
|
: [];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '备注',
|
|
||||||
dataIndex: 'remark',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`${props.title}`}
|
title={`${props.title}`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="1000px"
|
width="900px"
|
||||||
trigger={
|
trigger={
|
||||||
<MyButtons.Default title={props.title} size="middle" type="primary" />
|
<MyButtons.Default title={props.title} size="middle" type="primary" />
|
||||||
}
|
}
|
||||||
@ -164,7 +164,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
colProps: { span: 6 },
|
colProps: { span: 6 },
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
title: '是否入住',
|
title: '是否办理入住',
|
||||||
dataIndex: 'is_live_in',
|
dataIndex: 'is_live_in',
|
||||||
colProps: { span: 6 },
|
colProps: { span: 6 },
|
||||||
valueType: 'switch',
|
valueType: 'switch',
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
MyButtons,
|
MyButtons,
|
||||||
MyColumns,
|
MyColumns,
|
||||||
MyImportModal,
|
|
||||||
MyPageContainer,
|
MyPageContainer,
|
||||||
MyProTableProps,
|
MyProTableProps,
|
||||||
usePageTabs,
|
usePageTabs,
|
||||||
@ -33,15 +32,6 @@ export default function Index({ title = '项目列表' }) {
|
|||||||
}
|
}
|
||||||
// headerTitle="项目列表"
|
// headerTitle="项目列表"
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<MyImportModal
|
|
||||||
key="ImportHouse"
|
|
||||||
title="批量导入"
|
|
||||||
type="danger"
|
|
||||||
size="middle"
|
|
||||||
templateApi={Apis.Asset.AssetProjects.DownloadTemplate}
|
|
||||||
importApi={Apis.Asset.AssetProjects.Import}
|
|
||||||
reload={action?.reload}
|
|
||||||
/>,
|
|
||||||
<AssetCreate key="Create" reload={action?.reload} title={'项目'} />,
|
<AssetCreate key="Create" reload={action?.reload} title={'项目'} />,
|
||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
|
|||||||
@ -98,18 +98,6 @@ export default function Index({ title = '账单任务' }) {
|
|||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
<TaskShow item={item} title="查看" reload={action?.reload} />
|
<TaskShow item={item} title="查看" reload={action?.reload} />
|
||||||
<MyButtons.Default
|
|
||||||
title="重新执行"
|
|
||||||
type="link"
|
|
||||||
color="primary"
|
|
||||||
isConfirm
|
|
||||||
description="是否重新执行此任务?"
|
|
||||||
onConfirm={() =>
|
|
||||||
Apis.HouseCharage.HouseChargeTasks.ExecuteTask({
|
|
||||||
id: item.id,
|
|
||||||
}).then(() => action?.reload())
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
Apis.HouseCharage.HouseChargeTasks.Delete({
|
Apis.HouseCharage.HouseChargeTasks.Delete({
|
||||||
|
|||||||
@ -1,14 +1,8 @@
|
|||||||
import {
|
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyColumns,
|
|
||||||
MyProTableProps,
|
|
||||||
} from '@/common';
|
|
||||||
import { MyModal } from '@/components/MyModal';
|
import { MyModal } from '@/components/MyModal';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
|
||||||
|
|
||||||
export default function AssetInfo(props: MyBetaModalFormProps) {
|
export default function AssetInfo(props: MyBetaModalFormProps) {
|
||||||
return (
|
return (
|
||||||
@ -67,24 +61,6 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
|||||||
dataIndex: 'processed_time',
|
dataIndex: 'processed_time',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
MyColumns.Option({
|
|
||||||
render: (_, item: any, index, action) => (
|
|
||||||
<Space key={index}>
|
|
||||||
<MyButtons.Default
|
|
||||||
title="重新执行"
|
|
||||||
type="link"
|
|
||||||
color="primary"
|
|
||||||
isConfirm
|
|
||||||
description="确认执行此任务吗?"
|
|
||||||
onConfirm={() =>
|
|
||||||
Apis.HouseCharage.HouseChargeTaskDetails.CreateHouseBill({
|
|
||||||
id: item.id,
|
|
||||||
}).then(() => action?.reload())
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
),
|
|
||||||
}),
|
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,73 +0,0 @@
|
|||||||
import {
|
|
||||||
MyButtons,
|
|
||||||
MyColumns,
|
|
||||||
MyPageContainer,
|
|
||||||
MyProTableProps,
|
|
||||||
usePageTabs,
|
|
||||||
} from '@/common';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
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();
|
|
||||||
|
|
||||||
// 注册当前页面为标签页
|
|
||||||
usePageTabs({
|
|
||||||
tabKey: 'positions',
|
|
||||||
tabLabel: title,
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<MyPageContainer
|
|
||||||
title={title}
|
|
||||||
enableTabs={true}
|
|
||||||
tabKey="positions"
|
|
||||||
tabLabel={title}
|
|
||||||
>
|
|
||||||
<ProTable
|
|
||||||
{...MyProTableProps.props}
|
|
||||||
request={async (params, sort) =>
|
|
||||||
MyProTableProps.request(params, sort, Apis.Common.Positions.List)
|
|
||||||
}
|
|
||||||
toolBarRender={(action) => [
|
|
||||||
<Create key="Create" reload={action?.reload} title={title} />,
|
|
||||||
]}
|
|
||||||
columns={[
|
|
||||||
MyColumns.ID(),
|
|
||||||
{
|
|
||||||
title: '岗位名称',
|
|
||||||
dataIndex: 'name',
|
|
||||||
width: 300,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '是否启用',
|
|
||||||
dataIndex: 'is_use',
|
|
||||||
search: false,
|
|
||||||
render: (text) => (text ? '是' : '否'),
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
MyColumns.CreatedAt(),
|
|
||||||
MyColumns.UpdatedAt(),
|
|
||||||
MyColumns.Option({
|
|
||||||
render: (_, item: any, index, action) => (
|
|
||||||
<Space key={index}>
|
|
||||||
<Update item={item} reload={action?.reload} title="岗位" />
|
|
||||||
<MyButtons.Delete
|
|
||||||
onConfirm={() =>
|
|
||||||
Apis.Common.Positions.Delete({ id: item.id }).then(() =>
|
|
||||||
action?.reload(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
),
|
|
||||||
}),
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</MyPageContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,51 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} 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 (
|
|
||||||
<BetaSchemaForm<ApiTypes.Common.Positions.Store>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`添加岗位`}
|
|
||||||
layout="horizontal"
|
|
||||||
labelCol={{ span: 6 }}
|
|
||||||
wrapperCol={{ span: 18 }}
|
|
||||||
width="450px"
|
|
||||||
trigger={<MyButtons.Create title={`添加岗位`} />}
|
|
||||||
form={form}
|
|
||||||
key={new Date().getTime()}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open) {
|
|
||||||
form.resetFields(); // 清空表单数据
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values: any) =>
|
|
||||||
Apis.Common.Positions.Store({
|
|
||||||
...values,
|
|
||||||
is_use: 1,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success(props.title + '成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
{
|
|
||||||
key: 'name',
|
|
||||||
title: '岗位名称',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
|
||||||
import { Form, message } from 'antd';
|
|
||||||
export default function Update(props: MyBetaModalFormProps) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
return (
|
|
||||||
<BetaSchemaForm<ApiTypes.Company.CompanyPositions.Update>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`编辑${props.title}`}
|
|
||||||
trigger={<MyButtons.Edit />}
|
|
||||||
layout="horizontal"
|
|
||||||
labelCol={{ span: 6 }}
|
|
||||||
wrapperCol={{ span: 18 }}
|
|
||||||
width="450px"
|
|
||||||
form={form}
|
|
||||||
key={new Date().getTime()}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open && props.item) {
|
|
||||||
form.setFieldsValue(props.item);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values: any) =>
|
|
||||||
Apis.Common.Positions.Update({
|
|
||||||
...values,
|
|
||||||
id: props.item?.id ?? 0,
|
|
||||||
is_use: Number(values.is_use),
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success(props.title + '成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
{
|
|
||||||
key: 'name',
|
|
||||||
title: '岗位名称',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'is_use',
|
|
||||||
title: '是否启用',
|
|
||||||
valueType: 'switch',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { required: true },
|
|
||||||
fieldProps: {
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -7,7 +7,6 @@ import {
|
|||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import PositionAdd from '../../positions/modals/PositionAdd';
|
|
||||||
import PositionCreate from '../../positions/modals/PositionCreate';
|
import PositionCreate from '../../positions/modals/PositionCreate';
|
||||||
import PositionUpdate from '../../positions/modals/PositionUpdate';
|
import PositionUpdate from '../../positions/modals/PositionUpdate';
|
||||||
|
|
||||||
@ -25,12 +24,6 @@ export default function Organizations(props: MyBetaModalFormProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<PositionAdd
|
|
||||||
key="Create"
|
|
||||||
reload={action?.reload}
|
|
||||||
item={props?.item}
|
|
||||||
title="岗位111"
|
|
||||||
/>,
|
|
||||||
<PositionCreate
|
<PositionCreate
|
||||||
key="Create"
|
key="Create"
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
|
|||||||
@ -1,135 +0,0 @@
|
|||||||
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, Space } from 'antd';
|
|
||||||
import { useRef, useState } from 'react';
|
|
||||||
|
|
||||||
export default function PositionAdd(props: MyBetaModalFormProps) {
|
|
||||||
// 使用 useState 保存选中的岗位 ID 和行数据,确保跨页选中状态保持
|
|
||||||
const [selectedPositionsIds, setSelectedPositionsIds] = useState<number[]>(
|
|
||||||
[],
|
|
||||||
);
|
|
||||||
const [selectedRows, setSelectedRows] = useState<any[]>([]);
|
|
||||||
|
|
||||||
// 添加 tableRef 用于操作表格
|
|
||||||
const tableRef = useRef<any>();
|
|
||||||
|
|
||||||
const onShowContactPhone = () => {
|
|
||||||
if (selectedPositionsIds.length === 0) {
|
|
||||||
message.warning('请至少选择一个岗位');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 确保 positions_ids 是字符串数组
|
|
||||||
const positionsIds = selectedPositionsIds.map((id) => String(id));
|
|
||||||
|
|
||||||
Apis.Company.CompanyPositions.BatchStore({
|
|
||||||
companies_id: props?.item?.id ?? 0,
|
|
||||||
positions_ids: positionsIds,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
// 成功后重置选中状态
|
|
||||||
setSelectedPositionsIds([]);
|
|
||||||
setSelectedRows([]);
|
|
||||||
props.reload?.();
|
|
||||||
message.success('添加成功!');
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
console.error('添加失败:', error);
|
|
||||||
message.error('添加失败: ' + (error.message || '未知错误'));
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<MyModal
|
|
||||||
title={'岗位库'}
|
|
||||||
type="primary"
|
|
||||||
size="middle"
|
|
||||||
width="600px"
|
|
||||||
node={
|
|
||||||
<ProTable
|
|
||||||
actionRef={tableRef}
|
|
||||||
{...MyProTableProps.props}
|
|
||||||
request={async (params, sort) =>
|
|
||||||
MyProTableProps.request(
|
|
||||||
{
|
|
||||||
...params,
|
|
||||||
is_use: 1,
|
|
||||||
},
|
|
||||||
sort,
|
|
||||||
Apis.Common.Positions.List,
|
|
||||||
undefined,
|
|
||||||
(res) => {
|
|
||||||
// 确保响应数据正确处理
|
|
||||||
console.log('加载岗位数据:', res);
|
|
||||||
return res;
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
// style={{ height: '800px', overflowY: 'auto', overflowX: 'hidden' }}
|
|
||||||
pagination={{
|
|
||||||
showQuickJumper: true,
|
|
||||||
}}
|
|
||||||
rowSelection={{
|
|
||||||
type: 'checkbox',
|
|
||||||
preserveSelectedRowKeys: true, // 启用跨页选择
|
|
||||||
selectedRowKeys: selectedPositionsIds,
|
|
||||||
onChange: (selectedRowKeys, selectedRows) => {
|
|
||||||
// 确保 selectedRowKeys 是数字类型
|
|
||||||
const numericKeys = selectedRowKeys.map((key) =>
|
|
||||||
typeof key === 'string' ? parseInt(key, 10) : key,
|
|
||||||
) as number[];
|
|
||||||
|
|
||||||
// 更新选中状态
|
|
||||||
setSelectedPositionsIds(numericKeys);
|
|
||||||
|
|
||||||
// 合并当前页面选中的行和之前选中的行
|
|
||||||
const newSelectedRows = [...selectedRows];
|
|
||||||
|
|
||||||
// 设置选中行数据
|
|
||||||
setSelectedRows(newSelectedRows);
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
tableAlertOptionRender={({ selectedRowKeys, onCleanSelected }) => {
|
|
||||||
return (
|
|
||||||
<Space>
|
|
||||||
<span>已选 {selectedRowKeys.length} 项</span>
|
|
||||||
<a onClick={onCleanSelected}>清空</a>
|
|
||||||
<MyButtons.Create
|
|
||||||
title="批量添加"
|
|
||||||
type="primary"
|
|
||||||
key="create2"
|
|
||||||
onClick={() => onShowContactPhone()}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
options={false}
|
|
||||||
columns={[
|
|
||||||
MyColumns.ID(),
|
|
||||||
{
|
|
||||||
title: '岗位名称',
|
|
||||||
dataIndex: 'name',
|
|
||||||
width: 300,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '是否启用',
|
|
||||||
dataIndex: 'is_use',
|
|
||||||
search: false,
|
|
||||||
render: (text) => (text ? '是' : '否'),
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -17,7 +17,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title={`添加岗位`}
|
title={`添加岗位`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="500px"
|
width="500px"
|
||||||
trigger={<MyButtons.Create title={`岗位`} />}
|
trigger={<MyButtons.Create title={`添加岗位`} />}
|
||||||
form={form}
|
form={form}
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
if (open) {
|
if (open) {
|
||||||
|
|||||||
@ -1,74 +0,0 @@
|
|||||||
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { HouseMeterReadingsOperationTypeEnum } from '@/gen/Enums';
|
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
|
||||||
|
|
||||||
export default function Index(props: MyBetaModalFormProps) {
|
|
||||||
console.log(props?.item, 'pppppppp');
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ProTable
|
|
||||||
{...MyProTableProps.props}
|
|
||||||
request={async (params, sort) =>
|
|
||||||
MyProTableProps.request(
|
|
||||||
{ ...params, phone: props?.item?.phone },
|
|
||||||
sort,
|
|
||||||
Apis.Archive.HouseOccupants.CustomerHouseByPhone,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
// search={false}
|
|
||||||
// options={false}
|
|
||||||
columns={[
|
|
||||||
MyColumns.EnumTag({
|
|
||||||
title: '操作类型',
|
|
||||||
dataIndex: 'operation_type',
|
|
||||||
valueEnum: HouseMeterReadingsOperationTypeEnum,
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
title: '抄表读数',
|
|
||||||
dataIndex: 'current_reading',
|
|
||||||
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 ? '已生成' : '未生成'),
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
// MyColumns.Option({
|
|
||||||
// render: (_, item: any, index, action) => (
|
|
||||||
// <Space key={index}>
|
|
||||||
// {/* 只有未生成账单的抄表记录,且不是重置读数,才显示修正按钮 */}
|
|
||||||
// {!item?.bill_status &&
|
|
||||||
// item?.operation_type !==
|
|
||||||
// HouseMeterReadingsOperationTypeEnum.ResetReading.value && (
|
|
||||||
// <CorrectReading item={item} reload={action?.reload} />
|
|
||||||
// )}
|
|
||||||
// </Space>
|
|
||||||
// ),
|
|
||||||
// }),
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
|
||||||
import { HouseOccupantsCardTypeEnum, SexEnum } from '@/gen/Enums';
|
|
||||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
|
||||||
import { Image, Space } from 'antd';
|
|
||||||
|
|
||||||
export default function info(props: MyBetaModalFormProps) {
|
|
||||||
const { item } = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Space direction="vertical" style={{ width: '100%' }}>
|
|
||||||
<ProCard title="基本信息">
|
|
||||||
<ProDescriptions bordered>
|
|
||||||
<ProDescriptions.Item label="姓名">
|
|
||||||
<div style={{ fontWeight: 'bold' }}>{item?.name}</div>
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
|
|
||||||
<ProDescriptions.Item label="电话">
|
|
||||||
{item?.phone}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="性别">
|
|
||||||
<renderTextHelper.Tag Enums={SexEnum} value={item?.sex} key="sex" />
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
|
|
||||||
<ProDescriptions.Item label="证件类型">
|
|
||||||
<renderTextHelper.Tag
|
|
||||||
Enums={HouseOccupantsCardTypeEnum}
|
|
||||||
value={props?.item?.card_type}
|
|
||||||
key="card_type"
|
|
||||||
/>
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="证件号码" span={2}>
|
|
||||||
{props?.item?.id_card}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="证件材料" span={3}>
|
|
||||||
<Space>
|
|
||||||
<Image.PreviewGroup>
|
|
||||||
{props?.item?.card_front_image?.map(
|
|
||||||
(res: any, index: number) => {
|
|
||||||
return (
|
|
||||||
<Image
|
|
||||||
width={40}
|
|
||||||
height={30}
|
|
||||||
src={res?.url || ''}
|
|
||||||
key={`${res?.name}_${index}`}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)}
|
|
||||||
</Image.PreviewGroup>
|
|
||||||
<Image.PreviewGroup>
|
|
||||||
{props?.item?.card_back_image?.map(
|
|
||||||
(res: any, index: number) => {
|
|
||||||
return (
|
|
||||||
<Image
|
|
||||||
width={40}
|
|
||||||
height={30}
|
|
||||||
src={res?.url || ''}
|
|
||||||
key={`${res?.name}_${index}`}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)}
|
|
||||||
</Image.PreviewGroup>
|
|
||||||
</Space>
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
</ProDescriptions>
|
|
||||||
</ProCard>
|
|
||||||
</Space>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
import {
|
|
||||||
MyButtons,
|
|
||||||
MyColumns,
|
|
||||||
MyPageContainer,
|
|
||||||
MyProTableProps,
|
|
||||||
usePageTabs,
|
|
||||||
} from '@/common';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
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: 'archive-asset-houses',
|
|
||||||
tabLabel: title,
|
|
||||||
});
|
|
||||||
return (
|
|
||||||
<MyPageContainer title={title}>
|
|
||||||
<ProTable
|
|
||||||
{...MyProTableProps.props}
|
|
||||||
request={async (params, sort) =>
|
|
||||||
MyProTableProps.request(
|
|
||||||
params,
|
|
||||||
sort,
|
|
||||||
Apis.Archive.HouseOccupants.CustomerList,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
MyColumns.ID(),
|
|
||||||
{
|
|
||||||
title: '客户名称',
|
|
||||||
dataIndex: 'name',
|
|
||||||
search: {
|
|
||||||
transform: (value) => {
|
|
||||||
return { name: value };
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '客户电话',
|
|
||||||
dataIndex: 'phone',
|
|
||||||
},
|
|
||||||
MyColumns.UpdatedAt(),
|
|
||||||
MyColumns.Option({
|
|
||||||
render: (_, item: any, index, action) => (
|
|
||||||
<Space key={index}>
|
|
||||||
<MyButtons.View
|
|
||||||
title="查看"
|
|
||||||
onClick={() => {
|
|
||||||
navigate(`/customer/show/${item.id}`);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
),
|
|
||||||
}),
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</MyPageContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
import { MyPageContainer, usePageTabs } 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 CustomerHouse from '../components/CustomerHouse';
|
|
||||||
import CustomerInfo from '../components/CustomerInfo';
|
|
||||||
|
|
||||||
export default function Show({ title = '客户档案' }) {
|
|
||||||
const { id } = useParams<{ id: string }>();
|
|
||||||
const [data, setShow] = useState<any>({});
|
|
||||||
|
|
||||||
// 注册标签页
|
|
||||||
const { addTab } = usePageTabs({
|
|
||||||
tabKey: `customer-detail-${id}`,
|
|
||||||
tabLabel: `${data?.name}档案` || title,
|
|
||||||
});
|
|
||||||
|
|
||||||
const loadShow = () => {
|
|
||||||
let paramsId: any = { id: id ?? 0 };
|
|
||||||
Apis.Archive.HouseOccupants.Show(paramsId).then((res) => {
|
|
||||||
setShow(res?.data);
|
|
||||||
// 更新标签页标题
|
|
||||||
if (res?.data?.name) {
|
|
||||||
addTab({
|
|
||||||
key: `customer-detail-${id}`,
|
|
||||||
label: `${res?.data?.name}档案`,
|
|
||||||
path: `/customer/show/${id}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
loadShow();
|
|
||||||
}, [id]);
|
|
||||||
|
|
||||||
let items = [
|
|
||||||
{
|
|
||||||
label: '关联房屋',
|
|
||||||
key: '1',
|
|
||||||
closable: false,
|
|
||||||
children: (
|
|
||||||
<CustomerHouse
|
|
||||||
item={{ ...data, phone: data?.phone }}
|
|
||||||
reload={() => {
|
|
||||||
loadShow();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<MyPageContainer title={title}>
|
|
||||||
<CustomerInfo item={data} reload={loadShow} />
|
|
||||||
<ProCard style={{ marginTop: 16 }}>
|
|
||||||
<Tabs type="card" items={items} defaultActiveKey="1" size="small" />
|
|
||||||
</ProCard>
|
|
||||||
</MyPageContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
MyButtons,
|
MyButtons,
|
||||||
MyColumns,
|
MyColumns,
|
||||||
MyImportModal,
|
|
||||||
MyPageContainer,
|
MyPageContainer,
|
||||||
MyProTableProps,
|
MyProTableProps,
|
||||||
usePageTabs,
|
usePageTabs,
|
||||||
@ -42,15 +41,6 @@ export default function Index({ title = '仪表管理' }) {
|
|||||||
MyProTableProps.request(params, sort, Apis.Meter.HouseMeters.List)
|
MyProTableProps.request(params, sort, Apis.Meter.HouseMeters.List)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<MyImportModal
|
|
||||||
key="ImportHouse"
|
|
||||||
title="批量导入"
|
|
||||||
type="danger"
|
|
||||||
size="middle"
|
|
||||||
templateApi={Apis.Meter.HouseMeters.DownloadTemplate}
|
|
||||||
importApi={Apis.Meter.HouseMeters.Import}
|
|
||||||
reload={action?.reload}
|
|
||||||
/>,
|
|
||||||
<CompanyCreate key="Create" reload={action?.reload} title={title} />,
|
<CompanyCreate key="Create" reload={action?.reload} title={title} />,
|
||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
@ -103,20 +93,15 @@ export default function Index({ title = '仪表管理' }) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
MyColumns.SoftDelete({
|
MyColumns.SoftDelete({
|
||||||
onRestore: Apis.Meter.HouseMeters.Restore,
|
onRestore: Apis.Company.Companies.Restore,
|
||||||
onSoftDelete: Apis.Meter.HouseMeters.SoftDelete,
|
onSoftDelete: Apis.Company.Companies.SoftDelete,
|
||||||
search: false,
|
search: false,
|
||||||
}),
|
}),
|
||||||
MyColumns.CreatedAt(),
|
MyColumns.CreatedAt(),
|
||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
<MyButtons.View
|
{/* <CompanyShow item={item} title="查看" reload={action?.reload} /> */}
|
||||||
title="查看"
|
|
||||||
onClick={() => {
|
|
||||||
navigate(`/meter/readings/show/${item.id}`);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<CompanyUpdate
|
<CompanyUpdate
|
||||||
item={{ ...item, type: 'link' }}
|
item={{ ...item, type: 'link' }}
|
||||||
title="机构"
|
title="机构"
|
||||||
@ -125,7 +110,7 @@ export default function Index({ title = '仪表管理' }) {
|
|||||||
{item.meter_type ===
|
{item.meter_type ===
|
||||||
HouseMetersMeterTypeEnum.HouseMeter.value && (
|
HouseMetersMeterTypeEnum.HouseMeter.value && (
|
||||||
<MeterHasOne
|
<MeterHasOne
|
||||||
item={{ ...item, size: 'small' }}
|
item={item}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title={'绑房'}
|
title={'绑房'}
|
||||||
/>
|
/>
|
||||||
@ -133,14 +118,14 @@ export default function Index({ title = '仪表管理' }) {
|
|||||||
{item.meter_type ===
|
{item.meter_type ===
|
||||||
HouseMetersMeterTypeEnum.CommonMeter.value && (
|
HouseMetersMeterTypeEnum.CommonMeter.value && (
|
||||||
<MeterHasHouse
|
<MeterHasHouse
|
||||||
item={{ ...item, size: 'small' }}
|
item={item}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title={'绑房'}
|
title={'绑房'}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
Apis.Meter.HouseMeters.Delete({ id: item.id }).then(() =>
|
Apis.Company.Companies.Delete({ id: item.id }).then(() =>
|
||||||
action?.reload(),
|
action?.reload(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -37,8 +37,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
onFinish={async (values) =>
|
onFinish={async (values) =>
|
||||||
Apis.Meter.HouseMeters.Store({
|
Apis.Meter.HouseMeters.Store({
|
||||||
...values,
|
...values,
|
||||||
latest_value: values.initial_value,
|
|
||||||
latest_time: values.initial_time,
|
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.reload?.();
|
props.reload?.();
|
||||||
@ -95,62 +93,11 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'initial_time',
|
key: 'initial_time',
|
||||||
title: '初始抄表时间',
|
title: '初始抄表时间',
|
||||||
valueType: 'dateTime',
|
valueType: 'date',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
fieldProps: {
|
|
||||||
disabledDate: (current: any) => {
|
|
||||||
// 禁用未来的日期
|
|
||||||
return current && current > new Date();
|
|
||||||
},
|
|
||||||
disabledTime: (current: any) => {
|
|
||||||
// 如果是今天,禁用未来的时间
|
|
||||||
if (
|
|
||||||
current &&
|
|
||||||
current.format('YYYY-MM-DD') ===
|
|
||||||
new Date().toISOString().split('T')[0]
|
|
||||||
) {
|
|
||||||
const now = new Date();
|
|
||||||
return {
|
|
||||||
disabledHours: () => {
|
|
||||||
const hours = [];
|
|
||||||
for (let i = now.getHours() + 1; i < 24; i++) {
|
|
||||||
hours.push(i);
|
|
||||||
}
|
|
||||||
return hours;
|
|
||||||
},
|
|
||||||
disabledMinutes: (selectedHour: number) => {
|
|
||||||
if (selectedHour === now.getHours()) {
|
|
||||||
const minutes = [];
|
|
||||||
for (let i = now.getMinutes() + 1; i < 60; i++) {
|
|
||||||
minutes.push(i);
|
|
||||||
}
|
|
||||||
return minutes;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
disabledSeconds: (
|
|
||||||
selectedHour: number,
|
|
||||||
selectedMinute: number,
|
|
||||||
) => {
|
|
||||||
if (
|
|
||||||
selectedHour === now.getHours() &&
|
|
||||||
selectedMinute === now.getMinutes()
|
|
||||||
) {
|
|
||||||
const seconds = [];
|
|
||||||
for (let i = now.getSeconds() + 1; i < 60; i++) {
|
|
||||||
seconds.push(i);
|
|
||||||
}
|
|
||||||
return seconds;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
valueType: 'dependency',
|
valueType: 'dependency',
|
||||||
name: ['asset_projects_id'],
|
name: ['asset_projects_id'],
|
||||||
@ -54,7 +54,6 @@ export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) {
|
|||||||
<MyModal
|
<MyModal
|
||||||
title={props.title || '查看'}
|
title={props.title || '查看'}
|
||||||
type="primary"
|
type="primary"
|
||||||
size={props?.item?.size || 'small'}
|
|
||||||
width="920px"
|
width="920px"
|
||||||
node={
|
node={
|
||||||
<ProTable
|
<ProTable
|
||||||
@ -53,13 +53,13 @@ export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MyModal
|
<MyModal
|
||||||
title={props.title || '查看'}
|
title={props.title || '查看'}
|
||||||
type="primary"
|
type="primary"
|
||||||
width="920px"
|
width="920px"
|
||||||
myRef={modalRef}
|
myRef={modalRef}
|
||||||
size={props?.item?.size || 'small'}
|
|
||||||
node={
|
node={
|
||||||
<ProTable
|
<ProTable
|
||||||
actionRef={tableRef}
|
actionRef={tableRef}
|
||||||
@ -15,7 +15,6 @@ import {
|
|||||||
HouseMetersUsageTypeEnum,
|
HouseMetersUsageTypeEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import NormalReading from './modals/NormalReading';
|
import NormalReading from './modals/NormalReading';
|
||||||
import ResetReading from './modals/ResetReading';
|
|
||||||
|
|
||||||
export default function Index({ title = '抄表数据' }) {
|
export default function Index({ title = '抄表数据' }) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -59,10 +58,6 @@ export default function Index({ title = '抄表数据' }) {
|
|||||||
title: '仪表名称',
|
title: '仪表名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '关联房屋',
|
|
||||||
dataIndex: 'full_name',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '收费标准',
|
title: '收费标准',
|
||||||
dataIndex: ['charge_standard', 'name'],
|
dataIndex: ['charge_standard', 'name'],
|
||||||
@ -88,27 +83,34 @@ export default function Index({ title = '抄表数据' }) {
|
|||||||
dataIndex: 'latest_time',
|
dataIndex: 'latest_time',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
dataIndex: 'remark',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
MyColumns.SoftDelete({
|
||||||
|
onRestore: Apis.Company.Companies.Restore,
|
||||||
|
onSoftDelete: Apis.Company.Companies.SoftDelete,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
MyColumns.CreatedAt(),
|
MyColumns.CreatedAt(),
|
||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
{/* <CompanyShow item={item} title="查看" reload={action?.reload} /> */}
|
{/* <CompanyShow item={item} title="查看" reload={action?.reload} /> */}
|
||||||
<MyButtons.View
|
|
||||||
title="查看"
|
|
||||||
onClick={() => {
|
|
||||||
navigate(`/meter/readings/show/${item.id}`);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<NormalReading
|
<NormalReading
|
||||||
item={{ ...item, size: 'small' }}
|
item={{ ...item, type: 'link' }}
|
||||||
title="抄表"
|
title="抄表"
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
/>
|
/>
|
||||||
<ResetReading
|
|
||||||
item={{ ...item, title: '重置', size: 'small' }}
|
<MyButtons.Delete
|
||||||
title="重置"
|
onConfirm={() =>
|
||||||
reload={action?.reload}
|
Apis.Company.Companies.Delete({ id: item.id }).then(() =>
|
||||||
|
action?.reload(),
|
||||||
|
)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
@ -10,7 +10,7 @@ import { HouseMeterReadingsOperationTypeEnum } from '@/gen/Enums';
|
|||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { Form, message } from 'antd';
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
export default function NormalReading(props: MyBetaModalFormProps) {
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -23,13 +23,7 @@ export default function NormalReading(props: MyBetaModalFormProps) {
|
|||||||
labelAlign="left"
|
labelAlign="left"
|
||||||
width="600px"
|
width="600px"
|
||||||
key={new Date().getTime()}
|
key={new Date().getTime()}
|
||||||
trigger={
|
trigger={<MyButtons.Default title={`抄表`} type="primary" />}
|
||||||
<MyButtons.Create
|
|
||||||
title={`抄表`}
|
|
||||||
type="primary"
|
|
||||||
size={props.item?.size || 'middle'}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
form={form}
|
form={form}
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
if (open && props.item) {
|
if (open && props.item) {
|
||||||
@ -47,7 +41,6 @@ export default function NormalReading(props: MyBetaModalFormProps) {
|
|||||||
onFinish={async (values) =>
|
onFinish={async (values) =>
|
||||||
Apis.Meter.HouseMeterReadings.Store({
|
Apis.Meter.HouseMeterReadings.Store({
|
||||||
...values,
|
...values,
|
||||||
house_meters_id: props.item?.id,
|
|
||||||
operation_type:
|
operation_type:
|
||||||
HouseMeterReadingsOperationTypeEnum.NormalReading.value,
|
HouseMeterReadingsOperationTypeEnum.NormalReading.value,
|
||||||
})
|
})
|
||||||
@ -68,10 +61,11 @@ export default function NormalReading(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'latest_time',
|
key: 'latest_time',
|
||||||
title: '上次抄表时间',
|
title: '上次抄表时间',
|
||||||
valueType: 'dateTime',
|
valueType: 'date',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
fieldProps: { disabled: true },
|
fieldProps: { disabled: true },
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
key: 'current_reading',
|
key: 'current_reading',
|
||||||
title: '本次抄表读数',
|
title: '本次抄表读数',
|
||||||
@ -102,7 +96,7 @@ export default function NormalReading(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'reading_time',
|
key: 'reading_time',
|
||||||
title: '本次抄表时间',
|
title: '本次抄表时间',
|
||||||
valueType: 'dateTime',
|
valueType: 'date',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
formItemProps: {
|
formItemProps: {
|
||||||
...rulesHelper.text,
|
...rulesHelper.text,
|
||||||
@ -125,58 +119,6 @@ export default function NormalReading(props: MyBetaModalFormProps) {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
fieldProps: {
|
|
||||||
disabledDate: (current: any) => {
|
|
||||||
// 禁用未来的日期
|
|
||||||
return current && current > new Date();
|
|
||||||
},
|
|
||||||
disabledTime: (current: any) => {
|
|
||||||
// 如果是今天,禁用未来的时间
|
|
||||||
if (
|
|
||||||
current &&
|
|
||||||
current.format('YYYY-MM-DD') ===
|
|
||||||
new Date().toISOString().split('T')[0]
|
|
||||||
) {
|
|
||||||
const now = new Date();
|
|
||||||
return {
|
|
||||||
disabledHours: () => {
|
|
||||||
const hours = [];
|
|
||||||
for (let i = now.getHours() + 1; i < 24; i++) {
|
|
||||||
hours.push(i);
|
|
||||||
}
|
|
||||||
return hours;
|
|
||||||
},
|
|
||||||
disabledMinutes: (selectedHour: number) => {
|
|
||||||
if (selectedHour === now.getHours()) {
|
|
||||||
const minutes = [];
|
|
||||||
for (let i = now.getMinutes() + 1; i < 60; i++) {
|
|
||||||
minutes.push(i);
|
|
||||||
}
|
|
||||||
return minutes;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
disabledSeconds: (
|
|
||||||
selectedHour: number,
|
|
||||||
selectedMinute: number,
|
|
||||||
) => {
|
|
||||||
if (
|
|
||||||
selectedHour === now.getHours() &&
|
|
||||||
selectedMinute === now.getMinutes()
|
|
||||||
) {
|
|
||||||
const seconds = [];
|
|
||||||
for (let i = now.getSeconds() + 1; i < 60; i++) {
|
|
||||||
seconds.push(i);
|
|
||||||
}
|
|
||||||
return seconds;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Selects?.Employees({
|
Selects?.Employees({
|
||||||
key: 'company_employees_id',
|
key: 'company_employees_id',
|
||||||
@ -15,10 +15,10 @@ import { Space } from 'antd';
|
|||||||
import TaskCreate from './modals/TaskCreate';
|
import TaskCreate from './modals/TaskCreate';
|
||||||
import TaskShow from './modals/TaskShow';
|
import TaskShow from './modals/TaskShow';
|
||||||
|
|
||||||
export default function Index({ title = '仪表账单' }) {
|
export default function Index({ title = '账单任务' }) {
|
||||||
// 注册当前页面为标签页
|
// 注册当前页面为标签页
|
||||||
usePageTabs({
|
usePageTabs({
|
||||||
tabKey: 'house_meter_tasks',
|
tabKey: 'house_charge_tasks',
|
||||||
tabLabel: title,
|
tabLabel: title,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -32,7 +32,11 @@ export default function Index({ title = '仪表账单' }) {
|
|||||||
<ProTable
|
<ProTable
|
||||||
{...MyProTableProps.props}
|
{...MyProTableProps.props}
|
||||||
request={async (params, sort) =>
|
request={async (params, sort) =>
|
||||||
MyProTableProps.request(params, sort, Apis.Meter.HouseMeterTasks.List)
|
MyProTableProps.request(
|
||||||
|
params,
|
||||||
|
sort,
|
||||||
|
Apis.HouseCharage.HouseChargeTasks.List,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<TaskCreate key="Create" reload={action?.reload} title="账单任务" />,
|
<TaskCreate key="Create" reload={action?.reload} title="账单任务" />,
|
||||||
122
src/pages/mete/tasks/modals/TaskCreate.tsx
Normal file
122
src/pages/mete/tasks/modals/TaskCreate.tsx
Normal file
@ -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 (
|
||||||
|
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeTasks.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`创建${props.title}`}
|
||||||
|
width="480px"
|
||||||
|
layout="horizontal"
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
wrapperCol={{ span: 16 }}
|
||||||
|
labelAlign="left"
|
||||||
|
trigger={<MyButtons.Create title={`创建${props.title}`} />}
|
||||||
|
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 },
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -17,7 +17,7 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
|||||||
MyProTableProps.request(
|
MyProTableProps.request(
|
||||||
{ ...params, house_charge_tasks_id: props?.item?.id },
|
{ ...params, house_charge_tasks_id: props?.item?.id },
|
||||||
sort,
|
sort,
|
||||||
Apis.Meter.HouseMeterTasks.List,
|
Apis.HouseCharage.HouseChargeTaskDetails.List,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
@ -1,60 +0,0 @@
|
|||||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
|
||||||
import {
|
|
||||||
HouseMetersMeterTypeEnum,
|
|
||||||
HouseMetersUsageTypeEnum,
|
|
||||||
} from '@/gen/Enums';
|
|
||||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
|
||||||
import { Space } from 'antd';
|
|
||||||
|
|
||||||
export default function info(props: MyBetaModalFormProps) {
|
|
||||||
const { item } = props;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Space direction="vertical" style={{ width: '100%' }}>
|
|
||||||
<ProCard title="基本信息">
|
|
||||||
<ProDescriptions bordered>
|
|
||||||
<ProDescriptions.Item label="仪表名称">
|
|
||||||
<div style={{ fontWeight: 'bold' }}>
|
|
||||||
【{item?.id}】{item?.name}
|
|
||||||
</div>
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="类型">
|
|
||||||
<renderTextHelper.Tag
|
|
||||||
Enums={HouseMetersMeterTypeEnum}
|
|
||||||
value={item?.meter_type}
|
|
||||||
key="meter_type"
|
|
||||||
/>
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="使用类型">
|
|
||||||
<renderTextHelper.Tag
|
|
||||||
Enums={HouseMetersUsageTypeEnum}
|
|
||||||
value={item?.usage_type}
|
|
||||||
key="usage_type"
|
|
||||||
/>
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
|
|
||||||
<ProDescriptions.Item label="收费标准">
|
|
||||||
{item?.charge_standard?.name || '-'}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="初始抄表读数">
|
|
||||||
{item?.initial_value}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="初始抄表时间">
|
|
||||||
{item?.initial_time}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="最新抄表读数">
|
|
||||||
{item?.latest_value}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
|
|
||||||
<ProDescriptions.Item label="最新抄表时间">
|
|
||||||
{item?.latest_time}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
|
|
||||||
<ProDescriptions.Item label="备注">
|
|
||||||
{item?.remark || '-'}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
</ProDescriptions>
|
|
||||||
</ProCard>
|
|
||||||
</Space>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,210 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { HouseMeterReadingsOperationTypeEnum } 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 (
|
|
||||||
<BetaSchemaForm<ApiTypes.Meter.HouseMeterReadings.Update>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`修正抄表数据`}
|
|
||||||
layout="horizontal"
|
|
||||||
labelCol={{ span: 6 }}
|
|
||||||
wrapperCol={{ span: 18 }}
|
|
||||||
labelAlign="left"
|
|
||||||
width="600px"
|
|
||||||
key={new Date().getTime()}
|
|
||||||
trigger={<MyButtons.Default title={`修正`} type="primary" />}
|
|
||||||
form={form}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open && props.item) {
|
|
||||||
form.setFieldsValue(props.item);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values) =>
|
|
||||||
Apis.Meter.HouseMeterReadings.Update({
|
|
||||||
...values,
|
|
||||||
id: props.item?.id ?? 0,
|
|
||||||
house_meters_id: props.item?.house_meters_id,
|
|
||||||
previous_reading: props.item?.previous_reading,
|
|
||||||
operation_type:
|
|
||||||
HouseMeterReadingsOperationTypeEnum.CorrectReading.value,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success(props.title + '成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
{
|
|
||||||
key: 'previous_reading',
|
|
||||||
title: '上次抄表读数',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
fieldProps: { disabled: true },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'current_reading',
|
|
||||||
title: '修正抄表读数',
|
|
||||||
valueType: 'number',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: {
|
|
||||||
...rulesHelper.number,
|
|
||||||
rules: [
|
|
||||||
...rulesHelper.number.rules,
|
|
||||||
{
|
|
||||||
validator: (_, value) => {
|
|
||||||
const latestValue = form.getFieldValue('latest_value');
|
|
||||||
if (
|
|
||||||
value &&
|
|
||||||
latestValue &&
|
|
||||||
Number(value) <= Number(latestValue)
|
|
||||||
) {
|
|
||||||
return Promise.reject(
|
|
||||||
new Error('本次读数必须大于上次抄表读数'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return Promise.resolve();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
fieldProps: {
|
|
||||||
onChange: (e: any, num: number) => {
|
|
||||||
form.setFieldsValue({
|
|
||||||
usage_amount: rulesHelper.getDifference(
|
|
||||||
parseFloat(form.getFieldValue('previous_reading')),
|
|
||||||
parseFloat(form.getFieldValue('current_reading')),
|
|
||||||
),
|
|
||||||
remark: `修正前读数:${props.item?.current_reading}`,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'reading_time',
|
|
||||||
title: '修正抄表时间',
|
|
||||||
valueType: 'dateTime',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: {
|
|
||||||
...rulesHelper.text,
|
|
||||||
rules: [
|
|
||||||
...rulesHelper.text.rules,
|
|
||||||
{
|
|
||||||
validator: (_, value) => {
|
|
||||||
const latestTime = form.getFieldValue('latest_time');
|
|
||||||
if (value && latestTime) {
|
|
||||||
const currentTime = new Date(value);
|
|
||||||
const lastTime = new Date(latestTime);
|
|
||||||
if (currentTime <= lastTime) {
|
|
||||||
return Promise.reject(
|
|
||||||
new Error('本次抄表时间必须大于上次抄表时间'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Promise.resolve();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
fieldProps: {
|
|
||||||
disabledDate: (current: any) => {
|
|
||||||
// 禁用未来的日期
|
|
||||||
return current && current > new Date();
|
|
||||||
},
|
|
||||||
disabledTime: (current: any) => {
|
|
||||||
// 如果是今天,禁用未来的时间
|
|
||||||
if (
|
|
||||||
current &&
|
|
||||||
current.format('YYYY-MM-DD') ===
|
|
||||||
new Date().toISOString().split('T')[0]
|
|
||||||
) {
|
|
||||||
const now = new Date();
|
|
||||||
return {
|
|
||||||
disabledHours: () => {
|
|
||||||
const hours = [];
|
|
||||||
for (let i = now.getHours() + 1; i < 24; i++) {
|
|
||||||
hours.push(i);
|
|
||||||
}
|
|
||||||
return hours;
|
|
||||||
},
|
|
||||||
disabledMinutes: (selectedHour: number) => {
|
|
||||||
if (selectedHour === now.getHours()) {
|
|
||||||
const minutes = [];
|
|
||||||
for (let i = now.getMinutes() + 1; i < 60; i++) {
|
|
||||||
minutes.push(i);
|
|
||||||
}
|
|
||||||
return minutes;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
disabledSeconds: (
|
|
||||||
selectedHour: number,
|
|
||||||
selectedMinute: number,
|
|
||||||
) => {
|
|
||||||
if (
|
|
||||||
selectedHour === now.getHours() &&
|
|
||||||
selectedMinute === now.getMinutes()
|
|
||||||
) {
|
|
||||||
const seconds = [];
|
|
||||||
for (let i = now.getSeconds() + 1; i < 60; i++) {
|
|
||||||
seconds.push(i);
|
|
||||||
}
|
|
||||||
return seconds;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'usage_amount',
|
|
||||||
title: '修正后用量',
|
|
||||||
valueType: 'number',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: {
|
|
||||||
...rulesHelper.number,
|
|
||||||
},
|
|
||||||
fieldProps: {
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Selects?.Employees({
|
|
||||||
key: 'company_employees_id',
|
|
||||||
title: '抄表人',
|
|
||||||
params: {
|
|
||||||
companies_id: props.item?.companies_id,
|
|
||||||
},
|
|
||||||
colProps: { span: 24 },
|
|
||||||
required: true,
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
fieldNames: {
|
|
||||||
label: 'label',
|
|
||||||
value: 'value',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
key: 'remark',
|
|
||||||
title: '备注',
|
|
||||||
valueType: 'textarea',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,220 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyFormItems,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import {
|
|
||||||
HouseMeterReadingsOperationTypeEnum,
|
|
||||||
HouseMetersMeterTypeEnum,
|
|
||||||
HouseMetersUsageTypeEnum,
|
|
||||||
} 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 (
|
|
||||||
<BetaSchemaForm<ApiTypes.Meter.HouseMeterReadings.Store>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`重置抄表数据`}
|
|
||||||
layout="horizontal"
|
|
||||||
labelCol={{ span: 6 }}
|
|
||||||
wrapperCol={{ span: 18 }}
|
|
||||||
labelAlign="left"
|
|
||||||
width="600px"
|
|
||||||
key={new Date().getTime()}
|
|
||||||
trigger={
|
|
||||||
<MyButtons.Default
|
|
||||||
title={props.item?.title || `重置读数`}
|
|
||||||
type="primary"
|
|
||||||
size={props.item?.size || 'middle'}
|
|
||||||
danger
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
form={form}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open && props.item) {
|
|
||||||
form.resetFields(); // 清空表单数据
|
|
||||||
form.setFieldsValue({
|
|
||||||
...props.item,
|
|
||||||
house_meters_id: props.item?.id,
|
|
||||||
latest_value:
|
|
||||||
props.item?.latest_value === '0.00'
|
|
||||||
? props.item?.initial_value
|
|
||||||
: props.item?.latest_value,
|
|
||||||
latest_time: props.item?.latest_time || props.item?.initial_time,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values) =>
|
|
||||||
Apis.Meter.HouseMeterReadings.Store({
|
|
||||||
...values,
|
|
||||||
house_meters_id: props.item?.id,
|
|
||||||
operation_type:
|
|
||||||
HouseMeterReadingsOperationTypeEnum.ResetReading.value,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success(props.title + '成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false)
|
|
||||||
}
|
|
||||||
columns={[
|
|
||||||
{
|
|
||||||
key: 'name',
|
|
||||||
title: '仪表名称',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
fieldProps: { disabled: true },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
},
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'meter_type',
|
|
||||||
title: '仪表类型',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
valueEnum: HouseMetersMeterTypeEnum,
|
|
||||||
required: true,
|
|
||||||
fieldProps: { disabled: true },
|
|
||||||
}),
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'usage_type',
|
|
||||||
title: '使用类型',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
valueEnum: HouseMetersUsageTypeEnum,
|
|
||||||
required: true,
|
|
||||||
fieldProps: { disabled: true },
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
key: 'latest_value',
|
|
||||||
title: '上次抄表读数',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
fieldProps: { disabled: true },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'latest_time',
|
|
||||||
title: '上次抄表时间',
|
|
||||||
valueType: 'dateTime',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
fieldProps: { disabled: true },
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
key: 'current_reading',
|
|
||||||
title: '重置抄表读数',
|
|
||||||
valueType: 'number',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: {
|
|
||||||
...rulesHelper.number,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'reading_time',
|
|
||||||
title: '重置抄表时间',
|
|
||||||
valueType: 'dateTime',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: {
|
|
||||||
...rulesHelper.text,
|
|
||||||
rules: [
|
|
||||||
...rulesHelper.text.rules,
|
|
||||||
{
|
|
||||||
validator: (_, value) => {
|
|
||||||
const latestTime = form.getFieldValue('latest_time');
|
|
||||||
if (value && latestTime) {
|
|
||||||
const currentTime = new Date(value);
|
|
||||||
const lastTime = new Date(latestTime);
|
|
||||||
if (currentTime <= lastTime) {
|
|
||||||
return Promise.reject(
|
|
||||||
new Error('本次抄表时间必须大于上次抄表时间'),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Promise.resolve();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
fieldProps: {
|
|
||||||
disabledDate: (current: any) => {
|
|
||||||
// 禁用未来的日期
|
|
||||||
return current && current > new Date();
|
|
||||||
},
|
|
||||||
disabledTime: (current: any) => {
|
|
||||||
// 如果是今天,禁用未来的时间
|
|
||||||
if (
|
|
||||||
current &&
|
|
||||||
current.format('YYYY-MM-DD') ===
|
|
||||||
new Date().toISOString().split('T')[0]
|
|
||||||
) {
|
|
||||||
const now = new Date();
|
|
||||||
return {
|
|
||||||
disabledHours: () => {
|
|
||||||
const hours = [];
|
|
||||||
for (let i = now.getHours() + 1; i < 24; i++) {
|
|
||||||
hours.push(i);
|
|
||||||
}
|
|
||||||
return hours;
|
|
||||||
},
|
|
||||||
disabledMinutes: (selectedHour: number) => {
|
|
||||||
if (selectedHour === now.getHours()) {
|
|
||||||
const minutes = [];
|
|
||||||
for (let i = now.getMinutes() + 1; i < 60; i++) {
|
|
||||||
minutes.push(i);
|
|
||||||
}
|
|
||||||
return minutes;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
disabledSeconds: (
|
|
||||||
selectedHour: number,
|
|
||||||
selectedMinute: number,
|
|
||||||
) => {
|
|
||||||
if (
|
|
||||||
selectedHour === now.getHours() &&
|
|
||||||
selectedMinute === now.getMinutes()
|
|
||||||
) {
|
|
||||||
const seconds = [];
|
|
||||||
for (let i = now.getSeconds() + 1; i < 60; i++) {
|
|
||||||
seconds.push(i);
|
|
||||||
}
|
|
||||||
return seconds;
|
|
||||||
}
|
|
||||||
return [];
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
Selects?.Employees({
|
|
||||||
key: 'company_employees_id',
|
|
||||||
title: '抄表人',
|
|
||||||
params: {
|
|
||||||
companies_id: props.item?.companies_id,
|
|
||||||
},
|
|
||||||
colProps: { span: 24 },
|
|
||||||
required: true,
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
fieldNames: {
|
|
||||||
label: 'label',
|
|
||||||
value: 'value',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
{
|
|
||||||
key: 'remark',
|
|
||||||
title: '备注',
|
|
||||||
valueType: 'textarea',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
import { MyPageContainer, usePageTabs } 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 MeteInfo from '../components/MeteInfo';
|
|
||||||
import HasHouse from '../table/HasHouse';
|
|
||||||
import ReadingLIst from '../table/ReadingLIst';
|
|
||||||
|
|
||||||
export default function Show({ title = '仪表详情' }) {
|
|
||||||
const { id } = useParams<{ id: string }>();
|
|
||||||
const [data, setShow] = useState<any>({});
|
|
||||||
console.log('id', data);
|
|
||||||
|
|
||||||
// 注册标签页
|
|
||||||
const { addTab } = usePageTabs({
|
|
||||||
tabKey: `meter-detail-${id}`,
|
|
||||||
tabLabel: `仪表:${data?.name}` || title,
|
|
||||||
});
|
|
||||||
|
|
||||||
const loadShow = () => {
|
|
||||||
let paramsId: any = { id: id ?? 0 };
|
|
||||||
Apis.Meter.HouseMeters.Show(paramsId).then((res) => {
|
|
||||||
setShow(res?.data);
|
|
||||||
// 更新标签页标题
|
|
||||||
if (res?.data?.name) {
|
|
||||||
addTab({
|
|
||||||
key: `meter-detail-${id}`,
|
|
||||||
label: title,
|
|
||||||
path: `/mete/readings/show/${id}`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
loadShow();
|
|
||||||
}, [id]);
|
|
||||||
|
|
||||||
let items = [
|
|
||||||
{
|
|
||||||
label: '抄表数据',
|
|
||||||
key: '1',
|
|
||||||
closable: false,
|
|
||||||
children: (
|
|
||||||
<ReadingLIst
|
|
||||||
item={{ ...data, id: id }}
|
|
||||||
reload={() => {
|
|
||||||
loadShow();
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '关联房屋',
|
|
||||||
key: '2',
|
|
||||||
closable: false,
|
|
||||||
children: <HasHouse item={{ ...data, id: id }} />,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<MyPageContainer title={title}>
|
|
||||||
<MeteInfo item={data} reload={loadShow} />
|
|
||||||
<ProCard style={{ marginTop: 16 }}>
|
|
||||||
<Tabs type="card" items={items} defaultActiveKey="1" size="small" />
|
|
||||||
</ProCard>
|
|
||||||
</MyPageContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,103 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyColumns,
|
|
||||||
MyProTableProps,
|
|
||||||
} from '@/common';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { HouseMetersMeterTypeEnum } from '@/gen/Enums';
|
|
||||||
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 (
|
|
||||||
<>
|
|
||||||
<ProTable
|
|
||||||
{...MyProTableProps.props}
|
|
||||||
request={async (params, sort) =>
|
|
||||||
MyProTableProps.request(
|
|
||||||
{ ...params, house_meters_id: props?.item?.id },
|
|
||||||
sort,
|
|
||||||
Apis.Meter.HouseMeterHasHouses.List,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
toolBarRender={(action) => [
|
|
||||||
<NormalReading
|
|
||||||
key="Create"
|
|
||||||
reload={action?.reload}
|
|
||||||
item={props?.item}
|
|
||||||
title="抄表"
|
|
||||||
/>,
|
|
||||||
...(props?.item?.meter_type ===
|
|
||||||
HouseMetersMeterTypeEnum.HouseMeter.value
|
|
||||||
? [
|
|
||||||
<MeterHasOne
|
|
||||||
key="MeterHasOne"
|
|
||||||
item={{ ...props?.item, size: 'middle' }}
|
|
||||||
reload={action?.reload}
|
|
||||||
title={'绑房'}
|
|
||||||
/>,
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
...(props?.item?.meter_type ===
|
|
||||||
HouseMetersMeterTypeEnum.CommonMeter.value
|
|
||||||
? [
|
|
||||||
<MeterHasHouse
|
|
||||||
key="MeterHasHouse"
|
|
||||||
item={{ ...props?.item, size: 'middle' }}
|
|
||||||
reload={action?.reload}
|
|
||||||
title={'绑房'}
|
|
||||||
/>,
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
]}
|
|
||||||
// search={false}
|
|
||||||
// options={false}
|
|
||||||
columns={[
|
|
||||||
MyColumns.ID(),
|
|
||||||
{
|
|
||||||
title: '项目名称',
|
|
||||||
dataIndex: 'project_name',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '楼栋名称',
|
|
||||||
dataIndex: 'building_name',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '单元名称',
|
|
||||||
dataIndex: 'unit_name',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '房号',
|
|
||||||
dataIndex: 'name',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '房屋名称',
|
|
||||||
dataIndex: 'full_name',
|
|
||||||
},
|
|
||||||
MyColumns.UpdatedAt(),
|
|
||||||
MyColumns.Option({
|
|
||||||
render: (_, item: any, index, action) => (
|
|
||||||
<Space key={index}>
|
|
||||||
<MyButtons.Delete
|
|
||||||
onConfirm={() =>
|
|
||||||
Apis.Meter.HouseMeterHasHouses.Delete({ id: item.id }).then(
|
|
||||||
() => action?.reload(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
),
|
|
||||||
}),
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,91 +0,0 @@
|
|||||||
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { HouseMeterReadingsOperationTypeEnum } from '@/gen/Enums';
|
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
|
||||||
import { Space } from 'antd';
|
|
||||||
import CorrectReading from '../modals/CorrectReading';
|
|
||||||
import NormalReading from '../modals/NormalReading';
|
|
||||||
import ResetReading from '../modals/ResetReading';
|
|
||||||
|
|
||||||
export default function Index(props: MyBetaModalFormProps) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ProTable
|
|
||||||
{...MyProTableProps.props}
|
|
||||||
request={async (params, sort) =>
|
|
||||||
MyProTableProps.request(
|
|
||||||
{ ...params, house_meters_id: props?.item?.id },
|
|
||||||
sort,
|
|
||||||
Apis.Meter.HouseMeterReadings.List,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
toolBarRender={(action) => [
|
|
||||||
<NormalReading
|
|
||||||
key="Create"
|
|
||||||
reload={action?.reload}
|
|
||||||
item={props?.item}
|
|
||||||
title="抄表"
|
|
||||||
/>,
|
|
||||||
<ResetReading
|
|
||||||
key="Reset"
|
|
||||||
reload={action?.reload}
|
|
||||||
item={props?.item}
|
|
||||||
title="重置"
|
|
||||||
/>,
|
|
||||||
]}
|
|
||||||
// search={false}
|
|
||||||
// options={false}
|
|
||||||
columns={[
|
|
||||||
MyColumns.EnumTag({
|
|
||||||
title: '操作类型',
|
|
||||||
dataIndex: 'operation_type',
|
|
||||||
valueEnum: HouseMeterReadingsOperationTypeEnum,
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
title: '抄表读数',
|
|
||||||
dataIndex: 'current_reading',
|
|
||||||
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 ? '已生成' : '未生成'),
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
MyColumns.Option({
|
|
||||||
render: (_, item: any, index, action) => (
|
|
||||||
<Space key={index}>
|
|
||||||
{/* 只有未生成账单的抄表记录,且不是重置读数,才显示修正按钮 */}
|
|
||||||
{!item?.bill_status &&
|
|
||||||
item?.operation_type !==
|
|
||||||
HouseMeterReadingsOperationTypeEnum.ResetReading.value && (
|
|
||||||
<CorrectReading item={item} reload={action?.reload} />
|
|
||||||
)}
|
|
||||||
</Space>
|
|
||||||
),
|
|
||||||
}),
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,223 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyFormItems,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import {
|
|
||||||
HouseMetersMeterTypeEnum,
|
|
||||||
HouseMeterTasksGenerationMethodEnum,
|
|
||||||
} 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 (
|
|
||||||
<BetaSchemaForm<ApiTypes.Meter.HouseMeterTasks.Store>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`创建${props.title}`}
|
|
||||||
width="480px"
|
|
||||||
layout="horizontal"
|
|
||||||
labelCol={{ span: 8 }}
|
|
||||||
wrapperCol={{ span: 16 }}
|
|
||||||
labelAlign="left"
|
|
||||||
trigger={<MyButtons.Create title={`创建${props.title}`} />}
|
|
||||||
key={new Date().getTime()}
|
|
||||||
form={form}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open) {
|
|
||||||
form.resetFields(); // 清空表单数据
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values: any) =>
|
|
||||||
Apis.Meter.HouseMeterTasks.Store({
|
|
||||||
...values,
|
|
||||||
data: [values?.data_id],
|
|
||||||
})
|
|
||||||
.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,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
|
|
||||||
{
|
|
||||||
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 },
|
|
||||||
},
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'meter_type',
|
|
||||||
title: '仪表类型',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
valueEnum: HouseMetersMeterTypeEnum,
|
|
||||||
required: true,
|
|
||||||
fieldProps: {
|
|
||||||
onChange: () => {
|
|
||||||
// 切换计量单位时清空计费模式
|
|
||||||
form.setFieldValue('generation_method', undefined);
|
|
||||||
form.setFieldValue('data', undefined);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
name: ['meter_type'],
|
|
||||||
valueType: 'dependency',
|
|
||||||
columns: ({ meter_type }: any) => {
|
|
||||||
return meter_type === HouseMetersMeterTypeEnum.CommonMeter.value
|
|
||||||
? [
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'generation_method',
|
|
||||||
title: '生成方式',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
valueEnum: () => {
|
|
||||||
let obj: any = JSON.parse(
|
|
||||||
JSON.stringify(HouseMeterTasksGenerationMethodEnum),
|
|
||||||
);
|
|
||||||
delete obj.Unit;
|
|
||||||
delete obj.Building;
|
|
||||||
return obj;
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
Selects?.AssetMeters({
|
|
||||||
title: '选择仪表',
|
|
||||||
params: {
|
|
||||||
asset_projects_id:
|
|
||||||
form.getFieldValue('asset_projects_id'),
|
|
||||||
// 仪表类型必须为房屋仪表
|
|
||||||
meter_type: HouseMetersMeterTypeEnum.CommonMeter.value,
|
|
||||||
},
|
|
||||||
key: 'data_id',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: meter_type === HouseMetersMeterTypeEnum.HouseMeter.value
|
|
||||||
? [
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'generation_method',
|
|
||||||
title: '生成方式',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
valueEnum: HouseMeterTasksGenerationMethodEnum,
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
name: ['generation_method'],
|
|
||||||
valueType: 'dependency',
|
|
||||||
columns: ({ generation_method }: any) => {
|
|
||||||
return generation_method ===
|
|
||||||
HouseMeterTasksGenerationMethodEnum.Building.value
|
|
||||||
? [
|
|
||||||
Selects?.AssetBuildings({
|
|
||||||
title: '选择楼栋',
|
|
||||||
key: 'data_id',
|
|
||||||
params: {
|
|
||||||
asset_projects_id:
|
|
||||||
form.getFieldValue('asset_projects_id'),
|
|
||||||
},
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: generation_method ===
|
|
||||||
HouseMeterTasksGenerationMethodEnum.Unit.value
|
|
||||||
? [
|
|
||||||
Selects?.AssetUnits({
|
|
||||||
title: '选择单元',
|
|
||||||
key: 'data_id',
|
|
||||||
params: {
|
|
||||||
asset_projects_id:
|
|
||||||
form.getFieldValue('asset_projects_id'),
|
|
||||||
},
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: generation_method ===
|
|
||||||
HouseMeterTasksGenerationMethodEnum.Meter.value
|
|
||||||
? [
|
|
||||||
Selects?.AssetMeters({
|
|
||||||
title: '选择仪表',
|
|
||||||
params: {
|
|
||||||
asset_projects_id:
|
|
||||||
form.getFieldValue('asset_projects_id'),
|
|
||||||
// 仪表类型必须为房屋仪表
|
|
||||||
meter_type:
|
|
||||||
HouseMetersMeterTypeEnum.HouseMeter.value,
|
|
||||||
},
|
|
||||||
key: 'data_id',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
import { MyBetaModalFormProps } from '@/common';
|
|
||||||
import { PlayCircleFilled } from '@ant-design/icons';
|
|
||||||
import { ProCard } from '@ant-design/pro-components';
|
|
||||||
import './style.scss';
|
|
||||||
export default function infoPreview(props: MyBetaModalFormProps) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
{props?.item?.type === 'Image' ? (
|
|
||||||
<div className="card_info_preview">
|
|
||||||
<div className="title">内容预览:朋友圈/图片消息</div>
|
|
||||||
<ProCard>
|
|
||||||
<div className="preview_header">
|
|
||||||
<div className="avatar">员工头像</div>
|
|
||||||
<div className="info">
|
|
||||||
<div className="name">员工的名字</div>
|
|
||||||
<div className="desc">此处显示“发送文案”输入的文案</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="preview_content">
|
|
||||||
<div className="item"></div>
|
|
||||||
<div className="item"></div>
|
|
||||||
<div className="item"></div>
|
|
||||||
<div className="item"></div>
|
|
||||||
</div>
|
|
||||||
</ProCard>
|
|
||||||
</div>
|
|
||||||
) : props?.item?.type === 'Video' ? (
|
|
||||||
<div className="card_info_preview">
|
|
||||||
<div className="title">内容预览:朋友圈/视频消息</div>
|
|
||||||
<ProCard>
|
|
||||||
<div className="preview_header">
|
|
||||||
<div className="avatar">员工头像</div>
|
|
||||||
<div className="info">
|
|
||||||
<div className="name">员工的名字</div>
|
|
||||||
<div className="desc">此处显示“发送文案”输入的文案</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="preview_content">
|
|
||||||
<div className="video_preview">
|
|
||||||
<PlayCircleFilled style={{ fontSize: 40 }} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ProCard>
|
|
||||||
</div>
|
|
||||||
) : props?.item?.type === 'Link' ||
|
|
||||||
props?.item?.type === 'MiniProgram' ? (
|
|
||||||
<div className="card_info_preview">
|
|
||||||
<div className="title">内容预览:朋友圈/转载链接消息</div>
|
|
||||||
<ProCard>
|
|
||||||
<div className="preview_header">
|
|
||||||
<div className="avatar">员工头像</div>
|
|
||||||
<div className="info">
|
|
||||||
<div className="name">员工的名字</div>
|
|
||||||
<div className="desc">此处显示“发送文案”输入的文案</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="preview_content cover_image_preview">
|
|
||||||
<div className="cover_image">封面图</div>
|
|
||||||
<div className="cover_info">
|
|
||||||
此处显示“链接标题”输入的文案,文案字数多时可以换行显示
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ProCard>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<></>
|
|
||||||
)}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,76 +0,0 @@
|
|||||||
.card_info_preview {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
width: 400px;
|
|
||||||
padding: 15px;
|
|
||||||
margin-left: 10px;
|
|
||||||
border-radius: 10px;
|
|
||||||
.title {
|
|
||||||
border-left: 3px solid #1890ff;
|
|
||||||
padding-left: 15px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
.preview_header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
.avatar {
|
|
||||||
width: 60px;
|
|
||||||
height: 60px;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
font-size: 17px;
|
|
||||||
font-weight: 500;
|
|
||||||
padding: 8px;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 20px;
|
|
||||||
}
|
|
||||||
.info {
|
|
||||||
padding-left: 15px;
|
|
||||||
.name {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
.desc {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.preview_content {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
.item {
|
|
||||||
width: 70px;
|
|
||||||
height: 70px;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
}
|
|
||||||
.video_preview {
|
|
||||||
width: 150px;
|
|
||||||
height: 150px;
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.cover_image_preview {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
padding: 10px;
|
|
||||||
border-radius: 10px;
|
|
||||||
.cover_image {
|
|
||||||
width: 70px;
|
|
||||||
height: 70px;
|
|
||||||
background-color: #eee;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 70px;
|
|
||||||
font-size: 17px;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
.cover_info {
|
|
||||||
flex: 1;
|
|
||||||
padding-left: 10px;
|
|
||||||
font-size: 12px;
|
|
||||||
height: 70px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -6,15 +6,10 @@ import {
|
|||||||
usePageTabs,
|
usePageTabs,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import {
|
|
||||||
CustomerMomentsChannelEnum,
|
|
||||||
CustomerMomentsContentTypeEnum,
|
|
||||||
CustomerMomentsPushTypeEnum,
|
|
||||||
CustomerMomentsTaskEndTypeEnum,
|
|
||||||
} from '@/gen/Enums';
|
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Card, Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import Create from './modals/Create';
|
import Create from './modals/Create';
|
||||||
|
import Update from './modals/Update';
|
||||||
|
|
||||||
export default function Index({ title = '推送任务' }) {
|
export default function Index({ title = '推送任务' }) {
|
||||||
// 注册当前页面为标签页
|
// 注册当前页面为标签页
|
||||||
@ -49,83 +44,21 @@ export default function Index({ title = '推送任务' }) {
|
|||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
{
|
{
|
||||||
title: '名称',
|
title: '名称',
|
||||||
dataIndex: 'title',
|
dataIndex: 'name',
|
||||||
render: (_, i: any) => {
|
|
||||||
return (
|
|
||||||
<Card size="small">
|
|
||||||
<Space align="start">
|
|
||||||
<img src={i?.cover_image[0]?.url} width={45} height={45} />
|
|
||||||
<div>{i?.title}</div>
|
|
||||||
</Space>
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
MyColumns.EnumTag({
|
|
||||||
title: '发送渠道',
|
|
||||||
dataIndex: 'channel',
|
|
||||||
valueEnum: CustomerMomentsChannelEnum,
|
|
||||||
}),
|
|
||||||
MyColumns.EnumTag({
|
|
||||||
title: '内容类型',
|
|
||||||
dataIndex: 'content_type',
|
|
||||||
valueEnum: CustomerMomentsContentTypeEnum,
|
|
||||||
}),
|
|
||||||
MyColumns.EnumTag({
|
|
||||||
title: '推送类型',
|
|
||||||
dataIndex: 'push_type',
|
|
||||||
valueEnum: CustomerMomentsPushTypeEnum,
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
title: '定时发送时间',
|
|
||||||
dataIndex: 'scheduled_time',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
|
|
||||||
MyColumns.EnumTag({
|
|
||||||
title: '任务结束类型',
|
|
||||||
dataIndex: 'task_end_type',
|
|
||||||
valueEnum: CustomerMomentsTaskEndTypeEnum,
|
|
||||||
search: false,
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
title: '任务结束天数',
|
|
||||||
dataIndex: 'task_days',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '定时结束',
|
|
||||||
dataIndex: 'task_end_time',
|
|
||||||
search: false,
|
|
||||||
},
|
},
|
||||||
MyColumns.UpdatedAt(),
|
MyColumns.UpdatedAt(),
|
||||||
MyColumns.CreatedAt(),
|
MyColumns.CreatedAt(),
|
||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
{/* <Update item={item} reload={action?.reload} title={title} /> */}
|
<Update item={item} reload={action?.reload} title={title} />
|
||||||
<MyButtons.Default
|
<MyButtons.Delete
|
||||||
isConfirm
|
|
||||||
title="发送"
|
|
||||||
type="primary"
|
|
||||||
disabled={
|
|
||||||
item?.push_type === 'ScheduledPush' ||
|
|
||||||
item?.push_status === 'Pushed'
|
|
||||||
}
|
|
||||||
description="确定发送?"
|
|
||||||
onConfirm={() => {
|
|
||||||
Apis.Customer.CustomerMoments.Send({
|
|
||||||
id: item.id,
|
|
||||||
}).then(() => action?.reload());
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{/* <MyButtons.Delete
|
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
Apis.Customer.CustomerMoments.Delete({
|
Apis.Customer.CustomerMomentCategories.Delete({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
}).then(() => action?.reload())
|
}).then(() => action?.reload())
|
||||||
}
|
}
|
||||||
/> */}
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -18,16 +18,11 @@ import {
|
|||||||
CustomerMomentsTaskEndTypeEnum,
|
CustomerMomentsTaskEndTypeEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { Button, Form, message, Space, Steps } from 'antd';
|
import { Button, message, Space, Steps } from 'antd';
|
||||||
import { useRef, useState } from 'react';
|
import { useState } from 'react';
|
||||||
import MyinfoPreview from '../components/infoPreview';
|
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
const [current, setCurrent] = useState(0);
|
const [current, setCurrent] = useState(0);
|
||||||
const [getContentType, setContentType] = useState('');
|
|
||||||
const [formData, setFormData] = useState<any>({});
|
const [formData, setFormData] = useState<any>({});
|
||||||
const [form] = Form.useForm();
|
|
||||||
const modalRef: any = useRef(null);
|
|
||||||
const steps = [
|
const steps = [
|
||||||
{
|
{
|
||||||
title: '创建任务',
|
title: '创建任务',
|
||||||
@ -57,7 +52,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title: '推送类型',
|
title: '推送类型',
|
||||||
valueEnum: CustomerMomentsPushTypeEnum,
|
valueEnum: CustomerMomentsPushTypeEnum,
|
||||||
required: true,
|
required: true,
|
||||||
colProps: { span: 9 },
|
colProps: { span: 8 },
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
name: ['push_type'],
|
name: ['push_type'],
|
||||||
@ -86,7 +81,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title: '任务结束类型',
|
title: '任务结束类型',
|
||||||
valueEnum: CustomerMomentsTaskEndTypeEnum,
|
valueEnum: CustomerMomentsTaskEndTypeEnum,
|
||||||
required: true,
|
required: true,
|
||||||
colProps: { span: 9 },
|
colProps: { span: 8 },
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
name: ['task_end_type'],
|
name: ['task_end_type'],
|
||||||
@ -98,11 +93,10 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
key: 'task_days',
|
key: 'task_days',
|
||||||
title: '任务结束天数',
|
title: '任务结束天数',
|
||||||
colProps: { span: 10 },
|
colProps: { span: 10 },
|
||||||
valueType: 'digit',
|
valueType: 'number',
|
||||||
formItemProps: { ...rulesHelper.number },
|
formItemProps: { ...rulesHelper.number },
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
suffix: '天结束',
|
suffix: '天结束',
|
||||||
style: { width: '200px' },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@ -174,7 +168,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
name: ['content_type'],
|
name: ['content_type'],
|
||||||
valueType: 'dependency',
|
valueType: 'dependency',
|
||||||
columns: ({ content_type }: any) => {
|
columns: ({ content_type }: any) => {
|
||||||
setContentType(content_type);
|
|
||||||
return content_type === 'MiniProgram'
|
return content_type === 'MiniProgram'
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
@ -235,84 +228,76 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title={`创建${props.title}`}
|
title={`创建${props.title}`}
|
||||||
type="primary"
|
type="primary"
|
||||||
size={'middle'}
|
size={'middle'}
|
||||||
myRef={modalRef}
|
width="800px"
|
||||||
width="1200px"
|
|
||||||
node={
|
node={
|
||||||
<Space direction="vertical">
|
<Space direction="vertical">
|
||||||
<div style={{ width: '1160px' }}>
|
<Steps current={current} items={steps} />
|
||||||
<Steps
|
<BetaSchemaForm<ApiTypes.Customer.CustomerMomentCategories.Store>
|
||||||
style={{ padding: '50px 150px 30px 150px' }}
|
{...MyModalFormProps.props}
|
||||||
current={current}
|
title={`添加${props.title}`}
|
||||||
items={steps}
|
wrapperCol={{ span: 24 }}
|
||||||
/>
|
width="800px"
|
||||||
</div>
|
layoutType="Form"
|
||||||
<Space align="start">
|
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||||
<div style={{ width: '700px' }}>
|
onFinish={async (values) => {
|
||||||
<BetaSchemaForm<ApiTypes.Customer.CustomerMomentCategories.Store>
|
setFormData(values);
|
||||||
{...MyModalFormProps.props}
|
console.log('提交的数据2:', values);
|
||||||
title={`添加${props.title}`}
|
if (current < steps.length - 1) {
|
||||||
wrapperCol={{ span: 24 }}
|
handleNext();
|
||||||
width="800px"
|
} else {
|
||||||
form={form}
|
let data = { ...formData, ...values };
|
||||||
layoutType="Form"
|
Apis.Customer.CustomerMoments.Store({
|
||||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
...data,
|
||||||
onFinish={async (values) => {
|
one_moment_categories_id: formData?.moment_categories_ids[0],
|
||||||
setFormData(values);
|
two_moment_categories_id: formData?.moment_categories_ids[1],
|
||||||
if (current < steps.length - 1) {
|
})
|
||||||
handleNext();
|
.then(() => {
|
||||||
} else {
|
props.reload?.();
|
||||||
let data = { ...formData, ...values };
|
message.success(props.title + '成功');
|
||||||
Apis.Customer.CustomerMoments.Store({
|
return true;
|
||||||
...data,
|
})
|
||||||
one_moment_categories_id:
|
.catch(() => false);
|
||||||
formData?.moment_categories_ids[0],
|
}
|
||||||
two_moment_categories_id:
|
}}
|
||||||
formData?.moment_categories_ids[1],
|
// onFinish={async (values) =>
|
||||||
})
|
// Apis.Customer.CustomerMomentCategories.Store(values)
|
||||||
.then(() => {
|
// .then(() => {
|
||||||
props.reload?.();
|
// props.reload?.();
|
||||||
message.success('提交成功!');
|
// message.success(props.title + '成功');
|
||||||
form.setFieldsValue({});
|
// return true;
|
||||||
modalRef.current?.close();
|
// })
|
||||||
setCurrent(0);
|
// .catch(() => false)
|
||||||
return true;
|
// }
|
||||||
})
|
columns={steps[current].columns}
|
||||||
.catch(() => false);
|
submitter={{
|
||||||
}
|
render: (props, dom) => {
|
||||||
}}
|
return (
|
||||||
columns={steps[current].columns}
|
<Space
|
||||||
submitter={{
|
style={{ display: 'flex', justifyContent: 'flex-end' }}
|
||||||
render: (props) => {
|
>
|
||||||
return (
|
{current > 0 && (
|
||||||
<Space
|
<Button onClick={handlePrev}>上一步</Button>
|
||||||
style={{ display: 'flex', justifyContent: 'flex-end' }}
|
)}
|
||||||
|
{current < steps.length - 1 ? (
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => props.form?.submit?.()}
|
||||||
>
|
>
|
||||||
{current > 0 && (
|
下一步
|
||||||
<Button onClick={handlePrev}>上一步</Button>
|
</Button>
|
||||||
)}
|
) : (
|
||||||
{current < steps.length - 1 ? (
|
<Button
|
||||||
<Button
|
type="primary"
|
||||||
type="primary"
|
onClick={() => props.form?.submit?.()}
|
||||||
onClick={() => props.form?.submit?.()}
|
>
|
||||||
>
|
提交
|
||||||
下一步
|
</Button>
|
||||||
</Button>
|
)}
|
||||||
) : (
|
</Space>
|
||||||
<Button
|
);
|
||||||
type="primary"
|
},
|
||||||
onClick={() => props.form?.submit?.()}
|
}}
|
||||||
>
|
/>
|
||||||
提交
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</Space>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{current ? <MyinfoPreview item={{ type: getContentType }} /> : ''}
|
|
||||||
</Space>
|
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user