feat: 重构BOM架构,新增基础设置与虚拟工位管理功能
本次重构删除原有BOM物料清单表,改用工单工艺组合×工艺物料清单作为唯一用料来源;新增系统基础设置表支持WMS地址、日志保留天数等配置,新增虚拟工位作业管理后台接口与前端页签控制功能,同时优化工位号校验逻辑、事件日志自动清理与工单用料查询能力。
This commit is contained in:
@@ -57,8 +57,9 @@
|
||||
<el-table-column label="开始时间" width="110">
|
||||
<template #default="{ row }">{{ fmtDateOnly(row.planStart) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="300" fixed="right">
|
||||
<el-table-column label="操作" width="350" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button size="small" @click="openUsage(row)">用料</el-button>
|
||||
<el-tooltip v-if="can('produce.workorder:dailyplan') && !['DONE','CANCELLED'].includes(row.status)"
|
||||
:disabled="hasCombination(row)" content="请先选择工艺组合" placement="top">
|
||||
<span style="margin-right:12px">
|
||||
@@ -187,6 +188,27 @@
|
||||
<el-button v-if="can('produce.workorder:dailyplan')" type="primary" @click="submitAutoSchedule">确认排产</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 工单单台用料汇总(只读:工单工艺组合 × 工艺物料清单 实时汇总,不落库) -->
|
||||
<el-dialog v-model="usage.show" :title="`单台用料汇总 - ${usage.orderNo}`" width="820px">
|
||||
<el-alert type="info" :closable="false" style="margin-bottom:12px"
|
||||
title="物料跟着工单走:按该工单的工艺组合 × 各工艺的物料清单实时汇总(同成品不同工单可用不同工艺)。单台含损耗用量 = Σ 各行单台用量 × (1+损耗率%),是备料/反冲的计算口径。" />
|
||||
<el-table :data="usage.rows" border size="small" v-loading="usage.loading"
|
||||
empty-text="该工单工艺组合未配置物料清单">
|
||||
<el-table-column prop="materialCode" label="图号" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="materialName" label="物料名称" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="spec" label="规格" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="unit" label="单位" width="70" align="center" />
|
||||
<el-table-column label="管理方式" width="100" align="center">
|
||||
<template #default="{ row }">{{ row.manageMode === '2' ? 'SN(电气件)' : '批次(结构件)' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="unitQty" label="单台净用量" width="100" align="center" />
|
||||
<el-table-column prop="lossRate" label="损耗率(%)" width="100" align="center" />
|
||||
<el-table-column prop="effQty" label="单台含损耗" width="110" align="center" />
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<el-button @click="usage.show = false">关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<PageHelp :data="helpWorkOrder" page="WorkOrder" />
|
||||
</template>
|
||||
@@ -286,6 +308,17 @@ async function loadComboData() {
|
||||
} catch { flows.value = [] }
|
||||
}
|
||||
|
||||
// ---------- 工单单台用料汇总(只读) ----------
|
||||
const usage = reactive({ show: false, orderNo: '', rows: [], loading: false })
|
||||
async function openUsage(row) {
|
||||
Object.assign(usage, { show: true, orderNo: row.workOrderNo, rows: [], loading: true })
|
||||
try {
|
||||
usage.rows = (await request.get('/order-usage', { params: { orderNo: row.workOrderNo } })) || []
|
||||
} finally {
|
||||
usage.loading = false
|
||||
}
|
||||
}
|
||||
|
||||
const dialog = reactive({ show: false, id: 0, workOrderNo: '', productTypeId: 0, productCode: '', productName: '', contractNo: '', projectNo: '', productSerial: '', quantity: 1, dueDate: '', planStart: '', status: 'CREATED' })
|
||||
|
||||
async function load() {
|
||||
|
||||
Reference in New Issue
Block a user