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.
157 lines
2.8 KiB
157 lines
2.8 KiB
11 months ago
|
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||
|
import { dateFormatter } from '@/utils/formatTime'
|
||
|
import { validateHanset, validateEmail } from '@/utils/validator'
|
||
|
const { t } = useI18n() // 国际化
|
||
|
|
||
|
/**
|
||
|
* @returns {Array} 备件申领主表
|
||
|
*/
|
||
|
export const CountJobMain = useCrudSchemas(reactive<CrudSchema[]>([
|
||
|
{
|
||
|
label: '计划编号',
|
||
|
field: 'number',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
isSearch: true,
|
||
|
table: {
|
||
|
width: 180,
|
||
|
fixed: 'left'
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '工单编号',
|
||
|
field: 'jobNumber',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
isSearch: true,
|
||
|
table: {
|
||
|
width: 180,
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '名称',
|
||
|
field: 'name',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
isSearch: false,
|
||
|
},
|
||
|
{
|
||
|
label: '操作',
|
||
|
field: 'action',
|
||
|
isDetail: false,
|
||
|
isForm: false,
|
||
|
table: {
|
||
|
width: 200,
|
||
|
fixed: 'right'
|
||
|
}
|
||
|
}
|
||
|
]))
|
||
|
|
||
|
//表单校验
|
||
|
export const CountJobMainRules = reactive({
|
||
|
name: [
|
||
|
{ required: true, message: '请填写描述', trigger: 'change' }
|
||
|
],
|
||
|
remark: [
|
||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
|
||
|
],
|
||
|
available: [
|
||
|
{ required: true, message: '请选择是否可用', trigger: 'change' }
|
||
|
],
|
||
|
})
|
||
|
|
||
|
/**
|
||
|
* @returns {Array} 备件申请子表
|
||
|
*/
|
||
|
export const CountJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
|
||
|
{
|
||
|
label: '工单编号',
|
||
|
field: 'number',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
isSearch: true,
|
||
|
table: {
|
||
|
width: 180,
|
||
|
fixed: 'left'
|
||
|
},
|
||
|
},
|
||
|
|
||
|
{
|
||
|
label: '备件编号',
|
||
|
field: 'itemNumber',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
isSearch: true,
|
||
|
table: {
|
||
|
width: 180,
|
||
|
},
|
||
|
},
|
||
|
|
||
|
{
|
||
|
label: '库位编号',
|
||
|
field: 'locationNumber',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
isSearch: true,
|
||
|
table: {
|
||
|
width: 180,
|
||
|
},
|
||
|
},
|
||
|
|
||
|
{
|
||
|
label: '库区编号',
|
||
|
field: 'areaNumber',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
isSearch: true,
|
||
|
table: {
|
||
|
width: 180,
|
||
|
},
|
||
|
},
|
||
|
|
||
|
{
|
||
|
label: '库存数量',
|
||
|
field: 'qty',
|
||
|
sort: 'custom',
|
||
|
isForm: false,
|
||
|
isSearch: true,
|
||
|
table: {
|
||
|
width: 180,
|
||
|
},
|
||
|
form: {
|
||
|
component: 'InputNumber',
|
||
|
componentProps: {
|
||
|
min: 0,
|
||
|
precision: 2
|
||
|
}
|
||
|
},
|
||
|
tableForm: {
|
||
|
type: 'InputNumber',
|
||
|
min: 0,
|
||
|
precision: 2
|
||
|
}
|
||
|
},
|
||
|
{
|
||
|
label: '操作',
|
||
|
field: 'action',
|
||
|
isDetail: false,
|
||
|
isForm: false,
|
||
|
table: {
|
||
|
width: 150,
|
||
|
fixed: 'right'
|
||
|
},
|
||
|
isTableForm: false,
|
||
|
}
|
||
|
]))
|
||
|
|
||
|
//表单校验
|
||
|
export const CountJobDetailRules = reactive({
|
||
|
lineNumber: [
|
||
|
{ required: true, message: '请输入行号', trigger: 'blur' },
|
||
|
{ max: 50, message: '不得超过50个字符', trigger: 'blur' }
|
||
|
],
|
||
|
stdPackQty: [
|
||
|
{ required: true, message: '请输入标包数量', trigger: 'blur' }
|
||
|
],
|
||
|
})
|