Browse Source

检修和维修工单bug

master
zhang_li 8 months ago
parent
commit
1088c8b5a1
  1. 12
      src/utils/validator.ts
  2. 47
      src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts
  3. 4
      src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts
  4. 6
      src/views/eam/device/devicemaintainjob/index.vue
  5. 1
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  6. 4
      src/views/eam/device/devicemaintenancejob/index.vue
  7. 7
      src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts
  8. 3
      src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts

12
src/utils/validator.ts

@ -208,6 +208,17 @@ export function validateNum(rule, value, callback) {
callback() callback()
} }
} }
export function validateNum100(rule, value, callback) {
if (value) {
if (value<=100) {
callback()
} else {
callback(new Error('预估人数不得超出100'))
}
} else {
callback()
}
}
//数字和小数点 //数字和小数点
export function validateNumDot(rule, value, callback) { export function validateNumDot(rule, value, callback) {
@ -749,6 +760,7 @@ export default {
validateChinese, validateChinese,
validatePostCode, validatePostCode,
validateNum, validateNum,
validateNum100,
validateNumDot, validateNumDot,
validateZYS, validateZYS,
validateOrganization, validateOrganization,

47
src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts

@ -6,7 +6,7 @@ import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMai
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' import { validateHanset, validateNum, validateNum100 } from '@/utils/validator'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore() const userStore = useUserStore()
@ -33,7 +33,7 @@ export const DeviceInspectionMainRules = reactive({
{ max: 200, message: '不得超过200个字符', trigger: 'blur' }, { max: 200, message: '不得超过200个字符', trigger: 'blur' },
], ],
maintenancePhone: [ maintenancePhone: [
{ validator:validateHanset, message: '输入电话格式不正确', trigger: 'blur'} { validator: validateHanset, message: '输入电话格式不正确', trigger: 'blur' }
], ],
status: [required], status: [required],
@ -306,27 +306,32 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150, width: 150,
fixed: 'right' fixed: 'right'
}, },
isDetail:false isDetail: false
} }
])) ]))
// 表单校验 // 表单校验
export const DeviceInspectionDetailRules = reactive({ export const DeviceInspectionDetailRules = reactive({
chargePeoples:[ chargePeoples: [
required, required,
], ],
estimatedMinutes:[ peoples: [
required, required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}, { validator: validateNum, message: '请输入正整数', trigger: 'blur' },
{ validator: validateNum100, message: '预估人数不得超出100', trigger: 'blur' },
],
estimatedMinutes: [
required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' },
], ],
number: [required], number: [required],
actualMinutes: [ actualMinutes: [
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}, { validator: validateNum, message: '请输入正整数', trigger: 'blur' },
], ],
maintenance: [required], maintenance: [required],
uncompleted :[ uncompleted: [
{ required:true, message: '该项为必填项', trigger: 'blur'} { required: true, message: '该项为必填项', trigger: 'blur' }
], ],
}) })
@ -352,9 +357,9 @@ export const DeviceInspectionDetail = 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'
@ -395,7 +400,7 @@ export const DeviceInspectionDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: '人数', label: '预估人数',
field: 'peoples', field: 'peoples',
sort: 'custom', sort: 'custom',
table: { table: {
@ -502,12 +507,12 @@ export const DeviceInspectionDetail = 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) => {
@ -528,9 +533,9 @@ export const DeviceInspectionDetail = 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',
@ -547,9 +552,9 @@ export const DeviceInspectionDetail = 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,
}, },

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

@ -4,7 +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' import { validateNum100, 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 })
@ -226,6 +226,8 @@ export const DeviceMaintainOrderDetailRules = reactive({
required, required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'}, { validator:validateNum, message: '请输入正整数', trigger: 'blur'},
{ validator:validateNum100, message: '预估人数不得超出100', trigger: 'blur'},
], ],
estimatedMinutes: [ estimatedMinutes: [

6
src/views/eam/device/devicemaintainjob/index.vue

@ -507,11 +507,7 @@ function buttonControllFunction(row, val) {
return true return true
} }
} else if(val == 'add') { } else if(val == 'add') {
if (row.status == 'COMPLETED' || row.status == 'VERIFIED' || row.status == 'REJECTED' || !isReceiver(row.maintenance)) { return false
return false
} else {
return true
}
} else { } else {
return true return true
} }

1
src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts

@ -182,6 +182,7 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
}, },
dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE,
isSearch: true, isSearch: true,
search: { search: {
component: 'Select', component: 'Select',

4
src/views/eam/device/devicemaintenancejob/index.vue

@ -479,6 +479,10 @@ const openFormSec = async (type: string, row?: any) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
const deviceMoldType = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
row.typeName = deviceMoldType.find((account) => account.value == row.type)?.label
console.log(row)
operatRecord.value = row; operatRecord.value = row;
detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintenanceMain') detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintenanceMain')
} }

7
src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts

@ -8,7 +8,7 @@ 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 * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import { validateHanset, validateNumDot, validateNum, validateEmail } from '@/utils/validator' import { validateHanset, validateNum, validateNum100 } from '@/utils/validator'
const userStore = useUserStore() const userStore = useUserStore()
const userListAll = await UserApi.getSimpleUserList() const userListAll = await UserApi.getSimpleUserList()
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
@ -311,6 +311,11 @@ export const MoldInspectionDetailRules = reactive({
chargePeoples:[ chargePeoples:[
required, required,
], ],
peoples: [
required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' },
{ validator: validateNum100, message: '预估人数不得超出100', trigger: 'blur' },
],
estimatedMinutes:[ estimatedMinutes:[
required, required,
{ validator:validateNum, message: '请输入正整数', trigger: 'blur'} { validator:validateNum, message: '请输入正整数', trigger: 'blur'}

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

@ -4,7 +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' import { validateNum,validateNum100 } 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 })
@ -286,6 +286,7 @@ export const MoldMaintainOrderDetailRules = reactive({
peoples: [ peoples: [
required, required,
{ validator: validateNum, message: '请输入正整数', trigger: 'blur' }, { validator: validateNum, message: '请输入正整数', trigger: 'blur' },
{ validator: validateNum100, message: '预估人数不得超出100', trigger: 'blur' },
], ],
estimatedMinutes: [ estimatedMinutes: [
required, required,

Loading…
Cancel
Save