diff --git a/.umirc.ts b/.umirc.ts index 28f6911..6fb83c0 100644 --- a/.umirc.ts +++ b/.umirc.ts @@ -15,8 +15,8 @@ export default defineConfig({ proxy: { '/api/': { // target: 'http://yt:8003', - target: 'http://10.39.13.78:8001/', - // target: 'https://test-admin.linyikj.com.cn/', + // target: 'http://10.39.13.78:8001/', + target: 'https://test-admin.linyikj.com.cn/', // target: 'https://admin.linyikj.com.cn/', // target: 'http://cd69cef8.natappfree.cc/', diff --git a/src/common/utils/rulesHelper.ts b/src/common/utils/rulesHelper.ts index c407cf4..37fa840 100644 --- a/src/common/utils/rulesHelper.ts +++ b/src/common/utils/rulesHelper.ts @@ -151,4 +151,15 @@ export const rulesHelper = { 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; + } + }, }; diff --git a/src/gen/Enums.ts b/src/gen/Enums.ts index 1a7d72a..a1ec500 100644 --- a/src/gen/Enums.ts +++ b/src/gen/Enums.ts @@ -1,624 +1,803 @@ // ActivitiesPublishStatusEnum -export const ActivitiesPublishStatusEnum= { - 'Unpublished': {"text":"未发布","color":"#9e9e9e","value":"Unpublished"}, - 'Published': {"text":"已发布","color":"#00c853","value":"Published"}, - 'Unlisted': {"text":"已下架","color":"#d32f2f","value":"Unlisted"}, +export const ActivitiesPublishStatusEnum = { + Unpublished: { text: '未发布', color: '#9e9e9e', value: 'Unpublished' }, + Published: { text: '已发布', color: '#00c853', value: 'Published' }, + Unlisted: { text: '已下架', color: '#d32f2f', value: 'Unlisted' }, }; // ActivitiesPublishTypeEnum -export const ActivitiesPublishTypeEnum= { - 'Manual': {"text":"手动","color":"#4caf50","value":"Manual"}, - 'Schedule': {"text":"定时","color":"#2196f3","value":"Schedule"}, +export const ActivitiesPublishTypeEnum = { + Manual: { text: '手动', color: '#4caf50', value: 'Manual' }, + Schedule: { text: '定时', color: '#2196f3', value: 'Schedule' }, }; // ActivitiesStatusEnum -export const ActivitiesStatusEnum= { - 'NotStarted': {"text":"未开始","color":"#9e9e9e","value":"NotStarted"}, - 'InProgress': {"text":"进行中","color":"#00c853","value":"InProgress"}, - 'Finished': {"text":"已结束","color":"#d32f2f","value":"Finished"}, +export const ActivitiesStatusEnum = { + NotStarted: { text: '未开始', color: '#9e9e9e', value: 'NotStarted' }, + InProgress: { text: '进行中', color: '#00c853', value: 'InProgress' }, + Finished: { text: '已结束', color: '#d32f2f', value: 'Finished' }, }; // ActivityEnrollsStatusEnum -export const ActivityEnrollsStatusEnum= { - 'PendingReview': {"text":"待审核","color":"#2196f3","value":"PendingReview"}, - 'Success': {"text":"成功","color":"#00c853","value":"Success"}, - 'Failed': {"text":"失败","color":"#d32f2f","value":"Failed"}, - 'Cancelled': {"text":"取消","color":"#ff9800","value":"Cancelled"}, +export const ActivityEnrollsStatusEnum = { + PendingReview: { text: '待审核', color: '#2196f3', value: 'PendingReview' }, + Success: { text: '成功', color: '#00c853', value: 'Success' }, + Failed: { text: '失败', color: '#d32f2f', value: 'Failed' }, + Cancelled: { text: '取消', color: '#ff9800', value: 'Cancelled' }, }; // AssetHousesOrientationEnum -export const AssetHousesOrientationEnum= { - 'East': {"text":"东","color":"#007bff","value":"East"}, - 'South': {"text":"南","color":"#28a745","value":"South"}, - 'West': {"text":"西","color":"#ffc107","value":"West"}, - 'North': {"text":"北","color":"#dc3545","value":"North"}, - 'Southeast': {"text":"东南","color":"#20c997","value":"Southeast"}, - 'Northeast': {"text":"东北","color":"#6f42c1","value":"Northeast"}, - 'Southwest': {"text":"西南","color":"#fd7e14","value":"Southwest"}, - 'Northwest': {"text":"西北","color":"#17a2b8","value":"Northwest"}, - 'EastWest': {"text":"东西","color":"#6610f2","value":"EastWest"}, - 'SouthNorth': {"text":"南北","color":"#e83e8c","value":"SouthNorth"}, +export const AssetHousesOrientationEnum = { + East: { text: '东', color: '#007bff', value: 'East' }, + South: { text: '南', color: '#28a745', value: 'South' }, + West: { text: '西', color: '#ffc107', value: 'West' }, + North: { text: '北', color: '#dc3545', value: 'North' }, + Southeast: { text: '东南', color: '#20c997', value: 'Southeast' }, + Northeast: { text: '东北', color: '#6f42c1', value: 'Northeast' }, + Southwest: { text: '西南', color: '#fd7e14', value: 'Southwest' }, + Northwest: { text: '西北', color: '#17a2b8', value: 'Northwest' }, + EastWest: { text: '东西', color: '#6610f2', value: 'EastWest' }, + SouthNorth: { text: '南北', color: '#e83e8c', value: 'SouthNorth' }, }; // AssetHousesOwnershipTypeEnum -export const AssetHousesOwnershipTypeEnum= { - 'CommodityHousing': {"text":"商品房","color":"#007bff","value":"CommodityHousing"}, - 'FundedHousing': {"text":"集资房","color":"#28a745","value":"FundedHousing"}, - 'MilitaryHousing': {"text":"军产房","color":"#17a2b8","value":"MilitaryHousing"}, - 'AffordableHousing': {"text":"保障房","color":"#ffc107","value":"AffordableHousing"}, - 'RuralHousing': {"text":"农民房","color":"#6f42c1","value":"RuralHousing"}, - 'CommercialOffice': {"text":"商业写字楼","color":"#fd7e14","value":"CommercialOffice"}, - 'CommercialComplex': {"text":"商业综合体","color":"#dc3545","value":"CommercialComplex"}, - 'ResettlementHousing': {"text":"回迁房","color":"#20c997","value":"ResettlementHousing"}, +export const AssetHousesOwnershipTypeEnum = { + CommodityHousing: { + text: '商品房', + color: '#007bff', + value: 'CommodityHousing', + }, + FundedHousing: { text: '集资房', color: '#28a745', value: 'FundedHousing' }, + MilitaryHousing: { + text: '军产房', + color: '#17a2b8', + value: 'MilitaryHousing', + }, + AffordableHousing: { + text: '保障房', + color: '#ffc107', + value: 'AffordableHousing', + }, + RuralHousing: { text: '农民房', color: '#6f42c1', value: 'RuralHousing' }, + CommercialOffice: { + text: '商业写字楼', + color: '#fd7e14', + value: 'CommercialOffice', + }, + CommercialComplex: { + text: '商业综合体', + color: '#dc3545', + value: 'CommercialComplex', + }, + ResettlementHousing: { + text: '回迁房', + color: '#20c997', + value: 'ResettlementHousing', + }, }; // AssetHousesPropertyOwnershipEnum -export const AssetHousesPropertyOwnershipEnum= { - 'Individual': {"text":"个人","color":"#2db7f5","value":"Individual"}, - 'Enterprise': {"text":"企业","color":"#87d068","value":"Enterprise"}, - 'Developer': {"text":"开发商","color":"#fa8c16","value":"Developer"}, - 'Government': {"text":"政府","color":"#f5222d","value":"Government"}, +export const AssetHousesPropertyOwnershipEnum = { + Individual: { text: '个人', color: '#2db7f5', value: 'Individual' }, + Enterprise: { text: '企业', color: '#87d068', value: 'Enterprise' }, + Developer: { text: '开发商', color: '#fa8c16', value: 'Developer' }, + Government: { text: '政府', color: '#f5222d', value: 'Government' }, }; // AssetHousesStatusEnum -export const AssetHousesStatusEnum= { - 'Unsold': {"text":"未售","color":"#6c757d","value":"Unsold"}, - 'SoldNotDelivered': {"text":"已售未交房","color":"#ffc107","value":"SoldNotDelivered"}, - 'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"}, - 'Rented': {"text":"出租","color":"#007bff","value":"Rented"}, - 'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"}, +export const AssetHousesStatusEnum = { + Unsold: { text: '未售', color: '#6c757d', value: 'Unsold' }, + SoldNotDelivered: { + text: '已售未交房', + color: '#ffc107', + value: 'SoldNotDelivered', + }, + SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' }, + Rented: { text: '出租', color: '#007bff', value: 'Rented' }, + Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' }, }; // AssetHousesUsageEnum -export const AssetHousesUsageEnum= { - 'Residence': {"text":"住宅","color":"#007bff","value":"Residence"}, - 'Apartment': {"text":"公寓","color":"#28a745","value":"Apartment"}, - 'Villa': {"text":"别墅","color":"#17a2b8","value":"Villa"}, - 'Shop': {"text":"商铺","color":"#ffc107","value":"Shop"}, - 'ParkingSpace': {"text":"车位","color":"#6c757d","value":"ParkingSpace"}, - 'Office': {"text":"写字楼","color":"#6610f2","value":"Office"}, - 'Clubhouse': {"text":"会所","color":"#fd7e14","value":"Clubhouse"}, - 'PropertyRoom': {"text":"物业用房","color":"#dc3545","value":"PropertyRoom"}, +export const AssetHousesUsageEnum = { + Residence: { text: '住宅', color: '#007bff', value: 'Residence' }, + Apartment: { text: '公寓', color: '#28a745', value: 'Apartment' }, + Villa: { text: '别墅', color: '#17a2b8', value: 'Villa' }, + Shop: { text: '商铺', color: '#ffc107', value: 'Shop' }, + ParkingSpace: { text: '车位', color: '#6c757d', value: 'ParkingSpace' }, + Office: { text: '写字楼', color: '#6610f2', value: 'Office' }, + Clubhouse: { text: '会所', color: '#fd7e14', value: 'Clubhouse' }, + PropertyRoom: { text: '物业用房', color: '#dc3545', value: 'PropertyRoom' }, }; // AssetProjectsChargeEnum -export const AssetProjectsChargeEnum= { - 'Contract': {"text":"包干制","color":"#007bff","value":"Contract"}, - 'Commission': {"text":"酬金制","color":"#28a745","value":"Commission"}, +export const AssetProjectsChargeEnum = { + Contract: { text: '包干制', color: '#007bff', value: 'Contract' }, + Commission: { text: '酬金制', color: '#28a745', value: 'Commission' }, }; // AssetProjectsEntrustTypeEnum -export const AssetProjectsEntrustTypeEnum= { - 'DeveloperJointEntrust': {"text":"开发商全委","color":"#007bff","value":"DeveloperJointEntrust"}, - 'OwnersFullEntrust': {"text":"业委会全委","color":"#28a745","value":"OwnersFullEntrust"}, - 'GovernmentFullEntrust': {"text":"政府类全委","color":"#ffc107","value":"GovernmentFullEntrust"}, +export const AssetProjectsEntrustTypeEnum = { + DeveloperJointEntrust: { + text: '开发商全委', + color: '#007bff', + value: 'DeveloperJointEntrust', + }, + OwnersFullEntrust: { + text: '业委会全委', + color: '#28a745', + value: 'OwnersFullEntrust', + }, + GovernmentFullEntrust: { + text: '政府类全委', + color: '#ffc107', + value: 'GovernmentFullEntrust', + }, }; // AssetProjectsPropertyTypeEnum -export const AssetProjectsPropertyTypeEnum= { - 'Residence': {"text":"住宅","color":"#ff0000","value":"Residence"}, - 'Commercial': {"text":"商业","color":"#ff6600","value":"Commercial"}, - 'Office': {"text":"办公","color":"#ffcc00","value":"Office"}, - 'IndustrialPark': {"text":"产业园","color":"#00cc66","value":"IndustrialPark"}, - 'Complex': {"text":"综合体","color":"#0099ff","value":"Complex"}, - 'Municipal': {"text":"市政设施","color":"#6633cc","value":"Municipal"}, - 'Venue': {"text":"场馆","color":"#9966ff","value":"Venue"}, - 'Education': {"text":"教育","color":"#339999","value":"Education"}, - 'Medical': {"text":"医疗","color":"#cc3366","value":"Medical"}, +export const AssetProjectsPropertyTypeEnum = { + Residence: { text: '住宅', color: '#ff0000', value: 'Residence' }, + Commercial: { text: '商业', color: '#ff6600', value: 'Commercial' }, + Office: { text: '办公', color: '#ffcc00', value: 'Office' }, + IndustrialPark: { text: '产业园', color: '#00cc66', value: 'IndustrialPark' }, + Complex: { text: '综合体', color: '#0099ff', value: 'Complex' }, + Municipal: { text: '市政设施', color: '#6633cc', value: 'Municipal' }, + Venue: { text: '场馆', color: '#9966ff', value: 'Venue' }, + Education: { text: '教育', color: '#339999', value: 'Education' }, + Medical: { text: '医疗', color: '#cc3366', value: 'Medical' }, }; // AssetProjectsStatusEnum -export const AssetProjectsStatusEnum= { - 'SignedNotDelivered': {"text":"签约未交付","color":"#6c757d","value":"SignedNotDelivered"}, - 'RollingDevelopment': {"text":"滚动开发","color":"#007bff","value":"RollingDevelopment"}, - 'ManagedAndClosed': {"text":"在管封园","color":"#ffc107","value":"ManagedAndClosed"}, - 'Exited': {"text":"退出","color":"#dc3545","value":"Exited"}, +export const AssetProjectsStatusEnum = { + SignedNotDelivered: { + text: '签约未交付', + color: '#6c757d', + value: 'SignedNotDelivered', + }, + RollingDevelopment: { + text: '滚动开发', + color: '#007bff', + value: 'RollingDevelopment', + }, + ManagedAndClosed: { + text: '在管封园', + color: '#ffc107', + value: 'ManagedAndClosed', + }, + Exited: { text: '退出', color: '#dc3545', value: 'Exited' }, }; // AssetUnitsBuildingStructureEnum -export const AssetUnitsBuildingStructureEnum= { - 'SteelConcrete': {"text":"钢混","color":"#007bff","value":"SteelConcrete"}, - 'SteelStructure': {"text":"钢结构","color":"#28a745","value":"SteelStructure"}, - 'BrickConcrete': {"text":"砖混","color":"#ffc107","value":"BrickConcrete"}, - 'BrickWood': {"text":"砖木","color":"#dc3545","value":"BrickWood"}, +export const AssetUnitsBuildingStructureEnum = { + SteelConcrete: { text: '钢混', color: '#007bff', value: 'SteelConcrete' }, + SteelStructure: { text: '钢结构', color: '#28a745', value: 'SteelStructure' }, + BrickConcrete: { text: '砖混', color: '#ffc107', value: 'BrickConcrete' }, + BrickWood: { text: '砖木', color: '#dc3545', value: 'BrickWood' }, }; // AssetUnitsBuildingTypeEnum -export const AssetUnitsBuildingTypeEnum= { - 'SlabAndTower': {"text":"板塔结合","color":"#007bff","value":"SlabAndTower"}, - 'Slab': {"text":"板楼","color":"#28a745","value":"Slab"}, - 'Tower': {"text":"塔楼","color":"#ffc107","value":"Tower"}, +export const AssetUnitsBuildingTypeEnum = { + SlabAndTower: { text: '板塔结合', color: '#007bff', value: 'SlabAndTower' }, + Slab: { text: '板楼', color: '#28a745', value: 'Slab' }, + Tower: { text: '塔楼', color: '#ffc107', value: 'Tower' }, }; // BannerSpacesTypeEnum -export const BannerSpacesTypeEnum= { - 'Popup': {"text":"弹窗","color":"#ff0000","value":"Popup"}, - 'Banner': {"text":"横幅广告","color":"#00ff00","value":"Banner"}, - 'FloatingButton': {"text":"悬浮按钮","color":"#0000ff","value":"FloatingButton"}, +export const BannerSpacesTypeEnum = { + Popup: { text: '弹窗', color: '#ff0000', value: 'Popup' }, + Banner: { text: '横幅广告', color: '#00ff00', value: 'Banner' }, + FloatingButton: { + text: '悬浮按钮', + color: '#0000ff', + value: 'FloatingButton', + }, }; // BannersRedirectTypeEnum -export const BannersRedirectTypeEnum= { - 'InnerPage': {"text":"跳内页","color":"#ff0000","value":"InnerPage"}, - 'H5': {"text":"跳H5","color":"#00ff00","value":"H5"}, - 'MiniProgramHome': {"text":"跳小程序首屏","color":"#0000ff","value":"MiniProgramHome"}, - 'AnotherMiniProgram': {"text":"跳另一个小程序","color":"#ffa500","value":"AnotherMiniProgram"}, +export const BannersRedirectTypeEnum = { + InnerPage: { text: '跳内页', color: '#ff0000', value: 'InnerPage' }, + H5: { text: '跳H5', color: '#00ff00', value: 'H5' }, + MiniProgramHome: { + text: '跳小程序首屏', + color: '#0000ff', + value: 'MiniProgramHome', + }, + AnotherMiniProgram: { + text: '跳另一个小程序', + color: '#ffa500', + value: 'AnotherMiniProgram', + }, }; // BannersTypeEnum -export const BannersTypeEnum= { - 'Image': {"text":"图片","color":"#ff0000","value":"Image"}, - 'Video': {"text":"视频","color":"#00ff00","value":"Video"}, - 'Text': {"text":"文本","color":"#0000ff","value":"Text"}, +export const BannersTypeEnum = { + Image: { text: '图片', color: '#ff0000', value: 'Image' }, + Video: { text: '视频', color: '#00ff00', value: 'Video' }, + Text: { text: '文本', color: '#0000ff', value: 'Text' }, }; // 缓存类型 -export const CacheTypeEnum= { - 'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#e3da02","value":"MobilePhoneVerificationCode"}, +export const CacheTypeEnum = { + MobilePhoneVerificationCode: { + text: '手机验证码', + color: '#e3da02', + value: 'MobilePhoneVerificationCode', + }, }; // CompaniesMerchantTypeEnum -export const CompaniesMerchantTypeEnum= { - 'PropertyManagement': {"text":"物业公司","color":"#007bff","value":"PropertyManagement"}, - 'ServiceProvider': {"text":"服务商","color":"#28a745","value":"ServiceProvider"}, +export const CompaniesMerchantTypeEnum = { + PropertyManagement: { + text: '物业公司', + color: '#007bff', + value: 'PropertyManagement', + }, + ServiceProvider: { + text: '服务商', + color: '#28a745', + value: 'ServiceProvider', + }, }; // CompanyAppsAppTypeEnum -export const CompanyAppsAppTypeEnum= { - 'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"}, - 'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"}, - 'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"}, +export const CompanyAppsAppTypeEnum = { + MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' }, + MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' }, + WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' }, }; // CompanyAppsModuleEnum -export const CompanyAppsModuleEnum= { - 'Employee': {"text":"员工端","color":"#3b82f6","value":"Employee"}, - 'Customer': {"text":"客户端","color":"#10b981","value":"Customer"}, +export const CompanyAppsModuleEnum = { + Employee: { text: '员工端', color: '#3b82f6', value: 'Employee' }, + Customer: { text: '客户端', color: '#10b981', value: 'Customer' }, }; // CompanyAppsWorkTypeEnum -export const CompanyAppsWorkTypeEnum= { - 'WorkWechatApp': {"text":"企微应用","color":"#00c853","value":"WorkWechatApp"}, - 'WorkWechat': {"text":"企微","color":"#0091ea","value":"WorkWechat"}, +export const CompanyAppsWorkTypeEnum = { + WorkWechatApp: { text: '企微应用', color: '#00c853', value: 'WorkWechatApp' }, + WorkWechat: { text: '企微', color: '#0091ea', value: 'WorkWechat' }, }; // CompanyEmployeeBacklogsStatusEnum -export const CompanyEmployeeBacklogsStatusEnum= { - 'Pending': {"text":"待办","color":"#FF6600","value":"Pending"}, - 'Completed': {"text":"已办","color":"#2A82E4","value":"Completed"}, +export const CompanyEmployeeBacklogsStatusEnum = { + Pending: { text: '待办', color: '#FF6600', value: 'Pending' }, + Completed: { text: '已办', color: '#2A82E4', value: 'Completed' }, }; // CompanyEmployeeBacklogsTypeEnum -export const CompanyEmployeeBacklogsTypeEnum= { - 'WorkOrder': {"text":"工单","color":"#FF6600","value":"WorkOrder"}, - 'Contract': {"text":"合同","color":"#2A82E4","value":"Contract"}, +export const CompanyEmployeeBacklogsTypeEnum = { + WorkOrder: { text: '工单', color: '#FF6600', value: 'WorkOrder' }, + Contract: { text: '合同', color: '#2A82E4', value: 'Contract' }, }; // CompanyReceiptAccountsPayChannelEnum -export const CompanyReceiptAccountsPayChannelEnum= { - 'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"}, - 'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, - 'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"}, - 'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"}, +export const CompanyReceiptAccountsPayChannelEnum = { + WeChat: { text: '微信', color: '#07c160', value: 'WeChat' }, + Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' }, + BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' }, + TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' }, }; // ConvenienceServicesTypeEnum -export const ConvenienceServicesTypeEnum= { - 'EmergencyRepair': {"text":"紧急抢修","color":"#ef4444","value":"EmergencyRepair"}, - 'LifeService': {"text":"生活服务","color":"#3b82f6","value":"LifeService"}, - 'GovernmentConsulting': {"text":"政务咨询","color":"#10b981","value":"GovernmentConsulting"}, - 'PropertyExclusive': {"text":"物业专属","color":"#8b5cf6","value":"PropertyExclusive"}, +export const ConvenienceServicesTypeEnum = { + EmergencyRepair: { + text: '紧急抢修', + color: '#ef4444', + value: 'EmergencyRepair', + }, + LifeService: { text: '生活服务', color: '#3b82f6', value: 'LifeService' }, + GovernmentConsulting: { + text: '政务咨询', + color: '#10b981', + value: 'GovernmentConsulting', + }, + PropertyExclusive: { + text: '物业专属', + color: '#8b5cf6', + value: 'PropertyExclusive', + }, }; // CustomerBacklogsStatusEnum -export const CustomerBacklogsStatusEnum= { - 'Pending': {"text":"待办","color":"#faad14","value":"Pending"}, - 'Completed': {"text":"已办","color":"#2A82E4","value":"Completed"}, +export const CustomerBacklogsStatusEnum = { + Pending: { text: '待办', color: '#faad14', value: 'Pending' }, + Completed: { text: '已办', color: '#2A82E4', value: 'Completed' }, }; // CustomerBacklogsTypeEnum -export const CustomerBacklogsTypeEnum= { - 'RegisterApply': {"text":"登记申请","color":"#2db7f5","value":"RegisterApply"}, - 'PaymentPending': {"text":"费用待缴","color":"#faad14","value":"PaymentPending"}, - 'ContractTodo': {"text":"合同待办","color":"#722ed1","value":"ContractTodo"}, +export const CustomerBacklogsTypeEnum = { + RegisterApply: { text: '登记申请', color: '#2db7f5', value: 'RegisterApply' }, + PaymentPending: { + text: '费用待缴', + color: '#faad14', + value: 'PaymentPending', + }, + ContractTodo: { text: '合同待办', color: '#722ed1', value: 'ContractTodo' }, }; // CustomerMomentTasksStatusEnum -export const CustomerMomentTasksStatusEnum= { - 'NotSent': {"text":"未发","color":"#FF4500","value":"NotSent"}, - 'Sent': {"text":"已发","color":"#32CD32","value":"Sent"}, +export const CustomerMomentTasksStatusEnum = { + NotSent: { text: '未发', color: '#FF4500', value: 'NotSent' }, + Sent: { text: '已发', color: '#32CD32', value: 'Sent' }, }; // CustomerMomentsChannelEnum -export const CustomerMomentsChannelEnum= { - 'MomentCorp': {"text":"朋友圈(企业)","color":"#1E90FF","value":"MomentCorp"}, - 'CustomerDirectCorp': {"text":"客户1对1消息群发(企业)","color":"#FFA500","value":"CustomerDirectCorp"}, - 'CustomerGroupCorp': {"text":"客户群群发(企业)","color":"#FF69B4","value":"CustomerGroupCorp"}, +export const CustomerMomentsChannelEnum = { + MomentCorp: { text: '朋友圈(企业)', color: '#1E90FF', value: 'MomentCorp' }, + CustomerDirectCorp: { + text: '客户1对1消息群发(企业)', + color: '#FFA500', + value: 'CustomerDirectCorp', + }, + CustomerGroupCorp: { + text: '客户群群发(企业)', + color: '#FF69B4', + value: 'CustomerGroupCorp', + }, }; // CustomerMomentsContentTypeEnum -export const CustomerMomentsContentTypeEnum= { - 'Image': {"text":"图片消息","color":"#1E90FF","value":"Image"}, - 'Link': {"text":"转载链接消息","color":"#32CD32","value":"Link"}, - 'MiniProgram': {"text":"跳小程序","color":"#FFA500","value":"MiniProgram"}, - 'Video': {"text":"视频消息","color":"#FF69B4","value":"Video"}, +export const CustomerMomentsContentTypeEnum = { + Image: { text: '图片消息', color: '#1E90FF', value: 'Image' }, + Link: { text: '转载链接消息', color: '#32CD32', value: 'Link' }, + MiniProgram: { text: '跳小程序', color: '#FFA500', value: 'MiniProgram' }, + Video: { text: '视频消息', color: '#FF69B4', value: 'Video' }, }; // CustomerMomentsPushStatusEnum -export const CustomerMomentsPushStatusEnum= { - 'NotPushed': {"text":"未推送","color":"#FF4500","value":"NotPushed"}, - 'Pushed': {"text":"已推送","color":"#32CD32","value":"Pushed"}, +export const CustomerMomentsPushStatusEnum = { + NotPushed: { text: '未推送', color: '#FF4500', value: 'NotPushed' }, + Pushed: { text: '已推送', color: '#32CD32', value: 'Pushed' }, }; // CustomerMomentsPushTypeEnum -export const CustomerMomentsPushTypeEnum= { - 'ManualPush': {"text":"手动推送","color":"#1E90FF","value":"ManualPush"}, - 'ScheduledPush': {"text":"定时推送","color":"#32CD32","value":"ScheduledPush"}, +export const CustomerMomentsPushTypeEnum = { + ManualPush: { text: '手动推送', color: '#1E90FF', value: 'ManualPush' }, + ScheduledPush: { text: '定时推送', color: '#32CD32', value: 'ScheduledPush' }, }; // CustomerMomentsRangeTypeEnum -export const CustomerMomentsRangeTypeEnum= { - 'Project': {"text":"按项目推送","color":"#1E90FF","value":"Project"}, +export const CustomerMomentsRangeTypeEnum = { + Project: { text: '按项目推送', color: '#1E90FF', value: 'Project' }, }; // CustomerMomentsSkipTypeEnum -export const CustomerMomentsSkipTypeEnum= { - 'H5': {"text":"H5","color":"#1E90FF","value":"H5"}, +export const CustomerMomentsSkipTypeEnum = { + H5: { text: 'H5', color: '#1E90FF', value: 'H5' }, }; // CustomerMomentsTaskEndTypeEnum -export const CustomerMomentsTaskEndTypeEnum= { - 'AfterNDays': {"text":"发送后N天","color":"#1E90FF","value":"AfterNDays"}, - 'ScheduledEnd': {"text":"定时结束","color":"#32CD32","value":"ScheduledEnd"}, +export const CustomerMomentsTaskEndTypeEnum = { + AfterNDays: { text: '发送后N天', color: '#1E90FF', value: 'AfterNDays' }, + ScheduledEnd: { text: '定时结束', color: '#32CD32', value: 'ScheduledEnd' }, }; // CustomerOpinionsTypeEnum -export const CustomerOpinionsTypeEnum= { - 'FeatureException': {"text":"功能异常","color":"#ff0000","value":"FeatureException"}, - 'FeatureSuggestion': {"text":"新功能建议","color":"#00bfff","value":"FeatureSuggestion"}, +export const CustomerOpinionsTypeEnum = { + FeatureException: { + text: '功能异常', + color: '#ff0000', + value: 'FeatureException', + }, + FeatureSuggestion: { + text: '新功能建议', + color: '#00bfff', + value: 'FeatureSuggestion', + }, }; // 账单状态枚举 -export const HouseBillsBillStatusEnum= { - 'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"}, - 'PartiallyPaid': {"text":"部分支付","color":"#60a5fa","value":"PartiallyPaid"}, - 'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, - 'Overdue': {"text":"已逾期","color":"#ef4444","value":"Overdue"}, - 'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, +export const HouseBillsBillStatusEnum = { + PendingPayment: { text: '待支付', color: '#facc15', value: 'PendingPayment' }, + PartiallyPaid: { text: '部分支付', color: '#60a5fa', value: 'PartiallyPaid' }, + Paid: { text: '已支付', color: '#10b981', value: 'Paid' }, + Overdue: { text: '已逾期', color: '#ef4444', value: 'Overdue' }, + Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' }, }; // 房屋账单类型枚举 -export const HouseBillsTypeEnum= { - 'PropertyFee': {"text":"物业费","color":"#3b82f6","value":"PropertyFee"}, - 'MaintenanceFund': {"text":"维修基金","color":"#10b981","value":"MaintenanceFund"}, - 'WaterFee': {"text":"水费","color":"#06b6d4","value":"WaterFee"}, - 'ElectricityFee': {"text":"电费","color":"#f59e0b","value":"ElectricityFee"}, - 'SharedWaterFee': {"text":"公摊水费","color":"#8b5cf6","value":"SharedWaterFee"}, - 'SharedElectricityFee': {"text":"公摊电费","color":"#ec4899","value":"SharedElectricityFee"}, +export const HouseBillsTypeEnum = { + PropertyFee: { text: '物业费', color: '#3b82f6', value: 'PropertyFee' }, + MaintenanceFund: { + text: '维修基金', + color: '#10b981', + value: 'MaintenanceFund', + }, + WaterFee: { text: '水费', color: '#06b6d4', value: 'WaterFee' }, + ElectricityFee: { text: '电费', color: '#f59e0b', value: 'ElectricityFee' }, + SharedWaterFee: { + text: '公摊水费', + color: '#8b5cf6', + value: 'SharedWaterFee', + }, + SharedElectricityFee: { + text: '公摊电费', + color: '#ec4899', + value: 'SharedElectricityFee', + }, }; // HouseChargeStandardsApportionmentMethodEnum -export const HouseChargeStandardsApportionmentMethodEnum= { - 'HouseCount': {"text":"房屋数分摊","color":"#3b82f6","value":"HouseCount"}, - 'AreaProportion': {"text":"房屋计费面积分摊","color":"#10b981","value":"AreaProportion"}, - 'FixedRatio': {"text":"按固定比例分摊","color":"#f59e0b","value":"FixedRatio"}, +export const HouseChargeStandardsApportionmentMethodEnum = { + HouseCount: { text: '房屋数分摊', color: '#3b82f6', value: 'HouseCount' }, + AreaProportion: { + text: '房屋计费面积分摊', + color: '#10b981', + value: 'AreaProportion', + }, + FixedRatio: { text: '按固定比例分摊', color: '#f59e0b', value: 'FixedRatio' }, }; // HouseChargeStandardsCalculationMethodEnum -export const HouseChargeStandardsCalculationMethodEnum= { - 'ChargeableArea': {"text":"计费面积","color":"#3b82f6","value":"ChargeableArea"}, - 'BuiltArea': {"text":"建筑面积","color":"#10b981","value":"BuiltArea"}, - 'InsideArea': {"text":"套内面积","color":"#f59e0b","value":"InsideArea"}, - 'PerUnit': {"text":"按套","color":"#06b6d4","value":"PerUnit"}, - 'ElectricityUsage': {"text":"用电量","color":"#8b5cf6","value":"ElectricityUsage"}, - 'WaterUsage': {"text":"用水量","color":"#ec4899","value":"WaterUsage"}, +export const HouseChargeStandardsCalculationMethodEnum = { + ChargeableArea: { + text: '计费面积', + color: '#3b82f6', + value: 'ChargeableArea', + }, + BuiltArea: { text: '建筑面积', color: '#10b981', value: 'BuiltArea' }, + InsideArea: { text: '套内面积', color: '#f59e0b', value: 'InsideArea' }, + PerUnit: { text: '按套', color: '#06b6d4', value: 'PerUnit' }, + ElectricityUsage: { + text: '用电量', + color: '#8b5cf6', + value: 'ElectricityUsage', + }, + WaterUsage: { text: '用水量', color: '#ec4899', value: 'WaterUsage' }, }; // HouseChargeStandardsCalculationModeEnum -export const HouseChargeStandardsCalculationModeEnum= { - 'FixedAmount': {"text":"固定金额","color":"#3b82f6","value":"FixedAmount"}, - 'QuantityPrice': {"text":"数量*单价","color":"#10b981","value":"QuantityPrice"}, +export const HouseChargeStandardsCalculationModeEnum = { + FixedAmount: { text: '固定金额', color: '#3b82f6', value: 'FixedAmount' }, + QuantityPrice: { + text: '数量*单价', + color: '#10b981', + value: 'QuantityPrice', + }, }; // HouseChargeStandardsCalculationPeriodEnum -export const HouseChargeStandardsCalculationPeriodEnum= { - 'PerTime': {"text":"按次","color":"#3b82f6","value":"PerTime"}, - 'PerDay': {"text":"按日","color":"#10b981","value":"PerDay"}, - 'PerMonth': {"text":"按月","color":"#f59e0b","value":"PerMonth"}, - 'PerYear': {"text":"按年","color":"#8b5cf6","value":"PerYear"}, +export const HouseChargeStandardsCalculationPeriodEnum = { + PerTime: { text: '按次', color: '#3b82f6', value: 'PerTime' }, + PerDay: { text: '按日', color: '#10b981', value: 'PerDay' }, + PerMonth: { text: '按月', color: '#f59e0b', value: 'PerMonth' }, + PerYear: { text: '按年', color: '#8b5cf6', value: 'PerYear' }, }; // HouseChargeStandardsPriceAlgorithmEnum -export const HouseChargeStandardsPriceAlgorithmEnum= { - 'Fixed': {"text":"固定","color":"#4caf50","value":"Fixed"}, - 'Tiered': {"text":"分级价阶梯","color":"#2196f3","value":"Tiered"}, - 'Peak': {"text":"最高价阶梯","color":"#ff9800","value":"Peak"}, +export const HouseChargeStandardsPriceAlgorithmEnum = { + Fixed: { text: '固定', color: '#4caf50', value: 'Fixed' }, + Tiered: { text: '分级价阶梯', color: '#2196f3', value: 'Tiered' }, + Peak: { text: '最高价阶梯', color: '#ff9800', value: 'Peak' }, }; // HouseChargeStandardsStatusEnum -export const HouseChargeStandardsStatusEnum= { - 'Active': {"text":"启用","color":"#3b82f6","value":"Active"}, - 'Inactive': {"text":"禁用","color":"#ef4444","value":"Inactive"}, +export const HouseChargeStandardsStatusEnum = { + Active: { text: '启用', color: '#3b82f6', value: 'Active' }, + Inactive: { text: '禁用', color: '#ef4444', value: 'Inactive' }, }; // HouseChargeStandardsTypeEnum -export const HouseChargeStandardsTypeEnum= { - 'House': {"text":"房屋","color":"#3b82f6","value":"House"}, - 'Meter': {"text":"仪表","color":"#10b981","value":"Meter"}, +export const HouseChargeStandardsTypeEnum = { + House: { text: '房屋', color: '#3b82f6', value: 'House' }, + Meter: { text: '仪表', color: '#10b981', value: 'Meter' }, }; // HouseChargeTaskDetailsStatusEnum -export const HouseChargeTaskDetailsStatusEnum= { - 'Pending': {"text":"待处理","color":"#f59e0b","value":"Pending"}, - 'Success': {"text":"成功","color":"#22c55e","value":"Success"}, - 'Failed': {"text":"失败","color":"#ef4444","value":"Failed"}, +export const HouseChargeTaskDetailsStatusEnum = { + Pending: { text: '待处理', color: '#f59e0b', value: 'Pending' }, + Success: { text: '成功', color: '#22c55e', value: 'Success' }, + Failed: { text: '失败', color: '#ef4444', value: 'Failed' }, }; // HouseChargeTasksStatusEnum -export const HouseChargeTasksStatusEnum= { - 'Pending': {"text":"待执行","color":"#f59e0b","value":"Pending"}, - 'InProgress': {"text":"执行中","color":"#3b82f6","value":"InProgress"}, - 'Completed': {"text":"已完成","color":"#10b981","value":"Completed"}, - 'Failed': {"text":"失败","color":"#ef4444","value":"Failed"}, +export const HouseChargeTasksStatusEnum = { + Pending: { text: '待执行', color: '#f59e0b', value: 'Pending' }, + InProgress: { text: '执行中', color: '#3b82f6', value: 'InProgress' }, + Completed: { text: '已完成', color: '#10b981', value: 'Completed' }, + Failed: { text: '失败', color: '#ef4444', value: 'Failed' }, }; // HouseChargeTasksTypeEnum -export const HouseChargeTasksTypeEnum= { - 'Scheduled': {"text":"定时创建","color":"#3b82f6","value":"Scheduled"}, - 'Manual': {"text":"手动创建","color":"#10b981","value":"Manual"}, +export const HouseChargeTasksTypeEnum = { + Scheduled: { text: '定时创建', color: '#3b82f6', value: 'Scheduled' }, + Manual: { text: '手动创建', color: '#10b981', value: 'Manual' }, }; // HouseCollectionRecordsCollectionResultEnum -export const HouseCollectionRecordsCollectionResultEnum= { - 'PromiseToPay': {"text":"承诺缴费","color":"#4caf50","value":"PromiseToPay"}, - 'RefuseToPay': {"text":"拒绝缴费","color":"#f44336","value":"RefuseToPay"}, - 'NotReached': {"text":"未联系到","color":"#9e9e9e","value":"NotReached"}, - 'NeedFollowUp': {"text":"需要跟进","color":"#ff9800","value":"NeedFollowUp"}, +export const HouseCollectionRecordsCollectionResultEnum = { + PromiseToPay: { text: '承诺缴费', color: '#4caf50', value: 'PromiseToPay' }, + RefuseToPay: { text: '拒绝缴费', color: '#f44336', value: 'RefuseToPay' }, + NotReached: { text: '未联系到', color: '#9e9e9e', value: 'NotReached' }, + NeedFollowUp: { text: '需要跟进', color: '#ff9800', value: 'NeedFollowUp' }, }; // HouseCollectionRecordsSmsStatusEnum -export const HouseCollectionRecordsStatusEnum= { - 'NotNotified': {"text":"未通知","color":"#808080","value":"NotNotified"}, - 'Notified': {"text":"已通知","color":"#00cc00","value":"Notified"}, - 'Failed': {"text":"失败","color":"#ff0000","value":"Failed"}, +export const HouseCollectionRecordsStatusEnum = { + NotNotified: { text: '未通知', color: '#808080', value: 'NotNotified' }, + Notified: { text: '已通知', color: '#00cc00', value: 'Notified' }, + Failed: { text: '失败', color: '#ff0000', value: 'Failed' }, }; // HouseCollectionTasksChannelEnum -export const HouseCollectionTasksChannelEnum= { - 'SMS': {"text":"短信","color":"#1E90FF","value":"SMS"}, - 'MiniProgram': {"text":"小程序","color":"#00BFFF","value":"MiniProgram"}, - 'OfficialAccount': {"text":"公众号","color":"#32CD32","value":"OfficialAccount"}, - 'PhoneCall': {"text":"电话催缴","color":"#FF8C00","value":"PhoneCall"}, - 'Visit': {"text":"上门催缴","color":"#8B4513","value":"Visit"}, - 'WeChat': {"text":"微信联系","color":"#20B2AA","value":"WeChat"}, - 'WrittenNotice': {"text":"书面通知","color":"#708090","value":"WrittenNotice"}, +export const HouseCollectionTasksChannelEnum = { + SMS: { text: '短信', color: '#1E90FF', value: 'SMS' }, + MiniProgram: { text: '小程序', color: '#00BFFF', value: 'MiniProgram' }, + OfficialAccount: { + text: '公众号', + color: '#32CD32', + value: 'OfficialAccount', + }, + PhoneCall: { text: '电话催缴', color: '#FF8C00', value: 'PhoneCall' }, + Visit: { text: '上门催缴', color: '#8B4513', value: 'Visit' }, + WeChat: { text: '微信联系', color: '#20B2AA', value: 'WeChat' }, + WrittenNotice: { text: '书面通知', color: '#708090', value: 'WrittenNotice' }, }; // HouseCollectionTasksStatusEnum -export const HouseCollectionTasksStatusEnum= { - 'Processing': {"text":"进行中","color":"#ffcc00","value":"Processing"}, - 'Completed': {"text":"已完成","color":"#00cc00","value":"Completed"}, - 'Failed': {"text":"失败","color":"#ff0000","value":"Failed"}, +export const HouseCollectionTasksStatusEnum = { + Processing: { text: '进行中', color: '#ffcc00', value: 'Processing' }, + Completed: { text: '已完成', color: '#00cc00', value: 'Completed' }, + Failed: { text: '失败', color: '#ff0000', value: 'Failed' }, }; // HouseMeterReadingsOperationTypeEnum -export const HouseMeterReadingsOperationTypeEnum= { - 'NormalReading': {"text":"正常抄表","color":"#4caf50","value":"NormalReading"}, - 'ResetReading': {"text":"重置读数","color":"#f44336","value":"ResetReading"}, - 'CorrectReading': {"text":"修正读数","color":"#ff9800","value":"CorrectReading"}, +export const HouseMeterReadingsOperationTypeEnum = { + NormalReading: { text: '正常抄表', color: '#4caf50', value: 'NormalReading' }, + ResetReading: { text: '重置读数', color: '#f44336', value: 'ResetReading' }, + CorrectReading: { + text: '修正读数', + color: '#ff9800', + value: 'CorrectReading', + }, }; // HouseMeterTasksGenerationMethodEnum -export const HouseMeterTasksGenerationMethodEnum= { - 'Building': {"text":"按楼栋","color":"#4caf50","value":"Building"}, - 'Unit': {"text":"按单元","color":"#2196f3","value":"Unit"}, - 'Meter': {"text":"按仪表","color":"#ff9800","value":"Meter"}, +export const HouseMeterTasksGenerationMethodEnum = { + Building: { text: '按楼栋', color: '#4caf50', value: 'Building' }, + Unit: { text: '按单元', color: '#2196f3', value: 'Unit' }, + Meter: { text: '按仪表', color: '#ff9800', value: 'Meter' }, }; // HouseMetersMeterTypeEnum -export const HouseMetersMeterTypeEnum= { - 'HouseMeter': {"text":"房屋表","color":"#4caf50","value":"HouseMeter"}, - 'CommonMeter': {"text":"公摊表","color":"#2196f3","value":"CommonMeter"}, +export const HouseMetersMeterTypeEnum = { + HouseMeter: { text: '房屋表', color: '#4caf50', value: 'HouseMeter' }, + CommonMeter: { text: '公摊表', color: '#2196f3', value: 'CommonMeter' }, }; // HouseMetersUsageTypeEnum -export const HouseMetersUsageTypeEnum= { - 'WaterMeter': {"text":"水表","color":"#2196f3","value":"WaterMeter"}, - 'ElectricMeter': {"text":"电表","color":"#ff9800","value":"ElectricMeter"}, - 'GasMeter': {"text":"燃气表","color":"#f44336","value":"GasMeter"}, - 'HeatingMeter': {"text":"暖气表","color":"#9c27b0","value":"HeatingMeter"}, +export const HouseMetersUsageTypeEnum = { + WaterMeter: { text: '水表', color: '#2196f3', value: 'WaterMeter' }, + ElectricMeter: { text: '电表', color: '#ff9800', value: 'ElectricMeter' }, + GasMeter: { text: '燃气表', color: '#f44336', value: 'GasMeter' }, + HeatingMeter: { text: '暖气表', color: '#9c27b0', value: 'HeatingMeter' }, }; // HouseOccupantsCardTypeEnum -export const HouseOccupantsCardTypeEnum= { - 'MainlandID': {"text":"中国大陆居民身份证","color":"#2db7f5","value":"MainlandID"}, - 'HKPermit': {"text":"香港来往大陆通行证(回乡证)","color":"#fa8c16","value":"HKPermit"}, - 'MOPermit': {"text":"澳门来往大陆通行证(回乡证)","color":"#faad14","value":"MOPermit"}, - 'TWPermit': {"text":"台湾来往大陆通行证(台胞证)","color":"#87d068","value":"TWPermit"}, - 'Passport': {"text":"护照","color":"#108ee9","value":"Passport"}, - 'BusinessLicense': {"text":"营业执照","color":"#f5222d","value":"BusinessLicense"}, +export const HouseOccupantsCardTypeEnum = { + MainlandID: { + text: '中国大陆居民身份证', + color: '#2db7f5', + value: 'MainlandID', + }, + HKPermit: { + text: '香港来往大陆通行证(回乡证)', + color: '#fa8c16', + value: 'HKPermit', + }, + MOPermit: { + text: '澳门来往大陆通行证(回乡证)', + color: '#faad14', + value: 'MOPermit', + }, + TWPermit: { + text: '台湾来往大陆通行证(台胞证)', + color: '#87d068', + value: 'TWPermit', + }, + Passport: { text: '护照', color: '#108ee9', value: 'Passport' }, + BusinessLicense: { + text: '营业执照', + color: '#f5222d', + value: 'BusinessLicense', + }, }; // HouseOccupantsHouseRelationEnum -export const HouseOccupantsHouseRelationEnum= { - 'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"}, - 'NonOwner': {"text":"非产权人","color":"#fa8c16","value":"NonOwner"}, +export const HouseOccupantsHouseRelationEnum = { + Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' }, + NonOwner: { text: '非产权人', color: '#fa8c16', value: 'NonOwner' }, }; // HouseOccupantsRelationWithOwnerEnum -export const HouseOccupantsRelationWithOwnerEnum= { - 'Self': {"text":"本人","color":"#52c41a","value":"Self"}, - 'Spouse': {"text":"配偶","color":"#2db7f5","value":"Spouse"}, - 'Children': {"text":"子女","color":"#87d068","value":"Children"}, - 'Parents': {"text":"父母","color":"#faad14","value":"Parents"}, - 'Siblings': {"text":"兄弟姐妹","color":"#fa8c16","value":"Siblings"}, - 'OtherRelatives': {"text":"其他亲属","color":"#f5222d","value":"OtherRelatives"}, - 'PrimaryTenant': {"text":"主租客","color":"#722ed1","value":"PrimaryTenant"}, - 'Tenant': {"text":"租客","color":"#1890ff","value":"Tenant"}, +export const HouseOccupantsRelationWithOwnerEnum = { + Self: { text: '本人', color: '#52c41a', value: 'Self' }, + Spouse: { text: '配偶', color: '#2db7f5', value: 'Spouse' }, + Children: { text: '子女', color: '#87d068', value: 'Children' }, + Parents: { text: '父母', color: '#faad14', value: 'Parents' }, + Siblings: { text: '兄弟姐妹', color: '#fa8c16', value: 'Siblings' }, + OtherRelatives: { + text: '其他亲属', + color: '#f5222d', + value: 'OtherRelatives', + }, + PrimaryTenant: { text: '主租客', color: '#722ed1', value: 'PrimaryTenant' }, + Tenant: { text: '租客', color: '#1890ff', value: 'Tenant' }, }; // HouseOccupantsResidentialRelationEnum -export const HouseOccupantsResidentialRelationEnum= { - 'Resident': {"text":"住户","color":"#2db7f5","value":"Resident"}, - 'PrimaryTenant': {"text":"主租人","color":"#87d068","value":"PrimaryTenant"}, - 'Tenant': {"text":"租客","color":"#fa8c16","value":"Tenant"}, +export const HouseOccupantsResidentialRelationEnum = { + Resident: { text: '住户', color: '#2db7f5', value: 'Resident' }, + PrimaryTenant: { text: '主租人', color: '#87d068', value: 'PrimaryTenant' }, + Tenant: { text: '租客', color: '#fa8c16', value: 'Tenant' }, }; // HouseOccupantsStatusEnum -export const HouseOccupantsStatusEnum= { - 'Normal': {"text":"绑定","color":"#52c41a","value":"Normal"}, - 'Unbound': {"text":"解绑","color":"#f5222d","value":"Unbound"}, +export const HouseOccupantsStatusEnum = { + Normal: { text: '绑定', color: '#52c41a', value: 'Normal' }, + Unbound: { text: '解绑', color: '#f5222d', value: 'Unbound' }, }; // 订单状态枚举 -export const HouseOrdersOrderStatusEnum= { - 'Pending': {"text":"待支付","color":"#facc15","value":"Pending"}, - 'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, - 'Refunded': {"text":"已退款","color":"#60a5fa","value":"Refunded"}, - 'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, - 'Failed': {"text":"支付失败","color":"#ef4444","value":"Failed"}, +export const HouseOrdersOrderStatusEnum = { + Pending: { text: '待支付', color: '#facc15', value: 'Pending' }, + Paid: { text: '已支付', color: '#10b981', value: 'Paid' }, + Refunded: { text: '已退款', color: '#60a5fa', value: 'Refunded' }, + Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' }, + Failed: { text: '支付失败', color: '#ef4444', value: 'Failed' }, }; // HouseOrdersPaymentMethodEnum -export const HouseOrdersPaymentMethodEnum= { - 'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"}, - 'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, - 'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"}, - 'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"}, +export const HouseOrdersPaymentMethodEnum = { + WeChat: { text: '微信', color: '#07c160', value: 'WeChat' }, + Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' }, + BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' }, + TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' }, }; // HouseRegistersCustomerTypeEnum -export const HouseRegistersCustomerTypeEnum= { - 'Individual': {"text":"个人客户","color":"#2db7f5","value":"Individual"}, - 'Enterprise': {"text":"普通企业","color":"#87d068","value":"Enterprise"}, - 'Developer': {"text":"开发企业","color":"#fa8c16","value":"Developer"}, - 'Government': {"text":"政府组织","color":"#f5222d","value":"Government"}, +export const HouseRegistersCustomerTypeEnum = { + Individual: { text: '个人客户', color: '#2db7f5', value: 'Individual' }, + Enterprise: { text: '普通企业', color: '#87d068', value: 'Enterprise' }, + Developer: { text: '开发企业', color: '#fa8c16', value: 'Developer' }, + Government: { text: '政府组织', color: '#f5222d', value: 'Government' }, }; // HouseRegistersHouseStatusEnum -export const HouseRegistersHouseStatusEnum= { - 'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"}, - 'Rented': {"text":"出租","color":"#007bff","value":"Rented"}, - 'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"}, +export const HouseRegistersHouseStatusEnum = { + SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' }, + Rented: { text: '出租', color: '#007bff', value: 'Rented' }, + Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' }, }; // 房屋登记身份类型 -export const HouseRegistersIdentityTypeEnum= { - 'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"}, - 'Tenant': {"text":"租客","color":"#87d068","value":"Tenant"}, - 'CoResident': {"text":"同住人(亲属)","color":"#108ee9","value":"CoResident"}, +export const HouseRegistersIdentityTypeEnum = { + Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' }, + Tenant: { text: '租客', color: '#87d068', value: 'Tenant' }, + CoResident: { text: '同住人(亲属)', color: '#108ee9', value: 'CoResident' }, }; // HouseRegistersStatusEnum -export const HouseRegistersStatusEnum= { - 'Pending': {"text":"待审","color":"#faad14","value":"Pending"}, - 'Approved': {"text":"通过","color":"#52c41a","value":"Approved"}, - 'Rejected': {"text":"驳回","color":"#f5222d","value":"Rejected"}, +export const HouseRegistersStatusEnum = { + Pending: { text: '待审', color: '#faad14', value: 'Pending' }, + Approved: { text: '通过', color: '#52c41a', value: 'Approved' }, + Rejected: { text: '驳回', color: '#f5222d', value: 'Rejected' }, }; // HouseRegistersTypeEnum -export const HouseRegistersTypeEnum= { - 'AddOwner': {"text":"添加产权人","color":"#52c41a","value":"AddOwner"}, - 'RemoveOwner': {"text":"减少产权人","color":"#d9363e","value":"RemoveOwner"}, - 'AddOccupant': {"text":"添加住户","color":"#108ee9","value":"AddOccupant"}, - 'RemoveOccupant': {"text":"移除住户","color":"#fa8c16","value":"RemoveOccupant"}, - 'MoveOut': {"text":"搬离登记","color":"#f50","value":"MoveOut"}, - 'MoveIn': {"text":"搬入登记","color":"#ffc53d","value":"MoveIn"}, - 'UpdateInfo': {"text":"修改信息","color":"#722ed1","value":"UpdateInfo"}, - 'UpdatePhone': {"text":"修改电话","color":"#13c2c2","value":"UpdatePhone"}, +export const HouseRegistersTypeEnum = { + AddOwner: { text: '添加产权人', color: '#52c41a', value: 'AddOwner' }, + RemoveOwner: { text: '减少产权人', color: '#d9363e', value: 'RemoveOwner' }, + AddOccupant: { text: '添加住户', color: '#108ee9', value: 'AddOccupant' }, + RemoveOccupant: { + text: '移除住户', + color: '#fa8c16', + value: 'RemoveOccupant', + }, + MoveOut: { text: '搬离登记', color: '#f50', value: 'MoveOut' }, + MoveIn: { text: '搬入登记', color: '#ffc53d', value: 'MoveIn' }, + UpdateInfo: { text: '修改信息', color: '#722ed1', value: 'UpdateInfo' }, + UpdatePhone: { text: '修改电话', color: '#13c2c2', value: 'UpdatePhone' }, }; // HouseRegistersUsagePlanEnum -export const HouseRegistersUsagePlanEnum= { - 'Permanent': {"text":"常住","color":"#52c41a","value":"Permanent"}, - 'Vacation': {"text":"度假","color":"#faad14","value":"Vacation"}, - 'Rental': {"text":"出租","color":"#2db7f5","value":"Rental"}, - 'Commercial': {"text":"商用","color":"#f5222d","value":"Commercial"}, +export const HouseRegistersUsagePlanEnum = { + Permanent: { text: '常住', color: '#52c41a', value: 'Permanent' }, + Vacation: { text: '度假', color: '#faad14', value: 'Vacation' }, + Rental: { text: '出租', color: '#2db7f5', value: 'Rental' }, + Commercial: { text: '商用', color: '#f5222d', value: 'Commercial' }, }; // HouseWorkOrdersAssignStatusEnum -export const HouseWorkOrdersAssignStatusEnum= { - 'Unassigned': {"text":"未指派","color":"#ff0000","value":"Unassigned"}, - 'Assigned': {"text":"已指派","color":"#00ff00","value":"Assigned"}, +export const HouseWorkOrdersAssignStatusEnum = { + Unassigned: { text: '未指派', color: '#ff0000', value: 'Unassigned' }, + Assigned: { text: '已指派', color: '#00ff00', value: 'Assigned' }, }; // HouseWorkOrdersComplaintTypeEnum -export const HouseWorkOrdersComplaintTypeEnum= { - 'Hygiene': {"text":"卫生环境","color":"#ff0000","value":"Hygiene"}, - 'Greening': {"text":"绿植绿化","color":"#00aaff","value":"Greening"}, - 'Safety': {"text":"安全问题","color":"#ffaa00","value":"Safety"}, - 'Maintenance': {"text":"维修问题","color":"#aa00ff","value":"Maintenance"}, - 'PropertyService': {"text":"物业服务","color":"#00aa55","value":"PropertyService"}, - 'Staff': {"text":"工作人员","color":"#ff00aa","value":"Staff"}, - 'Other': {"text":"其他","color":"#aaaaaa","value":"Other"}, +export const HouseWorkOrdersComplaintTypeEnum = { + Hygiene: { text: '卫生环境', color: '#ff0000', value: 'Hygiene' }, + Greening: { text: '绿植绿化', color: '#00aaff', value: 'Greening' }, + Safety: { text: '安全问题', color: '#ffaa00', value: 'Safety' }, + Maintenance: { text: '维修问题', color: '#aa00ff', value: 'Maintenance' }, + PropertyService: { + text: '物业服务', + color: '#00aa55', + value: 'PropertyService', + }, + Staff: { text: '工作人员', color: '#ff00aa', value: 'Staff' }, + Other: { text: '其他', color: '#aaaaaa', value: 'Other' }, }; // HouseWorkOrdersLevelEnum -export const HouseWorkOrdersLevelEnum= { - 'Urgent': {"text":"紧急","color":"#ff0000","value":"Urgent"}, - 'High': {"text":"高","color":"#ff7f00","value":"High"}, - 'Medium': {"text":"中","color":"#00cc00","value":"Medium"}, - 'Low': {"text":"低","color":"#999999","value":"Low"}, +export const HouseWorkOrdersLevelEnum = { + Urgent: { text: '紧急', color: '#ff0000', value: 'Urgent' }, + High: { text: '高', color: '#ff7f00', value: 'High' }, + Medium: { text: '中', color: '#00cc00', value: 'Medium' }, + Low: { text: '低', color: '#999999', value: 'Low' }, }; // HouseWorkOrdersLocationEnum -export const HouseWorkOrdersLocationEnum= { - 'CommonArea': {"text":"公共区域","color":"#ff0000","value":"CommonArea"}, - 'MyHome': {"text":"我家","color":"#00ff00","value":"MyHome"}, +export const HouseWorkOrdersLocationEnum = { + CommonArea: { text: '公共区域', color: '#ff0000', value: 'CommonArea' }, + MyHome: { text: '我家', color: '#00ff00', value: 'MyHome' }, }; // HouseWorkOrdersStatusEnum -export const HouseWorkOrdersStatusEnum= { - 'Pending': {"text":"待处理","color":"#FFA500","value":"Pending"}, - 'Processing': {"text":"处理中","color":"#1E90FF","value":"Processing"}, - 'Completed': {"text":"已完成","color":"#28A745","value":"Completed"}, - 'Closed': {"text":"已关闭","color":"#6C757D","value":"Closed"}, +export const HouseWorkOrdersStatusEnum = { + Pending: { text: '待处理', color: '#FFA500', value: 'Pending' }, + Processing: { text: '处理中', color: '#1E90FF', value: 'Processing' }, + Completed: { text: '已完成', color: '#28A745', value: 'Completed' }, + Closed: { text: '已关闭', color: '#6C757D', value: 'Closed' }, }; // HouseWorkOrdersTypeEnum -export const HouseWorkOrdersTypeEnum= { - 'Repair': {"text":"报修","color":"#ff0000","value":"Repair"}, - 'Incident': {"text":"报事","color":"#00aaff","value":"Incident"}, - 'Complaint': {"text":"投诉","color":"#aa00ff","value":"Complaint"}, +export const HouseWorkOrdersTypeEnum = { + Repair: { text: '报修', color: '#ff0000', value: 'Repair' }, + Incident: { text: '报事', color: '#00aaff', value: 'Incident' }, + Complaint: { text: '投诉', color: '#aa00ff', value: 'Complaint' }, }; // MsgPropertyAnnouncementsPublishTypeEnum -export const MsgPropertyAnnouncementsPublishTypeEnum= { - 'Manual': {"text":"手动","color":"#4caf50","value":"Manual"}, - 'Schedule': {"text":"定时","color":"#2196f3","value":"Schedule"}, +export const MsgPropertyAnnouncementsPublishTypeEnum = { + Manual: { text: '手动', color: '#4caf50', value: 'Manual' }, + Schedule: { text: '定时', color: '#2196f3', value: 'Schedule' }, }; // OrganizationsTypeEnum -export const OrganizationsTypeEnum= { - 'Group': {"text":"集团","color":"#007bff","value":"Group"}, - 'Company': {"text":"公司","color":"#28a745","value":"Company"}, - 'ManagementOffice': {"text":"管理处","color":"#ffc107","value":"ManagementOffice"}, - 'Department': {"text":"部门","color":"#dc3545","value":"Department"}, +export const OrganizationsTypeEnum = { + Group: { text: '集团', color: '#007bff', value: 'Group' }, + Company: { text: '公司', color: '#28a745', value: 'Company' }, + ManagementOffice: { + text: '管理处', + color: '#ffc107', + value: 'ManagementOffice', + }, + Department: { text: '部门', color: '#dc3545', value: 'Department' }, }; // 性别 -export const SexEnum= { - 'Male': {"text":"男","color":"#0000ff","value":"Male"}, - 'FeMale': {"text":"女","color":"#ff0000","value":"FeMale"}, +export const SexEnum = { + Male: { text: '男', color: '#0000ff', value: 'Male' }, + FeMale: { text: '女', color: '#ff0000', value: 'FeMale' }, }; // SysModuleEnum -export const SysModuleEnum= { - 'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"}, - 'Customer': {"text":"客户","color":"#d4b106","value":"Customer"}, +export const SysModuleEnum = { + Admin: { text: '管理员', color: '#cf1322', value: 'Admin' }, + Customer: { text: '客户', color: '#d4b106', value: 'Customer' }, }; // SysPermissionsTypeEnum -export const SysPermissionsTypeEnum= { - 'Directory': {"text":"目录","color":"#6d7e14","value":"Directory"}, - 'Page': {"text":"页面","color":"#4d9a13","value":"Page"}, - 'Button': {"text":"按钮","color":"#97224f","value":"Button"}, +export const SysPermissionsTypeEnum = { + Directory: { text: '目录', color: '#6d7e14', value: 'Directory' }, + Page: { text: '页面', color: '#4d9a13', value: 'Page' }, + Button: { text: '按钮', color: '#97224f', value: 'Button' }, }; // WechatAuthsPlatformEnum -export const WechatAuthsPlatformEnum= { - 'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"}, - 'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"}, - 'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"}, +export const WechatAuthsPlatformEnum = { + MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' }, + MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' }, + WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' }, }; - diff --git a/src/pages/archive/modals/Delivery.tsx b/src/pages/archive/modals/Delivery.tsx index 744d191..ff6de1f 100644 --- a/src/pages/archive/modals/Delivery.tsx +++ b/src/pages/archive/modals/Delivery.tsx @@ -9,6 +9,7 @@ import { Apis } from '@/gen/Apis'; import { HouseOccupantsCardTypeEnum, HouseOccupantsHouseRelationEnum, + HouseOccupantsRelationWithOwnerEnum, HouseRegistersTypeEnum, } from '@/gen/Enums'; import { BetaSchemaForm, ProCard } from '@ant-design/pro-components'; @@ -21,7 +22,7 @@ export default function Create(props: MyBetaModalFormProps) { {...MyModalFormProps.props} title={`${props.title}`} wrapperCol={{ span: 24 }} - width="800px" + width="1000px" trigger={ } @@ -34,7 +34,7 @@ export default function AddOccupant(props: MyBetaModalFormProps) { form.resetFields(); // 清空表单数据 } }} - onFinish={async (values) => + onFinish={async (values: any) => Apis.Archive.HouseRegisters.Store({ ...values, asset_houses_id: props?.item?.id, @@ -43,6 +43,11 @@ export default function AddOccupant(props: MyBetaModalFormProps) { return { ...res, house_relation: HouseOccupantsHouseRelationEnum.NonOwner.value, + relation_with_owner: + values?.residential_relation === + HouseOccupantsResidentialRelationEnum.PrimaryTenant.value + ? values?.relation_with_owner + : values?.residential_relation, }; }), }) @@ -106,16 +111,16 @@ export default function AddOccupant(props: MyBetaModalFormProps) { name: ['residential_relation'], valueType: 'dependency', columns: ({ residential_relation }: any) => { - return residential_relation !== - HouseOccupantsResidentialRelationEnum.PrimaryTenant - .value + return residential_relation === + HouseOccupantsResidentialRelationEnum.Resident.value ? [ MyFormItems.EnumRadio({ key: 'relation_with_owner', - title: - residential_relation === 'Resident' - ? '与产权人关系' - : '与主租人关系', + title: '与产权人关系', + // title: + // residential_relation === 'Resident' + // ? '与产权人关系' + // : '与主租人关系', valueEnum: HouseOccupantsRelationWithOwnerEnum, colProps: { span: 16 }, required: true, @@ -227,6 +232,7 @@ export default function AddOccupant(props: MyBetaModalFormProps) { key: 'card_front_image', title: '证件正面', // uploadType: 'file', + required: true, max: 1, colProps: { span: 6 }, }), @@ -234,13 +240,14 @@ export default function AddOccupant(props: MyBetaModalFormProps) { key: 'card_back_image', title: '证件反面', // uploadType: 'file', + required: true, max: 1, colProps: { span: 6 }, }), { title: '是否入住', dataIndex: 'is_live_in', - colProps: { span: 6 }, + colProps: { span: 4 }, valueType: 'switch', }, { @@ -263,6 +270,11 @@ export default function AddOccupant(props: MyBetaModalFormProps) { : []; }, }, + { + title: '备注', + dataIndex: 'remark', + colProps: { span: 24 }, + }, ]; }, }, diff --git a/src/pages/archive/table/modals/Transfer.tsx b/src/pages/archive/table/modals/Transfer.tsx index 916b040..2f5a668 100644 --- a/src/pages/archive/table/modals/Transfer.tsx +++ b/src/pages/archive/table/modals/Transfer.tsx @@ -21,7 +21,7 @@ export default function Create(props: MyBetaModalFormProps) { {...MyModalFormProps.props} title={`${props.title}`} wrapperCol={{ span: 24 }} - width="900px" + width="1000px" trigger={ } @@ -164,7 +164,7 @@ export default function Create(props: MyBetaModalFormProps) { colProps: { span: 6 }, }), { - title: '是否办理入住', + title: '是否入住', dataIndex: 'is_live_in', colProps: { span: 6 }, valueType: 'switch', diff --git a/src/pages/asset/list/index.tsx b/src/pages/asset/list/index.tsx index 850bb88..189762b 100644 --- a/src/pages/asset/list/index.tsx +++ b/src/pages/asset/list/index.tsx @@ -1,6 +1,7 @@ import { MyButtons, MyColumns, + MyImportModal, MyPageContainer, MyProTableProps, usePageTabs, @@ -32,6 +33,15 @@ export default function Index({ title = '项目列表' }) { } // headerTitle="项目列表" toolBarRender={(action) => [ + , , ]} columns={[ diff --git a/src/pages/common/positions/index.tsx b/src/pages/common/positions/index.tsx new file mode 100644 index 0000000..d600319 --- /dev/null +++ b/src/pages/common/positions/index.tsx @@ -0,0 +1,73 @@ +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 ( + + + MyProTableProps.request(params, sort, Apis.Common.Positions.List) + } + toolBarRender={(action) => [ + , + ]} + 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) => ( + + + + Apis.Common.Positions.Delete({ id: item.id }).then(() => + action?.reload(), + ) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/common/positions/modals/Create.tsx b/src/pages/common/positions/modals/Create.tsx new file mode 100644 index 0000000..76047e7 --- /dev/null +++ b/src/pages/common/positions/modals/Create.tsx @@ -0,0 +1,51 @@ +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 ( + + {...MyModalFormProps.props} + title={`添加岗位`} + layout="horizontal" + labelCol={{ span: 6 }} + wrapperCol={{ span: 18 }} + width="450px" + trigger={} + 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 }, + }, + ]} + /> + ); +} diff --git a/src/pages/common/positions/modals/Update.tsx b/src/pages/common/positions/modals/Update.tsx new file mode 100644 index 0000000..afa4974 --- /dev/null +++ b/src/pages/common/positions/modals/Update.tsx @@ -0,0 +1,62 @@ +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 ( + + {...MyModalFormProps.props} + title={`编辑${props.title}`} + trigger={} + 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, + }, + }, + ]} + /> + ); +} diff --git a/src/pages/company/list/table/Positions.tsx b/src/pages/company/list/table/Positions.tsx index 81a9bda..c7b629b 100644 --- a/src/pages/company/list/table/Positions.tsx +++ b/src/pages/company/list/table/Positions.tsx @@ -7,6 +7,7 @@ import { import { Apis } from '@/gen/Apis'; import { ProTable } from '@ant-design/pro-components'; import { Space } from 'antd'; +import PositionAdd from '../../positions/modals/PositionAdd'; import PositionCreate from '../../positions/modals/PositionCreate'; import PositionUpdate from '../../positions/modals/PositionUpdate'; @@ -24,6 +25,12 @@ export default function Organizations(props: MyBetaModalFormProps) { ) } toolBarRender={(action) => [ + , ( + [], + ); + const [selectedRows, setSelectedRows] = useState([]); + + // 添加 tableRef 用于操作表格 + const tableRef = useRef(); + + 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 ( + + 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 ( + + 已选 {selectedRowKeys.length} 项 + 清空 + onShowContactPhone()} + /> + + ); + }} + options={false} + columns={[ + MyColumns.ID(), + { + title: '岗位名称', + dataIndex: 'name', + width: 300, + }, + { + title: '是否启用', + dataIndex: 'is_use', + search: false, + render: (text) => (text ? '是' : '否'), + width: 200, + }, + ]} + /> + } + /> + ); +} diff --git a/src/pages/company/positions/modals/PositionCreate.tsx b/src/pages/company/positions/modals/PositionCreate.tsx index c40be6a..7e500e2 100644 --- a/src/pages/company/positions/modals/PositionCreate.tsx +++ b/src/pages/company/positions/modals/PositionCreate.tsx @@ -17,7 +17,7 @@ export default function Create(props: MyBetaModalFormProps) { title={`添加岗位`} wrapperCol={{ span: 24 }} width="500px" - trigger={} + trigger={} form={form} onOpenChange={(open: any) => { if (open) { diff --git a/src/pages/mete/list/index.tsx b/src/pages/meter/list/index.tsx similarity index 81% rename from src/pages/mete/list/index.tsx rename to src/pages/meter/list/index.tsx index d55c764..c40dd5c 100644 --- a/src/pages/mete/list/index.tsx +++ b/src/pages/meter/list/index.tsx @@ -1,6 +1,7 @@ import { MyButtons, MyColumns, + MyImportModal, MyPageContainer, MyProTableProps, usePageTabs, @@ -41,6 +42,15 @@ export default function Index({ title = '仪表管理' }) { MyProTableProps.request(params, sort, Apis.Meter.HouseMeters.List) } toolBarRender={(action) => [ + , , ]} columns={[ @@ -93,15 +103,20 @@ export default function Index({ title = '仪表管理' }) { }, MyColumns.SoftDelete({ - onRestore: Apis.Company.Companies.Restore, - onSoftDelete: Apis.Company.Companies.SoftDelete, + onRestore: Apis.Meter.HouseMeters.Restore, + onSoftDelete: Apis.Meter.HouseMeters.SoftDelete, search: false, }), MyColumns.CreatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( - {/* */} + { + navigate(`/meter/readings/show/${item.id}`); + }} + /> @@ -118,14 +133,14 @@ export default function Index({ title = '仪表管理' }) { {item.meter_type === HouseMetersMeterTypeEnum.CommonMeter.value && ( )} - Apis.Company.Companies.Delete({ id: item.id }).then(() => + Apis.Meter.HouseMeters.Delete({ id: item.id }).then(() => action?.reload(), ) } diff --git a/src/pages/mete/list/modals/MeterCreate.tsx b/src/pages/meter/list/modals/MeterCreate.tsx similarity index 63% rename from src/pages/mete/list/modals/MeterCreate.tsx rename to src/pages/meter/list/modals/MeterCreate.tsx index edf4ef3..3e083c8 100644 --- a/src/pages/mete/list/modals/MeterCreate.tsx +++ b/src/pages/meter/list/modals/MeterCreate.tsx @@ -37,6 +37,8 @@ export default function Create(props: MyBetaModalFormProps) { onFinish={async (values) => Apis.Meter.HouseMeters.Store({ ...values, + latest_value: values.initial_value, + latest_time: values.initial_time, }) .then(() => { props.reload?.(); @@ -93,11 +95,62 @@ export default function Create(props: MyBetaModalFormProps) { { key: 'initial_time', title: '初始抄表时间', - valueType: 'date', + valueType: 'dateTime', colProps: { span: 24 }, 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', name: ['asset_projects_id'], diff --git a/src/pages/mete/list/modals/MeterHasHouse.tsx b/src/pages/meter/list/modals/MeterHasHouse.tsx similarity index 99% rename from src/pages/mete/list/modals/MeterHasHouse.tsx rename to src/pages/meter/list/modals/MeterHasHouse.tsx index e7d52ca..76db1b2 100644 --- a/src/pages/mete/list/modals/MeterHasHouse.tsx +++ b/src/pages/meter/list/modals/MeterHasHouse.tsx @@ -54,6 +54,7 @@ export default function ChargeStandardHasHouse(props: MyBetaModalFormProps) { + + + +
+ 【{item?.id}】{item?.name} +
+
+ + + + + + + + + {item?.charge_standard?.name || '-'} + + + {item?.initial_value} + + + {item?.initial_time} + + + {item?.latest_value} + + + + {item?.latest_time} + + + + {item?.remark || '-'} + +
+
+
+ ); +} diff --git a/src/pages/mete/readings/index.tsx b/src/pages/meter/readings/index.tsx similarity index 83% rename from src/pages/mete/readings/index.tsx rename to src/pages/meter/readings/index.tsx index 885176e..9057773 100644 --- a/src/pages/mete/readings/index.tsx +++ b/src/pages/meter/readings/index.tsx @@ -15,6 +15,7 @@ import { HouseMetersUsageTypeEnum, } from '@/gen/Enums'; import NormalReading from './modals/NormalReading'; +import ResetReading from './modals/ResetReading'; export default function Index({ title = '抄表数据' }) { const navigate = useNavigate(); @@ -58,6 +59,10 @@ export default function Index({ title = '抄表数据' }) { title: '仪表名称', dataIndex: 'name', }, + { + title: '关联房屋', + dataIndex: 'full_name', + }, { title: '收费标准', dataIndex: ['charge_standard', 'name'], @@ -83,34 +88,27 @@ export default function Index({ title = '抄表数据' }) { dataIndex: 'latest_time', search: false, }, - { - title: '备注', - dataIndex: 'remark', - search: false, - }, - MyColumns.SoftDelete({ - onRestore: Apis.Company.Companies.Restore, - onSoftDelete: Apis.Company.Companies.SoftDelete, - search: false, - }), MyColumns.CreatedAt(), MyColumns.Option({ render: (_, item: any, index, action) => ( {/* */} + { + navigate(`/meter/readings/show/${item.id}`); + }} + /> - - - Apis.Company.Companies.Delete({ id: item.id }).then(() => - action?.reload(), - ) - } + ), diff --git a/src/pages/meter/readings/modals/CorrectReading.tsx b/src/pages/meter/readings/modals/CorrectReading.tsx new file mode 100644 index 0000000..48a8249 --- /dev/null +++ b/src/pages/meter/readings/modals/CorrectReading.tsx @@ -0,0 +1,210 @@ +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 ( + + {...MyModalFormProps.props} + title={`修正抄表数据`} + layout="horizontal" + labelCol={{ span: 6 }} + wrapperCol={{ span: 18 }} + labelAlign="left" + width="600px" + key={new Date().getTime()} + trigger={} + 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 }, + }, + ]} + /> + ); +} diff --git a/src/pages/mete/readings/modals/NormalReading.tsx b/src/pages/meter/readings/modals/NormalReading.tsx similarity index 65% rename from src/pages/mete/readings/modals/NormalReading.tsx rename to src/pages/meter/readings/modals/NormalReading.tsx index bbdae65..a337fc8 100644 --- a/src/pages/mete/readings/modals/NormalReading.tsx +++ b/src/pages/meter/readings/modals/NormalReading.tsx @@ -10,7 +10,7 @@ import { HouseMeterReadingsOperationTypeEnum } from '@/gen/Enums'; import { BetaSchemaForm } from '@ant-design/pro-components'; import { Form, message } from 'antd'; -export default function Create(props: MyBetaModalFormProps) { +export default function NormalReading(props: MyBetaModalFormProps) { const [form] = Form.useForm(); return ( @@ -23,7 +23,13 @@ export default function Create(props: MyBetaModalFormProps) { labelAlign="left" width="600px" key={new Date().getTime()} - trigger={} + trigger={ + + } form={form} onOpenChange={(open: any) => { if (open && props.item) { @@ -41,6 +47,7 @@ export default function Create(props: MyBetaModalFormProps) { onFinish={async (values) => Apis.Meter.HouseMeterReadings.Store({ ...values, + house_meters_id: props.item?.id, operation_type: HouseMeterReadingsOperationTypeEnum.NormalReading.value, }) @@ -61,11 +68,10 @@ export default function Create(props: MyBetaModalFormProps) { { key: 'latest_time', title: '上次抄表时间', - valueType: 'date', + valueType: 'dateTime', colProps: { span: 24 }, fieldProps: { disabled: true }, }, - { key: 'current_reading', title: '本次抄表读数', @@ -96,7 +102,7 @@ export default function Create(props: MyBetaModalFormProps) { { key: 'reading_time', title: '本次抄表时间', - valueType: 'date', + valueType: 'dateTime', colProps: { span: 24 }, formItemProps: { ...rulesHelper.text, @@ -119,6 +125,58 @@ export default function Create(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({ key: 'company_employees_id', diff --git a/src/pages/meter/readings/modals/ResetReading.tsx b/src/pages/meter/readings/modals/ResetReading.tsx new file mode 100644 index 0000000..c73897d --- /dev/null +++ b/src/pages/meter/readings/modals/ResetReading.tsx @@ -0,0 +1,220 @@ +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 ( + + {...MyModalFormProps.props} + title={`重置抄表数据`} + layout="horizontal" + labelCol={{ span: 6 }} + wrapperCol={{ span: 18 }} + labelAlign="left" + width="600px" + key={new Date().getTime()} + trigger={ + + } + 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 }, + }, + ]} + /> + ); +} diff --git a/src/pages/meter/readings/show/$id.tsx b/src/pages/meter/readings/show/$id.tsx new file mode 100644 index 0000000..cef7e4e --- /dev/null +++ b/src/pages/meter/readings/show/$id.tsx @@ -0,0 +1,71 @@ +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({}); + 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: ( + { + loadShow(); + }} + /> + ), + }, + { + label: '关联房屋', + key: '2', + closable: false, + children: , + }, + ]; + + return ( + + + + + + + ); +} diff --git a/src/pages/meter/readings/table/HasHouse.tsx b/src/pages/meter/readings/table/HasHouse.tsx new file mode 100644 index 0000000..f8aeb0e --- /dev/null +++ b/src/pages/meter/readings/table/HasHouse.tsx @@ -0,0 +1,103 @@ +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 ( + <> + + MyProTableProps.request( + { ...params, house_meters_id: props?.item?.id }, + sort, + Apis.Meter.HouseMeterHasHouses.List, + ) + } + toolBarRender={(action) => [ + , + ...(props?.item?.meter_type === + HouseMetersMeterTypeEnum.HouseMeter.value + ? [ + , + ] + : []), + ...(props?.item?.meter_type === + HouseMetersMeterTypeEnum.CommonMeter.value + ? [ + , + ] + : []), + ]} + // 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) => ( + + + Apis.Meter.HouseMeterHasHouses.Delete({ id: item.id }).then( + () => action?.reload(), + ) + } + /> + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/meter/readings/table/ReadingLIst.tsx b/src/pages/meter/readings/table/ReadingLIst.tsx new file mode 100644 index 0000000..33d60e6 --- /dev/null +++ b/src/pages/meter/readings/table/ReadingLIst.tsx @@ -0,0 +1,91 @@ +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 ( + <> + + MyProTableProps.request( + { ...params, house_meters_id: props?.item?.id }, + sort, + Apis.Meter.HouseMeterReadings.List, + ) + } + toolBarRender={(action) => [ + , + , + ]} + // 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) => ( + + {/* 只有未生成账单的抄表记录,且不是重置读数,才显示修正按钮 */} + {!item?.bill_status && + item?.operation_type !== + HouseMeterReadingsOperationTypeEnum.ResetReading.value && ( + + )} + + ), + }), + ]} + /> + + ); +} diff --git a/src/pages/mete/tasks/index.tsx b/src/pages/meter/tasks/index.tsx similarity index 100% rename from src/pages/mete/tasks/index.tsx rename to src/pages/meter/tasks/index.tsx diff --git a/src/pages/mete/tasks/modals/TaskCreate.tsx b/src/pages/meter/tasks/modals/TaskCreate.tsx similarity index 100% rename from src/pages/mete/tasks/modals/TaskCreate.tsx rename to src/pages/meter/tasks/modals/TaskCreate.tsx diff --git a/src/pages/mete/tasks/modals/TaskShow.tsx b/src/pages/meter/tasks/modals/TaskShow.tsx similarity index 100% rename from src/pages/mete/tasks/modals/TaskShow.tsx rename to src/pages/meter/tasks/modals/TaskShow.tsx