feat(M08-B): 补联调归档包导出
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
<el-button :icon="FileDown" :disabled="riskItems.length === 0" @click="exportRiskRegister">风险</el-button>
|
||||
<el-button :icon="Copy" @click="copyHandoffReport">复制报告</el-button>
|
||||
<el-button :icon="FileDown" @click="exportHandoffReport">报告</el-button>
|
||||
<el-button :icon="FileDown" :disabled="!closeoutReady" @click="exportCloseoutArchive">归档包</el-button>
|
||||
<el-button :icon="RotateCcw" @click="resetDraft">重置</el-button>
|
||||
<input
|
||||
ref="snapshotInput"
|
||||
@@ -597,6 +598,56 @@ function exportHandoffReport() {
|
||||
);
|
||||
}
|
||||
|
||||
function exportCloseoutArchive() {
|
||||
downloadText(
|
||||
`cleaning-field-closeout-archive-${Date.now()}.json`,
|
||||
JSON.stringify(buildCloseoutArchive(), null, 2),
|
||||
'application/json;charset=utf-8'
|
||||
);
|
||||
}
|
||||
|
||||
function buildCloseoutArchive() {
|
||||
return {
|
||||
schema: 'qipai.cleaning.field-handoff.closeout-archive.v1',
|
||||
exportedAt: new Date().toISOString(),
|
||||
sessionMeta: { ...sessionMeta },
|
||||
closeoutGate: {
|
||||
ready: closeoutReady.value,
|
||||
missingFields: [...missingCloseoutFields.value],
|
||||
handoffReady: handoffReady.value
|
||||
},
|
||||
summary: {
|
||||
total: checklist.length,
|
||||
passed: passedCount.value,
|
||||
blocked: blockedCount.value,
|
||||
pending: pendingCount.value,
|
||||
evidenceRecorded: evidenceRecordedCount.value,
|
||||
evidenceMissing: evidenceMissingCount.value
|
||||
},
|
||||
categoryProgress: categoryProgress.value,
|
||||
riskItems: riskItems.value.map((item) => serializeHandoffItem(item)),
|
||||
evidenceMissingItems: evidenceMissingItems.value.map((item) => serializeHandoffItem(item)),
|
||||
checklist: checklist.map((item) => serializeHandoffItem(item)),
|
||||
report: buildHandoffReport()
|
||||
};
|
||||
}
|
||||
|
||||
function serializeHandoffItem(item: HandoffItem) {
|
||||
const itemDraft = draft[item.id];
|
||||
return {
|
||||
id: item.id,
|
||||
category: item.category,
|
||||
title: item.title,
|
||||
expected: item.expected,
|
||||
status: itemDraft.status,
|
||||
statusText: statusText(itemDraft.status),
|
||||
owner: itemDraft.owner,
|
||||
note: itemDraft.note,
|
||||
evidence: item.evidence,
|
||||
evidenceRef: itemDraft.evidenceRef
|
||||
};
|
||||
}
|
||||
|
||||
function buildHandoffReport() {
|
||||
const header = [
|
||||
'# 保洁现场联调交接报告',
|
||||
|
||||
Reference in New Issue
Block a user