docs: 统一修正全项目“SN管理”相关术语为“序列号”

本次 commit 统一修正了全项目范围内关于 SN 管理的术语表述,将原“SN管理”、“序列号件”、“批次件”等表述调整为“序列号”、“序列号=是”、“序列号=否”,同时同步更新了相关文档、代码注释、前端提示文本、数据库 schema 注释、API 文档等,确保全链路术语统一,消除理解歧义。
This commit is contained in:
SunYF
2026-10-10 15:58:59 +08:00
parent b032f47fc7
commit 8be6e03a15
335 changed files with 5742 additions and 1616 deletions
+62 -20
View File
@@ -108,6 +108,11 @@ function searchNodes(level) {
loadNodes(level)
}
function resetNodes(level) {
Object.assign(nodeState[level].filter, { zoneCode: '', shelfNo: '', layerNo: '', code: '', name: '', status: '' })
searchNodes(level)
}
// 筛选区:区域/货架/层 联动
async function onFilterRegion(level) {
const zc = nodeState[level].filter.zoneCode
@@ -302,7 +307,7 @@ const materials = ref([])
const materialTotal = ref(0)
const materialLoading = ref(false)
const matFilter = reactive({
materialCode: '', name: '', spec: '', manageMode: '', itemType: '', startDate: '', endDate: ''
materialCode: '', name: '', spec: '', manageMode: '', itemType: '', isActive: '', startDate: '', endDate: ''
})
const matPage = reactive({ current: 1, size: 10 })
@@ -315,11 +320,21 @@ const mForm = reactive({
})
const mSaving = ref(false)
// 类型默认联动(2026-09-30 类型与SN行为解耦):电气件→序列号件(1),结构件/其他→批次件(2);用户可手动改
// 类型默认联动(2026-09-30 类型与SN行为解耦):电气件→序列号=是(逐件录SN),结构件/其他→序列号=否(按批次数量);用户可手动改
function onMatTypeChange() {
mForm.snMode = Number(mForm.manageMode) === 2 ? 1 : 2
}
// 条11③:物料档案操作列独立「启用/停用」按钮(走专用启停接口,不经全字段编辑)
async function toggleMatStatus(row) {
const target = row.isActive === false
try {
await request.post('/material/toggle-status', { id: row.id, isActive: target })
ElMessage.success(target ? '已启用' : '已停用')
loadMaterials()
} catch { /* request 层已提示 */ }
}
async function loadMaterials() {
materialLoading.value = true
try {
@@ -330,6 +345,7 @@ async function loadMaterials() {
spec: matFilter.spec.trim(),
manageMode: matFilter.manageMode,
itemType: matFilter.itemType,
isActive: matFilter.isActive,
startDate: matFilter.startDate,
endDate: matFilter.endDate,
page: matPage.current,
@@ -348,6 +364,12 @@ function searchMaterials() {
loadMaterials()
}
function resetMatFilter() {
Object.assign(matFilter, { materialCode: '', name: '', spec: '', manageMode: '', itemType: '', startDate: '', endDate: '' })
matPage.current = 1
loadMaterials()
}
function resetMForm() {
mEditingId.value = 0
Object.assign(mForm, {
@@ -359,7 +381,7 @@ function resetMForm() {
function openMatCreate() {
resetMForm()
onMatTypeChange() // 新增默认按类型联动带出序列号件/批次件
onMatTypeChange() // 新增默认按类型联动带出序列号=是(按 SN 记账)/序列号=否(按批次记账)
matDialog.value = true
}
@@ -397,16 +419,16 @@ async function saveMaterial() {
}
}
if (!Number(mForm.itemType)) {
ElMessage.warning('品类为必填项')
ElMessage.warning('物料类别为必填项')
return
}
if (![1, 2, 3].includes(Number(mForm.manageMode))) {
ElMessage.warning('类型为必填项')
return
}
// 序列号件必选(2026-09-30 解耦定稿):0=未选择不可保存
// 序列号=是(按 SN 记账)必选(2026-09-30 解耦定稿):0=未选择不可保存
if (![1, 2].includes(Number(mForm.snMode))) {
ElMessage.warning('请选择是否有序列号(是=序列号件 / 否=批次件)')
ElMessage.warning('请选择是否有序列号(是=逐件录 SN / 否=按批次数量)')
return
}
const okSave = await confirmAction(
@@ -416,7 +438,7 @@ async function saveMaterial() {
if (!okSave) return
mSaving.value = true
try {
// 类型(1结构件/2电气件/3其他)与品类相互独立,原样提交;snMode(1序列号件/2批次件)独立提交
// 类型(1结构件/2电气件/3其他)与物料类别相互独立,原样提交;snMode(1序列号=是/2序列号=否)独立提交
const base = {
name: String(mForm.name || '').trim(),
spec: String(mForm.spec || '').trim(),
@@ -451,7 +473,7 @@ function openMatAttach(row) {
Object.assign(attachDrawer, { visible: true, code: row.code, name: row.name })
}
// 品类显示(1原材料/3成品/4其他;半成品不是物料品类,防御性保留显示)
// 物料类别显示(1原材料/3成品/4其他;半成品不是物料类别,防御性保留显示)
function itemTypeText(t) {
return t === 3 ? '成品' : t === 4 ? '其他' : '原材料'
}
@@ -464,7 +486,7 @@ function matTypeText(m) {
if (m === 3) return '其他'
return m === 2 ? '电气件' : '结构件'
}
// 序列号显示(记账语境:1是(序列号件)/2否(批次件)/0未选择)
// 序列号显示(记账语境:1是(序列号=是)/2否(序列号=否)/0未选择)
function snModeText(v) {
return Number(v) === 1 ? '是' : Number(v) === 2 ? '否' : '未选择'
}
@@ -490,6 +512,7 @@ async function exportMaterials() {
spec: matFilter.spec.trim(),
manageMode: matFilter.manageMode,
itemType: matFilter.itemType,
isActive: matFilter.isActive,
startDate: matFilter.startDate,
endDate: matFilter.endDate
}, '物料档案.xlsx', { countUrl: '/material/query', name: '物料档案' })
@@ -569,16 +592,20 @@ async function onMaterialFile(e) {
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="nodeState[1].loading" @click="searchNodes(1)">查询</el-button>
<el-button @click="resetNodes(1)">重置</el-button>
<el-button v-if="can('zone:create')" type="success" @click="openNodeCreate(1)">新增区域</el-button>
</el-form-item>
</el-form>
<el-table :data="nodeState[1].list" border size="small" v-loading="nodeState[1].loading" row-key="id" empty-text="暂无区域,请点击【新增区域】">
<el-table :data="nodeState[1].list" border size="small" v-loading="nodeState[1].loading" row-key="id" empty-text="暂无区域,请点击【新增区域】" :row-class-name="row => row.isSynthetic ? 'synthetic-row' : ''">
<el-table-column prop="code" label="区域编码" min-width="110" />
<el-table-column label="区域名称" min-width="140">
<template #default="{ row }">{{ row.zoneName || row.name || '-' }}</template>
</el-table-column>
<el-table-column label="实时库存" width="100" align="center">
<template #default="{ row }"><el-tag size="small" :type="row.stockQty > 0 ? 'success' : 'info'">{{ row.stockQty || 0 }}</el-tag></template>
<el-table-column label="实时库存" width="120" align="center">
<template #default="{ row }">
<el-tag size="small" :type="row.stockQty > 0 ? 'success' : 'info'">{{ row.stockQty || 0 }}</el-tag>
<div v-if="row.unshelvedQty > 0" class="unshelved-warn">⚠ 未上架 {{ row.unshelvedQty }}</div>
</template>
</el-table-column>
<el-table-column label="状态" width="80" align="center">
<template #default="{ row }">
@@ -593,7 +620,8 @@ 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')" link type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button>
<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>
</el-table-column>
</el-table>
@@ -627,10 +655,11 @@ async function onMaterialFile(e) {
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="nodeState[2].loading" @click="searchNodes(2)">查询</el-button>
<el-button @click="resetNodes(2)">重置</el-button>
<el-button v-if="can('zone:create')" type="success" @click="openNodeCreate(2)">新增货架</el-button>
</el-form-item>
</el-form>
<el-table :data="nodeState[2].list" border size="small" v-loading="nodeState[2].loading" row-key="id" empty-text="暂无货架">
<el-table :data="nodeState[2].list" border size="small" v-loading="nodeState[2].loading" row-key="id" empty-text="暂无货架" :row-class-name="row => row.isSynthetic ? 'synthetic-row' : ''">
<el-table-column label="区域" min-width="130">
<template #default="{ row }">{{ row.zoneName || row.zoneCode || '-' }}</template>
</el-table-column>
@@ -645,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')" link type="primary" size="small" @click="openNodeEdit(row)">编辑</el-button></template>
<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>
</el-table-column>
</el-table>
<div class="pager">
@@ -683,6 +712,7 @@ async function onMaterialFile(e) {
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="nodeState[3].loading" @click="searchNodes(3)">查询</el-button>
<el-button @click="resetNodes(3)">重置</el-button>
<el-button v-if="can('zone:create')" type="success" @click="openNodeCreate(3)">新增层</el-button>
<el-button v-if="can('zone:create')" type="warning" @click="openLayerBatchGen">批量生成层</el-button>
</el-form-item>
@@ -738,6 +768,7 @@ async function onMaterialFile(e) {
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="nodeState[4].loading" @click="searchNodes(4)">查询</el-button>
<el-button @click="resetNodes(4)">重置</el-button>
<el-button v-if="can('zone:create')" type="success" @click="openNodeCreate(4)">新增位置号</el-button>
<el-button v-if="can('zone:create')" type="warning" @click="openBatchGen">批量生成</el-button>
</el-form-item>
@@ -916,13 +947,19 @@ async function onMaterialFile(e) {
<el-option label="其他" :value="3" />
</el-select>
</el-form-item>
<el-form-item label="品类">
<el-form-item label="物料类别">
<el-select v-model="matFilter.itemType" placeholder="全部" clearable style="width:120px" @change="searchMaterials">
<el-option label="原材料" :value="1" />
<el-option label="成品" :value="3" />
<el-option label="其他" :value="4" />
</el-select>
</el-form-item>
<el-form-item label="启用">
<el-select v-model="matFilter.isActive" placeholder="全部" clearable style="width:100px" @change="searchMaterials">
<el-option label="启用" value="true" />
<el-option label="停用" value="false" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker v-model="matFilter.startDate" type="date" value-format="YYYY-MM-DD" placeholder="开始"
style="width:130px" @change="searchMaterials" />
@@ -932,10 +969,11 @@ async function onMaterialFile(e) {
</el-form-item>
<el-form-item>
<el-button type="primary" :loading="materialLoading" @click="searchMaterials">查询</el-button>
<el-button @click="resetMatFilter">重置</el-button>
<el-button v-if="can('material:create')" type="success" @click="openMatCreate">新增物料档案</el-button>
<el-button v-if="can('material:import')" type="warning" :loading="matImporting" @click="pickMaterialFile">导入</el-button>
<el-button v-if="can('material:export')" :loading="matExporting" @click="exportMaterials">导出</el-button>
<el-tooltip v-if="can('material:import')" content="Excel 首行表头按名称识别(列顺序可变、可含多余列):图号 | 名称 | 规格 | 单位 | 类型(结构件/电气件/其他) | 品类(原材料/成品/其他,可选;半成品不是物料品类) | 说明(除「说明」「品类」外均为必填)">
<el-tooltip v-if="can('material:import')" content="Excel 首行表头按名称识别(列顺序可变、可含多余列):图号 | 名称 | 规格 | 单位 | 类型(结构件/电气件/其他) | 物料类别(原材料/成品/其他,可选;半成品不是物料类别) | 说明(除「说明」「物料类别」外均为必填)">
<el-link type="info" :underline="false" style="margin-left:4px">导入说明</el-link>
</el-tooltip>
<input ref="matFileRef" type="file" accept=".xlsx,.xls" style="display:none" @change="onMaterialFile" />
@@ -952,7 +990,7 @@ async function onMaterialFile(e) {
<el-table-column prop="unit" label="单位" width="70" align="center">
<template #default="{ row }">{{ row.unit || '-' }}</template>
</el-table-column>
<el-table-column label="品类" width="90" align="center">
<el-table-column label="物料类别" width="90" align="center">
<template #default="{ row }">
<el-tag :type="itemTypeTagType(row.itemType)" size="small">{{ itemTypeText(row.itemType) }}</el-tag>
</template>
@@ -983,6 +1021,7 @@ async function onMaterialFile(e) {
<el-table-column label="操作" width="150" align="center">
<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 link type="success" size="small" @click="openMatAttach(row)">附件</el-button>
</template>
</el-table-column>
@@ -1009,7 +1048,7 @@ async function onMaterialFile(e) {
<el-form-item label="单位" required>
<el-input v-model="mForm.unit" placeholder="如 个/套" clearable />
</el-form-item>
<el-form-item label="品类" required>
<el-form-item label="物料类别" required>
<el-select v-model="mForm.itemType" placeholder="请选择" style="width:100%">
<el-option :value="1" label="原材料" />
<el-option :value="3" label="成品" />
@@ -1029,7 +1068,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>
@@ -1063,4 +1102,7 @@ async function onMaterialFile(e) {
<style scoped>
.pager { display: flex; justify-content: flex-end; margin-top: 10px; }
.unshelved-warn { color: #e6a23c; font-size: 12px; line-height: 1.4; margin-top: 2px; }
.synthetic-row { background: #f5f7fa !important; color: #909399; }
.synthetic-tag { color: #c0c4cc; font-size: 12px; }
</style>