From 1187a8eb21d1e9d3eed851a5dba3e6a3b95c8216 Mon Sep 17 00:00:00 2001 From: songguoqiang <765017469@qq.com> Date: Fri, 10 May 2024 09:07:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=BD=92=E8=BF=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/item/itemAccounts/index.ts | 3 ++- src/views/eam/item/itemInLocation/index.vue | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/api/eam/item/itemAccounts/index.ts b/src/api/eam/item/itemAccounts/index.ts index b9b7b30..62f4ad8 100644 --- a/src/api/eam/item/itemAccounts/index.ts +++ b/src/api/eam/item/itemAccounts/index.ts @@ -28,7 +28,7 @@ export const getItemAccounts = async (id: number) => { return await request.get({ url: `/eam/item-accounts/get?id=` + id }) } -// 查询备件台账详情 +// 根据库位查询备件台账详情 export const getByLocationNumber = async (locationNumber: string) => { return await request.get({ url: `/eam/item-accounts/getByLocationNumber?locationNumber=` + locationNumber }) } @@ -73,3 +73,4 @@ export const replaceLocation = async (data: Array) => { export const getItemAccountsNoPage = async (params) => { return await request.get({ url: `/eam/item-accounts/noPage`, params }) } + diff --git a/src/views/eam/item/itemInLocation/index.vue b/src/views/eam/item/itemInLocation/index.vue index 5b1b7ca..3adfe67 100644 --- a/src/views/eam/item/itemInLocation/index.vue +++ b/src/views/eam/item/itemInLocation/index.vue @@ -43,6 +43,7 @@ import download from '@/utils/download' import { ItemInLocation, ItemInLocationRules } from './itemInLocation.data' import * as ItemInLocationApi from '@/api/eam/item/itemInLocation' + import * as ItemAccountApi from '@/api/eam/item/itemAccounts' import * as defaultButtons from '@/utils/disposition/defaultButtons' import TableHead from '@/components/TableHead/src/TableHead.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue' @@ -59,12 +60,27 @@ const tableColumns = ref(ItemInLocation.allSchemas.tableColumns) // 查询页面返回 - const searchTableSuccess = (formField, searchField, val, formRef) => { - nextTick(() => { + const searchTableSuccess = async(formField, searchField, val, formRef) => { + const ret = await ItemAccountApi.getByLocationNumber(val[0][searchField]); + if(ret.itemNumber==null || ret.itemNumber=='' || !ret.itemNumber){ + nextTick(() => { const setV = {} + setV[formField] = ''; + setV[formField] = val[0][searchField] + formRef.setValues(setV) + message.error('该库位下无绑定的备件') + return; + }) + }else{ + nextTick(() => { + const setV = {} + setV['itemNumber'] = ret.itemNumber + setV['itemName'] = ret.itemName setV[formField] = val[0][searchField] formRef.setValues(setV) }) + } + } // 字段设置 更新主列表字段