feat: 两库对等物料管理及产品工号贯通全流程

- 新增 MES 本地物料表及双向同步接口,WMS 物料变更自动同步
- 全流程新增产品工号字段,贯通入库/库存/出库/检验环节
- 工单管理支持多工单混产,移除单工单互斥限制
- 新增批次号/SN 字段支持质量检验联动 WMS 库存处置
- 修复权限规则,仅内置管理员账号不允许修改删除
- 工位终端新增 SN 扫码自动切换所属工单功能
This commit is contained in:
SunYF
2026-09-29 14:55:03 +08:00
parent a229b6727a
commit 76c9b6a7e2
103 changed files with 9412 additions and 1726 deletions
+23 -12
View File
@@ -15,7 +15,7 @@ import { helpOutbound } from '../help'
const activeTab = ref('prep') // prep=备料出库 / general=通用出库 / records=出库记录
const operator = getRealName()
/* ===================== 备料出库(MES 工单台账) ===================== */
/* ===================== 备料出库(WMS 工单备料台账,由 MES 备料单同步) ===================== */
const queryForm = reactive({ orderNo: '' })
// 目标工位:AGV 配送 toDock 参数,DOCK01~DOCK20 下拉选填(不选默认产线入口 DOCK01)
const targetDock = ref('')
@@ -117,9 +117,9 @@ const CATEGORY_OPTIONS = [
{ value: 'deliver', label: '发货' },
{ value: 'other', label: '其他' }
]
// 归属口径(需求22):工单编号/科技项目号/其他,默认其他;工单编号是独立维度标签,非 MES 工单号
// 归属口径(需求22):合同号/科技项目号/其他,默认其他;合同号是独立维度标签,非 MES 工单号
const OWNERSHIP_OPTIONS = [
{ value: 'workorder', label: '工单编号' },
{ value: 'workorder', label: '合同号' },
{ value: 'project', label: '科技项目号' },
{ value: 'other', label: '其他' }
]
@@ -293,7 +293,7 @@ async function submitGen() {
if (!genForm.materialCode) { ElMessage.warning('请选择物料'); return }
if (!genForm.outboundCategory) { ElMessage.warning('请选择出库类别'); return }
if (genForm.ownershipType !== 'other' && !genForm.ownershipNo.trim()) {
ElMessage.warning('请填写归属编号(工单编号 / 科技项目号)'); return
ElMessage.warning('请填写归属编号(合同号 / 科技项目号)'); return
}
if (genForm.outboundCategory === 'other' && !genForm.remark.trim()) {
ElMessage.warning('出库类别选「其他」时,请在备注中填写具体原因'); return
@@ -350,7 +350,7 @@ function recDefaultRange() {
const end = new Date(); const start = new Date(); start.setMonth(start.getMonth() - 3)
return [fmt(start), fmt(end)]
}
const recFilters = reactive({ outboundType: '', status: '', materialCode: '', boxNo: '', ownershipNo: '', inspectionNo: '', dateRange: recDefaultRange() })
const recFilters = reactive({ outboundType: '', status: '', materialCode: '', boxNo: '', ownershipNo: '', inspectionNo: '', productWorkNo: '', dateRange: recDefaultRange() })
const recRows = ref([])
const recTotal = ref(0)
const loadingRec = ref(false)
@@ -368,6 +368,7 @@ async function loadRecords() {
boxNo: recFilters.boxNo.trim(),
ownershipNo: recFilters.ownershipNo.trim(),
inspectionNo: recFilters.inspectionNo.trim(),
productWorkNo: recFilters.productWorkNo.trim(),
page: recPage.current, pageSize: recPage.size
}
if (Array.isArray(recFilters.dateRange) && recFilters.dateRange.length === 2) {
@@ -380,7 +381,7 @@ async function loadRecords() {
} finally { loadingRec.value = false }
}
function searchRec() { recPage.current = 1; loadRecords() }
function resetRec() { Object.assign(recFilters, { outboundType: '', status: '', materialCode: '', boxNo: '', ownershipNo: '', dateRange: recDefaultRange() }); searchRec() }
function resetRec() { Object.assign(recFilters, { outboundType: '', status: '', materialCode: '', boxNo: '', ownershipNo: '', inspectionNo: '', productWorkNo: '', dateRange: recDefaultRange() }); searchRec() }
function downloadCSV() {
// 时间窗口与列表保持一致:未选/已清空时回落近 3 个月,保证确认框条数 = 实际导出条数
@@ -392,6 +393,7 @@ function downloadCSV() {
boxNo: recFilters.boxNo.trim(),
ownershipNo: recFilters.ownershipNo.trim(),
inspectionNo: recFilters.inspectionNo.trim(),
productWorkNo: recFilters.productWorkNo.trim(),
startDate: dr[0],
endDate: dr[1]
}, '出库管理.xlsx', { countUrl: '/outbound/query', name: '出库记录' })
@@ -410,10 +412,10 @@ onMounted(loadDicts)
<template>
<div>
<el-tabs v-model="activeTab" @tab-change="onTabChange">
<!-- ============ 备料出库(MES 工单台账驱动) ============ -->
<el-tab-pane label="工单备料出库(MES)" name="prep">
<!-- ============ 备料出库(WMS 工单备料台账,由 MES 备料单同步) ============ -->
<el-tab-pane label="工单领料出库(操作)" name="prep">
<el-alert type="info" :closable="false" class="mb12"
title="本页对接 MES 工单台账:输入 MES 工单号查询其物料台账并领料。"
title="本页按 MES 工单号查询 WMS 工单备料台账(由 MES 备料单同步),按缺口一键领料;工单号下拉来自 MES 实时工单。"
description="未启用 MES 或工单未同步时,工单下拉可能为空——此时可直接手输工单号(前提是台账已同步),或改用「通用出库」处理退料/样品/报废/发货等不挂靠工单的场景。" />
<el-card shadow="never" class="mb12">
<el-form inline label-width="90px" @submit.prevent>
@@ -506,7 +508,7 @@ onMounted(loadDicts)
<el-option v-for="o in OWNERSHIP_OPTIONS" :key="o.value" :value="o.value" :label="o.label" />
</el-select>
<el-input v-if="genForm.ownershipType !== 'none'" v-model="genForm.ownershipNo"
placeholder="归属编号(工单号/科技项目号/其他)" clearable style="width:260px" />
placeholder="归属编号(合同号/科技项目号/其他)" clearable style="width:260px" />
</el-form-item>
<el-form-item label="目标工位">
<el-select v-model="genForm.targetStation" filterable clearable
@@ -604,12 +606,15 @@ onMounted(loadDicts)
<el-table-column prop="quantity" label="数量" width="80" align="center" />
<el-table-column label="归属" min-width="130">
<template #default="{ row }">
<span v-if="row.ownershipType === 'workorder'">工单编号 {{ row.ownershipNo || '' }}</span>
<span v-if="row.ownershipType === 'workorder'">合同号 {{ row.ownershipNo || '' }}</span>
<span v-else-if="row.ownershipType === 'project'">科技项目号 {{ row.ownershipNo || '' }}</span>
<span v-else-if="row.ownershipType === 'other'">其他 {{ row.ownershipNo || '' }}</span>
<span v-else>其他</span>
</template>
</el-table-column>
<el-table-column label="产品工号" min-width="110" align="center">
<template #default="{ row }">{{ row.productWorkNo || '-' }}</template>
</el-table-column>
<el-table-column prop="targetStation" label="目标工位" width="100" align="center">
<template #default="{ row }">{{ row.targetStation || '-' }}</template>
</el-table-column>
@@ -662,6 +667,9 @@ onMounted(loadDicts)
<el-form-item label="检测单号">
<el-input v-model="recFilters.inspectionNo" placeholder="检测单号(模糊)" clearable style="width:180px" @keyup.enter="searchRec" />
</el-form-item>
<el-form-item label="产品工号">
<el-input v-model="recFilters.productWorkNo" placeholder="产品工号(模糊)" clearable style="width:180px" @keyup.enter="searchRec" />
</el-form-item>
<el-form-item label="时间">
<el-date-picker v-model="recFilters.dateRange" type="daterange" value-format="YYYY-MM-DD"
range-separator="至" start-placeholder="开始" end-placeholder="结束" style="width:240px" />
@@ -711,12 +719,15 @@ onMounted(loadDicts)
<el-table-column prop="quantity" label="数量" width="70" align="center" />
<el-table-column label="归属" min-width="130">
<template #default="{ row }">
<span v-if="row.ownershipType === 'workorder'">工单编号 {{ row.ownershipNo || '' }}</span>
<span v-if="row.ownershipType === 'workorder'">合同号 {{ row.ownershipNo || '' }}</span>
<span v-else-if="row.ownershipType === 'project'">科技项目号 {{ row.ownershipNo || '' }}</span>
<span v-else-if="row.ownershipType === 'other'">其他 {{ row.ownershipNo || '' }}</span>
<span v-else>其他</span>
</template>
</el-table-column>
<el-table-column label="产品工号" min-width="110" align="center">
<template #default="{ row }">{{ row.productWorkNo || '-' }}</template>
</el-table-column>
<el-table-column prop="targetStation" label="目标工位" width="100" align="center">
<template #default="{ row }">{{ row.targetStation || '-' }}</template>
</el-table-column>