feat: 大屏多订单改为同屏并列展示,物料申请新增跨工位借料来源并移除工单完成日期

This commit is contained in:
SunYF
2026-11-02 19:17:05 +08:00
parent 0c03d32682
commit fd2f0e2767
77 changed files with 1773 additions and 664 deletions
@@ -272,7 +272,6 @@
<template #default="{ row }">{{ productNameOfUnplanned(row) }}</template>
</el-table-column>
<el-table-column prop="quantity" label="数量" width="80" />
<el-table-column prop="dueDate" label="完成日期" width="120" />
<el-table-column label="状态" width="100">
<template #default="{ row }"><el-tag size="small">{{ woStatusText(row.status) }}</el-tag></template>
</el-table-column>
@@ -336,7 +335,7 @@ const total = ref(0)
const page = ref(1)
const pageSize = ref(50)
const productTypes = ref([])
const dialog = reactive({ show: false, id: 0, orderNo: '', planDate: '', planRange: [], mode: 'AVG', planQty: 1, productType: '', productCode: '', productName: '', woQty: '', woStart: '', woDue: '', stationPlanQty: {}, combination: [] })
const dialog = reactive({ show: false, id: 0, orderNo: '', planDate: '', planRange: [], mode: 'AVG', planQty: 1, productType: '', productCode: '', productName: '', woQty: '', woStart: '', woPlanEnd: '', stationPlanQty: {}, combination: [] })
// 工位号→接驳台编码、工位号→名称
const stationDockMap = ref({})
@@ -583,7 +582,7 @@ async function loadWorkOrderInfo() {
const wo = await ensureWorkOrder(dialog.orderNo)
if (!wo) {
dialog.productType = ''; dialog.productCode = ''; dialog.productName = ''; dialog.woQty = ''
dialog.combination = []; dialog.woStart = ''; dialog.woDue = ''
dialog.combination = []; dialog.woStart = ''; dialog.woPlanEnd = ''
return
}
dialog.productCode = wo.productCode || ''
@@ -593,18 +592,18 @@ async function loadWorkOrderInfo() {
const pt = productTypes.value.find((p) => p.id === wo.productTypeId)
dialog.productType = pt ? (pt.name + (pt.code ? ' / ' + pt.code : '')) : ''
dialog.woStart = wo.planStart ? String(wo.planStart).slice(0, 10) : ''
dialog.woDue = wo.dueDate ? String(wo.dueDate).slice(0, 10) : ''
dialog.woPlanEnd = wo.planEnd ? String(wo.planEnd).slice(0, 10) : ''
if (!dialog.id) {
const today = todayStr()
const start = dialog.woStart || today
const end = dialog.woDue || addDays(7)
const end = dialog.woPlanEnd || addDays(7)
// 起期不晚于止期;若起期晚于止期(如止期已过期)则退化为单日,避免 el-date-picker 报错
dialog.planRange = start <= end ? [start, end] : [end, end]
}
}
async function onOrderChange() {
await loadWorkOrderInfo()
if (dialog.id && (dialog.woStart || dialog.woDue)) dialog.planDate = dialog.woStart || dialog.woDue
if (dialog.id && (dialog.woStart || dialog.woPlanEnd)) dialog.planDate = dialog.woStart || dialog.woPlanEnd
}
function openAdd(presetOrderNo) {
Object.assign(dialog, {
@@ -624,7 +623,7 @@ function openEdit(row) {
loadAlloc()
}
function warnOutOfWindow(dates) {
const s = dialog.woStart || ''; const e = dialog.woDue || ''
const s = dialog.woStart || ''; const e = dialog.woPlanEnd || ''
if ((!s && !e) || !dialog.orderNo) return
if (dates.some((d) => (s && d < s) || (e && d > e))) ElMessage.warning('所选日期超出工单执行期间')
}