feat: 新增工序签字功能,移除移料指令模块
新增操作工/检验员工序签字功能,支持工艺步骤配置签字要求;删除移料指令相关代码,将移料页签重命名为产线点位(上料/下料);新增成品入库功能及相关权限;优化备料单状态、质量状态逻辑,新增批次序号字段;修复AGV取消后备料单回退状态问题。
This commit is contained in:
@@ -52,8 +52,9 @@
|
||||
<el-tab-pane v-if="hasTab('material')" label="物料 / 叫料" name="material">
|
||||
<MaterialPanel />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="hasTab('move')" label="移料" name="move">
|
||||
<MovePanel />
|
||||
<!-- 页签 key 沿用 'move':兼容存量工位 visibleTabs 配置(历史为移料,现为产线点位上料/下料) -->
|
||||
<el-tab-pane v-if="hasTab('move')" label="产线点位(上料/下料)" name="move">
|
||||
<LinePointPanel />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="hasTab('pdf')" label="工艺文件" name="pdf">
|
||||
<PdfPanel />
|
||||
@@ -76,7 +77,7 @@ import { useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import WorkPanel from './panels/WorkPanel.vue'
|
||||
import MaterialPanel from './panels/MaterialPanel.vue'
|
||||
import MovePanel from './panels/MovePanel.vue'
|
||||
import LinePointPanel from './panels/LinePointPanel.vue'
|
||||
import PdfPanel from './panels/PdfPanel.vue'
|
||||
import InspectPanel from './panels/InspectPanel.vue'
|
||||
import OnlinePanel from './panels/OnlinePanel.vue'
|
||||
@@ -85,8 +86,8 @@ import WorkloadDialog from './panels/WorkloadDialog.vue'
|
||||
import PageHelp from '../components/PageHelp.vue'
|
||||
import {
|
||||
helpInspect,
|
||||
helpLinePoint,
|
||||
helpMaterial,
|
||||
helpMove,
|
||||
helpOffline,
|
||||
helpOnline,
|
||||
helpPdf,
|
||||
@@ -98,7 +99,6 @@ import {
|
||||
hasNg,
|
||||
hasTab,
|
||||
loadConfig,
|
||||
loadMoves,
|
||||
loadPoints,
|
||||
loadStats,
|
||||
loadStationState,
|
||||
@@ -141,7 +141,7 @@ const HELP_MAP = {
|
||||
offline: helpOffline,
|
||||
work: helpWorkstation,
|
||||
material: helpMaterial,
|
||||
move: helpMove,
|
||||
move: helpLinePoint,
|
||||
pdf: helpPdf,
|
||||
inspect: helpInspect
|
||||
}
|
||||
@@ -180,7 +180,6 @@ onMounted(async () => {
|
||||
else if (hasTab('offline')) tab.value = 'offline'
|
||||
else tab.value = 'work'
|
||||
refreshAll()
|
||||
loadMoves()
|
||||
workRef.value?.focusScan?.()
|
||||
|
||||
timerTask = setInterval(loadTask, 5000) // 任务 5 秒
|
||||
@@ -189,7 +188,6 @@ onMounted(async () => {
|
||||
timerClock = setInterval(() => {
|
||||
tickClock()
|
||||
loadPoints() // 点位台账 10 秒
|
||||
loadMoves()
|
||||
loadWip() // 在制品 10 秒
|
||||
loadStationState() // 停单状态 10 秒
|
||||
}, 10000)
|
||||
|
||||
+8
-124
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div class="move-panel">
|
||||
<!-- ① 产线点位图(唯一事实源:每点位当前工件) -->
|
||||
<div class="line-point-panel">
|
||||
<!-- 产线点位图(唯一事实源:每点位当前工件)+ 人工上料/下料登记 -->
|
||||
<section class="card">
|
||||
<div class="card-title">
|
||||
产线点位(点击选择起点 → 再点终点 → 下发移料)
|
||||
产线点位(上料/下料登记)
|
||||
<el-button size="large" @click="clearSel">清空选择</el-button>
|
||||
<el-button size="large" @click="loadPoints">刷新</el-button>
|
||||
</div>
|
||||
@@ -31,80 +31,32 @@
|
||||
|
||||
<div class="ops">
|
||||
<div class="sel-text">
|
||||
起点:<b>{{ fromText }}</b> | 终点:<b>{{ toText }}</b>
|
||||
已选点位:<b>{{ selected || '未选择' }}</b>
|
||||
</div>
|
||||
<el-button type="primary" size="large" :disabled="!canIssue" @click="onIssue">下发移料</el-button>
|
||||
<el-button size="large" :disabled="!selected" @click="onIn">上料登记</el-button>
|
||||
<el-button type="danger" size="large" :disabled="!selected" @click="onOut">下料释放</el-button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ② 移料指令 -->
|
||||
<section class="card">
|
||||
<div class="card-title">移料指令(最近 20 条)</div>
|
||||
<el-table :data="moves" border size="large" height="420">
|
||||
<el-table-column prop="cmdNo" label="指令号" min-width="150" />
|
||||
<el-table-column prop="sn" label="工件SN" min-width="140" />
|
||||
<el-table-column label="起点 → 终点" min-width="140">
|
||||
<template #default="{ row }">{{ row.fromPoint }} → {{ row.toPoint }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="110">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="statusType(row.status)" effect="dark">{{ statusText(row.status) }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operator" label="操作人" width="110" />
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
v-if="row.status === 'ISSUED'"
|
||||
size="large"
|
||||
@click="onAck(row)"
|
||||
>应答</el-button>
|
||||
<el-button
|
||||
v-if="row.status === 'ISSUED' || row.status === 'ACK'"
|
||||
type="primary"
|
||||
size="large"
|
||||
@click="onArrive(row)"
|
||||
>确认到位</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { ackLineMove, arriveLineMove, issueLineMove, occupyLinePoint } from '../../api'
|
||||
import { occupyLinePoint } from '../../api'
|
||||
import {
|
||||
beltPoints,
|
||||
loadMoves,
|
||||
loadPoints,
|
||||
myDocks,
|
||||
orderNo,
|
||||
pointByNo,
|
||||
stationNo,
|
||||
state
|
||||
stationNo
|
||||
} from '../../store/station'
|
||||
|
||||
const moves = computed(() => state.moves)
|
||||
const selected = ref('')
|
||||
const from = ref('')
|
||||
const to = ref('')
|
||||
|
||||
const fromText = computed(() => from.value || '未选择')
|
||||
const toText = computed(() => to.value || '未选择')
|
||||
const canIssue = computed(() => {
|
||||
if (!from.value || !to.value || from.value === to.value) return false
|
||||
return !!pointByNo(from.value)?.occupied
|
||||
})
|
||||
|
||||
function clearSel() {
|
||||
selected.value = ''
|
||||
from.value = ''
|
||||
to.value = ''
|
||||
}
|
||||
|
||||
function typeClass(p) {
|
||||
@@ -116,50 +68,6 @@ function typeClass(p) {
|
||||
|
||||
function onPick(p) {
|
||||
selected.value = p.pointNo
|
||||
if (!from.value) {
|
||||
// 起点必须是占用点位
|
||||
if (!p.occupied) {
|
||||
ElMessage.warning(p.pointNo + ' 当前无工件,不能作为起点')
|
||||
return
|
||||
}
|
||||
from.value = p.pointNo
|
||||
return
|
||||
}
|
||||
if (p.pointNo === from.value) {
|
||||
to.value = ''
|
||||
return
|
||||
}
|
||||
if (p.occupied) {
|
||||
ElMessage.warning(p.pointNo + ' 已被占用,不能作为终点')
|
||||
return
|
||||
}
|
||||
to.value = p.pointNo
|
||||
}
|
||||
|
||||
async function onIssue() {
|
||||
const src = pointByNo(from.value)
|
||||
if (!src) return
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确认把「${src.currentSn}」从 ${from.value} 移到 ${to.value}?`,
|
||||
'移料确认',
|
||||
{ confirmButtonText: '确认下发', cancelButtonText: '取消', type: 'warning' }
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
try {
|
||||
await issueLineMove({
|
||||
sn: src.currentSn,
|
||||
fromPoint: from.value,
|
||||
toPoint: to.value,
|
||||
orderNo: orderNo.value || src.orderNo || ''
|
||||
})
|
||||
ElMessage.success('移料指令已下发')
|
||||
clearSel()
|
||||
loadPoints()
|
||||
loadMoves()
|
||||
} catch (e) { /* 统一错误提示 */ }
|
||||
}
|
||||
|
||||
async function onIn() {
|
||||
@@ -210,34 +118,10 @@ async function onOut() {
|
||||
loadPoints()
|
||||
} catch (e) { /* 统一错误提示 */ }
|
||||
}
|
||||
|
||||
async function onAck(row) {
|
||||
try {
|
||||
await ackLineMove({ cmdNo: row.cmdNo })
|
||||
ElMessage.success('已应答')
|
||||
loadMoves()
|
||||
} catch (e) { /* 统一错误提示 */ }
|
||||
}
|
||||
|
||||
async function onArrive(row) {
|
||||
try {
|
||||
await arriveLineMove({ cmdNo: row.cmdNo })
|
||||
ElMessage.success('到位已记账')
|
||||
loadMoves()
|
||||
loadPoints()
|
||||
} catch (e) { /* 统一错误提示 */ }
|
||||
}
|
||||
|
||||
function statusText(s) {
|
||||
return { ISSUED: '已下发', ACK: '已应答', ARRIVED: '已到位', CLOSED: '已闭环', FAILED: '失败' }[s] || s
|
||||
}
|
||||
function statusType(s) {
|
||||
return { ISSUED: 'warning', ACK: 'primary', ARRIVED: 'success', CLOSED: 'info', FAILED: 'danger' }[s] || 'info'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.move-panel {
|
||||
.line-point-panel {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 12px;
|
||||
@@ -204,7 +204,7 @@
|
||||
<script setup>
|
||||
import { computed, nextTick, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { arriveLineMove, fileNameFromUrl, getTrace, pdfOpenUrl, reportProcessDone, reportTempStore } from '../../api'
|
||||
import { fileNameFromUrl, getTrace, pdfOpenUrl, reportProcessDone, reportTempStore } from '../../api'
|
||||
import {
|
||||
autoTorqueState,
|
||||
bindBlocking,
|
||||
@@ -216,7 +216,6 @@ import {
|
||||
flowName,
|
||||
hasNg,
|
||||
loadBind,
|
||||
loadMoves,
|
||||
loadPoints,
|
||||
loadStats,
|
||||
loadTask,
|
||||
@@ -243,7 +242,6 @@ import {
|
||||
stepValues,
|
||||
stationNo,
|
||||
submitTorqueStep,
|
||||
suggestOutPoint,
|
||||
torqueDoneCount,
|
||||
torqueRowOfStep,
|
||||
torqueStepCount,
|
||||
@@ -426,25 +424,13 @@ async function onTakeIn() {
|
||||
}
|
||||
taking.value = true
|
||||
try {
|
||||
// 扫码即到位凭证:不再下发移料指令,直接记账到本工位
|
||||
const r = await bringSnToStation(v)
|
||||
await loadPoints()
|
||||
if (r.mode === 'MOVE' && r.cmdNo) {
|
||||
// PLC 联调前由人工确认到位;联调后由 PLC 到位信号自动闭环
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`已下发移料指令:${r.fromPoint} → 工位${stationNo.value}。工件到位后点「确认到位」记账。`,
|
||||
'移料指令已下发',
|
||||
{ confirmButtonText: '确认到位', cancelButtonText: '稍后', type: 'info' }
|
||||
)
|
||||
await arriveLineMove({ cmdNo: r.cmdNo })
|
||||
await loadPoints()
|
||||
await loadMoves()
|
||||
} catch { /* 稍后:指令留在列表,可在移料页确认 */ }
|
||||
}
|
||||
setCurrentSn(v)
|
||||
markStationArrival()
|
||||
scanInput.value = ''
|
||||
ElMessage.success(r.mode === 'IN' ? '已登记上料到本工位' : r.mode === 'HERE' ? '工件已在本工位' : '工件已调入本工位')
|
||||
ElMessage.success(r.mode === 'IN' ? '已登记上料到本工位' : '工件已在本工位')
|
||||
} catch (e) { /* 统一错误提示 */ }
|
||||
taking.value = false
|
||||
focusScan()
|
||||
@@ -452,14 +438,9 @@ async function onTakeIn() {
|
||||
|
||||
async function onMoveOut() {
|
||||
if (!sn.value) return
|
||||
const target = suggestOutPoint.value
|
||||
if (!target) {
|
||||
ElMessage.warning('下游无可用点位')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`确认把「${sn.value}」移出本工位到 ${target.label || target.pointNo}?`,
|
||||
`确认把「${sn.value}」移出本工位?下工位扫码后自动登记到位。`,
|
||||
'移出确认',
|
||||
{ confirmButtonText: '确认移出', cancelButtonText: '取消', type: 'warning' }
|
||||
)
|
||||
@@ -467,14 +448,10 @@ async function onMoveOut() {
|
||||
return
|
||||
}
|
||||
try {
|
||||
const cmdNo = await moveOut(sn.value, target.pointNo)
|
||||
try {
|
||||
await arriveLineMove({ cmdNo })
|
||||
} catch { /* 指令保留在列表 */ }
|
||||
await moveOut()
|
||||
await loadPoints()
|
||||
await loadMoves()
|
||||
setCurrentSn('')
|
||||
ElMessage.success('已移出到 ' + (target.label || target.pointNo))
|
||||
ElMessage.success('已移出本工位,点位已释放')
|
||||
} catch (e) { /* 统一错误提示 */ }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user