Browse Source

备件出库备件归还

master
songguoqiang 7 months ago
parent
commit
c6becb0522
  1. 23
      src/views/eam/item/itemAccounts/itemAccounts.data.ts
  2. 61
      src/views/eam/item/itemInLocation/itemInLocation.data.ts
  3. 295
      src/views/eam/item/itemOutLocation/itemOutLocation.data.ts

23
src/views/eam/item/itemAccounts/itemAccounts.data.ts

@ -5,7 +5,7 @@ import { LocationArea } from '@/views/eam/basic/locationArea/locationArea.data'
import * as LocationApi from '@/api/eam/basic/location'
import { Location } from '@/views/eam/basic/location/location.data'
import { validateNumber } from '@/utils/validator'
import * as ItemApi from '@/api/eam/basic/item'
import { Item } from '@/views/eam/basic/item/item.data'
import { getStrDictOptions } from '@/utils/dict'
@ -18,7 +18,10 @@ export const ItemAccountsRules = reactive({
areaNumber: [required],
type: [required],
locationNumber: [required],
qty: [required]
qty: [
required,
{ validator: validateNumber, message: '数量不能等于0', trigger: 'blur' },
],
})
export const ItemAccounts = useCrudSchemas(
@ -211,6 +214,22 @@ export const ItemAccounts = useCrudSchemas(
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false
},
// {
// label: '是否账内库',
// field: 'isInAccount',

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

@ -2,6 +2,7 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as LocationApi from '@/api/eam/basic/location'
import { Location } from '@/views/eam/basic/location/location.data'
import { validateNumber } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const ItemInLocationRules = reactive({
number: [required],
@ -52,28 +53,28 @@ export const ItemInLocation = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
isForm:false
},
// {
// label: '备件编号',
// field: 'itemNumber',
// sort: 'custom',
// isSearch: true,
// form:{
// componentProps:{
// disabled:true
// }
// }
// },
// {
// label: '备件名称',
// field: 'itemName',
// sort: 'custom',
// isSearch: false,
// form:{
// componentProps:{
// disabled:true
// }
// }
// },
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '备件名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
}
},
{
label: '归还人',
field: 'returner',
@ -104,6 +105,22 @@ export const ItemInLocation = useCrudSchemas(reactive<CrudSchema[]>([
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false
},
{
label: '操作',
field: 'action',

295
src/views/eam/item/itemOutLocation/itemOutLocation.data.ts

@ -1,155 +1,176 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as LocationAreaApi from '@/api/eam/basic/locationArea'
import { LocationArea } from '@/views/eam/basic/locationArea/locationArea.data'
import { dateFormatter } from '@/utils/formatTime'
import * as LocationApi from '@/api/eam/basic/location'
import { Location } from '@/views/eam/basic/location/location.data'
import { validateNumber } from '@/utils/validator'
// 表单校验
export const ItemOutLocationRules = reactive({
// number: [required],
itemNumber: [required],
qty: [required],
locationNumber: [required],
qty: [
required,
{ validator: validateNumber, message: '数量不能等于0', trigger: 'blur' },
],
locationNumber: [required]
})
export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '编号',
// field: 'number',
// sort: 'custom',
// isSearch: false,
// isForm:false,
// },
// {
// label: '库区编号',
// field: 'areaNumber',
// sort: 'custom',
// isSearch: false,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择库区编号', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: '库区信息', // 查询弹窗标题
// searchAllSchemas: LocationArea.allSchemas, // 查询弹窗所需类
// searchPage: LocationAreaApi.getLocationAreaPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }
// ]
// }
// }
// },
// {
// label: '库区名称',
// field: 'areaName',
// sort: 'custom',
// isSearch: false,
// isForm:false
// },
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
export const ItemOutLocation = useCrudSchemas(
reactive<CrudSchema[]>([
// {
// label: '编号',
// field: 'number',
// sort: 'custom',
// isSearch: false,
// isForm:false,
// },
// {
// label: '库区编号',
// field: 'areaNumber',
// sort: 'custom',
// isSearch: false,
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择库区编号', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: '库区信息', // 查询弹窗标题
// searchAllSchemas: LocationArea.allSchemas, // 查询弹窗所需类
// searchPage: LocationAreaApi.getLocationAreaPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'available',
// value: 'TRUE',
// isMainValue: false
// }
// ]
// }
// }
// },
// {
// label: '库区名称',
// field: 'areaName',
// sort: 'custom',
// isSearch: false,
// isForm:false
// },
{
label: '库位编号',
field: 'locationNumber',
sort: 'custom',
isSearch: true,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchField: 'number', // 查询弹窗赋值字段
searchTitle: '库位信息', // 查询弹窗标题
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
searchCondition: [
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
// ,
// {
// key: 'areaNumber',
// value: 'areaNumber',
// isMainValue: true
// },
]
// ,
// {
// key: 'areaNumber',
// value: 'areaNumber',
// isMainValue: true
// },
]
}
}
}
},
{
label: '库位名称',
field: 'locationName',
sort: 'custom',
isSearch: false,
isForm:false
},
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
form:{
componentProps:{
disabled:true
},
{
label: '库位名称',
field: 'locationName',
sort: 'custom',
isSearch: false,
isForm: false
},
{
label: '备件编号',
field: 'itemNumber',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
disabled: true
}
}
}
},
{
label: '备件名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
},
{
label: '备件名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
form: {
componentProps: {
disabled: true
}
}
}
},
{
label: '领用人',
field: 'receiver',
sort: 'custom',
isSearch: false,
},
// {
// label: '出库类型',
// field: 'type',
// sort: 'custom',
// isSearch: false,
// form: {
// component: 'Select'
// },
// },
{
label: '出库数量',
field: 'qty',
sort: 'custom',
table: {
width: 110
},
form:{
component: 'InputNumber',
componentProps:{
min: 0,//最小值`
precision: 2//精度`
{
label: '领用人',
field: 'receiver',
sort: 'custom',
isSearch: false
},
// {
// label: '出库类型',
// field: 'type',
// sort: 'custom',
// isSearch: false,
// form: {
// component: 'Select'
// },
// },
{
label: '出库数量',
field: 'qty',
sort: 'custom',
table: {
width: 110
},
form: {
component: 'InputNumber',
componentProps: {
min: 0, //最小值`
precision: 2 //精度`
}
}
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false
},
{
label: '操作',
field: 'action',
isForm: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
}
},
{
label: '操作',
field: 'action',
isForm: false,
isTable:false,
table: {
width: 150,
fixed: 'right'
}
}
]))
])
)

Loading…
Cancel
Save