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. 297
      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',

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

@ -1,155 +1,176 @@
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: '编号', // {
// field: 'number', // label: '编号',
// sort: 'custom', // field: 'number',
// isSearch: false, // sort: 'custom',
// isForm:false, // isSearch: false,
// }, // isForm:false,
// { // },
// label: '库区编号', // {
// field: 'areaNumber', // label: '库区编号',
// sort: 'custom', // field: 'areaNumber',
// isSearch: false, // sort: 'custom',
// form: { // isSearch: false,
// // labelMessage: '信息提示说明!!!', // form: {
// componentProps: { // // labelMessage: '信息提示说明!!!',
// isSearchList: true, // 开启查询弹窗 // componentProps: {
// searchListPlaceholder: '请选择库区编号', // 输入框占位文本 // isSearchList: true, // 开启查询弹窗
// searchField: 'number', // 查询弹窗赋值字段 // searchListPlaceholder: '请选择库区编号', // 输入框占位文本
// searchTitle: '库区信息', // 查询弹窗标题 // searchField: 'number', // 查询弹窗赋值字段
// searchAllSchemas: LocationArea.allSchemas, // 查询弹窗所需类 // searchTitle: '库区信息', // 查询弹窗标题
// searchPage: LocationAreaApi.getLocationAreaPage, // 查询弹窗所需分页方法 // searchAllSchemas: LocationArea.allSchemas, // 查询弹窗所需类
// searchCondition: [ // searchPage: LocationAreaApi.getLocationAreaPage, // 查询弹窗所需分页方法
// { // searchCondition: [
// key: 'available', // {
// value: 'TRUE', // key: 'available',
// isMainValue: false // value: 'TRUE',
// } // isMainValue: false
// ] // }
// } // ]
// } // }
// }, // }
// { // },
// label: '库区名称', // {
// field: 'areaName', // label: '库区名称',
// sort: 'custom', // field: 'areaName',
// isSearch: false, // sort: 'custom',
// isForm:false // isSearch: false,
// }, // isForm:false
{ // },
label: '库位编号', {
field: 'locationNumber', label: '库位编号',
sort: 'custom', field: 'locationNumber',
isSearch: true, sort: 'custom',
form: { isSearch: true,
// labelMessage: '信息提示说明!!!', form: {
componentProps: { // labelMessage: '信息提示说明!!!',
isSearchList: true, // 开启查询弹窗 componentProps: {
searchListPlaceholder: '请选择库位编号', // 输入框占位文本 isSearchList: true, // 开启查询弹窗
searchField: 'number', // 查询弹窗赋值字段 searchListPlaceholder: '请选择库位编号', // 输入框占位文本
searchTitle: '库位信息', // 查询弹窗标题 searchField: 'number', // 查询弹窗赋值字段
searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 searchTitle: '库位信息', // 查询弹窗标题
searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 searchAllSchemas: Location.allSchemas, // 查询弹窗所需类
searchCondition: [ searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法
{ searchCondition: [
key: 'available', {
value: 'TRUE', key: 'available',
isMainValue: false value: 'TRUE',
} isMainValue: false
}
// ,
// { // ,
// key: 'areaNumber', // {
// value: 'areaNumber', // key: 'areaNumber',
// isMainValue: true // value: 'areaNumber',
// }, // isMainValue: true
] // },
]
}
} }
} },
}, {
{ label: '库位名称',
label: '库位名称', 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 }
} }
} },
}, {
{ label: '备件名称',
label: '备件名称', field: 'itemName',
field: 'itemName', sort: 'custom',
sort: 'custom', isSearch: false,
isSearch: false, form: {
form:{ componentProps: {
componentProps:{ disabled: true
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', label: '领用人',
componentProps:{ field: 'receiver',
min: 0,//最小值` sort: 'custom',
precision: 2//精度` 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