feat: 全项目列表页操作列规范统一 + 问题.md 六条整改

- 操作列按6条标准统一(WMS 13页/MES 18页):fixed right、宽160超限折更多、一列一填充、危险操作link+二次确认置末、页面级新建移工具栏
- 修复MES物料档案启用报错:改走 POST /product-types/status 专用端点,不再被全字段必填校验拦截
- 附件归档清理由按年改为用户选月(精确到月,截止月最晚6个月前,默认当前月-6),前后端同步
- 序列号文案统一为「是=逐件录SN,否=按数量(不录SN)」,MES 下拉改单选框
- 入库货架/层/位置必填校验(InboundEntry 前端 + inbound.go 后端),杜绝有区域无货架的新脏数据
- 生产流程卡新增列表Tab(新接口 GET /process-card/list 分页),去掉筛选默认时间
- 清理遗留 assets_bak/public_bak 备份目录;更新 WMS/MES 前端构建产物(index.html)
This commit is contained in:
SunYF
2026-10-10 18:09:17 +08:00
parent f6a26256c5
commit 56d56648f9
224 changed files with 687 additions and 1874 deletions
@@ -104,20 +104,34 @@ async function remove(row) {
// 空间清理抽屉(需求2):归拢归档 / 物理清理已删附件 / 日志清理(仅管理员)三项,
// 每项先「预检」(dryRun) 展示影响范围,再「执行」前二次确认。
const cleaner = reactive({ show: false, busy: '', purgePreview: null, logPreview: null, logDays: 30 })
const cleaner = reactive({ show: false, busy: '', purgePreview: null, logPreview: null, logDays: 30, archiveMonth: null })
// 归档截止月:精确到月,最近半年数据不可归档,最晚可选到 6 个月前
const archiveMax = (() => { const d = new Date(); d.setDate(1); d.setMonth(d.getMonth() - 6); d.setHours(0, 0, 0, 0); return d })()
function archiveMonthDisabled(date) {
return date.getTime() > archiveMax.getTime()
}
function archiveMonthEndTs(d) {
if (!d) return 0
const dt = new Date(d)
const last = new Date(dt.getFullYear(), dt.getMonth() + 1, 0, 23, 59, 59)
return Math.floor(last.getTime() / 1000)
}
function openCleaner() {
cleaner.show = true
cleaner.purgePreview = null
cleaner.logPreview = null
if (!cleaner.archiveMonth) cleaner.archiveMonth = new Date(archiveMax)
}
// 归档:把早于本地保留年数的附件备份到外部目录并标记归档
// 归档:把早于所选归档截止月(含当月)的附件备份到外部目录并标记归档
async function archive() {
const go = await confirmAction('将把早于「本地保留年数」的附件归档(备份到外部目录并标记,索引保留),是否继续?', '归档确认')
const before = archiveMonthEndTs(cleaner.archiveMonth)
if (!before) { ElMessage.warning('请选择归档截止月'); return }
const go = await confirmAction('将把创建时间早于所选归档截止月(含当月)的附件归档(备份到外部目录并标记,索引保留),是否继续?', '归档确认')
if (!go) return
cleaner.busy = 'archive'
try {
const d = await request.post('/attachments/archive', { dryRun: false })
const d = await request.post('/attachments/archive', { dryRun: false, archiveBefore: before })
ElMessage.success(`归档完成:移动 ${d?.moved || 0}、标记 ${d?.marked || 0}、失败 ${d?.failed || 0}`)
await load()
} finally {
@@ -249,8 +263,12 @@ onActivated(() => load())
</el-table-column>
<el-table-column label="操作" width="130" align="center" fixed="right">
<template #default="{ row }">
<el-button link type="primary" size="small" :disabled="row.deleted" @click="download(row)">下载</el-button>
<el-button v-if="can('attachment:manage')" link type="danger" size="small" :disabled="row.deleted" @click="remove(row)">删除</el-button>
<el-button type="primary" size="small" :disabled="row.deleted" @click="download(row)">下载</el-button>
<el-popconfirm v-if="can('attachment:manage')" title="确认删除该附件?" @confirm="remove(row)">
<template #reference>
<el-button link type="danger" size="small" :disabled="row.deleted">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
@@ -271,7 +289,12 @@ onActivated(() => load())
<el-card shadow="never" class="mb12">
<template #header><b>① 归档清理</b></template>
<p class="tip">把早于「本地保留年数」(默认 1 年)的附件备份到外部目录并标记已归档,释放本地空间(索引保留可追溯)。ArchiveDir 为空时仅标记不移动。</p>
<p class="tip">选择「归档截止月」(精确到月):将创建时间早于该月月底(含当月)的附件备份到外部目录并标记已归档,释放本地空间(索引保留可追溯)。ArchiveDir 为空时仅标记不移动。最近半年数据不可归档,截止月最晚只能选到 6 个月前。</p>
<el-form inline class="mb12">
<el-form-item label="归档截止月" required>
<el-date-picker v-model="cleaner.archiveMonth" type="month" placeholder="选择截止月" :disabled-date="archiveMonthDisabled" style="width:170px" />
</el-form-item>
</el-form>
<el-button type="warning" :loading="cleaner.busy === 'archive'" @click="archive">执行归档</el-button>
</el-card>