Browse Source

检修工单代码

master
ljlong_2630 10 months ago
parent
commit
e0ad6aa626
  1. 6
      src/api/eam/device/deviceMaintenanceMain/index.ts
  2. 101
      src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts
  3. 18
      src/views/eam/device/deviceInspectionMain/index.vue
  4. 5
      src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts

6
src/api/eam/device/deviceMaintenanceMain/index.ts

@ -66,3 +66,9 @@ export const orderStepChange = async (data: DeviceMaintenanceMainVO) => {
export const orderTurnTo = async (data: DeviceMaintenanceMainVO) => { export const orderTurnTo = async (data: DeviceMaintenanceMainVO) => {
return await request.get({ url: `/eam/device-maintenance-main/turnTo?deviceNumber=`+data.deviceNumber +`&id=`+data.id + `&receiverType=`+ data.type +`&receiverUserId=` + data.maintenance }) return await request.get({ url: `/eam/device-maintenance-main/turnTo?deviceNumber=`+data.deviceNumber +`&id=`+data.id + `&receiverType=`+ data.type +`&receiverUserId=` + data.maintenance })
} }
// 查询维修工单主列表不分页
export const getDeviceMainTempList = async (type: String) => {
return await request.get({ url: `/eam/device-maintenance-main/getList?type=` + type })
}

101
src/views/eam/device/deviceInspectionMain/deviceInspectionMain.data.ts

@ -3,20 +3,22 @@ import { selectAllFactoryArea } from '@/api/system/dept'
import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import { selecUserByType } from '@/api/system/dept' import { selecUserByType } from '@/api/system/dept'
import * as DeviceMaintenanceMainApi from '@/api/eam/device/deviceMaintenanceMain'
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 repairList = await DeviceMaintenanceMainApi.getDeviceMainTempList('DEVICE')
// 表单校验 // 表单校验
export const DeviceInspectionMainRules = reactive({ export const DeviceInspectionMainRules = reactive({
number: [required], number: [required],
maintenanceNumber: [required], // maintenanceNumber: [required],
deviceNumber: [required], deviceNumber: [required],
factoryAreaNumber: [required], factoryAreaNumber: [required],
status: [required], status: [required],
type: [required], type: [required],
concurrencyStamp: [required], concurrencyStamp: [required],
faultType: [required],
}) })
export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
@ -34,10 +36,34 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '维修工单号', label: '维修工单号',
field: 'maintenanceNumber', field: 'maintenanceNumber',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: '150', width: '150',
}, },
api: () => repairList,
// formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
// return repairList.find((account) => account.number == cellValue)?.name
// },
search: {
show: true,
component: 'Select',
api: () => repairList,
componentProps: {
optionsAlias: {
labelField: 'number',
valueField: 'number'
}
}
},
form: {
component: 'Select',
api: () => repairList,
componentProps: {
optionsAlias: {
labelField: 'number',
valueField: 'number'
},
},
}
}, },
{ {
label: '设备', label: '设备',
@ -74,7 +100,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '厂区编号', label: '厂区',
field: 'factoryAreaNumber', field: 'factoryAreaNumber',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
@ -105,7 +131,7 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'name', labelField: 'name',
valueField: 'id' valueField: 'id'
}, },
placeholder: "请选择设备" placeholder: "请选择设备"
}, },
} }
}, },
@ -141,25 +167,10 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
labelField: 'name', labelField: 'name',
valueField: 'id' valueField: 'id'
}, },
placeholder: "请选择设备" placeholder: "请选择设备"
}, },
} }
}, },
{
label: '描述',
field: 'describe',
sort: 'custom',
isSearch: false,
table: {
width: '230',
},
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
// { // {
// label: '维修人联系电话', // label: '维修人联系电话',
// field: 'maintenancePhone', // field: 'maintenancePhone',
@ -169,7 +180,6 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
label: '状态', label: '状态',
field: 'status', field: 'status',
sort: 'custom', sort: 'custom',
isSearch: true,
table: { table: {
width: '150', width: '150',
}, },
@ -177,7 +187,11 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.JX_STATUS, dictType: DICT_TYPE.JX_STATUS,
dictClass: 'string', dictClass: 'string',
form: { form: {
component: 'Select' component: 'Select',
componentProps: {
disabled: true,
placeholder: "请选择设备"
},
}, },
}, },
{ {
@ -191,7 +205,30 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.DEVICE_MOLD_TYPE, dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string', dictClass: 'string',
form: { form: {
component: 'Select' component: 'Select',
componentProps: {
disabled: true,
placeholder: "请选择设备"
}
},
},
{
label: '故障类型',
field: 'faultType',
sort: 'custom',
table: {
width: '150',
},
// isSearch: false,
dictType: DICT_TYPE.FAULT_TYPE,
dictClass: 'string',
form: {
value: 'PM',
component: 'Select',
componentProps: {
// disabled: true,
placeholder: "请选择故障类型"
}
}, },
}, },
// { // {
@ -201,7 +238,21 @@ export const DeviceInspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
// formatter: dateFormatter, // formatter: dateFormatter,
// isForm: false, // isForm: false,
// }, // },
{
label: '描述',
field: 'describe',
sort: 'custom',
isSearch: false,
table: {
width: '230',
},
form: {
component: 'Input',
componentProps: {
type: 'textarea',
}
},
},
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',

18
src/views/eam/device/deviceInspectionMain/index.vue

@ -30,7 +30,7 @@
<BasicForm ref="basicFormRef" @success="formsSuccess" :rules="DeviceInspectionMainRules" <BasicForm ref="basicFormRef" @success="formsSuccess" :rules="DeviceInspectionMainRules"
:formAllSchemas="DeviceInspectionMain.allSchemas" :apiUpdate="DeviceInspectionMainApi.updateDeviceInspectionMain" :formAllSchemas="DeviceInspectionMain.allSchemas" :apiUpdate="DeviceInspectionMainApi.updateDeviceInspectionMain"
:apiCreate="DeviceInspectionMainApi.createDeviceInspectionMain" @searchTableSuccess="searchTableSuccess" :apiCreate="DeviceInspectionMainApi.createDeviceInspectionMain" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" /> :isBusiness="false" @onChange="onChange"/>
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceInspectionMain.allSchemas" /> <Detail ref="detailRef" :isBasic="true" :allSchemas="DeviceInspectionMain.allSchemas" />
@ -46,6 +46,7 @@ import { DeviceInspectionMain, DeviceInspectionMainRules } from './deviceInspect
import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain' import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
// import TableHead from '@/components/TableHead/src/TableHead.vue' // import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' // import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue' // import Detail from '@/components/Detail/src/Detail.vue'
@ -104,6 +105,8 @@ const HeadButttondata = [
// //
const buttonBaseClick = (val, item) => { const buttonBaseClick = (val, item) => {
if (val == 'add') { // if (val == 'add') { //
DeviceInspectionMain.allSchemas.formSchema[4].value = 'PROCCED';
DeviceInspectionMain.allSchemas.formSchema[5].value = 'DEVICE';
openForm('create') openForm('create')
} else if (val == 'import') { // } else if (val == 'import') { //
handleImport() handleImport()
@ -236,6 +239,19 @@ function handleFinishOrder(row) {
} }
const onChange = (field, cur, item) => {
//
if (field == 'deviceNumber') {
basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber)
basicFormRef.value.formRef.formModel.maintenance = String(userStore?.getUser?.id)
basicFormRef.value.formRef.formModel.maintenanceNumber = ''
} else if (field == 'maintenanceNumber') {
basicFormRef.value.formRef.formModel.deviceNumber = item.componentProps.options.find(element => element.number == cur).deviceNumber
basicFormRef.value.formRef.formModel.factoryAreaNumber = Number(item.componentProps.options.find(element => element.number == cur).factoryAreaNumber)
basicFormRef.value.formRef.formModel.maintenance = String(userStore?.getUser?.id)
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

5
src/views/eam/device/deviceMaintenanceMain/deviceMaintenanceMain.data.ts

@ -40,13 +40,10 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive<CrudSchema[]>([
table: { table: {
width: '150', width: '150',
}, },
isForm: false,
isSearch: true,
isTable: true,
}, },
{ {
label: '设备模具编号', label: '设备',
field: 'deviceNumber', field: 'deviceNumber',
sort: 'custom', sort: 'custom',
table: { table: {

Loading…
Cancel
Save