Browse Source

修复维修完成不成功问题

master
ljlong_2630 8 months ago
parent
commit
f5775367b6
  1. 304
      src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts
  2. 40
      src/views/eam/device/devicemaintenancejob/index.vue
  3. 245
      src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

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

@ -50,22 +50,6 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: false,
isTable: true,
},
{
label: '转办类型',
field: 'turnType',
sort: 'custom',
isDetail: false,
isTable: false,
isSearch: false,
isForm: true,
dictType: DICT_TYPE.TURN_TYPE,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
}
}
},
{
label: '设备模具编号',
field: 'deviceNumber',
@ -469,4 +453,290 @@ export const DeviceMaintenanceDetailRules = reactive({
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
maintenances: [required],
})
})
// 表单校验
export const DeviceMaintenanceMainSecRules = reactive({
number: [required],
requestNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
maintenance: [required],
type: [required],
classes: [required],
faultType: [required],
describes : [
required,
{ max: 200, message: '不得超过200个字符', trigger: 'blur' },
],
})
export const DeviceMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工单编号',
field: 'number',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: false,
},
{
label: '报修工单编号',
field: 'requestNumber',
sort: 'custom',
table: {
width: '150',
},
isForm: false,
isSearch: false,
isTable: true,
},
{
label: '转办类型',
field: 'turnType',
sort: 'custom',
isDetail: false,
isTable: false,
isSearch: false,
isForm: true,
dictType: DICT_TYPE.TURN_TYPE,
dictClass: 'string',
form: {
component: 'Select',
value: 0,
}
},
{
label: '设备模具编号',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
api: () => deviceList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceList.find((account) => account.number == cellValue)?.name
},
search: {
show: false,
component: 'Input',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
}
}
},
form: {
component: 'Select',
api: () => deviceList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
},
}
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
},
form: {
component: 'Select',
api: () => factoryList,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
placeholder: "请先选择设备"
},
}
},
{
label: '厂区编号',
field: 'factoryAreaNumber1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
isDetail: false,
table: {
width: '150',
},
api: () => userListAll,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userListAll.find((account) => account.id == cellValue)?.nickname
},
form: {
component: 'Select',
api: () => userListAll,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'nickname',
valueField: 'id'
},
placeholder: "请先选择设备"
},
}
},
{
label: '维修人',
field: 'maintenance1',
sort: 'custom',
isDetail: true,
isSearch: false,
isForm: false,
isTable: false,
table: {
width: 150
}
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return deviceMoldTypeList.find((account) => account.value == cellValue)?.label
},
isSearch: true,
search: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
},
},
form: {
component: 'Select',
componentProps: {
options: deviceTypeList,
optionsAlias: {
labelField: 'label',
valueField: 'value'
},
placeholder: "请选择设备"
}
},
},
{
label: '班次',
field: 'classes',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
dictType: DICT_TYPE.MAINTENANCE_SHIFT,
dictClass: 'number',
form: {
component: 'Select'
},
},
{
label: '故障类型',
field: 'faultType',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
dictType: DICT_TYPE.FAULT_TYPE,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '描述',
field: 'describes',
sort: 'custom',
table: {
width: '150',
},
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{
label: '是否完成',
field: 'status',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isTable: true,
isForm: false,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: false,
}
},
tableForm: {
type: 'Select',
componentProps: {
disabled: false,
}
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isDetail:false
}
]))

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

@ -64,6 +64,26 @@
@success="submitForm"
:isSearchTableItem="true"
/>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRefSec"
:rules="DeviceMaintenanceMainSecRules"
:formAllSchemas="DeviceMaintenanceMainSec.allSchemas"
:tableAllSchemas="DeviceMaintenanceDetail.allSchemas"
:tableFormRules="DeviceMaintenanceDetailRules"
:tableData="tableData"
:apiUpdate="DeviceMaintenanceMainApi.updateDeviceMaintenanceMain"
:apiCreate="DeviceMaintenanceMainApi.createDeviceMaintenanceMain"
:isBusiness="false"
@onChange="onChange"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@success="submitForm"
:isSearchTableItem="true"
/>
<!-- 详情 -->
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceMaintenanceMain.allSchemas" /> -->
@ -113,7 +133,9 @@ import {
DeviceMaintenanceMain,
DeviceMaintenanceMainRules,
DeviceMaintenanceDetail,
DeviceMaintenanceDetailRules
DeviceMaintenanceDetailRules,
DeviceMaintenanceMainSec,
DeviceMaintenanceMainSecRules,
} from './deviceMaintenanceMain.data'
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain'
import * as DeviceMaintenanceDetailApi from '@/api/eam/device/deviceMaintenanceDetail'
@ -130,6 +152,7 @@ const userStore = useUserStore() // 用户信息
const route = useRoute() //
const routeName = ref()
const formRef = ref()
const formRefSec = ref()
routeName.value = route.name
const tableColumns = ref(DeviceMaintenanceMain.allSchemas.tableColumns)
const tableData = ref([])
@ -295,14 +318,8 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'repair') {
openDetail(row, '代码', row.number)
} else if (val == 'turnOrder') {
DeviceMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'turnType'
}).show = true
DeviceMaintenanceMain.allSchemas.formSchema.find(item => {
return item.field == 'type'
}).componentProps.options = deviceMoldTypeList
openForm('turnOrder', row)
} else if (val == 'finish') {
openFormSec('turnOrder', row)
} else if (val == 'finishOrder') {
finishOrder(row)
} else if (val == 'verifyOrder') {
verifyOrder(row)
@ -317,8 +334,13 @@ const buttonTableClick = async (val, row) => {
const openForm = (type: string, row?: any) => {
tableData.value = [] //
debugger
formRef.value.open(type, row)
}
const openFormSec = (type: string, row?: any) => {
tableData.value = [] //
formRefSec.value.open(type, row)
}
/** 详情操作 */
const detailRef = ref()

245
src/views/eam/mold/moldmaintenancejob/moldMaintenanceMain.data.ts

@ -364,4 +364,247 @@ export const MoldMaintenanceDetailRules = reactive({
workOut: [required],
maintenance: [required],
itemNumbers: [required],
})
})
// 表单校验
export const MoldMaintenanceMainSecRules = reactive({
number: [required],
requestNumber: [required],
deviceNumber: [required],
factoryAreaNumber: [required],
maintenance: [required],
type: [required],
classes: [required],
faultType: [required],
describes : [required],
})
export const MoldMaintenanceMainSec = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '维修工单编号',
field: 'number',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: false,
},
{
label: '报修工单编号',
field: 'requestNumber',
sort: 'custom',
table: {
width: '150',
},
isForm: false,
isSearch: false,
isTable: true,
},
{
label: '类型',
field: 'type',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
isForm: true,
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: true,
}
},
search: {
value: 'MOLD'
}
},
{
label: '转办类型',
field: 'turnType',
sort: 'custom',
isDetail: false,
isTable: false,
isSearch: false,
isForm: true,
dictType: DICT_TYPE.TURN_TYPE,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
}
}
},
{
label: '设备模具编号',
field: 'deviceNumber',
sort: 'custom',
table: {
width: '150',
},
api: () => moldList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return moldList.find((account) => account.number == cellValue)?.name
},
search: {
show: true,
component: 'Input',
// api: () => moldList,
// componentProps: {
// optionsAlias: {
// labelField: 'name',
// valueField: 'number'
// }
// }
},
form: {
component: 'Select',
api: () => moldList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'number'
},
},
}
},
{
label: '厂区编号',
field: 'factoryAreaNumber',
sort: 'custom',
table: {
width: '150',
},
api: () => factoryList,
formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return factoryList.find((account) => account.id == cellValue)?.name
},
search: {
show: true,
component: 'Select',
api: () => factoryList,
componentProps: {
optionsAlias: {
labelField: 'name',
valueField: 'id'
}
}
},
form: {
component: 'Select',
api: () => factoryList,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
placeholder: "请先选择设备"
},
}
},
{
label: '维修人',
field: 'maintenance',
sort: 'custom',
table: {
width: '150',
},
isSearch: true,
form: {
component: 'Select',
api: () => userList,
componentProps: {
disabled: true,
optionsAlias: {
labelField: 'name',
valueField: 'id'
},
placeholder: "请先选择模具"
},
}
},
{
label: '班次',
field: 'classes',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
dictType: DICT_TYPE.MAINTENANCE_SHIFT,
dictClass: 'number',
form: {
component: 'Select'
},
},
{
label: '故障类型',
field: 'faultType',
sort: 'custom',
table: {
width: '150',
},
isSearch: false,
dictType: DICT_TYPE.FAULT_TYPE,
dictClass: 'string',
form: {
component: 'Select'
},
},
{
label: '描述',
field: 'describes',
sort: 'custom',
table: {
width: '150',
},
form: {
component: 'Input',
componentProps:{
type:'textarea'
}
},
},
{
label: '是否完成',
field: 'status',
sort: 'custom',
table: {
width: '150',
},
isForm: false,
isSearch: false,
isTable: true,
dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS,
dictClass: 'string',
form: {
component: 'Select',
componentProps: {
disabled: false,
}
},
tableForm: {
type: 'Select',
componentProps: {
disabled: false,
}
},
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 300,
fixed: 'right'
},
isDetail:false
}
]))
Loading…
Cancel
Save