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.
 
 
 

953 lines
17 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { fa } from 'element-plus/es/locale'
import * as PackageunitApi from '@/api/wms/packageunit'
import { Select } from '@element-plus/icons-vue/dist/types'
export const Packageunit1 = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装代码',
field: 'code',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '包装名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '包装类型',
field: 'type',
dictType: DICT_TYPE.PACK_UNIT_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '长',
field: 'length',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '宽',
field: 'width',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '高',
field: 'height',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '重量',
field: 'weight',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单位',
field: 'unit',
sort: 'custom',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string',
isSearch: false,
table: {
width: 150
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '包装描述',
field: 'desc',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
},
{
label: '是否重复使用',
field: 'reuse',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '是否管理包装库存',
field: 'manageBalance',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 180
},
},
{
label: '生效时间',
field: 'activeTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '失效时间',
field: 'expireTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
isForm: false,
},
{
label: '创建者',
field: 'creator',
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: true,
table: {
width: 150
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
isForm: false,
isTable: false,
isDetail: false,
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除者',
field: 'deleterId',
sort: 'custom',
isDetail: false,
isForm: false,
isTable: false,
table: {
width: 150
},
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
export const Packageunit = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装代码',
field: 'code',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},{
label: '父包装代码',
field: 'parentCode',
sort: 'custom',
isTable:false,
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
enterSearch: true,
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择父包装代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '包装规格信息', // 查询弹窗标题
searchAllSchemas: Packageunit1.allSchemas, // 查询弹窗所需类
searchPage: PackageunitApi.getPackageunitPageParent, // 查询弹窗所需分页方法
searchCondition:[{
key: 'available',
value: 'TRUE',
isMainValue: false
}],
verificationParams: [{
key: 'code',
action: '==',
value: '',
isMainValue: false,
isSearch: 'true',
isFormModel: true
}], // 失去焦点校验参数
}
}
},
{
label: '包装名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '包装类型',
field: 'type',
dictType: DICT_TYPE.PACK_UNIT_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '长',
field: 'length',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '宽',
field: 'width',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '高',
field: 'height',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '重量',
field: 'weight',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单位',
field: 'unit',
sort: 'custom',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string',
isSearch: false,
table: {
width: 150
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '包装描述',
field: 'desc',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
},
{
label: '是否重复使用',
field: 'reuse',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '是否管理包装库存',
field: 'manageBalance',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 180
},
},
{
label: '生效时间',
field: 'activeTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '失效时间',
field: 'expireTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
isForm: false,
},
{
label: '创建者',
field: 'creator',
isForm: false,
isTable: true
},
{
label: '最后更新时间',
field: 'updateTime',
sort: 'custom',
isDetail: true,
isForm: false,
isTable: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width:'100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
}
},
{
label: '最后更新者',
field: 'updater',
isDetail: true,
isForm: false,
isTable: true,
table: {
width: 150
}
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
isForm: false,
isTable: false,
isDetail: false,
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除者',
field: 'deleterId',
sort: 'custom',
isDetail: false,
isForm: false,
isTable: false,
table: {
width: 150
},
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isForm: false,
isDetail: false,
isTable: false,
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isForm: false,
isDetail: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 表单校验
export const PackageunitRules = reactive({
code: [
{ required: true, message: '请输入包装代码', trigger: 'change' }
],
name: [
{ required: true, message: '请输入包装名称', trigger: 'change' }
],
type: [
{ required: true, message: '请选择包装类型', trigger: 'change' }
],
reuse: [
{ required: true, message: '请选择是否重复使用', trigger: 'change' }
],
desc: [
{ max: 50, message: '不得超过50个字符', trigger: 'blur' },
{ required: true, message: '请输入包装描述', trigger: 'change' }
],
})
//新增时针对父包装代码copy出的实体
export const PackageunitCopy = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '包装代码',
field: 'code',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '父包装代码',
field: 'parentCode',
sort: 'custom',
table: {
width: 150
}
},
{
label: '包装名称',
field: 'name',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '包装类型',
field: 'type',
dictType: DICT_TYPE.PACK_UNIT_TYPE,
dictClass: 'string',
sort: 'custom',
isSearch: true,
table: {
width: 150
},
},
{
label: '长',
field: 'length',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '宽',
field: 'width',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '高',
field: 'height',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '重量',
field: 'weight',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单位',
field: 'unit',
sort: 'custom',
dictType: DICT_TYPE.PACK_UNIT,
dictClass: 'string',
isSearch: true,
table: {
width: 150
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '包装描述',
field: 'desc',
sort: 'custom',
isSearch: false,
table: {
width: 150
},
},
{
label: '是否重复使用',
field: 'reuse',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 150
},
},
{
label: '是否管理包装库存',
field: 'manageBalance',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isSearch: false,
form: {
component: 'Switch',
value: 'FALSE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
table: {
width: 180
},
},
{
label: '生效时间',
field: 'activeTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '失效时间',
field: 'expireTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
table: {
width: 180
},
formatter: dateFormatter,
isForm: false,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
table: {
width: 150
},
},
{
label: '删除时间',
field: 'deletionTime',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 180
},
formatter: dateFormatter,
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '删除者',
field: 'deleterId',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
},
{
label: '扩展属性',
field: 'extraProperties',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '地点',
field: 'siteId',
sort: 'custom',
isForm: false,
isTable: false,
table: {
width: 150
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))