|
|
|
@ -131,13 +131,13 @@
|
|
|
|
@select-all="handleDetailSelectAll"
|
|
|
|
@select-all="handleDetailSelectAll"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-table-column type="selection" width="55" :reserve-selection="true" align="center" />
|
|
|
|
<el-table-column type="selection" width="55" :reserve-selection="true" align="center" />
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableTaskCodeColumn')" align="center" prop="taskCode" sortable />
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableTaskCodeColumn')" align="center" prop="taskCode" sortable width="200px"/>
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableProductCodeColumn')" align="center" prop="barCode" sortable />
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableProductCodeColumn')" align="center" prop="barCode" sortable />
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableProductNameColumn')" align="center" prop="productName" sortable />
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableProductNameColumn')" align="center" prop="productName" sortable />
|
|
|
|
<el-table-column label="设备名称" align="center" prop="deviceDisplayName" />
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableDeviceNameColumn')" align="center" prop="deviceDisplayName" />
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableTotalNumberColumn')" align="center" prop="number" />
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableTotalNumberColumn')" align="center" prop="number" width="120px"/>
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTablePlanNumberColumn')" align="center" prop="planNumber" />
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTablePlanNumberColumn')" align="center" prop="planNumber" width="120px"/>
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableUnplanNumberColumn')" align="center">
|
|
|
|
<el-table-column :label="t('ProductionPlan.TaskSummary.detailTableUnplanNumberColumn')" align="center" width="120px">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<span class="el-alert--warning" style="color: #e66126">
|
|
|
|
<span class="el-alert--warning" style="color: #e66126">
|
|
|
|
{{ scope.row.number - scope.row.planNumber > 0 ? scope.row.number - scope.row.planNumber : 0 }}
|
|
|
|
{{ scope.row.number - scope.row.planNumber > 0 ? scope.row.number - scope.row.planNumber : 0 }}
|
|
|
|
@ -617,6 +617,14 @@ const handleDeviceSelectConfirm = (payload: { ids: (number | string)[]; rows: an
|
|
|
|
.filter((item): item is { id: number; name: string } => Boolean(item))
|
|
|
|
.filter((item): item is { id: number; name: string } => Boolean(item))
|
|
|
|
selectedDeviceRows.value = payload.rows
|
|
|
|
selectedDeviceRows.value = payload.rows
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const refreshDetailListAfterDeviceSaved = async () => {
|
|
|
|
|
|
|
|
const taskId = Number(currentDeviceRelationRow.value?.taskId)
|
|
|
|
|
|
|
|
if (!Number.isFinite(taskId)) return
|
|
|
|
|
|
|
|
delete allDetailsMap.value[taskId]
|
|
|
|
|
|
|
|
if (Number(currentTask.value?.id) === taskId && currentTask.value) {
|
|
|
|
|
|
|
|
await handleCurrentTaskChange(currentTask.value)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
const submitDeviceRelation = async () => {
|
|
|
|
const submitDeviceRelation = async () => {
|
|
|
|
if (!currentProductData.value || !deviceRelationForm.productId) return
|
|
|
|
if (!currentProductData.value || !deviceRelationForm.productId) return
|
|
|
|
deviceRelationSaving.value = true
|
|
|
|
deviceRelationSaving.value = true
|
|
|
|
@ -636,21 +644,7 @@ const submitDeviceRelation = async () => {
|
|
|
|
delete payload.devices
|
|
|
|
delete payload.devices
|
|
|
|
delete payload.molds
|
|
|
|
delete payload.molds
|
|
|
|
await ProductApi.updateProduct(payload)
|
|
|
|
await ProductApi.updateProduct(payload)
|
|
|
|
const displayText = deviceRelationForm.devices.map((item) => item.name).join('、')
|
|
|
|
await refreshDetailListAfterDeviceSaved()
|
|
|
|
const rowId = currentDeviceRelationRow.value?.id
|
|
|
|
|
|
|
|
if (rowId !== undefined) {
|
|
|
|
|
|
|
|
Object.values(allDetailsMap.value).forEach((rows) => {
|
|
|
|
|
|
|
|
rows.forEach((item: any) => {
|
|
|
|
|
|
|
|
if (item.id === rowId) {
|
|
|
|
|
|
|
|
item.deviceDisplayName = displayText
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const target = detailList.value.find((item: any) => item.id === rowId)
|
|
|
|
|
|
|
|
if (target) {
|
|
|
|
|
|
|
|
target.deviceDisplayName = displayText
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
message.success('关联设备已保存')
|
|
|
|
message.success('关联设备已保存')
|
|
|
|
deviceRelationDialogVisible.value = false
|
|
|
|
deviceRelationDialogVisible.value = false
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
|