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.
202 lines
4.4 KiB
202 lines
4.4 KiB
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
import * as AreaApi from '@/api/wms/areabasic'
|
|
import { Area } from '@/views/wms/basicDataManage/factoryModeling/areabasic/areabasic.data'
|
|
|
|
import * as WarehouseApi from '@/api/wms/warehouse'
|
|
import { Warehouse } from '@/views/wms/basicDataManage/factoryModeling/warehouse/warehouse.data'
|
|
|
|
const { t } = useI18n() // 国际化
|
|
|
|
/**
|
|
* @returns {Array} 库位组
|
|
*/
|
|
export const Locationgroup = useCrudSchemas(reactive<CrudSchema[]>([
|
|
{
|
|
label: '代码',
|
|
field: 'code',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150,
|
|
fixed: 'left'
|
|
},
|
|
isSearch: true
|
|
},
|
|
{
|
|
label: '名称',
|
|
field: 'name',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
},
|
|
isSearch: true,
|
|
},
|
|
{
|
|
label: '仓库代码',
|
|
field: 'warehouseCode',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
},
|
|
isSearch: true,
|
|
form: {
|
|
// labelMessage: '信息提示说明!!!',
|
|
componentProps: {
|
|
isSearchList: true, // 开启查询弹窗
|
|
searchListPlaceholder: '请选择仓库代码', // 输入框占位文本
|
|
searchField: 'code', // 查询弹窗赋值字段
|
|
searchTitle: '仓库信息', // 查询弹窗标题
|
|
searchAllSchemas: Warehouse.allSchemas, // 查询弹窗所需类
|
|
searchPage: WarehouseApi.getWarehousePage // 查询弹窗所需分页方法
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '库区代码',
|
|
field: 'areaCode',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
},
|
|
form: {
|
|
// labelMessage: '信息提示说明!!!',
|
|
componentProps: {
|
|
isSearchList: true, // 开启查询弹窗
|
|
searchListPlaceholder: '请选择库区代码', // 输入框占位文本
|
|
searchField: 'code', // 查询弹窗赋值字段
|
|
searchTitle: '库区信息', // 查询弹窗标题
|
|
searchAllSchemas: Area.allSchemas, // 查询弹窗所需类
|
|
searchPage: AreaApi.getAreaPage // 查询弹窗所需分页方法
|
|
}
|
|
}
|
|
},
|
|
{
|
|
label: '是否可用',
|
|
field: 'available',
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
dictClass: 'string',
|
|
isTable: true,
|
|
isSearch: true,
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
},
|
|
form: {
|
|
component: 'Switch',
|
|
value: 'TRUE',
|
|
componentProps: {
|
|
inactiveValue: 'FALSE',
|
|
activeValue: 'TRUE'
|
|
}
|
|
},
|
|
},
|
|
{
|
|
label: '生效时间',
|
|
field: 'activeTime',
|
|
isTable: true,
|
|
formatter: dateFormatter,
|
|
detail: {
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
},
|
|
sort: 'custom',
|
|
table: {
|
|
width: 180
|
|
},
|
|
form: {
|
|
component: 'DatePicker',
|
|
componentProps: {
|
|
type: 'datetime',
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
valueFormat: 'x',
|
|
}
|
|
},
|
|
},
|
|
{
|
|
label: '失效时间',
|
|
field: 'expireTime',
|
|
isTable: true,
|
|
formatter: dateFormatter,
|
|
detail: {
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
},
|
|
sort: 'custom',
|
|
table: {
|
|
width: 180
|
|
},
|
|
form: {
|
|
component: 'DatePicker',
|
|
componentProps: {
|
|
type: 'datetime',
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
valueFormat: 'x',
|
|
}
|
|
},
|
|
},
|
|
{
|
|
label: '备注',
|
|
field: 'remark',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
},
|
|
},
|
|
{
|
|
label: '创建时间',
|
|
field: 'createTime',
|
|
formatter: dateFormatter,
|
|
detail: {
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
},
|
|
sort: 'custom',
|
|
table: {
|
|
width: 180
|
|
},
|
|
form: {
|
|
component: 'DatePicker',
|
|
componentProps: {
|
|
type: 'datetime',
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
valueFormat: 'x',
|
|
}
|
|
},
|
|
isForm: false,
|
|
isTable: false
|
|
},
|
|
{
|
|
label: '创建者',
|
|
field: 'creator',
|
|
sort: 'custom',
|
|
table: {
|
|
width: 150
|
|
},
|
|
isForm: false,
|
|
isTable: false
|
|
},
|
|
{
|
|
label: '操作',
|
|
field: 'action',
|
|
isDetail: false,
|
|
isForm: false ,
|
|
table: {
|
|
width: 150,
|
|
fixed: 'right'
|
|
}
|
|
}
|
|
]))
|
|
|
|
//表单校验
|
|
export const LocationgroupRules = reactive({
|
|
code: [
|
|
{ required: true, message: '请输入代码', trigger: 'blur' }
|
|
],
|
|
warehouseCode: [
|
|
{ required: true, message: '请输入仓库代码', trigger: 'change' }
|
|
],
|
|
areaCode: [
|
|
{ required: true, message: '请输入库区代码', trigger: 'change' }
|
|
],
|
|
available: [
|
|
{ required: true, message: '请选择是否可用', trigger: 'change' }
|
|
],
|
|
})
|