refactor: 重构产线工位与备料流程,移除冗余字段
1. 移除工单、工件、日排产中的冗余工位组合/接驳台字段 2. 新增工位接驳台编码字段与唯一约束,关联WMS接驳台主数据 3. 重构日排产为工位产量分配模式,替代原接驳台列表 4. 新增备料单工位级字段与分批出库支持 5. 移除定时同步可生产数量,改为WMS实时拉取接口 6. 过滤操作日志,排除登录/退出相关日志 7. 调整仪表盘工序展示逻辑为今日派工路线 8. 新增接驳台维护菜单与基础数据
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<el-card>
|
||||
<el-alert type="info" :closable="false" style="margin-bottom:12px"
|
||||
title="工位组合下发:把某工单/工件要经过的「工位组合」写入产线设备(如 PLC 控制器),产线传送带据此只停靠对应工位。系统保证「上一条未收到完成信号前不下发下一条」,避免串序。" />
|
||||
title="工位组合下发:把某工单/工件要经过的「工位组合」写入产线设备(如 PLC 控制器),产线传送带据此只停靠对应工位。工位组合由今日「工位派工(station_process)」自动派生,无需手动选择;如需调整路线,请到「工位」页改派工。系统保证「上一条未收到完成信号前不下发下一条」,避免串序。" />
|
||||
|
||||
<el-tabs v-model="tab" @tab-change="onTab">
|
||||
<!-- Tab1 下发录入(前,默认打开) -->
|
||||
@@ -24,9 +24,6 @@
|
||||
<el-tag v-else type="info" size="large">未带出(选择 SN 后自动识别)</el-tag>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form-item label="工位组合">
|
||||
<ProcessSeqPicker v-model="send.processCombination" :disabled-codes="disabledStations" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="can('produce.plc:send')" type="primary" @click="doSend">下发工位码</el-button>
|
||||
</el-form-item>
|
||||
@@ -69,19 +66,18 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, computed, onMounted } from 'vue'
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import request from '../utils/request'
|
||||
import { can } from '../utils/perm'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import ProcessSeqPicker from '../components/ProcessSeqPicker.vue'
|
||||
import { helpPlc } from '../help'
|
||||
|
||||
// 多 Tab 范式:下发录入在前默认打开,下发记录在后点击才加载。
|
||||
// 当前工位语义(2026-09-08):选择工件 SN 后由工件实际进度自动带出(只读);
|
||||
// ≤当前工位的工位视为已完成,自动从组合中剔除并禁选。
|
||||
// 工位组合由今日「工位派工(station_process)」自动派生,不再手选。
|
||||
const tab = ref('send')
|
||||
const send = reactive({ orderNo: '', sn: '', stationNo: 0, processCombination: '' })
|
||||
const send = reactive({ orderNo: '', sn: '', stationNo: 0 })
|
||||
const query = reactive({ orderNo: '', status: '' })
|
||||
const logs = ref([])
|
||||
const workOrders = ref([])
|
||||
@@ -90,24 +86,12 @@ const currentStation = ref(0)
|
||||
|
||||
const plcStatusText = (s) => (s === 'DONE' ? '已完成' : '已下发')
|
||||
|
||||
// 已完成(≤当前工位)禁选
|
||||
const disabledStations = computed(() => {
|
||||
if (!currentStation.value) return []
|
||||
return Array.from({ length: currentStation.value }, (_, i) => i + 1)
|
||||
})
|
||||
|
||||
// SN 变化:从工件进度带出当前工位;同时把组合里 ≤当前工位的编号自动剔除
|
||||
// SN 变化:从工件进度带出当前工位
|
||||
function onSnChange() {
|
||||
currentStation.value = 0
|
||||
if (!send.sn) return
|
||||
const wp = orderSns.value.find((w) => w.sn === send.sn)
|
||||
const cp = Number(wp?.currentProcess || wp?.currentStation || 0)
|
||||
currentStation.value = cp
|
||||
if (cp > 0 && send.processCombination) {
|
||||
const kept = String(send.processCombination).split(',')
|
||||
.map(Number).filter((n) => n > cp).sort((a, b) => a - b)
|
||||
send.processCombination = kept.join(',')
|
||||
}
|
||||
currentStation.value = Number(wp?.currentProcess || wp?.currentStation || 0)
|
||||
}
|
||||
|
||||
// 选中工单后带出该工单已上线/未完工的 SN 供选择;SN 也可扫码手输
|
||||
@@ -121,14 +105,14 @@ async function onOrderChange() {
|
||||
}
|
||||
|
||||
async function doSend() {
|
||||
if (!send.orderNo || !send.processCombination) return ElMessage.warning('请选择工单号和工位组合')
|
||||
if (!send.orderNo) return ElMessage.warning('请选择工单号')
|
||||
if (!send.sn) return ElMessage.warning('请选择/扫码输入该工单下的工件 SN')
|
||||
if (!currentStation.value) return ElMessage.warning('未识别到工件当前工位,请先选择已上线工件的 SN')
|
||||
send.stationNo = currentStation.value
|
||||
try {
|
||||
await request.post('/plc/send-process', { ...send })
|
||||
// 工位组合由后端按今日工位派工(station_process)自动派生,前端只传工单/SN/当前工位
|
||||
await request.post('/plc/send-process', { orderNo: send.orderNo, sn: send.sn, stationNo: send.stationNo })
|
||||
ElMessage.success('工位码下发成功(未收到完成信号不会下发下一条)')
|
||||
send.processCombination = ''
|
||||
} catch (e) { /* 拦截器已提示,如"上一条未完成" */ }
|
||||
}
|
||||
async function loadLogs() {
|
||||
|
||||
Reference in New Issue
Block a user