Browse Source

维修工单问题修复

master
ljlong_2630 9 months ago
parent
commit
5c3bb8f22b
  1. 4
      src/components/BasicForm/src/BasicForm.vue
  2. 1
      src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts
  3. 3
      src/views/eam/device/deviceinspectionjob/deviceInspectionMain.data.ts
  4. 64
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  5. 6
      src/views/eam/device/devicemaintenancejob/index.vue

4
src/components/BasicForm/src/BasicForm.vue

@ -372,11 +372,11 @@ const open = async (type: string, row?: any, masterParmas?: any) => {
if (masterParmas) { if (masterParmas) {
if (!row) { if (!row) {
row = { row = {
maintenanceNumber: masterParmas.maintenanceNumber, number: masterParmas.number,
} }
} }
} }
if (row?.id || row?.maintenanceNumber) { if (row?.id || row?.number) {
formLoading.value = true formLoading.value = true
try { try {
nextTick(() => { nextTick(() => {

1
src/views/eam/device/deviceMaintainPlan/deviceMaintainPlan.data.ts

@ -7,7 +7,6 @@ export const DeviceMaintainPlanRules = reactive({
name: [required], name: [required],
maintenanceType: [required], maintenanceType: [required],
type: [required], type: [required],
concurrencyStamp: [required],
}) })
export const DeviceMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceMaintainPlan = useCrudSchemas(reactive<CrudSchema[]>([

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

@ -26,8 +26,7 @@ export const DeviceInspectionMainRules = reactive({
describes: [ describes: [
], ],
maintenancePhone: [ maintenancePhone: [
{ max: 11, message: '不得超过11个字符', trigger: 'blur' }, { validator:validateHanset, message: '输入电话格式不正确', trigger: 'blur'}
{ validator:validateHanset, message: '请输入数字格式', trigger: 'blur'}
], ],
status: [required], status: [required],
type: [required], type: [required],

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

@ -5,11 +5,13 @@ import { useUserStore } from '@/store/modules/user'
import { selecUserByType } from '@/api/system/dept' import { selecUserByType } from '@/api/system/dept'
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 { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
const userStore = useUserStore() const userStore = useUserStore()
const factoryList = await selectAllFactoryArea() const factoryList = await selectAllFactoryArea()
const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({})
const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 }) const userList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: 1 })
const userListAll = await UserApi.getSimpleUserList()
const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD')
const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE)
// 表单校验 // 表单校验
@ -123,13 +125,17 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
form: { form: {
component: 'Select', component: 'Select',
api: () => userList, api: () => userListAll,
componentProps: { componentProps: {
disabled: true, disabled: true,
optionsAlias: { optionsAlias: {
labelField: 'name', labelField: 'nickname',
valueField: 'id' valueField: 'id'
}, },
placeholder: "请先选择设备" placeholder: "请先选择设备"
@ -206,6 +212,9 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
}, },
form: { form: {
component: 'Input', component: 'Input',
componentProps: {
type: 'textarea',
}
}, },
}, },
@ -222,6 +231,18 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
])) ]))
export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修编号',
field: 'number',
sort: 'custom',
isSearch: false,
form: {
component: 'Input',
componentProps: {
disabled: true
}
},
},
{ {
label: '故障描述', label: '故障描述',
field: 'describes', field: 'describes',
@ -229,6 +250,13 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
}, },
isSearch: false, isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
}, },
{ {
label: '故障真因', label: '故障真因',
@ -237,6 +265,13 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
}, },
isSearch: false, isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
}, },
{ {
label: '解决措施', label: '解决措施',
@ -245,6 +280,13 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
}, },
isSearch: false, isSearch: false,
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
}, },
{ {
label: '维修人', label: '维修人',
@ -346,9 +388,17 @@ export const DeviceMaintenanceDetail = useCrudSchemas(reactive<CrudSchema[]>([
])) ]))
// 表单校验 // 表单校验
export const DeviceMaintenanceDetailRules = reactive({ export const DeviceMaintenanceDetailRules = reactive({
describes: [required], describes: [
describes1: [required], required,
workOut: [required], { max: 200, message: '不得超过200个字符', trigger: 'blur' },
maintenance: [required], ],
itemNumbers: [required], describes1: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
workOut: [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
maintenances: [required],
}) })

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

@ -55,12 +55,13 @@
:tableData="tableData" :tableData="tableData"
:apiUpdate="DeviceMaintenanceMainApi.updateDeviceMaintenanceMain" :apiUpdate="DeviceMaintenanceMainApi.updateDeviceMaintenanceMain"
:apiCreate="DeviceMaintenanceMainApi.createDeviceMaintenanceMain" :apiCreate="DeviceMaintenanceMainApi.createDeviceMaintenanceMain"
:isBusiness="true" :isBusiness="false"
@onChange="onChange" @onChange="onChange"
@handleAddTable="handleAddTable" @handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable" @handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@success="submitForm"
:isSearchTableItem="true" :isSearchTableItem="true"
/> />
@ -365,6 +366,7 @@ const searchFormClick = (searchData) => {
// //
function acceptOrder(row) { function acceptOrder(row) {
DeviceMaintenanceMainApi.orderStepChange(row) DeviceMaintenanceMainApi.orderStepChange(row)
getList()
} }
// //
function turnOrder() {} function turnOrder() {}
@ -464,7 +466,7 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
try { try {
let data1 = { let data1 = {
id:data.id, id:data.id,
maintenanceNumber:data.maintenanceNumber, number:data.number,
describes:data.describes, describes:data.describes,
describes1:data.describes1, describes1:data.describes1,
itemNumbers:data.itemNumbers, itemNumbers:data.itemNumbers,

Loading…
Cancel
Save