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
+5 -1
View File
@@ -228,7 +228,11 @@ onMounted(() => { loadDocks(); loadTasks(); loadMode() })
<el-table-column prop="remark" label="备注" min-width="140" show-overflow-tooltip />
<el-table-column label="操作" width="90" align="center" fixed="right">
<template #default="{ row }">
<el-button v-if="canCancel(row.status)" size="small" type="danger" plain @click="cancelTask(row)">取消</el-button>
<el-popconfirm v-if="canCancel(row.status)" title="确认取消该 AGV 任务?" @confirm="cancelTask(row)">
<template #reference>
<el-button size="small" type="danger" link>取消</el-button>
</template>
</el-popconfirm>
<span v-else>-</span>
</template>
</el-table-column>
@@ -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>
+15 -11
View File
@@ -428,7 +428,7 @@ async function saveMaterial() {
}
// 序列号=是(按 SN 记账)必选(2026-09-30 解耦定稿):0=未选择不可保存
if (![1, 2].includes(Number(mForm.snMode))) {
ElMessage.warning('请选择是否有序列号(是=逐件录 SN / 否=按批次数量)')
ElMessage.warning('请选择序列号(是=逐件录SN / 否=按数量(不录SN))')
return
}
const okSave = await confirmAction(
@@ -488,7 +488,7 @@ function matTypeText(m) {
}
// 序列号显示(记账语境:1是(序列号=是)/2否(序列号=否)/0未选择)
function snModeText(v) {
return Number(v) === 1 ? '是' : Number(v) === 2 ? '否' : '未选择'
return Number(v) === 1 ? '逐件录SN' : Number(v) === 2 ? '按数量(不录SN)' : '未选择'
}
// 区域维护 / 物料档案共用同一组件:切换菜单时复用,watch(mode, immediate) 保证进入即加载
@@ -620,7 +620,7 @@ async function onMaterialFile(e) {
</el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right">
<template #default="{ row }">
<el-button v-if="can('zone:edit') && !row.isSynthetic" link type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button>
<el-button v-if="can('zone:edit') && !row.isSynthetic" type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button>
<span v-else-if="row.isSynthetic" class="synthetic-tag">虚拟</span>
</template>
</el-table-column>
@@ -674,7 +674,7 @@ async function onMaterialFile(e) {
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
</el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right">
<template #default="{ row }"><el-button v-if="can('zone:edit') && !row.isSynthetic" link type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button><span v-else-if="row.isSynthetic" class="synthetic-tag">虚拟</span></template>
<template #default="{ row }"><el-button v-if="can('zone:edit') && !row.isSynthetic" type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button><span v-else-if="row.isSynthetic" class="synthetic-tag">虚拟</span></template>
</el-table-column>
</el-table>
<div class="pager">
@@ -726,7 +726,7 @@ async function onMaterialFile(e) {
<el-table-column label="状态" width="80" align="center"><template #default="{ row }"><el-tag :type="row.status === '停用' ? 'info' : 'success'" size="small">{{ row.status || '启用' }}</el-tag></template></el-table-column>
<el-table-column label="备注" min-width="130" show-overflow-tooltip><template #default="{ row }">{{ row.description || '-' }}</template></el-table-column>
<el-table-column label="创建时间" width="155" align="center"><template #default="{ row }">{{ fmtTime(row.createdAt) }}</template></el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right"><template #default="{ row }"><el-button v-if="can('zone:edit')" link type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button></template></el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right"><template #default="{ row }"><el-button v-if="can('zone:edit')" type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button></template></el-table-column>
</el-table>
<div class="pager">
<el-pagination background layout="total, sizes, prev, pager, next" :total="nodeState[3].total"
@@ -783,7 +783,7 @@ async function onMaterialFile(e) {
<el-table-column label="状态" width="80" align="center"><template #default="{ row }"><el-tag :type="row.status === '停用' ? 'info' : 'success'" size="small">{{ row.status || '启用' }}</el-tag></template></el-table-column>
<el-table-column label="备注" min-width="120" show-overflow-tooltip><template #default="{ row }">{{ row.description || '-' }}</template></el-table-column>
<el-table-column label="创建时间" width="155" align="center"><template #default="{ row }">{{ fmtTime(row.createdAt) }}</template></el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right"><template #default="{ row }"><el-button v-if="can('zone:edit')" link type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button></template></el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right"><template #default="{ row }"><el-button v-if="can('zone:edit')" type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button></template></el-table-column>
</el-table>
<div class="pager">
<el-pagination background layout="total, sizes, prev, pager, next" :total="nodeState[4].total"
@@ -1002,7 +1002,7 @@ async function onMaterialFile(e) {
</el-tag>
</template>
</el-table-column>
<el-table-column label="序列号" width="90" align="center">
<el-table-column label="序列号" width="130" align="center">
<template #default="{ row }">
<el-tag :type="Number(row.snMode) === 1 ? 'warning' : 'success'" size="small">
{{ snModeText(row.snMode) }}
@@ -1018,11 +1018,15 @@ async function onMaterialFile(e) {
<el-table-column label="创建时间" width="155" align="center">
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
</el-table-column>
<el-table-column label="操作" width="150" align="center">
<el-table-column label="操作" width="150" align="center" fixed="right">
<template #default="{ row }">
<el-button v-if="can('material:edit')" link type="primary" size="small" @click="openMatEdit(row)">编辑</el-button>
<el-button link :type="row.isActive !== false ? 'warning' : 'success'" size="small" @click="toggleMatStatus(row)">{{ row.isActive !== false ? '停用' : '启用' }}</el-button>
<el-button v-if="can('material:edit')" type="primary" size="small" @click="openMatEdit(row)">编辑</el-button>
<el-button link type="success" size="small" @click="openMatAttach(row)">附件</el-button>
<el-popconfirm :title="row.isActive !== false ? '确认停用该物料?' : '确认启用该物料?'" @confirm="toggleMatStatus(row)">
<template #reference>
<el-button link :type="row.isActive !== false ? 'warning' : 'success'" size="small">{{ row.isActive !== false ? '停用' : '启用' }}</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
@@ -1068,7 +1072,7 @@ async function onMaterialFile(e) {
<el-radio :value="1">是</el-radio>
<el-radio :value="2">否</el-radio>
</el-radio-group>
<span style="color:#909399;font-size:12px;margin-left:8px">是否有序列号:是=逐件录 SN,否=按批次数量(不录SN);选类型时自动带默认,可手动更改,未选择不可出入库</span>
<span style="color:#909399;font-size:12px;margin-left:8px">是=逐件录SN,否=按数量(不录SN)</span>
</div>
</el-form-item>
<el-form-item label="安全库存" required>
+15 -5
View File
@@ -415,14 +415,24 @@ onActivated(() => {
<el-tag v-else type="success" size="small">有效</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="235" align="center" fixed="right">
<el-table-column label="操作" width="160" align="center" fixed="right">
<template #default="{ row }">
<el-button link type="primary" size="small" @click="openDetail(row)">
<el-button type="primary" size="small" @click="openDetail(row)">
明细{{ row.detailCount ? '(' + row.detailCount + ')' : '' }}
</el-button>
<el-button link type="success" size="small" @click="openAttach(row)">附件</el-button>
<el-button v-if="can('inbound:void') && !row.voided" link type="danger" size="small"
@click="openVoid(row)">作废</el-button>
<el-popconfirm v-if="can('inbound:void') && !row.voided" title="确认作废该入库单?" @confirm="openVoid(row)">
<template #reference>
<el-button link type="danger" size="small">作废</el-button>
</template>
</el-popconfirm>
<el-dropdown trigger="click">
<el-button link type="primary" size="small">更多 ▾</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="openAttach(row)">附件</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
</el-table-column>
</el-table>
@@ -605,10 +605,10 @@ onMounted(() => {
<el-table-column label="入库时间" width="155" align="center">
<template #default="{ row }">{{ row.inboundTime ? fmtTime(row.inboundTime) : '-' }}</template>
</el-table-column>
<el-table-column label="操作" width="170" align="center" fixed="right">
<el-table-column label="操作" width="160" align="center" fixed="right">
<template #default="{ row }">
<el-button link type="primary" size="small" @click="openDetailDrawer(row)">查看明细</el-button>
<el-button link type="success" size="small" @click="sendWhole(row)">整单送检</el-button>
<el-button type="primary" size="small" @click="sendWhole(row)">整单送检</el-button>
</template>
</el-table-column>
</el-table>
@@ -907,7 +907,7 @@ onMounted(() => {
</el-table-column>
<el-table-column label="操作" width="160" align="center" fixed="right">
<template #default="{ row }">
<el-button v-if="row.status === '不合格'" link type="warning" size="small" @click="openDispose(row)">处置</el-button>
<el-button v-if="row.status === '不合格'" type="primary" size="small" @click="openDispose(row)">处置</el-button>
<el-button v-if="row.status === '不合格' && row.disposalType && row.disposalType !== 'NONE'" link type="primary" size="small" @click="openResult(row)">处理结果</el-button>
<el-button link type="success" size="small" @click="openAttach(row)">附件</el-button>
</template>
+1 -1
View File
@@ -448,7 +448,7 @@ onMounted(loadDicts)
<el-table-column label="状态" width="110" align="center">
<template #default="{ row }"><el-tag :type="statusTag(row.status)" size="small">{{ row.status }}</el-tag></template>
</el-table-column>
<el-table-column label="操作" width="140" align="center">
<el-table-column label="操作" width="140" align="center" fixed="right">
<template #default="{ row }">
<el-button v-if="row.status !== '领料完结'" type="primary" size="small" @click="autoAllocate(row)">一键分配出库</el-button>
<span v-else style="color:#67c23a">已完结</span>
@@ -240,12 +240,16 @@ function openDetail(row) {
<el-table-column label="创建时间" width="160" align="center">
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center" fixed="right">
<el-table-column label="操作" width="160" align="center" fixed="right">
<template #default="{ row }">
<el-button link type="primary" size="small" @click="openDetail(row)">详情</el-button>
<el-button v-if="can('role:edit')" link type="primary" size="small" :disabled="row.code === 'admin'" @click="openEdit(row)">编辑权限</el-button>
<el-button v-if="can('role:delete')" link type="danger" size="small"
:disabled="['admin', 'operator', 'inspector'].includes(row.code)" @click="removeRole(row)">删除</el-button>
<el-button v-if="can('role:edit')" type="primary" size="small" :disabled="row.code === 'admin'" @click="openEdit(row)">编辑权限</el-button>
<el-popconfirm v-if="can('role:delete')" title="确认删除该角色?" @confirm="removeRole(row)">
<template #reference>
<el-button link type="danger" size="small"
:disabled="['admin', 'operator', 'inspector'].includes(row.code)">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
@@ -503,11 +503,11 @@ const currentStep = computed(() => {
<el-table-column label="发起时间" width="160" align="center">
<template #default="{ row }">{{ fmtTime(row.createdAt) }}</template>
</el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right">
<template #default="{ row }">
<el-button link type="primary" size="small" @click="exportDetail(row)">导出明细</el-button>
</template>
</el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right">
<template #default="{ row }">
<el-button type="primary" size="small" @click="exportDetail(row)">导出明细</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</div>
@@ -247,13 +247,16 @@ onMounted(() => {
<el-table-column label="创建时间" width="155" align="center">
<template #default="{ row }">{{ row.createdAt ? fmtTime(row.createdAt) : '-' }}</template>
</el-table-column>
<el-table-column label="操作" width="210" align="center" fixed="right">
<el-table-column label="操作" width="150" align="center" fixed="right">
<template #default="{ row }">
<el-button link type="primary" size="small" @click="openDetail(row)">详情</el-button>
<el-button v-if="can('user:edit')" link type="primary" size="small" :disabled="row.username === 'admin'"
<el-button v-if="can('user:edit')" type="primary" size="small" :disabled="row.username === 'admin'"
@click="openEdit(row)">编辑</el-button>
<el-button v-if="can('user:delete')" link type="danger" size="small" :disabled="row.username === 'admin'"
@click="removeUser(row)">删除</el-button>
<el-popconfirm v-if="can('user:delete')" title="确认删除该账号?" @confirm="removeUser(row)">
<template #reference>
<el-button link type="danger" size="small" :disabled="row.username === 'admin'">删除</el-button>
</template>
</el-popconfirm>
</template>
</el-table-column>
</el-table>