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.
408 lines
8.3 KiB
408 lines
8.3 KiB
1 year ago
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||
|
import { dateFormatter } from '@/utils/formatTime'
|
||
|
const { t } = useI18n() // 国际化
|
||
|
|
||
|
/**
|
||
|
* @returns {Array} 任务设置
|
||
|
*/
|
||
|
export const Jobsetting = useCrudSchemas(reactive<CrudSchema[]>([
|
||
|
{
|
||
|
label: '代码',
|
||
|
field: 'code',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150,
|
||
|
fixed: 'left'
|
||
|
},
|
||
|
isSearch: true,
|
||
|
form: {
|
||
|
componentProps: {
|
||
|
disabled: true
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '有效分钟',
|
||
|
field: 'validMinutes',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'InputNumber',
|
||
|
componentProps: {
|
||
|
min: 0,
|
||
|
precision:0
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '自动完成',
|
||
|
field: 'autoComplete',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '允许修改库位',
|
||
|
field: 'allowModifyLocation',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '允许修改数量',
|
||
|
field: 'allowModifyQty',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '允许大于推荐数量',
|
||
|
field: 'allowBiggerQty',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '允许小于推荐数量',
|
||
|
field: 'allowSmallerQty',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '允许修改库存状态',
|
||
|
field: 'allowModifyInventoryStatus',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '允许连续扫描',
|
||
|
field: 'allowContinuousScanning',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '允许部分完成',
|
||
|
field: 'allowPartialComplete',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '允许修改批次',
|
||
|
field: 'allowModifyBach',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '允许修改包装号',
|
||
|
field: 'allowModifyPackingNumber',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
isTable: true,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '是否可用',
|
||
|
field: 'available',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
isTable: false,
|
||
|
isForm: false,
|
||
|
},
|
||
|
{
|
||
|
label: '生效时间',
|
||
|
field: 'activeTime',
|
||
|
isTable: true,
|
||
|
formatter: dateFormatter,
|
||
|
detail: {
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
||
|
},
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 180
|
||
|
},
|
||
|
form: {
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
style: {width:'100%'},
|
||
|
type: 'datetime',
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'x',
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '是否软删除',
|
||
|
field: 'isSoftDeleted',
|
||
|
dictType: DICT_TYPE.TRUE_FALSE,
|
||
|
dictClass: 'string',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
form: {
|
||
|
component: 'Switch',
|
||
|
value: 'TRUE',
|
||
|
componentProps: {
|
||
|
inactiveValue: 'FALSE',
|
||
|
activeValue: 'TRUE'
|
||
|
}
|
||
|
},
|
||
|
isTable: false,
|
||
|
isForm: false,
|
||
|
},
|
||
|
{
|
||
|
label: '失效时间',
|
||
|
field: 'expireTime',
|
||
|
isTable: true,
|
||
|
formatter: dateFormatter,
|
||
|
detail: {
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
||
|
},
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 180
|
||
|
},
|
||
|
form: {
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
style: {width:'100%'},
|
||
|
type: 'datetime',
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'x',
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '创建时间',
|
||
|
field: 'createTime',
|
||
|
formatter: dateFormatter,
|
||
|
isForm: false,
|
||
|
isTable: false,
|
||
|
detail: {
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss'
|
||
|
},
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 180
|
||
|
},
|
||
|
form: {
|
||
|
component: 'DatePicker',
|
||
|
componentProps: {
|
||
|
style: {width:'100%'},
|
||
|
type: 'datetime',
|
||
|
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||
|
valueFormat: 'x',
|
||
|
}
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '备注',
|
||
|
field: 'remark',
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '创建者',
|
||
|
field: 'creator',
|
||
|
isTable: false,
|
||
|
isForm: false,
|
||
|
sort: 'custom',
|
||
|
table: {
|
||
|
width: 150
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '操作',
|
||
|
field: 'action',
|
||
|
isDetail: false,
|
||
|
isForm: false,
|
||
|
table: {
|
||
|
width: 150,
|
||
|
fixed: 'right'
|
||
|
}
|
||
|
}
|
||
|
]))
|
||
|
|
||
|
//表单校验
|
||
|
export const JobsettingRules = reactive({
|
||
|
code: [
|
||
|
{ required: true, message: '请输入代码', trigger: 'blur' },
|
||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
|
||
|
],
|
||
|
validMinutes: [
|
||
|
{ required: true, message: '请输入有效分钟', trigger: 'blur' }
|
||
|
],
|
||
|
autoComplete: [
|
||
|
{ required: true, message: '请选择是否自动完成', trigger: 'change' }
|
||
|
],
|
||
|
allowModifyLocation: [
|
||
|
{ required: true, message: '请选择是否允许修改库位', trigger: 'change' }
|
||
|
],
|
||
|
allowModifyQty: [
|
||
|
{ required: true, message: '请选择是否允许修改数量', trigger: 'change' }
|
||
|
],
|
||
|
allowBiggerQty: [
|
||
|
{ required: true, message: '请选择是否允许大于推荐数量', trigger: 'change' }
|
||
|
],
|
||
|
allowSmallerQty: [
|
||
|
{ required: true, message: '请选择是否允许小于推荐数量', trigger: 'change' }
|
||
|
],
|
||
|
allowModifyInventoryStatus: [
|
||
|
{ required: true, message: '请选择是否允许修改库存状态', trigger: 'change' }
|
||
|
],
|
||
|
allowContinuousScanning: [
|
||
|
{ required: true, message: '请选择是否允许连续扫描', trigger: 'change' }
|
||
|
],
|
||
|
allowPartialComplete: [
|
||
|
{ required: true, message: '请选择是否允许部分完成', trigger: 'change' }
|
||
|
],
|
||
|
allowModifyBach: [
|
||
|
{ required: true, message: '请选择是否允许修改批次', trigger: 'change' }
|
||
|
],
|
||
|
allowModifyPackingNumber: [
|
||
|
{ required: true, message: '请选择是否允许修改包装号', trigger: 'change' }
|
||
|
],
|
||
|
remark: [
|
||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
|
||
|
],
|
||
|
})
|