fix(workspace): 统一 MES 选择组件 id 判空处理
parent
1e4436561c
commit
860a12a7e7
|
|
@ -41,7 +41,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesDvCheckPlanApi.CheckPlan[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -87,7 +87,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesDvMachineryApi.Machinery[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -97,7 +97,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id as number)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -44,12 +44,18 @@ const showClear = computed(
|
|||
props.allowClear &&
|
||||
!props.disabled &&
|
||||
hovering.value &&
|
||||
props.modelValue !== undefined &&
|
||||
props.modelValue !== null,
|
||||
);
|
||||
|
||||
/** 根据 BOM 子物料编号回显选择器 */
|
||||
async function resolveBomById(bomItemId: number | undefined) {
|
||||
if (bomItemId === null || props.itemId === null) {
|
||||
if (
|
||||
bomItemId === undefined ||
|
||||
bomItemId === null ||
|
||||
props.itemId === undefined ||
|
||||
props.itemId === null
|
||||
) {
|
||||
selectedBom.value = undefined;
|
||||
return;
|
||||
}
|
||||
|
|
@ -86,7 +92,7 @@ function clearSelected() {
|
|||
|
||||
/** 打开 BOM 物料选择弹窗 */
|
||||
function handleClick(event: MouseEvent) {
|
||||
if (props.disabled || props.itemId === null) {
|
||||
if (props.disabled || props.itemId === undefined || props.itemId === null) {
|
||||
return;
|
||||
}
|
||||
const target = event.target as HTMLElement;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id as number)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id as number)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesProCardApi.Card[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesProTaskApi.Task[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesProWorkOrderApi.WorkOrder[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ function getMultipleSelectedRows() {
|
|||
...(gridApi.grid.getCheckboxRecords?.() ?? []),
|
||||
] as MesQcIndicatorApi.Indicator[];
|
||||
records.forEach((row) => {
|
||||
if (!row.id) {
|
||||
selectedMap.set(row.id as number, row);
|
||||
if (row.id !== undefined && row.id !== null) {
|
||||
selectedMap.set(row.id, row);
|
||||
}
|
||||
});
|
||||
return [...selectedMap.values()];
|
||||
|
|
@ -74,7 +74,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesQcIndicatorApi.Indicator[];
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id as number)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id as number)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesWmBatchApi.Batch[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesWmMaterialStockApi.MaterialStock[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ function getMultipleSelectedRows() {
|
|||
...(gridApi.grid.getCheckboxRecords?.() ?? []),
|
||||
] as MesWmPackageApi.Package[];
|
||||
records.forEach((row) => {
|
||||
if (!row.id) {
|
||||
selectedMap.set(row.id as number, row);
|
||||
if (row.id !== undefined && row.id !== null) {
|
||||
selectedMap.set(row.id, row);
|
||||
}
|
||||
});
|
||||
return [...selectedMap.values()];
|
||||
|
|
@ -83,7 +83,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesWmPackageApi.Package[];
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id as number)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function getMultipleSelectedRows() {
|
|||
...(gridApi.grid.getCheckboxRecords?.() ?? []),
|
||||
] as MesWmStockTakingPlanApi.StockTakingPlan[];
|
||||
records.forEach((row) => {
|
||||
if (!row.id) {
|
||||
if (row.id !== undefined && row.id !== null) {
|
||||
selectedMap.set(row.id, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -80,7 +80,11 @@ async function applyPreSelection() {
|
|||
const rows =
|
||||
gridApi.grid.getData() as MesWmStockTakingPlanApi.StockTakingPlan[];
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesDvCheckPlanApi.CheckPlan[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -87,7 +87,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesDvMachineryApi.Machinery[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -97,7 +97,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesMdClientApi.Client[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -83,7 +83,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -44,12 +44,18 @@ const showClear = computed(
|
|||
props.allowClear &&
|
||||
!props.disabled &&
|
||||
hovering.value &&
|
||||
props.modelValue !== undefined &&
|
||||
props.modelValue !== null,
|
||||
);
|
||||
|
||||
/** 根据 BOM 子物料编号回显选择器 */
|
||||
async function resolveBomById(bomItemId: number | undefined) {
|
||||
if (bomItemId === null || props.itemId === null) {
|
||||
if (
|
||||
bomItemId === undefined ||
|
||||
bomItemId === null ||
|
||||
props.itemId === undefined ||
|
||||
props.itemId === null
|
||||
) {
|
||||
selectedBom.value = undefined;
|
||||
return;
|
||||
}
|
||||
|
|
@ -86,7 +92,7 @@ function clearSelected() {
|
|||
|
||||
/** 打开 BOM 物料选择弹窗 */
|
||||
function handleClick(event: MouseEvent) {
|
||||
if (props.disabled || props.itemId === null) {
|
||||
if (props.disabled || props.itemId === undefined || props.itemId === null) {
|
||||
return;
|
||||
}
|
||||
const target = event.target as HTMLElement;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesMdItemApi.Item[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -90,7 +90,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesMdVendorApi.Vendor[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -83,7 +83,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesProCardApi.Card[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesProTaskApi.Task[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesProWorkOrderApi.WorkOrder[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function getMultipleSelectedRows() {
|
|||
...(gridApi.grid.getCheckboxRecords?.() ?? []),
|
||||
] as MesQcIndicatorApi.Indicator[];
|
||||
records.forEach((row) => {
|
||||
if (row.id !== null) {
|
||||
if (row.id !== undefined && row.id !== null) {
|
||||
selectedMap.set(row.id, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -74,7 +74,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesQcIndicatorApi.Indicator[];
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesTmToolApi.Tool[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -78,7 +78,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesWmBatchApi.Batch[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesWmMaterialStockApi.MaterialStock[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function getMultipleSelectedRows() {
|
|||
...(gridApi.grid.getCheckboxRecords?.() ?? []),
|
||||
] as MesWmPackageApi.Package[];
|
||||
records.forEach((row) => {
|
||||
if (row.id !== null) {
|
||||
if (row.id !== undefined && row.id !== null) {
|
||||
selectedMap.set(row.id, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -83,7 +83,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesWmPackageApi.Package[];
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function getMultipleSelectedRows() {
|
|||
...(gridApi.grid.getCheckboxRecords?.() ?? []),
|
||||
] as MesWmStockTakingPlanApi.StockTakingPlan[];
|
||||
records.forEach((row) => {
|
||||
if (row.id !== null) {
|
||||
if (row.id !== undefined && row.id !== null) {
|
||||
selectedMap.set(row.id, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -80,7 +80,11 @@ async function applyPreSelection() {
|
|||
const rows =
|
||||
gridApi.grid.getData() as MesWmStockTakingPlanApi.StockTakingPlan[];
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesDvCheckPlanApi.CheckPlan[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -87,7 +87,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesDvMachineryApi.Machinery[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -97,7 +97,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesMdClientApi.Client[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -83,7 +83,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -44,12 +44,18 @@ const showClear = computed(
|
|||
props.clearable &&
|
||||
!props.disabled &&
|
||||
hovering.value &&
|
||||
props.modelValue !== undefined &&
|
||||
props.modelValue !== null,
|
||||
);
|
||||
|
||||
/** 根据 BOM 子物料编号回显选择器 */
|
||||
async function resolveBomById(bomItemId: number | undefined) {
|
||||
if (bomItemId === null || props.itemId === null) {
|
||||
if (
|
||||
bomItemId === undefined ||
|
||||
bomItemId === null ||
|
||||
props.itemId === undefined ||
|
||||
props.itemId === null
|
||||
) {
|
||||
selectedBom.value = undefined;
|
||||
return;
|
||||
}
|
||||
|
|
@ -86,7 +92,7 @@ function clearSelected() {
|
|||
|
||||
/** 打开 BOM 物料选择弹窗 */
|
||||
function handleClick(event: MouseEvent) {
|
||||
if (props.disabled || props.itemId === null) {
|
||||
if (props.disabled || props.itemId === undefined || props.itemId === null) {
|
||||
return;
|
||||
}
|
||||
const target = event.target as HTMLElement;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesMdItemApi.Item[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -90,7 +90,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesMdVendorApi.Vendor[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -83,7 +83,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesProCardApi.Card[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesProTaskApi.Task[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesProWorkOrderApi.WorkOrder[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ function getMultipleSelectedRows() {
|
|||
...(gridApi.grid.getCheckboxRecords?.() ?? []),
|
||||
] as MesQcIndicatorApi.Indicator[];
|
||||
records.forEach((row) => {
|
||||
if (row.id !== null) {
|
||||
if (row.id !== undefined && row.id !== null) {
|
||||
selectedMap.set(row.id, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -74,7 +74,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesQcIndicatorApi.Indicator[];
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ function getMultipleSelectedRows() {
|
|||
] as MesTmToolApi.Tool[];
|
||||
records.forEach((row) => {
|
||||
const rowId = row.id;
|
||||
if (rowId !== null) {
|
||||
if (rowId !== undefined && rowId !== null) {
|
||||
selectedMap.set(rowId, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -78,7 +78,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = getTableRows();
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesWmBatchApi.Batch[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -118,7 +118,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesWmMaterialStockApi.MaterialStock[];
|
||||
for (const row of rows) {
|
||||
if (row.id === undefined || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ function getMultipleSelectedRows() {
|
|||
...(gridApi.grid.getCheckboxRecords?.() ?? []),
|
||||
] as MesWmPackageApi.Package[];
|
||||
records.forEach((row) => {
|
||||
if (row.id) {
|
||||
if (row.id !== undefined && row.id !== null) {
|
||||
selectedMap.set(row.id, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -83,7 +83,11 @@ async function applyPreSelection() {
|
|||
}
|
||||
const rows = gridApi.grid.getData() as MesWmPackageApi.Package[];
|
||||
for (const row of rows) {
|
||||
if (row.id || !preSelectedIds.value.includes(row.id as number)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function getMultipleSelectedRows() {
|
|||
...(gridApi.grid.getCheckboxRecords?.() ?? []),
|
||||
] as MesWmStockTakingPlanApi.StockTakingPlan[];
|
||||
records.forEach((row) => {
|
||||
if (row.id !== null) {
|
||||
if (row.id !== undefined && row.id !== null) {
|
||||
selectedMap.set(row.id, row);
|
||||
}
|
||||
});
|
||||
|
|
@ -80,7 +80,11 @@ async function applyPreSelection() {
|
|||
const rows =
|
||||
gridApi.grid.getData() as MesWmStockTakingPlanApi.StockTakingPlan[];
|
||||
for (const row of rows) {
|
||||
if (row.id === null || !preSelectedIds.value.includes(row.id)) {
|
||||
if (
|
||||
row.id === undefined ||
|
||||
row.id === null ||
|
||||
!preSelectedIds.value.includes(row.id)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (multiple.value) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue