diff --git a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts index a4311f6..7a80e5a 100644 --- a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts +++ b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts @@ -4,6 +4,7 @@ import { selecUserByType } from '@/api/system/dept' import { dateFormatter } from '@/utils/formatTime' import { ItemSearchTable } from '../../basic/item/item.data' import * as ItemApi from '@/api/eam/basic/item' +import { validateHanset, validateInteger, validateNum } from '@/utils/validator' const factoryList = await selectAllFactoryArea() const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }) @@ -221,9 +222,21 @@ export const DeviceMaintainOrderDetailRules = reactive({ concurrencyStamp: [required], name: [required], number: [required], - peoples: [required], - estimatedMinutes: [required], - actualMinutes: [required], + peoples: [ + + required, + { validator:validateNum, message: '请输入正整数', trigger: 'blur'}, + ], + estimatedMinutes: [ + + required, + { validator:validateNum, message: '请输入正整数', trigger: 'blur'}, + ], + actualMinutes: [ + + required, + { validator:validateNum, message: '请输入正整数', trigger: 'blur'}, + ], chargePeoples: [required], completionTime: [required], engineer: [required], diff --git a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts index 1e250ac..e5ee530 100644 --- a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts +++ b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts @@ -4,6 +4,7 @@ import { selecUserByType } from '@/api/system/dept' import { dateFormatter } from '@/utils/formatTime' import { ItemSearchTable } from '../../basic/item/item.data' import * as ItemApi from '@/api/eam/basic/item' +import { validateNum } from '@/utils/validator' const factoryList = await selectAllFactoryArea() const userList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: 1 }) const dutyUserList = await selecUserByType({ classType: 'MOLD', factoryAreaNumber: '', flag: undefined }) @@ -173,7 +174,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive([ value: 0 }, }, - + { label: '指派时间', field: 'assignTime', @@ -225,7 +226,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive([ } }, }, - + // { // label: '创建时间', // field: 'createTime', @@ -279,21 +280,30 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive([ // 表单校验 export const MoldMaintainOrderDetailRules = reactive({ - concurrencyStamp: [required], - name: [required], - number: [required], - peoples: [required], - estimatedMinutes: [required], - actualMinutes: [required], - chargePeoples: [required], - completionTime: [required], - engineer: [required], - uncompleted: [required], - contents: [required], + concurrencyStamp: [required], + name: [required], + number: [required], + peoples: [ + required, + { validator: validateNum, message: '请输入正整数', trigger: 'blur' }, + ], + estimatedMinutes: [ + required, + { validator: validateNum, message: '请输入正整数', trigger: 'blur' }, + ], + actualMinutes: [ + required, + { validator: validateNum, message: '请输入正整数', trigger: 'blur' }, + ], + chargePeoples: [required], + completionTime: [required], + engineer: [required], + uncompleted: [required], + contents: [required], }) export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ - + { label: '保养工单号', field: 'number', @@ -355,9 +365,9 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ tableForm: { type: 'Select', initOptions: userList, - multiple:true, - collapseTags:true, - collapseTagsTooltip:true, + multiple: true, + collapseTags: true, + collapseTagsTooltip: true, optionsAlias: { labelField: 'name', valueField: 'id' @@ -365,8 +375,8 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ }, api: () => dutyUserList, formatter: (_: Recordable, __: TableColumn, cellValue: number) => { - - return userList.filter(item=>cellValue?.includes(item.id)).map(cur=>cur.name).join(',') + + return userList.filter(item => cellValue?.includes(item.id)).map(cur => cur.name).join(',') }, form: { component: 'Select', @@ -405,7 +415,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ disabled: false, } }, - },{ + }, { label: '完成时间', field: 'completionTime', sort: 'custom', @@ -436,7 +446,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ form: { component: 'Input', componentProps: { - type:'textarea' + type: 'textarea' } } }, @@ -459,12 +469,12 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ sort: 'custom', table: { }, - tableForm:{ + tableForm: { isInpuFocusShow: true, // 开启查询弹窗 searchListPlaceholder: '请选择备件', searchField: 'itemNumbers1', searchTitle: '备件', - multiple:true, + multiple: true, searchAllSchemas: ItemSearchTable.allSchemas, searchPage: ItemApi.getItemList, tableSelectionChange: (value) => { @@ -485,9 +495,9 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ searchListPlaceholder: '请选择备件', // 输入框占位文本 searchField: 'itemNumbers1', // 查询弹窗赋值字段 searchTitle: '备件', // 查询弹窗标题 - multiple:true, - searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 - searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 + multiple: true, + searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 + searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 searchCondition: [{ key: 'number', value: 'deviceNumber', @@ -504,14 +514,14 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ sort: 'custom', table: { }, - isForm:false, - isDetail:false, - isTable:false, + isForm: false, + isDetail: false, + isTable: false, isSearch: false, isTableForm: false, }, - - + + { label: '工程师确认', field: 'engineer', @@ -520,7 +530,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive([ form: { component: 'Input', componentProps: { - type:'TextArea' + type: 'TextArea' } } },