Browse Source

备件归还、添加备件属性

master
songguoqiang 7 months ago
parent
commit
08720c578d
  1. 5
      src/api/eam/item/itemAccounts/index.ts
  2. 25
      src/views/eam/basic/item/item.data.ts
  3. 35
      src/views/eam/item/itemAccounts/index.vue
  4. 4
      src/views/eam/item/itemInLocation/index.vue
  5. 3
      src/views/eam/item/itemInLocation/itemInLocation.data.ts

5
src/api/eam/item/itemAccounts/index.ts

@ -33,6 +33,11 @@ export const getByLocationNumber = async (locationNumber: string) => {
return await request.get({ url: `/eam/item-accounts/getByLocationNumber?locationNumber=` + locationNumber })
}
// 根据备件查询备件台账详情
export const getByItemNumber = async (itemNumber: string) => {
return await request.get({ url: `/eam/item-accounts/getByItemNumber?itemNumber=` + itemNumber })
}
// 新增备件台账
export const createItemAccounts = async (data: ItemAccountsVO) => {
return await request.post({ url: `/eam/item-accounts/create`, data })

25
src/views/eam/basic/item/item.data.ts

@ -19,6 +19,31 @@ export const ItemRules = reactive({
],
})
export const ItemSearchTable = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '备件编号',
field: 'number',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
fixed: 'left'
},
},
{
label: '备件名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
},
},
{
label: '数量',
field: 'qty',
sort: 'custom',
}
]))
export const Item = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '零件编码',

35
src/views/eam/item/itemAccounts/index.vue

@ -68,13 +68,36 @@
const tableColumns = ref(ItemAccounts.allSchemas.tableColumns)
//
const searchTableSuccess = (formField, searchField, val, formRef) => {//
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
setV['itemName'] = val[0]['name']
const searchTableSuccess = async(formField, searchField, val, formRef) => {//
if(formField=='itemNumber'){
const aa = await ItemAccountsApi.getByItemNumber(val[0][searchField]);
if(aa.locationNumber==null||aa.locationNumber==''){//
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
setV['itemName'] = val[0]['name']
setV['locationNumber'] = ''
setV['areaNumber'] = ''
formRef.setValues(setV)
})
})
}else{//
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
setV['itemName'] = val[0]['name']
setV['locationNumber'] = aa.locationNumber
setV['areaNumber'] =aa.areaNumber
formRef.setValues(setV)
})
}
}else{
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
}
//

4
src/views/eam/item/itemInLocation/index.vue

@ -68,7 +68,7 @@
setV[formField] = '';
setV[formField] = val[0][searchField]
formRef.setValues(setV)
message.error('该库位下无绑定的备件')
message.info('该库位下无绑定的备件')
return;
})
}else{
@ -201,7 +201,7 @@
//
exportLoading.value = true
const data = await ItemInLocationApi.exportItemInLocation(tableObject.params)
download.excel(data, '备件入库记录.xlsx')
download.excel(data, '备件归还记录.xlsx')
} catch {
} finally {
exportLoading.value = false

3
src/views/eam/item/itemInLocation/itemInLocation.data.ts

@ -12,6 +12,9 @@ export const ItemInLocationRules = reactive({
required,
{ validator: validateNumber, message: '数量不能等于0', trigger: 'blur' },
],
returner: [
{ max: 50, message: '不得超过20个字符', trigger: 'blur' },
],
})
export const ItemInLocation = useCrudSchemas(reactive<CrudSchema[]>([

Loading…
Cancel
Save