From 3e1b3ddaeb4979503cfe986f926d33301c7b9536 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Fri, 10 May 2024 14:08:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=89=BA=E8=8F=9C=E5=8D=95=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/deviceMaintenanceDetail/index.ts | 6 +- .../eam/device/deviceMaintenanceMain/index.ts | 3 +- src/api/eam/device/deviceRepair/index.ts | 1 + .../eam/device/techMaintenanceDetail/index.ts | 51 + .../eam/device/techMaintenanceMain/index.ts | 95 ++ src/api/eam/device/techRepair/index.ts | 69 + .../device/deviceRepair/deviceRepair.data.ts | 12 +- src/views/eam/device/deviceRepair/index.vue | 5 + .../deviceMaintenanceMain.data.ts | 16 +- src/views/eam/device/techRepair/index.vue | 334 +++++ .../eam/device/techRepair/techRepair.data.ts | 245 ++++ .../eam/device/techmaintenancejob/index.vue | 1195 +++++++++++++++++ .../techMaintenanceMain.data.ts | 937 +++++++++++++ 13 files changed, 2941 insertions(+), 28 deletions(-) create mode 100644 src/api/eam/device/techMaintenanceDetail/index.ts create mode 100644 src/api/eam/device/techMaintenanceMain/index.ts create mode 100644 src/api/eam/device/techRepair/index.ts create mode 100644 src/views/eam/device/techRepair/index.vue create mode 100644 src/views/eam/device/techRepair/techRepair.data.ts create mode 100644 src/views/eam/device/techmaintenancejob/index.vue create mode 100644 src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts diff --git a/src/api/eam/device/deviceMaintenanceDetail/index.ts b/src/api/eam/device/deviceMaintenanceDetail/index.ts index b3b9c78..b2aa8e6 100644 --- a/src/api/eam/device/deviceMaintenanceDetail/index.ts +++ b/src/api/eam/device/deviceMaintenanceDetail/index.ts @@ -12,7 +12,7 @@ export const getDeviceMaintenanceDetailPage = async (params) => {   if (params.isSearch) {     delete params.isSearch     const data = {...params} -    return await request.post({ url: '/wms/purchasereceipt-request-detail/senior', data }) +    return await request.post({ url: '/eam/device-maintenance-job-detail/senior', data })   } else {     return await request.get({ url: `/eam/device-maintenance-job-detail/page`, params })   } @@ -42,10 +42,10 @@ export const deleteDeviceMaintenanceDetail = async (id: number) => { // 导出维修工单子 Excel export const exportPurchasereceiptRequestDetail = async (params) => { -  return await request.download({ url: `/wms/purchasereceipt-request-detail/export-excel`, params }) +  return await request.download({ url: `/eam/device-maintenance-job-detail/export-excel`, params }) } // 下载用户导入模板 export const importTemplate = () => { -  return request.download({ url: '/wms/purchasereceipt-request-detail/get-import-template' }) +  return request.download({ url: '/eam/device-maintenance-job-detail/get-import-template' }) } diff --git a/src/api/eam/device/deviceMaintenanceMain/index.ts b/src/api/eam/device/deviceMaintenanceMain/index.ts index 8684350..2bc137e 100644 --- a/src/api/eam/device/deviceMaintenanceMain/index.ts +++ b/src/api/eam/device/deviceMaintenanceMain/index.ts @@ -16,8 +16,9 @@ export interface DeviceMaintenanceMainVO { concurrencyStamp: number } -// 查询维修工单主列表 +// 查询设备维修工单主列表 export const getDeviceMaintenanceMainPage = async (params) => { + params.type = 'DEVICE' if (params.isSearch) { delete params.isSearch const data = {...params} diff --git a/src/api/eam/device/deviceRepair/index.ts b/src/api/eam/device/deviceRepair/index.ts index 1751735..5a9679d 100644 --- a/src/api/eam/device/deviceRepair/index.ts +++ b/src/api/eam/device/deviceRepair/index.ts @@ -17,6 +17,7 @@ export interface DeviceRepairVO { // 查询报修申请列表 export const getDeviceRepairPage = async (params) => { + params.type = 'DEVICE' if (params.isSearch) { delete params.isSearch const data = { ...params } diff --git a/src/api/eam/device/techMaintenanceDetail/index.ts b/src/api/eam/device/techMaintenanceDetail/index.ts new file mode 100644 index 0000000..e1342a9 --- /dev/null +++ b/src/api/eam/device/techMaintenanceDetail/index.ts @@ -0,0 +1,51 @@ +import request from '@/config/axios' + +export interface DeviceMaintenanceDetailVO { +  describes: string +  describes1: string +  workOut: string +  maintenances: string +} + +// 查询维修工单子列表 +export const getDeviceMaintenanceDetailPage = async (params) => { +  if (params.isSearch) { +    delete params.isSearch +    const data = {...params} +    return await request.post({ url: '/eam/tech-maintenance-job-detail/senior', data }) +  } else { +    return await request.get({ url: `/eam/tech-maintenance-job-detail/page`, params }) +  } +} + +// 查询维修工单子详情 +export const getPurchasereceiptRequestDetail = async (id) => { +  return await request.get({ url: `/eam/tech-maintenance-job-detail/selectListByNumber?id=` + id }) +} + +// 新增维修工单子 +export const createDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => { +  return await request.post({ url: `/eam/tech-maintenance-job-detail/create`, data }) +} + +// 修改维修工单子 +export const updateDeviceMaintenanceDetail = async (data: DeviceMaintenanceDetailVO) => { +  return await request.put({ url: `/eam/tech-maintenance-job-detail/update`, data }) +} + +// 删除维修工单子 +export const deleteDeviceMaintenanceDetail = async (id: number) => { +  return await request.delete({ url: `/eam/tech-maintenance-job-detail/delete?id=` + id }) +} + + + +// 导出维修工单子 Excel +export const exportPurchasereceiptRequestDetail = async (params) => { +  return await request.download({ url: `/eam/tech-maintenance-job-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { +  return request.download({ url: '/eam/tech-maintenance-job-detail/get-import-template' }) +} diff --git a/src/api/eam/device/techMaintenanceMain/index.ts b/src/api/eam/device/techMaintenanceMain/index.ts new file mode 100644 index 0000000..2b47249 --- /dev/null +++ b/src/api/eam/device/techMaintenanceMain/index.ts @@ -0,0 +1,95 @@ +import request from '@/config/axios' + +export interface DeviceMaintenanceMainVO { + id: number + number: string + requestNumber: string + describe: string + deviceNumber: string + factoryAreaNumber: string + maintenance: number + maintenancePhone: string + status: string + type: string + siteId: string + available: string + concurrencyStamp: number +} + +// 查询工艺维修工单主列表 +export const getTechMaintenanceMainPage = async (params) => { + params.type = 'TECH' + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/tech-maintenance-job-main/senior', data }) + } else { + return await request.get({ url: `/eam/tech-maintenance-job-main/page`, params }) + } +} + +// 查询维修工单主详情 +export const getDeviceMaintenanceMain = async (id: number) => { + return await request.get({ url: `/eam/tech-maintenance-job-main/get?id=` + id }) +} + +// 新增维修工单主 +export const createDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => { + return await request.post({ url: `/eam/tech-maintenance-job-main/createPC`, data }) +} + +// 修改维修工单主 +export const updateDeviceMaintenanceMain = async (data: DeviceMaintenanceMainVO) => { + return await request.put({ url: `/eam/tech-maintenance-job-main/update`, data }) +} +// 删除维修工单主 +export const deleteDeviceMaintenanceMain = async (id: number) => { + return await request.delete({ url: `/eam/tech-maintenance-job-main/delete?id=` + id }) +} + +// 导出维修工单主 Excel +export const exportDeviceMaintenanceMain = async (params) => { + return await request.download({ url: `/eam/tech-maintenance-job-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/tech-maintenance-job-main/get-import-template' }) +} + +// 修改维修工单主 +export const orderStepChange = async (data: DeviceMaintenanceMainVO) => { + return await request.get({ url: `/eam/tech-maintenance-job-main/orderClick?number=`+data.number+`&status=`+data.status+`&id=`+data.id+`&requestNumber=`+data.requestNumber }) +} + +// 修改维修工单主 +export const orderTurnTo = async (data: DeviceMaintenanceMainVO) => { + return await request.get({ url: `/eam/tech-maintenance-job-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/tech-maintenance-job-main/getList?type=` + type }) +} + + + +// 完成维修工单 +export const finishOrder = async (params) => { + return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickFinish`, params}) +} + + + +// 校验维修工单 +export const verifyOrder = async (params) => { + return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickVerify`, params}) +} + + +// 确认维修工单 +export const confirmOrder = async (params) => { + return await request.get({ url: `/eam/tech-maintenance-job-main/orderClickConfirm`, params}) +} + diff --git a/src/api/eam/device/techRepair/index.ts b/src/api/eam/device/techRepair/index.ts new file mode 100644 index 0000000..ceba717 --- /dev/null +++ b/src/api/eam/device/techRepair/index.ts @@ -0,0 +1,69 @@ +import request from '@/config/axios' + +export interface DeviceRepairVO { + id: number + number: string + describe: string + deviceNumber: string + factoryAreaNumber: string + declarer: number + declarerPhone: string + faultType: string + type: string + siteId: string + available: string + concurrencyStamp: number +} + +// 查询报修申请列表 +export const getDeviceRepairPage = async (params) => { + params.type = 'TECH' + if (params.isSearch) { + delete params.isSearch + const data = { ...params } + return await request.post({ url: '/eam/tech-repair-request/senior', data }) + } else { + return await request.get({ url: `/eam/tech-repair-request/page`, params }) + } +} + +// 查询报修申请详情 +export const getDeviceRepair = async (id: number) => { + return await request.get({ url: `/eam/tech-repair-request/get?id=` + id }) +} + +// 新增报修申请 +export const createDeviceRepair = async (data: DeviceRepairVO) => { + return await request.post({ url: `/eam/tech-repair-request/create`, data }) +} + +// 修改报修申请 +export const updateDeviceRepair = async (data: DeviceRepairVO) => { + return await request.put({ url: `/eam/tech-repair-request/update`, data }) +} + +// 删除报修申请 +export const deleteDeviceRepair = async (id: number) => { + return await request.delete({ url: `/eam/tech-repair-request/delete?id=` + id }) +} + +// 导出报修申请 Excel +export const exportDeviceRepair = async (params) => { + return await request.download({ url: `/eam/tech-repair-request/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/tech-repair-request/get-import-template' }) +} + +// 撤销申请 +export const cancel = (id: Number) => { + return request.delete({ url: '/eam/tech-repair-request/cancel?id=' + id }) +} + + +// 根据单号查询申请工单信息 +export const getOrderByNumber = (number: Number) => { + return request.get({ url: '/eam/tech-repair-request/getOrderByNumber?number=' + number }) +} diff --git a/src/views/eam/device/deviceRepair/deviceRepair.data.ts b/src/views/eam/device/deviceRepair/deviceRepair.data.ts index c23b0cd..5a80249 100644 --- a/src/views/eam/device/deviceRepair/deviceRepair.data.ts +++ b/src/views/eam/device/deviceRepair/deviceRepair.data.ts @@ -96,17 +96,6 @@ export const DeviceRepair = useCrudSchemas(reactive([ return deviceMoldTypeList.find((account) => account.value == cellValue)?.label }, isSearch: true, - search: { - component: 'Select', - componentProps: { - options: deviceTypeList, - optionsAlias: { - labelField: 'label', - valueField: 'value' - }, - filterable: true, - }, - }, form: { component: 'Select', componentProps: { @@ -115,6 +104,7 @@ export const DeviceRepair = useCrudSchemas(reactive([ labelField: 'label', valueField: 'value' }, + // disabled: true, filterable: true, placeholder: "请选择设备" } diff --git a/src/views/eam/device/deviceRepair/index.vue b/src/views/eam/device/deviceRepair/index.vue index 38aef78..11c2d15 100644 --- a/src/views/eam/device/deviceRepair/index.vue +++ b/src/views/eam/device/deviceRepair/index.vue @@ -180,6 +180,11 @@ const buttonTableClick = async (val, row) => { const basicFormRef = ref() const basicFormViewRef = ref() const openForm = (type: string, row?: any) => { + // if(type == 'create'){ + // DeviceRepair.allSchemas.formSchema.find(item => { + // return item.field == 'type' + // }).value = 'DEVICE' + // } if (type == 'view') { showView.value = true urls.value = row.filePathList diff --git a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts index abd9202..7fa8e2b 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -216,17 +216,6 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ }, // dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE, isSearch: true, - search: { - component: 'Select', - componentProps: { - options: deviceTypeList, - optionsAlias: { - labelField: 'label', - valueField: 'value' - }, - filterable: true, - }, - }, form: { component: 'Select', componentProps: { @@ -235,10 +224,11 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ labelField: 'label', valueField: 'value' }, - // disabled: true, + disabled: true, filterable: true, placeholder: "请选择设备" - } + }, + value: 'DEVICE' }, }, { diff --git a/src/views/eam/device/techRepair/index.vue b/src/views/eam/device/techRepair/index.vue new file mode 100644 index 0000000..c2f8288 --- /dev/null +++ b/src/views/eam/device/techRepair/index.vue @@ -0,0 +1,334 @@ + + + + + diff --git a/src/views/eam/device/techRepair/techRepair.data.ts b/src/views/eam/device/techRepair/techRepair.data.ts new file mode 100644 index 0000000..5a80249 --- /dev/null +++ b/src/views/eam/device/techRepair/techRepair.data.ts @@ -0,0 +1,245 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import { selectAllFactoryArea } from '@/api/system/dept' +import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' +import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' +import { validateHanset,validateNumDot, validateEmail } from '@/utils/validator' +import * as UserApi from '@/api/system/user' +const userListAll = await UserApi.getSimpleUserList() +// 邮箱账号的列表 +const factoryList = await selectAllFactoryArea() +const deviceList = ref([]); +const deviceListNoPage = await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) +const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') +const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) +// 表单校验 +export const DeviceRepairRules = reactive({ + number: [required], + deviceNumber: [required], + factoryAreaNumber: [required], + declarer: [required], + faultType: [required], + type: [required], + available: [required], + declarerPhone: [ + required, + { validator:validateHanset, message: '输入手机号格式不正确', trigger: 'blur'} + ] + // result: [required], +}) + +export const DeviceRepair = useCrudSchemas(reactive([ + { + label: '报修工单编号', + field: 'number', + sort: 'custom', + table: { + width: '150', + fixed: 'left', + }, + isSearch: false, + isForm: false + }, + { + 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' + }, + filterable: true, + } + }, + form: { + component: 'Select', + api: () => factoryList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + filterable: true, + onChange: (val) => { + DeviceAccountsApi.getDeviceAccountsNoPage({ + isSearch: false, + factoryAreaNumber: val + }).then((res) => { + deviceList.value = res + }).catch((e) => { + console.log(e) + }) + } + }, + } + }, + { + label: '类型', + field: 'type', + sort: 'custom', + table: { + width: '150', + }, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceMoldTypeList.find((account) => account.value == cellValue)?.label + }, + isSearch: true, + form: { + component: 'Select', + componentProps: { + options: deviceTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + // disabled: true, + filterable: true, + placeholder: "请选择设备" + } + }, + }, + { + label: '设备', + field: 'deviceNumber', + sort: 'custom', + table: { + width: '150', + }, + isSearch: true, + api: () => DeviceAccountsApi.getDeviceAccountsNoPage({ + isSearch: false + }), + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceListNoPage.find((account) => account.number == cellValue)?.name + }, + search: { + component: 'Select', + componentProps: { + options: deviceListNoPage, + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + filterable: true, + }, + }, + form: { + component: 'Select', + componentProps: { + options: deviceList, + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + filterable: true, + }, + } + }, + { + label: '报修人电话', + field: 'declarerPhone', + sort: 'custom', + table: { + width: '150', + }, + }, + { + label: '报修人', + field: 'declarer', + sort: 'custom', + table: { + width: '150', + }, + isForm: false, + isDetail: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userListAll.find((account) => account.id == cellValue)?.nickname + }, + search: { + component: 'Select', + componentProps: { + options: userListAll, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + }, + }, + }, + // { + // label: '故障类型', + // field: 'faultType', + // sort: 'custom', + // table: { + // width: '150', + // }, + // 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: 'result', + sort: 'custom', + table: { + width: '150', + }, + dictType: DICT_TYPE.WEI_XIU_ORDER_STATUS, + dictClass: 'string', + isSearch: true, + isForm: false, + form: { + component: 'Select', + }, + }, + { + label: '图片', + field: 'upload', + isForm: true, + form: { + component: 'UploadImgs', + componentProps: { + limit:3, + } + } + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 150, + fixed: 'right' + } + } +])) diff --git a/src/views/eam/device/techmaintenancejob/index.vue b/src/views/eam/device/techmaintenancejob/index.vue new file mode 100644 index 0000000..e5be9ca --- /dev/null +++ b/src/views/eam/device/techmaintenancejob/index.vue @@ -0,0 +1,1195 @@ + + + diff --git a/src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts b/src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts new file mode 100644 index 0000000..b30a7c3 --- /dev/null +++ b/src/views/eam/device/techmaintenancejob/techMaintenanceMain.data.ts @@ -0,0 +1,937 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { selectAllFactoryArea } from '@/api/system/dept' +import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' +import { useUserStore } from '@/store/modules/user' +import { ItemSearchTable } from '../../basic/item/item.data' +import * as ItemApi from '@/api/eam/basic/item' +import * as UserApi from '@/api/system/user' +import { getStrDictOptions } from '@/utils/dict' +import { selecUserByType } from '@/api/system/dept' +const userStore = useUserStore() +const factoryList = await selectAllFactoryArea() +const deviceList = await DeviceAccountsApi.getDeviceAccountsNoPage({}) +const userListAll = await UserApi.getSimpleUserList() +const deviceListAll = await DeviceAccountsApi.getDeviceAccountsAllNoPage({}) +const dutyUserList = await selecUserByType({ classType: 'DEVICE', factoryAreaNumber: '', flag: null }) +const deviceTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE).filter(item => item.value != 'MOLD') +const deviceMoldTypeList = getStrDictOptions(DICT_TYPE.APP_DEVICE_MOLD_TYPE) +// 表单校验 +export const DeviceMaintenanceMainRules = 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 DeviceMaintenanceMain = useCrudSchemas(reactive([ + { + label: '维修工单编号', + field: 'number', + sort: 'custom', + table: { + width: '150', + fixed: 'left', + }, + isSearch: false, + isForm: false, + }, + { + label: '报修工单编号', + field: 'requestNumber', + sort: 'custom', + table: { + width: '150', + }, + isForm: false, + isSearch: false, + isTable: true, + }, + { + label: '设备', + field: 'deviceNumber', + sort: 'custom', + table: { + width: '150', + }, + isDetail: false, + api: () => deviceList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceListAll.find((account) => account.number == cellValue)?.name + }, + search: { + show: false, + component: 'Input', + api: () => deviceList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + filterable: true, + } + }, + form: { + component: 'Select', + api: () => deviceList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + filterable: true, + }, + } + }, + { + label: '设备', + field: 'deviceNumberDetail', + sort: 'custom', + isDetail: true, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: false, + }, + { + 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' + }, + filterable: true, + } + }, + form: { + component: 'Select', + api: () => factoryList, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + filterable: true, + placeholder: "请先选择设备" + }, + } + }, + { + label: '厂区', + field: 'factoryAreaNumberDetail', + sort: 'custom',etail: true, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: 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' + }, + filterable: true, + placeholder: "请先选择设备" + }, + }, + isSearch: true, + search: { + component: 'Select', + api: () => userListAll, + componentProps: { + collapseTags: true, + collapseTagsTooltip: true, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + } + } + }, + { + label: '维修人', + field: 'maintenanceDetail', + sort: 'custom', + isDetail: true, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: false, + table: { + width: 150 + } + }, + { + label: '类型', + field: 'type', + sort: 'custom', + table: { + width: '150', + }, + isDetail: false, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceMoldTypeList.find((account) => account.value == cellValue)?.label + }, + // dictType: DICT_TYPE.APP_DEVICE_MOLD_TYPE, + isSearch: false, + form: { + component: 'Select', + componentProps: { + options: deviceTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + disabled: true, + filterable: true, + placeholder: "请选择设备" + }, + }, + }, + { + label: '类型', + field: 'typeDetail', + sort: 'custom', + isDetail: true, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: false, + }, + { + label: '班次', + field: 'classes', + sort: 'custom', + table: { + width: '150', + }, + isSearch: true, + dictType: DICT_TYPE.MAINTENANCE_SHIFT, + dictClass: 'string', + form: { + component: 'Select' + }, + }, + { + label: '故障类型', + field: 'faultType', + sort: 'custom', + table: { + width: '150', + }, + isDetail: false, + 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', + }, + 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: 'result', + sort: 'custom', + table: { + width: '150', + }, + isSearch: false, + isTable: true, + isForm: false, + dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, + dictClass: 'string', + }, + { + label: '报修人', + field: 'declarer', + sort: 'custom', + isDetail: false, + isForm: false, + isSearch: true, + table: { + width: '150', + }, + api: () => userListAll, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userListAll.find((account) => account.id == cellValue)?.nickname + }, + search: { + component: 'Select', + api: () => userListAll, + componentProps: { + collapseTags: true, + collapseTagsTooltip: true, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + } + } + }, + { + label: '报修人', + field: 'declarerDetail', + sort: 'custom', + isDetail: true, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: false, + table: { + width: 150 + } + }, + { + label: '报修人意见', + field: 'applyContent', + sort: 'custom', + isForm: false, + table: { + width: 150 + } + }, + { + label: '验证人', + field: 'verifyer', + sort: 'custom', + isDetail: false, + isForm: false, + table: { + width: '150', + }, + api: () => userListAll, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userListAll.find((account) => account.id == cellValue)?.nickname + }, + isSearch: true, + search: { + component: 'Select', + api: () => userListAll, + componentProps: { + collapseTags: true, + collapseTagsTooltip: true, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + } + } + }, + { + label: '验证人', + field: 'verifyerDetail', + sort: 'custom', + table: { + width: 150 + }, + isDetail: true, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: false, + }, + { + label: '验证人意见', + field: 'verifyContent', + sort: 'custom', + isForm: false, + table: { + width: 150 + } + }, + + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 300, + fixed: 'right' + }, + isDetail: false + } +])) + +export const DeviceMaintenanceDetail = useCrudSchemas(reactive([ + { + label: '维修编号', + field: 'number', + sort: 'custom', + isSearch: false, + form: { + component: 'Input', + componentProps: { + disabled: true + } + }, + }, + { + label: '故障描述', + field: 'describes', + sort: 'custom', + table: { + }, + isSearch: false, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + } + + }, + }, + { + label: '故障真因', + field: 'describes1', + sort: 'custom', + table: { + }, + isSearch: false, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + } + + }, + }, + { + label: '解决措施', + field: 'workOut', + sort: 'custom', + table: { + }, + isSearch: false, + form: { + component: 'Input', + componentProps: { + type: 'textarea', + } + + }, + }, + { + label: '维修人', + field: 'maintenances', + sort: 'custom', + isDetail: false, + // formatter: (_: Recordable, __: TableColumn, cellValue) => { + // let cellValueList = [] + // if (Array.isArray(cellValue)) { + // cellValueList = cellValue + // } else { + // cellValueList = cellValue ? cellValue.split(',') : []; + // } + // // const cellValueList = cellValue ? cellValue.split(',') : []; + // return userListAll + // .filter(item => cellValueList.includes(item.id.toString())) + // .map(item => item.nickname) + // .join(','); + // }, + isTable:true, + tableForm: { + type: 'Select', + initOptions: userListAll, + multiple: true, + collapseTags: true, + collapseTagsTooltip: true, + optionsAlias: { + labelField: 'nickname', + valueField: 'id' + }, + filterable: true, + }, + form: { + component: 'Select', + // api: () => dutyUserList, + componentProps: { + multiple: true, + collapseTags: true, + collapseTagsTooltip: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + filterable: true, + } + } + }, + { + label: '维修人', + field: 'maintenancesName', + sort: 'custom', + isForm:false, + isDetail:true, + isTable:false, + isTableForm:false + }, + { + label: '备件', + field: 'itemNumbers1', + sort: 'custom', + table: { + }, + tableForm: { + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件', + searchField: 'itemNumbers1', + searchTitle: '备件', + multiple: true, + searchAllSchemas: ItemSearchTable.allSchemas, + searchPage: ItemApi.getItemList, + searchCondition: [{ + key: 'number', + value: 'deviceNumber', + message: '请选择设备模具编号!', + isMainValue: true + }] + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择备件', // 输入框占位文本 + searchField: 'itemNumbers1', // 查询弹窗赋值字段 + searchTitle: '备件', // 查询弹窗标题 + multiple: true, + searchAllSchemas: ItemSearchTable.allSchemas, // 查询弹窗所需类 + searchPage: ItemApi.getItemList, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'number', + value: 'deviceNumber', + message: '请选择设备模具编号!', + isMainValue: true + }] + } + }, + isSearch: false, + }, + { + label: '备件1', + field: 'itemNumbers', + sort: 'custom', + table: { + }, + isForm: false, + isDetail: false, + isTable: false, + isSearch: false, + isTableForm: false, + }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 300, + fixed: 'right' + }, + isDetail: false, + isTableForm: false, + } +])) +// 表单校验 +export const DeviceMaintenanceDetailRules = reactive({ + describes: [ + required, + { max: 200, message: '不得超过200个字符', trigger: 'blur' }, + ], + describes1: [ + required, + { max: 200, message: '不得超过200个字符', trigger: 'blur' }, + ], + workOut: [ + required, + { max: 200, message: '不得超过200个字符', trigger: 'blur' }, + ], + maintenances: [required], +}) + + + +// 表单校验 +export const DeviceMaintenanceMainSecRules = reactive({ + number: [required], + requestNumber: [required], + deviceNumber: [required], + factoryAreaNumber: [required], + maintenance: [required], + turnType: [required], + type: [required], + classes: [required], + faultType: [required], + describes: [ + required, + { max: 200, message: '不得超过200个字符', trigger: 'blur' }, + ], +}) + +export const DeviceMaintenanceMainSec = useCrudSchemas(reactive([ + { + 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', + } + }, + { + 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: deviceMoldTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + filterable: true, + }, + }, + form: { + component: 'Select', + componentProps: { + options: deviceMoldTypeList, + optionsAlias: { + labelField: 'label', + valueField: 'value' + }, + filterable: true, + placeholder: "请选择设备" + } + }, + }, + { + 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' + }, + filterable: true, + } + }, + form: { + component: 'Select', + api: () => factoryList, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + filterable: true, + placeholder: "请先选择设备" + }, + } + }, + { + label: '厂区', + field: 'factoryAreaNumber1', + sort: 'custom', + isDetail: true, + isSearch: false, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '设备模具', + field: 'deviceNumber', + sort: 'custom', + table: { + width: '150', + }, + api: () => deviceList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return deviceListAll.find((account) => account.number == cellValue)?.name + }, + search: { + show: false, + component: 'Input', + api: () => deviceList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + filterable: true, + } + }, + form: { + component: 'Select', + api: () => deviceList, + componentProps: { + optionsAlias: { + labelField: 'name', + valueField: 'number' + }, + filterable: true, + }, + } + }, + { + label: '维修人', + field: 'maintenance', + sort: 'custom', + isDetail: false, + table: { + width: '150', + }, + api: () => dutyUserList, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return dutyUserList.find((account) => account.id == cellValue)?.name + }, + form: { + component: 'Select', + api: () => dutyUserList, + componentProps: { + disabled: false, + optionsAlias: { + labelField: 'name', + valueField: 'id' + }, + filterable: true, + placeholder: "请先选择设备" + }, + } + }, + { + label: '维修人', + field: 'maintenance1', + sort: 'custom', + isDetail: true, + isSearch: false, + isForm: false, + isTable: false, + table: { + width: 150 + } + }, + { + label: '班次', + field: 'classes', + sort: 'custom', + table: { + width: '150', + }, + isSearch: true, + dictType: DICT_TYPE.MAINTENANCE_SHIFT, + dictClass: 'string', + 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: 'result', + // sort: 'custom', + // table: { + // width: '150', + // }, + // isSearch: false, + // isTable: true, + // isForm: false, + // dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, + // dictClass: 'string', + // }, + { + label: '操作', + field: 'action', + isForm: false, + table: { + width: 300, + fixed: 'right' + }, + isDetail: false + } +])) \ No newline at end of file