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.

334 lines
6.4 KiB

import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter2 } from '@/utils/formatTime'
import { validateHanset, validateEmail } from '@/utils/validator'
import { dateFormatter } from '@/utils/formatTime'
1 year ago
import { validateTwoNum } from '@/utils/validator'
const { t } = useI18n() // 国际化
/**
* @returns {Array}
*/
export const QualityNoticeMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
1 year ago
isForm: false,
table: {
width: 150,
fixed: 'left'
}
},
{
label: '类型',
field: 'type',
1 year ago
dictType: DICT_TYPE.QUALITY_NOTIFICATION_TYPE,
sort: 'custom',
isSearch: true,
1 year ago
isForm: false,
table: {
width: 150
}
},
{
label: '描述',
field: 'description',
sort: 'custom',
isSearch: false,
1 year ago
isForm: false,
table: {
width: 150
}
},
{
label: '详情',
field: 'detail',
sort: 'custom',
isSearch: false,
1 year ago
isForm: false,
table: {
width: 150
}
1 year ago
}, {
label: '优先级',
field: 'priority',
sort: 'custom',
isSearch: false,
1 year ago
isForm: false,
table: {
width: 150
},
form: {
1 year ago
componentProps: {
disabled: true
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: false,
1 year ago
isForm: false,
table: {
width: 150
},
form: {
1 year ago
componentProps: {
disabled: true
}
},
},
{
label: '报告人',
field: 'reporter',
sort: 'custom',
isSearch: false,
1 year ago
isForm: false,
table: {
width: 150
},
form: {
1 year ago
componentProps: {
disabled: true
}
},
},
{
label: '报告时间',
field: 'reportTime',
sort: 'custom',
1 year ago
formatter: dateFormatter,
isSearch: false,
1 year ago
isForm: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 150
}
},
{
label: '要求开始时间',
field: 'requestStartTime',
sort: 'custom',
1 year ago
formatter: dateFormatter,
isSearch: false,
1 year ago
isForm: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 150
}
},
{
label: '要求结束时间',
field: 'requestEndTime',
sort: 'custom',
1 year ago
formatter: dateFormatter,
isSearch: false,
1 year ago
isForm: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 150
}
},
{
label: '是否造成停机',
field: 'whetherCausesMachineHalt',
1 year ago
dictType: DICT_TYPE.FALSE_OR_TRUE,
sort: 'custom',
isSearch: false,
1 year ago
isForm: false,
table: {
width: 150
}
},
{
label: '停机开始时间',
field: 'machineHaltStartTime',
sort: 'custom',
1 year ago
formatter: dateFormatter,
isSearch: false,
1 year ago
isForm: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 150
}
},
{
label: '停机结束时间',
field: 'machineHaltEndTime',
sort: 'custom',
1 year ago
formatter: dateFormatter,
isSearch: false,
1 year ago
isForm: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
1 year ago
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 150
}
},
{
label: '协调人',
field: 'coordinator',
sort: 'custom',
isSearch: false,
1 year ago
isForm: false,
table: {
width: 150
}
},
{
label: '任务模板编号',
field: 'taskTemplateCode',
sort: 'custom',
isSearch: false,
1 year ago
isForm: false,
table: {
width: 150
}
},
{
label: '完成时间',
field: 'finishTime',
sort: 'custom',
1 year ago
formatter: dateFormatter,
isSearch: false,
1 year ago
isForm: false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 150
}
},
{
// reference_certificate_row
label: '参考通知编号',
field: 'referenceNoticeCode',
sort: 'custom',
isSearch: false,
1 year ago
isForm: false,
form: {
component: 'InputNumber',
value: 0
},
table: {
width: 150
}
},
1 year ago
{
label: '操作',
field: 'action',
isDetail: false,
isForm: false,
table: {
width: 200,
fixed: 'right'
}
}
]))
//表单校验
export const QualityNoticeMainRules = reactive({
useDecision: [required],
})