refactor: 重构产线工位与备料流程,移除冗余字段

1. 移除工单、工件、日排产中的冗余工位组合/接驳台字段
2. 新增工位接驳台编码字段与唯一约束,关联WMS接驳台主数据
3. 重构日排产为工位产量分配模式,替代原接驳台列表
4. 新增备料单工位级字段与分批出库支持
5. 移除定时同步可生产数量,改为WMS实时拉取接口
6. 过滤操作日志,排除登录/退出相关日志
7. 调整仪表盘工序展示逻辑为今日派工路线
8. 新增接驳台维护菜单与基础数据
This commit is contained in:
SunYF
2026-09-19 07:50:21 +08:00
parent 543655d441
commit 37f10d3a13
156 changed files with 4489 additions and 1285 deletions
@@ -77,6 +77,12 @@ export const occupyLinePoint = (data) => request.post('/api/line/occupy', data)
// 工位叫料:{stationNo, dock, orderNo, items:[{materialCode, materialName, unit, manageMode, qty}]}
export const callLineMaterial = (data) => request.post('/api/line/call-material', data)
// 待接料列表(本工位):{stationNo, status, orderNo, planDate} → MES 备料单(待接料行)
export const getMaterialRequests = (params) => request.get('/api/material-requests', { params })
// 接料确认(主入口:扫码接料):{requestNo, qty?} → MES 累加 sentQty
export const receiveMaterialRequest = (data) => request.post('/api/material-request/receive', data)
// ---------- 工位终端巡检 / 应急 / 数量不符 / 退料(代理 MES 内部 API ----------
// 巡检提交:{category(CHECKIN/POINT/PROCESS/DONE/ALARM), stationNo, orderNo, sn, shift, result, items, photo, remark, processCode, stepId, stepName, measuredValue}
export const submitInspection = (data) => request.post('/api/inspection/submit', data)
@@ -93,13 +93,59 @@
<el-button type="primary" size="large" class="big-btn" :loading="calling" @click="doCall">提交叫料</el-button>
</div>
</section>
<!-- 待接料扫码接料主入口班组长补录见 MES 备料页 -->
<section class="card">
<div class="card-title">待接料本工位</div>
<div class="call-row">
<span class="lab">扫备料单号</span>
<el-input
v-model.trim="scanVal"
size="large"
class="dock-el"
placeholder="扫描备料单号接料"
clearable
@keyup.enter="doScanReceive"
/>
<el-button size="large" :loading="receiving" @click="doScanReceive">接料确认</el-button>
<el-button size="large" @click="loadPending">刷新</el-button>
</div>
<el-table :data="pending" border size="large" class="call-table" v-loading="pendingLoading">
<el-table-column label="图号" prop="materialCode" min-width="130" />
<el-table-column label="物料名称" prop="materialName" min-width="150" show-overflow-tooltip />
<el-table-column label="工序" width="80" align="center">
<template #default="{ row }">{{ row.processCode || '-' }}</template>
</el-table-column>
<el-table-column label="接驳台" prop="targetDock" width="110" align="center" />
<el-table-column label="需求" width="100" align="center">
<template #default="{ row }">{{ fmtQty(row.reqQty) }}</template>
</el-table-column>
<el-table-column label="已接" width="100" align="center">
<template #default="{ row }">{{ fmtQty(row.sentQty) }}</template>
</el-table-column>
<el-table-column label="批次" prop="batchNo" width="120" align="center" show-overflow-tooltip />
<el-table-column label="操作" width="110" align="center" fixed="right">
<template #default="{ row }">
<el-button
type="success"
size="large"
:loading="receiving && receivingNo === row.requestNo"
:disabled="row.status === 'DONE'"
@click="doReceive(row)"
>{{ row.status === 'DONE' ? '已完结' : '已接料' }}</el-button>
</template>
</el-table-column>
</el-table>
<el-empty v-if="!pendingLoading && !pending.length" description="本工位暂无待接料" :image-size="60" />
</section>
</div>
</template>
<script setup>
import { computed, ref } from 'vue'
import { computed, ref, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { bindRecord, bindRemove, callLineMaterial } from '../../api'
import { bindRecord, bindRemove, callLineMaterial, getMaterialRequests, receiveMaterialRequest } from '../../api'
import {
bindInputs,
loadBind,
@@ -118,6 +164,62 @@ const calling = ref(false)
const dock = ref('')
const items = ref([])
// ③ 待接料
const scanVal = ref('')
const pending = ref([])
const pendingLoading = ref(false)
const receiving = ref(false)
const receivingNo = ref('')
function fmtQty(v) {
const n = Number(v || 0)
return Number.isInteger(n) ? String(n) : n.toFixed(2)
}
async function loadPending() {
pendingLoading.value = true
try {
const res = await getMaterialRequests({ stationNo: stationNo.value, status: 'PENDING' })
const list = res?.data?.data || res?.data || []
// 仅展示未完结行(DONE 已送达)
pending.value = (Array.isArray(list) ? list : []).filter((r) => r.status !== 'DONE')
} catch (e) {
pending.value = []
}
pendingLoading.value = false
}
async function doScanReceive() {
const no = scanVal.value.trim()
if (!no) {
ElMessage.warning('请扫描备料单号')
return
}
await doReceive({ requestNo: no })
scanVal.value = ''
}
async function doReceive(row) {
if (!row?.requestNo) {
ElMessage.warning('缺少备料单号')
return
}
receiving.value = true
receivingNo.value = row.requestNo
try {
await receiveMaterialRequest({ requestNo: row.requestNo, operator: operatorName() })
ElMessage.success('接料确认成功:' + row.requestNo)
loadPending()
} catch (e) {
/* 统一错误提示 */
}
receiving.value = false
receivingNo.value = ''
}
onMounted(loadPending)
function addRow() {
items.value.push({ materialCode: '', materialName: '', unit: '个', manageMode: '1', qty: 1 })
}