ljlong_2630 8 months ago
parent
commit
b66dee5c2c
  1. 19
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  2. 74
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

19
src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts

@ -4,6 +4,7 @@ import { selecUserByType } from '@/api/system/dept'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { ItemSearchTable } from '../../basic/item/item.data' import { ItemSearchTable } from '../../basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemApi from '@/api/eam/basic/item'
import { validateHanset, validateInteger, validateNum } from '@/utils/validator'
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 })
const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }) const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null })
@ -221,9 +222,21 @@ export const DeviceMaintainOrderDetailRules = reactive({
concurrencyStamp: [required], concurrencyStamp: [required],
name: [required], name: [required],
number: [required], number: [required],
peoples: [required], peoples: [
estimatedMinutes: [required],
actualMinutes: [required], required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'},
],
estimatedMinutes: [
required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'},
],
actualMinutes: [
required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'},
],
chargePeoples: [required], chargePeoples: [required],
completionTime: [required], completionTime: [required],
engineer: [required], engineer: [required],

74
src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

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

Loading…
Cancel
Save