safety-eval-service-frontend/src/pages/Container/QualApplication/filingLocalDraft.js

73 lines
1.6 KiB
JavaScript
Raw Normal View History

2026-06-30 17:32:29 +08:00
import { createLocalMaterials } from "./filingMaterialTemplate";
const STORAGE_PREFIX = "qual_filing_local_draft:";
function storageKey(mode) {
return `${STORAGE_PREFIX}${mode || "application"}`;
}
export function loadLocalDraft(mode) {
try {
const raw = sessionStorage.getItem(storageKey(mode));
if (!raw) {
return null;
}
return JSON.parse(raw);
}
catch {
return null;
}
}
export function saveLocalDraft(mode, detail) {
try {
sessionStorage.setItem(storageKey(mode), JSON.stringify(detail));
}
catch (err) {
console.warn("[filingLocalDraft] save failed:", err);
}
}
export function clearLocalDraft(mode) {
sessionStorage.removeItem(storageKey(mode));
}
/** 新建表单:空白,不预填机构信息 */
2026-08-10 10:10:11 +08:00
export function createEmptyFilingDetail(mode) {
2026-06-30 17:32:29 +08:00
return {
id: null,
filingStatusCode: 5,
2026-08-10 10:10:11 +08:00
materials: createLocalMaterials(mode),
2026-06-30 17:32:29 +08:00
commitment: {
legalRepPersonnelId: "",
legalRepName: "",
filingUnitName: "",
signDate: null,
legalRepSignatureUrl: "",
signatureFiles: [],
commitmentContent: "",
},
personnelList: [],
equipmentList: [],
businessScope: "",
filingTerritoryName: "",
filingUnitName: "",
filingUnitTypeName: "",
creditCode: "",
registerAddress: "",
officeAddress: "",
qualCertNo: "",
infoDisclosureUrl: "",
legalPersonPhone: "",
contactPhone: "",
fixedAssetAmount: null,
workplaceArea: null,
archiveRoomArea: null,
fulltimeEvaluatorCount: null,
registeredEngineerCount: null,
unitIntro: "",
attachmentUrl: "",
attachments: [],
};
}