Browse Source

备件归还

master
songguoqiang 7 months ago
parent
commit
1187a8eb21
  1. 3
      src/api/eam/item/itemAccounts/index.ts
  2. 18
      src/views/eam/item/itemInLocation/index.vue

3
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<ItemAccountsVO>) => {
export const getItemAccountsNoPage = async (params) => {
return await request.get({ url: `/eam/item-accounts/noPage`, params })
}

18
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,14 +60,29 @@
const tableColumns = ref(ItemInLocation.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
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)
})
}
}
//
const updataTableColumns = (val) => {
tableColumns.value = val

Loading…
Cancel
Save