|
@@ -93,7 +93,7 @@
|
|
</template>
|
|
</template>
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<div :class="{'no-maintenance': !row.hasSetMaintenanceBom, 'has-maintenance': row.hasSetMaintenanceBom}">
|
|
<div :class="{'no-maintenance': !row.hasSetMaintenanceBom, 'has-maintenance': row.hasSetMaintenanceBom}">
|
|
- {{ row.hasSetMaintenanceBom ? '有保养项' : '无保养项' }}
|
|
|
|
|
|
+ {{ row.hasSetMaintenanceBom ? t('mainPlan.haveMaintItems') : t('mainPlan.noMaintItems') }}
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -441,9 +441,25 @@ const handleClose = () => {
|
|
// 确认选择
|
|
// 确认选择
|
|
const handleConfirm = () => {
|
|
const handleConfirm = () => {
|
|
if (selectedRows.value.length === 0) {
|
|
if (selectedRows.value.length === 0) {
|
|
- ElMessage.warning('请至少选择一个物料')
|
|
|
|
|
|
+ ElMessage.warning('请至少选择一个设备')
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // 检查是否有设备没有保养项
|
|
|
|
+ const hasInvalidDevice = selectedRows.value.some(
|
|
|
|
+ row => row.hasSetMaintenanceBom === false
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ if (hasInvalidDevice) {
|
|
|
|
+ // 显示警告信息
|
|
|
|
+ ElMessage.warning({
|
|
|
|
+ message: '请选择有保养项的设备',
|
|
|
|
+ duration: 3000,
|
|
|
|
+ grouping: true
|
|
|
|
+ })
|
|
|
|
+ return // 不关闭弹窗
|
|
|
|
+ }
|
|
|
|
+
|
|
emit('choose', selectedRows.value.map(row => ({
|
|
emit('choose', selectedRows.value.map(row => ({
|
|
...row,
|
|
...row,
|
|
// 确保返回必要字段
|
|
// 确保返回必要字段
|