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. 59
      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 * as LocationApi from '@/api/eam/basic/location'
import { Location } from '@/views/eam/basic/location/location.data' import { Location } from '@/views/eam/basic/location/location.data'
import { validateNumber } from '@/utils/validator'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemApi from '@/api/eam/basic/item'
import { Item } from '@/views/eam/basic/item/item.data' import { Item } from '@/views/eam/basic/item/item.data'
import { getStrDictOptions } from '@/utils/dict' import { getStrDictOptions } from '@/utils/dict'
@ -18,7 +18,10 @@ export const ItemAccountsRules = reactive({
areaNumber: [required], areaNumber: [required],
type: [required], type: [required],
locationNumber: [required], locationNumber: [required],
qty: [required] qty: [
required,
{ validator: validateNumber, message: '数量不能等于0', trigger: 'blur' },
],
}) })
export const ItemAccounts = useCrudSchemas( 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: '是否账内库', // label: '是否账内库',
// field: 'isInAccount', // 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 * as LocationApi from '@/api/eam/basic/location'
import { Location } from '@/views/eam/basic/location/location.data' import { Location } from '@/views/eam/basic/location/location.data'
import { validateNumber } from '@/utils/validator' import { validateNumber } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const ItemInLocationRules = reactive({ export const ItemInLocationRules = reactive({
number: [required], number: [required],
@ -52,28 +53,28 @@ export const ItemInLocation = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false, isSearch: false,
isForm:false isForm:false
}, },
// { {
// label: '备件编号', label: '备件编号',
// field: 'itemNumber', field: 'itemNumber',
// sort: 'custom', sort: 'custom',
// isSearch: true, isSearch: true,
// form:{ form:{
// componentProps:{ componentProps:{
// disabled:true disabled:true
// } }
// } }
// }, },
// { {
// label: '备件名称', label: '备件名称',
// field: 'itemName', field: 'itemName',
// sort: 'custom', sort: 'custom',
// isSearch: false, isSearch: false,
// form:{ form:{
// componentProps:{ componentProps:{
// disabled:true disabled:true
// } }
// } }
// }, },
{ {
label: '归还人', label: '归还人',
field: 'returner', 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: '操作', label: '操作',
field: 'action', field: 'action',

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

@ -1,19 +1,23 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import * as LocationAreaApi from '@/api/eam/basic/locationArea' import * as LocationAreaApi from '@/api/eam/basic/locationArea'
import { LocationArea } from '@/views/eam/basic/locationArea/locationArea.data' import { LocationArea } from '@/views/eam/basic/locationArea/locationArea.data'
import { dateFormatter } from '@/utils/formatTime'
import * as LocationApi from '@/api/eam/basic/location' import * as LocationApi from '@/api/eam/basic/location'
import { Location } from '@/views/eam/basic/location/location.data' import { Location } from '@/views/eam/basic/location/location.data'
import { validateNumber } from '@/utils/validator'
// 表单校验 // 表单校验
export const ItemOutLocationRules = reactive({ export const ItemOutLocationRules = reactive({
// number: [required], // number: [required],
itemNumber: [required], itemNumber: [required],
qty: [required], qty: [
locationNumber: [required], required,
{ validator: validateNumber, message: '数量不能等于0', trigger: 'blur' },
],
locationNumber: [required]
}) })
export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([ export const ItemOutLocation = useCrudSchemas(
reactive<CrudSchema[]>([
// { // {
// label: '编号', // label: '编号',
// field: 'number', // field: 'number',
@ -88,16 +92,16 @@ export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([
field: 'locationName', field: 'locationName',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
isForm:false isForm: false
}, },
{ {
label: '备件编号', label: '备件编号',
field: 'itemNumber', field: 'itemNumber',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form:{ form: {
componentProps:{ componentProps: {
disabled:true disabled: true
} }
} }
}, },
@ -106,9 +110,9 @@ export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([
field: 'itemName', field: 'itemName',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
form:{ form: {
componentProps:{ componentProps: {
disabled:true disabled: true
} }
} }
}, },
@ -116,7 +120,7 @@ export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([
label: '领用人', label: '领用人',
field: 'receiver', field: 'receiver',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false
}, },
// { // {
// label: '出库类型', // label: '出库类型',
@ -134,22 +138,39 @@ export const ItemOutLocation = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: 110 width: 110
}, },
form:{ form: {
component: 'InputNumber', component: 'InputNumber',
componentProps:{ componentProps: {
min: 0,//最小值` min: 0, //最小值`
precision: 2//精度` 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: '操作', label: '操作',
field: 'action', field: 'action',
isForm: false, isForm: false,
isTable:false, isTable: false,
table: { table: {
width: 150, width: 150,
fixed: 'right' fixed: 'right'
} }
} }
])) ])
)

Loading…
Cancel
Save