ljlong_2630 8 months ago
parent
commit
b66dee5c2c
  1. 19
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  2. 62
      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 { 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],

62
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 })
@ -279,17 +280,26 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验
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<CrudSchema[]>([
@ -355,9 +365,9 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
tableForm: {
type: 'Select',
initOptions: userList,
multiple:true,
collapseTags:true,
collapseTagsTooltip:true,
multiple: true,
collapseTags: true,
collapseTagsTooltip: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
@ -366,7 +376,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
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<CrudSchema[]>([
disabled: false,
}
},
},{
}, {
label: '完成时间',
field: 'completionTime',
sort: 'custom',
@ -436,7 +446,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'Input',
componentProps: {
type:'textarea'
type: 'textarea'
}
}
},
@ -459,12 +469,12 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
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<CrudSchema[]>([
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,9 +514,9 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
table: {
},
isForm:false,
isDetail:false,
isTable:false,
isForm: false,
isDetail: false,
isTable: false,
isSearch: false,
isTableForm: false,
},
@ -520,7 +530,7 @@ export const MoldMaintainOrderDetail = useCrudSchemas(reactive<CrudSchema[]>([
form: {
component: 'Input',
componentProps: {
type:'TextArea'
type: 'TextArea'
}
}
},

Loading…
Cancel
Save