|
|
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
|
|
|
// 表单校验
|
|
|
|
export const PackageRules = reactive({
|
|
|
|
number: [required],
|
|
|
|
itemCode: [required],
|
|
|
|
itemName: [required],
|
|
|
|
})
|
|
|
|
export const Package2 = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '包装号',
|
|
|
|
field: 'number',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
table: {
|
|
|
|
width: 180,
|
|
|
|
fixed: 'left'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]))
|
|
|
|
export const Package = useCrudSchemas(reactive<CrudSchema[]>([
|
|
|
|
{
|
|
|
|
label: '标签号',
|
|
|
|
field: 'number',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
table: {
|
|
|
|
fixed: 'left'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '标签类型',
|
|
|
|
field: 'type',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
dictType: DICT_TYPE.LABEL_TYPE,
|
|
|
|
dictClass: 'string'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '标签模板',
|
|
|
|
field: 'template',
|
|
|
|
sort: 'custom',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '标签状态',
|
|
|
|
field: 'status',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch: true,
|
|
|
|
dictType: DICT_TYPE.LABEL_STATUS,
|
|
|
|
dictClass: 'string'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '关联号',
|
|
|
|
field: 'relateNumber',
|
|
|
|
sort: 'custom',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '标签条码字符串',
|
|
|
|
field: 'barcodeString',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 180,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '打印次数',
|
|
|
|
field: 'printTimes',
|
|
|
|
sort: 'custom',
|
|
|
|
form: {
|
|
|
|
component: 'InputNumber',
|
|
|
|
componentProps: {
|
|
|
|
min: 0
|
|
|
|
},
|
|
|
|
value: 0
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '最后打印时间',
|
|
|
|
field: 'lastPrintTime',
|
|
|
|
sort: 'custom',
|
|
|
|
formatter: dateFormatter,
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
style: {width:'100%'},
|
|
|
|
type: 'datetime',
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
valueFormat: 'x',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '最后打印人ID',
|
|
|
|
field: 'lastPrintUserId',
|
|
|
|
sort: 'custom'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '最后打印人用户名',
|
|
|
|
field: 'lastPrintUserName',
|
|
|
|
sort: 'custom',
|
|
|
|
table: {
|
|
|
|
width: 180,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '是否可用',
|
|
|
|
field: 'available',
|
|
|
|
sort: 'custom',
|
|
|
|
isSearch:true,
|
|
|
|
isForm: false,
|
|
|
|
dictType: DICT_TYPE.TRUE_FALSE,
|
|
|
|
dictClass: 'string', // 默认都是字符串类型其他暂不考虑
|
|
|
|
search: {
|
|
|
|
value: 'TRUE',
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'Switch',
|
|
|
|
value: 'TRUE',
|
|
|
|
componentProps: {
|
|
|
|
inactiveValue: 'FALSE',
|
|
|
|
activeValue: 'TRUE'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
table: {
|
|
|
|
width: 110
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '创建时间',
|
|
|
|
field: 'createTime',
|
|
|
|
isForm: false,
|
|
|
|
table: {
|
|
|
|
width: 180
|
|
|
|
},
|
|
|
|
formatter: dateFormatter,
|
|
|
|
detail: {
|
|
|
|
dateFormat : 'YYYY-MM-DD HH:mm:ss'
|
|
|
|
},
|
|
|
|
form: {
|
|
|
|
component: 'DatePicker',
|
|
|
|
componentProps: {
|
|
|
|
style: {width:'100%'},
|
|
|
|
type: 'datetime',
|
|
|
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
valueFormat: 'x',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '创建者',
|
|
|
|
field: 'creator',
|
|
|
|
table: {
|
|
|
|
width: 130
|
|
|
|
},
|
|
|
|
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: 'action',
|
|
|
|
isForm: false,
|
|
|
|
table: {
|
|
|
|
width: 150,
|
|
|
|
fixed: 'right'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]))
|