diff --git a/src/api/eam/basic/item/index.ts b/src/api/eam/basic/item/index.ts index b2d2c77..0ab9652 100644 --- a/src/api/eam/basic/item/index.ts +++ b/src/api/eam/basic/item/index.ts @@ -72,3 +72,9 @@ export const getItemList = async (params) => { export const getaaa = async () => { return await request.get({ url: `/eam/producePlan/produce`}) } + +// 备件不分页 + +export const getItemNoPage = async (params) => { + return await request.get({ url: `/eam/item/noPage`, params }) +} \ No newline at end of file diff --git a/src/api/eam/basic/rel/index.ts b/src/api/eam/basic/rel/index.ts index 6d36567..70fe0d1 100644 --- a/src/api/eam/basic/rel/index.ts +++ b/src/api/eam/basic/rel/index.ts @@ -48,3 +48,10 @@ export const exportDeviceItem = async (params) => { export const createDeviceItemBatch = async (data: Array) => { return await request.post({url: `/rel/device-item/createBatch `, data }); }; + + + +// 查询设备备件关系列表 +export const getDeviceItemNoPage = async (params) => { + return await request.get({ url: `/rel/device-item/noPage`, params }) +} \ No newline at end of file diff --git a/src/components/SearchTable/src/SearchTable.vue b/src/components/SearchTable/src/SearchTable.vue index eeee0b9..b990d25 100644 --- a/src/components/SearchTable/src/SearchTable.vue +++ b/src/components/SearchTable/src/SearchTable.vue @@ -134,7 +134,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 const searchTableRef = ref() /** 提交表单 */ -const emit = defineEmits(['searchTableSuccess']) // 定义 searchTableSuccess 事件,用于操作成功后的回调 +const emit = defineEmits(['searchTableSuccess','onMountedCallBack']) // 定义 searchTableSuccess 事件,用于操作成功后的回调 const submitForm = async () => { // 提交请求 formLoading.value = true @@ -164,8 +164,8 @@ const submitForm = async () => { } } -const onMountedCallBack = (parent,tableRef)=>{ - debugger +const onMountedCallBack = (parent, tableRef) => { + emit('onMountedCallBack', parent, tableRef) } diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue index 74896e9..9162864 100644 --- a/src/components/Table/src/Table.vue +++ b/src/components/Table/src/Table.vue @@ -52,7 +52,7 @@ export default defineComponent({ data: { type: Array as PropType, default: () => [] - } + }, }, emits: ['update:pageSize', 'update:currentPage', 'register', 'update:sort'], setup(props, { attrs, slots, emit, expose }) { diff --git a/src/views/eam/device/deviceAccounts/index.vue b/src/views/eam/device/deviceAccounts/index.vue index 5ea509c..457f2c4 100644 --- a/src/views/eam/device/deviceAccounts/index.vue +++ b/src/views/eam/device/deviceAccounts/index.vue @@ -93,7 +93,7 @@ import { } from './deviceAccounts.data' import { Item } from '@/views/eam/basic/item/item.data' import * as ItemApi from '@/api/eam/basic/item' -import { createDeviceItemBatch, getDeviceItemPage } from '@/api/eam/basic/rel' +import { createDeviceItemBatch, getDeviceItemPage,getDeviceItemNoPage } from '@/api/eam/basic/rel' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { DeviceLedgerTabsList } from '@/utils/disposition/tabsList' @@ -467,6 +467,27 @@ const qrCodeBatch = async (val,item) => { window.open(src.value + "&number=" + qrCodeList) } - +const onMountedCallBack = (parent, searchTable) => { + getDeviceItemNoPage({ deviceNumber: deviceNumber.value }).then((res) => { + ItemApi.getItemNoPage().then(response => { + const selections = response.filter(element => { + let flag = false; + res.forEach(item => { + if (element.number == item.itemNumber) { + flag = true; + } + }); + return flag; + }); + // 使用nextTick确保表格渲染完成 + // 确保searchTable是有效的 + if (searchTable && selections.length > 0) { + selections.forEach(row => { + searchTable.value.toggleRowSelection(row, true); + }); + } + }); + }); +};