You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
255 lines
6.8 KiB
255 lines
6.8 KiB
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import * as LocationAreaApi from '@/api/eam/basic/locationArea'
|
|
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'
|
|
const typeList = getStrDictOptions(DICT_TYPE.ITEM_ACCOUNT_LOCATION_TYPE).filter(item => item.value != '1')
|
|
const typeLists = getStrDictOptions(DICT_TYPE.ITEM_ACCOUNT_LOCATION_TYPE)
|
|
// 表单校验
|
|
export const ItemAccountsRules = reactive({
|
|
itemNumber: [required],
|
|
name: [required],
|
|
areaNumber: [required],
|
|
type: [required],
|
|
locationNumber: [required],
|
|
qty: [
|
|
required,
|
|
{ validator: validateNumber, message: '数量不能等于0', trigger: 'blur' },
|
|
],
|
|
})
|
|
|
|
export const ItemAccounts = useCrudSchemas(
|
|
reactive<CrudSchema[]>([
|
|
{
|
|
label: '备件编号',
|
|
field: 'itemNumber',
|
|
sort: 'custom',
|
|
isSearch: true,
|
|
form: {
|
|
// labelMessage: '信息提示说明!!!',
|
|
componentProps: {
|
|
isSearchList: true, // 开启查询弹窗
|
|
searchListPlaceholder: '请选择备件编号', // 输入框占位文本
|
|
searchField: 'number', // 查询弹窗赋值字段
|
|
searchTitle: '备件信息', // 查询弹窗标题
|
|
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类
|
|
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法
|
|
searchCondition: [
|
|
{
|
|
key: 'available',
|
|
value: 'TRUE',
|
|
isMainValue: false
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '备件名称',
|
|
field: 'itemName',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 110
|
|
},
|
|
form:{
|
|
componentProps:{
|
|
disabled:true
|
|
}
|
|
},
|
|
isSearch: 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: false,
|
|
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
|
|
},
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '库位名称',
|
|
field: 'locationName',
|
|
sort: 'custom',
|
|
isSearch: false,
|
|
isForm:false
|
|
},
|
|
// {
|
|
// label: '库位类型',
|
|
// field: 'type',
|
|
// dictType: DICT_TYPE.ITEM_ACCOUNT_LOCATION_TYPE,
|
|
// dictClass: 'string',
|
|
// isSearch: true,
|
|
// isTable: true,
|
|
// sort: 'custom',
|
|
// table: {
|
|
// width: 130
|
|
// },
|
|
// form: {
|
|
// component: 'Select'
|
|
// }
|
|
// },
|
|
{
|
|
label: '库位类型',
|
|
field: 'type',
|
|
sort: 'custom',
|
|
table: {
|
|
width: '150',
|
|
},
|
|
isDetail: false,
|
|
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
|
|
return typeLists.find((account) => account.value == cellValue)?.label
|
|
},
|
|
// dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE,
|
|
isSearch: false,
|
|
search: {
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: typeList,
|
|
optionsAlias: {
|
|
labelField: 'label',
|
|
valueField: 'value'
|
|
},
|
|
filterable: true,
|
|
},
|
|
},
|
|
form: {
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: typeList,
|
|
optionsAlias: {
|
|
labelField: 'label',
|
|
valueField: 'value'
|
|
},
|
|
//disabled: true,
|
|
//filterable: true,
|
|
placeholder: "请选择类型"
|
|
}
|
|
},
|
|
},
|
|
// {
|
|
// label: '库位类型',
|
|
// field: 'type',
|
|
// dictType: DICT_TYPE.ITEM_ACCOUNT_LOCATION_TYPE,
|
|
// dictClass: 'string',
|
|
// isSearch: true,
|
|
// isTable: true,
|
|
// sort: 'custom',
|
|
// table: {
|
|
// width: 130
|
|
// },
|
|
// 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: 'isInAccount',
|
|
// dictType: DICT_TYPE.TRUE_FALSE,
|
|
// dictClass: 'string',
|
|
// isSearch: false,
|
|
// isTable: true,
|
|
// sort: 'custom',
|
|
// table: {
|
|
// width: 130
|
|
// },
|
|
|
|
{
|
|
label: '操作',
|
|
field: 'action',
|
|
isForm: false,
|
|
table: {
|
|
width: 250,
|
|
fixed: 'right'
|
|
}
|
|
}
|
|
])
|
|
)
|
|
|