feat: 重构勘察业务为明细模式并新增定时任务人性化配置
- 重构勘察业务:移除SOP相关表,新增勘察明细表支持建筑/楼层/房间/照片管理 - 新增定时任务人性化频率配置,支持分钟/小时/天/周/月/自定义六种模式 - 新增频率预览接口,支持配置转换为cron表达式与执行时间预览 - 更新系统品牌名称为鑫潼智电,修改全局标题与登录页文案
This commit is contained in:
1 parent
f72644c24f
commit
22d27a940d
29 files changed
+1908
-576
No files matched your search
@@ -30,10 +30,6 @@ export const SURVEY_PRIORITY_OPTIONS = [
|
||||
{ value: 3, label: '常规 · P3' }
|
||||
];
|
||||
|
||||
// SOP 规范模板编码与名称
|
||||
export const SOP_TEMPLATE_CODE = 'standard_dist';
|
||||
export const SOP_TEMPLATE_LABEL = '标准配电改造模板';
|
||||
|
||||
// 报酬规则(后端 dispatch_price 未配置时的前端兜底展示值)
|
||||
export const SURVEY_BASE_FEE = 350;
|
||||
export const SURVEY_LOOP_FEE = 5;
|
||||
@@ -61,35 +57,22 @@ export interface SurveyOrderWorker {
|
||||
completedCount?: number;
|
||||
}
|
||||
|
||||
export interface SurveySopItem {
|
||||
id: number;
|
||||
templateCode: string;
|
||||
sortOrder: number;
|
||||
itemName: string;
|
||||
itemDesc?: string;
|
||||
// 回执形式:photo 现场照片 / form 清单表单 / meter 测仪截图
|
||||
receiptType: 'photo' | 'form' | 'meter' | string;
|
||||
receiptRequire?: string;
|
||||
required: boolean;
|
||||
}
|
||||
|
||||
export interface SurveyOrderSopResult {
|
||||
id: number;
|
||||
surveyOrderId: number;
|
||||
sopItemId: number;
|
||||
checked: boolean;
|
||||
// 回执内容:photo/meter 类为照片对象 key 数组,form 类为单元素文本值数组
|
||||
receiptValue?: string[];
|
||||
// 详情/回执接口附带:照片类回执的预签名访问 URL(与 receiptValue 顺序一致)
|
||||
receiptUrls?: string[];
|
||||
remark?: string;
|
||||
checkedAt?: string;
|
||||
// 由后端 join 的检查项信息
|
||||
sopItem?: SurveySopItem;
|
||||
itemName?: string;
|
||||
receiptType?: string;
|
||||
receiptRequire?: string;
|
||||
sortOrder?: number;
|
||||
// 勘察明细:一条 = 建筑 + 楼层 + 房间(可空) + 现场照片
|
||||
export interface SurveyOrderDetail {
|
||||
id?: number;
|
||||
surveyOrderId?: number;
|
||||
buildingId?: number | null;
|
||||
// 建筑名称(冗余存储,客户拓扑变更后仍可读)
|
||||
buildingName?: string | null;
|
||||
// 楼层:正数为地上、负数为地下,如 '1' / '-1'
|
||||
floorNo?: string | null;
|
||||
roomId?: number | null;
|
||||
roomName?: string | null;
|
||||
// 现场照片对象 key
|
||||
photos?: string[];
|
||||
// 详情接口附带:照片预签名访问 URL(与 photos 顺序一致)
|
||||
photoUrls?: string[];
|
||||
remark?: string | null;
|
||||
}
|
||||
|
||||
export interface SurveyOrderInfo {
|
||||
@@ -141,8 +124,8 @@ export interface SurveyOrderInfo {
|
||||
updatedAt?: string;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
// 详情附带:SOP 回执
|
||||
sopResults?: SurveyOrderSopResult[];
|
||||
// 详情附带:勘察明细(建筑/楼层/房间 + 现场照片)
|
||||
details?: SurveyOrderDetail[];
|
||||
}
|
||||
|
||||
export interface SurveyOrderQuery {
|
||||
@@ -209,7 +192,8 @@ export interface SurveyOrderCreateParams {
|
||||
remark?: string;
|
||||
source?: string;
|
||||
isDraft?: number;
|
||||
templateCode?: string;
|
||||
// 勘察明细(创建/编辑时全量提交,新增/编辑/删除统一走此数组)
|
||||
details?: SurveyOrderDetail[];
|
||||
}
|
||||
|
||||
export type SurveyOrderUpdateParams = Partial<SurveyOrderCreateParams>;
|
||||
@@ -247,10 +231,6 @@ export const surveyOrderApi = {
|
||||
// KPI 统计卡
|
||||
getStats: () => request.get<SurveyOrderStats>('/survey-orders/stats'),
|
||||
|
||||
// SOP 规范模板检查项
|
||||
getSopItems: (templateCode: string = SOP_TEMPLATE_CODE) =>
|
||||
request.get<SurveySopItem[]>('/survey-orders/sop-items', { params: { templateCode } }),
|
||||
|
||||
// 报酬测算:基础出场工时费 + 回路数 × 单价
|
||||
getQuote: (loopCount: number) =>
|
||||
request.get<SurveyQuote>('/survey-orders/quote', { params: { loopCount } }),
|
||||
@@ -264,6 +244,10 @@ export const surveyOrderApi = {
|
||||
update: (id: number, data: SurveyOrderUpdateParams) =>
|
||||
request.put<SurveyOrderInfo>(`/survey-orders/${id}`, data),
|
||||
|
||||
// 勘察明细:全量替换(新增/编辑/删除统一提交完整数组)
|
||||
saveDetails: (id: number, details: SurveyOrderDetail[]) =>
|
||||
request.put<SurveyOrderDetail[]>(`/survey-orders/${id}/details`, { details }),
|
||||
|
||||
// 指派 / 改派共享电工
|
||||
assign: (id: number, data: SurveyOrderAssignParams) =>
|
||||
request.put<SurveyOrderInfo>(`/survey-orders/${id}/assign`, data),
|
||||
|
||||
Reference in new issue
Block a user