feat: 完成产线与仓储系统多模块迭代升级
本次迭代覆盖MES与WMS核心业务: 1. 新增接驳台托盘传感器读取与AGV对接能力 2. 完善工单排产、备料流程与权限体系拆分 3. 优化看板接口与前端路由、样式 4. 新增操作日志、库存盘点与角色保护逻辑 5. 修复代理地址、BOM保存等已知问题
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<el-table :data="flows" border size="small">
|
||||
<el-table-column prop="id" label="ID" width="60" />
|
||||
<el-table-column prop="name" label="流程名" min-width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="stationNo" label="工位号" width="90" align="center" />
|
||||
<el-table-column prop="stationNo" label="工序编号" width="100" align="center" />
|
||||
<el-table-column label="PDF" width="90" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="row.pdfFile" link type="primary" @click="previewPdf(row.pdfFile)">预览</el-button>
|
||||
@@ -29,8 +29,16 @@
|
||||
<el-tag :type="row.status === 'ACTIVE' ? 'success' : 'info'">{{ statusText(row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="绑定工位" min-width="120">
|
||||
<template #default="{ row }">{{ (row.stations || []).map(s => `工位${s}`).join('、') || '-' }}</template>
|
||||
<el-table-column label="绑定工位" min-width="150">
|
||||
<template #default="{ row }">
|
||||
<el-popover v-if="(row.stations || []).length" placement="top" :width="220" trigger="hover">
|
||||
<template #reference>
|
||||
<el-tag size="small" type="success">{{ (row.stations || []).length }} 个工位</el-tag>
|
||||
</template>
|
||||
<div style="line-height:1.9">{{ (row.stations || []).map(s => `工位${s}`).join('、') }}</div>
|
||||
</el-popover>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="步骤" min-width="120">
|
||||
<template #default="{ row }">
|
||||
@@ -71,8 +79,14 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="工位号" required>
|
||||
<el-select v-model="flowDlg.stationNo" placeholder="请选择工位号(固定12个)" style="width:100%">
|
||||
<el-form-item label="工序编号" required>
|
||||
<el-input-number v-model="flowDlg.stationNo" :min="1" :max="12" style="width:100%" />
|
||||
<div style="color:#909399;font-size:12px;line-height:1.4">该流程承载的工序编号(1~12)</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="绑定工位" required>
|
||||
<el-select v-model="flowDlg.stations" multiple collapse-tags placeholder="可多选工位:一个工位同一时刻只能绑一个启用流程,一个流程可绑多个工位" style="width:100%">
|
||||
<el-option v-for="i in 12" :key="i" :label="`工位${i}`" :value="i" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -292,7 +306,7 @@ async function onPdfChange(e) {
|
||||
}
|
||||
|
||||
const flowDlg = reactive({
|
||||
show: false, id: 0, name: '', stationNo: 1, pdfFile: '', status: 'ACTIVE',
|
||||
show: false, id: 0, name: '', stationNo: 1, stations: [], pdfFile: '', status: 'ACTIVE',
|
||||
remark: '', uploading: false, steps: []
|
||||
})
|
||||
|
||||
@@ -301,6 +315,7 @@ function openFlow(row) {
|
||||
flowDlg.id = row.id
|
||||
flowDlg.name = row.name || ''
|
||||
flowDlg.stationNo = row.stationNo || 1
|
||||
flowDlg.stations = (row.stations && row.stations.length) ? [...row.stations] : [row.stationNo || 1]
|
||||
flowDlg.pdfFile = row.pdfFile || ''
|
||||
flowDlg.status = row.status || 'ACTIVE'
|
||||
flowDlg.remark = row.remark || ''
|
||||
@@ -315,7 +330,7 @@ function openFlow(row) {
|
||||
}))
|
||||
} else {
|
||||
Object.assign(flowDlg, {
|
||||
id: 0, name: '', stationNo: 1, pdfFile: '', status: 'ACTIVE', remark: '', steps: []
|
||||
id: 0, name: '', stationNo: 1, stations: [1], pdfFile: '', status: 'ACTIVE', remark: '', steps: []
|
||||
})
|
||||
}
|
||||
if (!flowDlg.steps.length) flowDlg.steps.push(blankStep(1))
|
||||
@@ -361,11 +376,13 @@ function saveCriteria() {
|
||||
|
||||
async function saveFlow() {
|
||||
if (!flowDlg.name) return ElMessage.warning('请填写流程名')
|
||||
if (!flowDlg.stationNo) return ElMessage.warning('请选择工位号(1~12)')
|
||||
if (!flowDlg.stationNo) return ElMessage.warning('请选择工序编号(1~12)')
|
||||
if (!flowDlg.stations || !flowDlg.stations.length) return ElMessage.warning('请至少选择一个绑定工位')
|
||||
const body = {
|
||||
id: flowDlg.id || undefined,
|
||||
name: flowDlg.name,
|
||||
stationNo: flowDlg.stationNo,
|
||||
stations: flowDlg.stations,
|
||||
pdfFile: flowDlg.pdfFile,
|
||||
status: flowDlg.status,
|
||||
remark: flowDlg.remark,
|
||||
@@ -385,7 +402,7 @@ async function saveFlow() {
|
||||
}
|
||||
|
||||
async function delFlow(row) {
|
||||
await ElMessageBox.confirm('确认删除该工艺流程?有工位绑定时将无法删除。', '提示', { type: 'warning' })
|
||||
await ElMessageBox.confirm('确认删除该工艺流程?删除将同时解除其绑定的工位。', '提示', { type: 'warning' })
|
||||
await request.delete(`/process-flows/${row.id}`)
|
||||
ElMessage.success('删除成功')
|
||||
loadFlows()
|
||||
@@ -396,11 +413,11 @@ async function toggleStatus(row) {
|
||||
const action = toStatus === 'INACTIVE' ? '停用' : '启用'
|
||||
if (toStatus === 'INACTIVE') {
|
||||
await ElMessageBox.confirm(
|
||||
`确认停用「${row.name}」?停用后将自动解除工位${row.stationNo || ''}的绑定,且该流程不可再被工位使用。`,
|
||||
`确认停用「${row.name}」?停用后绑定该流程的工位将不再加载其作业步骤(绑定关系保留,启用后自动恢复)。`,
|
||||
'提示', { type: 'warning' })
|
||||
} else {
|
||||
await ElMessageBox.confirm(
|
||||
`确认启用「${row.name}」?启用后将自动绑定到工位${row.stationNo || ''}(该工位若有其他启用流程需先停用)。`,
|
||||
`确认启用「${row.name}」?启用后其绑定工位(${(row.stations || []).map(s => '工位' + s).join('、') || '-'})将恢复使用该流程。`,
|
||||
'提示', { type: 'warning' })
|
||||
}
|
||||
await request.post('/process-flows/status', { id: row.id, status: toStatus })
|
||||
|
||||
Reference in New Issue
Block a user