docs(business): 生成业务契约文档并重构MES客户端代码
- 创建案例.md文档,包含业务场景清单、业务流程、案例和回归测试三份完整文档 - WMS库房管理系统涵盖入库、出库、库存、检验、盘点等24个业务场景 - MES产线控制系统包含工单、排产、BOM、备料、质检、追溯等23个业务场景 - 工位终端系统支持上线、报工、下线、领料、巡检等15个现场作业场景 - 主链路从合同到成品入库,异常链路处理不合格、数量不符、退料等情况 - 删除MES客户端中的ScanRecord相关代码,精简客户端结构 - 更新客户端初始化逻辑,移除扫描记录相关的依赖注入配置
This commit is contained in:
@@ -55,6 +55,7 @@ const f2Shelf = ref([]); const f3Shelf = ref([]); const f3Layer = ref([])
|
||||
const f4Shelf = ref([]); const f4Layer = ref([])
|
||||
const cShelf = ref([]); const cLayer = ref([])
|
||||
const bShelf = ref([])
|
||||
const lbShelf = ref([])
|
||||
|
||||
async function picker(level, params) {
|
||||
const data = await request.get('/zone/picker', { params: { level, ...params } })
|
||||
@@ -239,6 +240,47 @@ async function submitBatch() {
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 区域维护:层批量生成 ---------- */
|
||||
const layerBatchDialog = ref(false)
|
||||
const layerBatchForm = reactive({ zoneCode: '', shelfNo: '', layerStart: 1, layerEnd: 1 })
|
||||
const layerBatchPreview = ref([])
|
||||
const layerBatchPreviewing = ref(false)
|
||||
const layerBatchSubmitting = ref(false)
|
||||
|
||||
function openLayerBatchGen() {
|
||||
Object.assign(layerBatchForm, { zoneCode: '', shelfNo: '', layerStart: 1, layerEnd: 1 })
|
||||
layerBatchPreview.value = []
|
||||
layerBatchDialog.value = true
|
||||
}
|
||||
async function onLayerBatchRegionChange() {
|
||||
layerBatchForm.shelfNo = ''
|
||||
await loadShelfOpts(lbShelf, layerBatchForm.zoneCode)
|
||||
}
|
||||
async function previewLayerBatch() {
|
||||
if (!layerBatchForm.zoneCode || !layerBatchForm.shelfNo) { ElMessage.warning('请选择区域与货架'); return }
|
||||
layerBatchPreviewing.value = true
|
||||
try {
|
||||
const data = await request.post('/zone/batch-generate', { ...layerBatchForm, level: 3, preview: true })
|
||||
layerBatchPreview.value = data?.list || []
|
||||
} finally {
|
||||
layerBatchPreviewing.value = false
|
||||
}
|
||||
}
|
||||
async function submitLayerBatch() {
|
||||
const go = await confirmAction(`已预检 ${layerBatchPreview.value.length} 个层,确认批量生成到库位表?(已存在的自动跳过)`, '批量生成确认')
|
||||
if (!go) return
|
||||
layerBatchSubmitting.value = true
|
||||
try {
|
||||
const data = await request.post('/zone/batch-generate', { ...layerBatchForm, level: 3, preview: false })
|
||||
ElMessage.success(`已生成 ${data?.created || 0} 个层,跳过已存在 ${data?.skipped || 0} 个`)
|
||||
layerBatchDialog.value = false
|
||||
zoneTabLoaded[3] = false
|
||||
if (activeZoneTab.value === 3) await loadNodes(3)
|
||||
} finally {
|
||||
layerBatchSubmitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 物料档案维护 ---------- */
|
||||
const materials = ref([])
|
||||
const materialTotal = ref(0)
|
||||
@@ -411,8 +453,11 @@ async function exportMaterials() {
|
||||
name: matFilter.name.trim(),
|
||||
spec: matFilter.spec.trim(),
|
||||
manageMode: matFilter.manageMode,
|
||||
itemType: matFilter.itemType
|
||||
}, '物料档案.xlsx')
|
||||
itemType: matFilter.itemType,
|
||||
startDate: matFilter.startDate,
|
||||
endDate: matFilter.endDate
|
||||
}, '物料档案.xlsx', { countUrl: '/material/query', name: '物料档案' })
|
||||
if (!name) return
|
||||
ElMessage.success('已导出:' + name)
|
||||
} catch (e) {
|
||||
ElMessage.error('导出失败:' + (e?.message || e))
|
||||
@@ -603,6 +648,7 @@ async function onMaterialFile(e) {
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="nodeState[3].loading" @click="searchNodes(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>
|
||||
</el-form>
|
||||
<el-table :data="nodeState[3].list" border size="small" v-loading="nodeState[3].loading" row-key="id" empty-text="暂无层">
|
||||
@@ -763,6 +809,41 @@ async function onMaterialFile(e) {
|
||||
共 {{ batchPreview.length }} 个位置,其中已存在 {{ batchPreview.filter(x=>x.exists).length }} 个(生成时自动跳过)。
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 层批量生成弹窗 -->
|
||||
<el-dialog v-model="layerBatchDialog" title="批量生成层" width="640px" append-to-body destroy-on-close>
|
||||
<el-form label-width="90px">
|
||||
<el-form-item label="区域" required>
|
||||
<el-select v-model="layerBatchForm.zoneCode" placeholder="请选择区域" filterable style="width:100%" @change="onLayerBatchRegionChange">
|
||||
<el-option v-for="r in regionOptions" :key="r.code" :value="r.code" :label="r.code + (r.zoneName ? ' '+r.zoneName : '')" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="货架" required>
|
||||
<el-select v-model="layerBatchForm.shelfNo" placeholder="请选择货架" filterable :disabled="!layerBatchForm.zoneCode" style="width:100%">
|
||||
<el-option v-for="s in lbShelf" :key="s.code" :value="s.code" :label="s.code" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="层范围">
|
||||
<el-input-number v-model="layerBatchForm.layerStart" :min="0" :step="1" step-strictly controls-position="right" style="width:120px" />
|
||||
<span style="margin:0 8px">至</span>
|
||||
<el-input-number v-model="layerBatchForm.layerEnd" :min="0" :step="1" step-strictly controls-position="right" style="width:120px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :loading="layerBatchPreviewing" @click="previewLayerBatch">预览</el-button>
|
||||
<el-button type="success" :loading="layerBatchSubmitting" :disabled="!layerBatchPreview.length" @click="submitLayerBatch">确认生成</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-if="layerBatchPreview.length" :data="layerBatchPreview" border size="small" max-height="300">
|
||||
<el-table-column prop="layerNo" label="层号" width="90" align="center" />
|
||||
<el-table-column prop="layerName" label="层名称" min-width="200" />
|
||||
<el-table-column label="是否已存在" width="110" align="center">
|
||||
<template #default="{ row }"><el-tag :type="row.exists ? 'info' : 'success'" size="small">{{ row.exists ? '已存在' : '新增' }}</el-tag></template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div v-if="layerBatchPreview.length" style="color:#909399;font-size:12px;margin-top:6px">
|
||||
共 {{ layerBatchPreview.length }} 个层,其中已存在 {{ layerBatchPreview.filter(x=>x.exists).length }} 个(生成时自动跳过)。
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<!-- 物料档案 -->
|
||||
|
||||
Reference in New Issue
Block a user