diff --git a/src/api/eam/device/deviceMaintainOrderMain/index.ts b/src/api/eam/device/deviceMaintainOrderMain/index.ts index dbf554e..a79189c 100644 --- a/src/api/eam/device/deviceMaintainOrderMain/index.ts +++ b/src/api/eam/device/deviceMaintainOrderMain/index.ts @@ -70,3 +70,7 @@ export const orderClickFinish = (id: number) => { return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id }) } +// 验证 +export const orderClickApprove = (id: number,status: string,verifyContent: string) => { + return request.get({ url: '/eam/device-maintain-job-main/orderClickVerify?id=' + id + '&status=' + status + '&verifyContent=' + verifyContent }) +} diff --git a/src/api/eam/device/deviceMaintenanceMain/index.ts b/src/api/eam/device/deviceMaintenanceMain/index.ts index b87f9aa..cbf5469 100644 --- a/src/api/eam/device/deviceMaintenanceMain/index.ts +++ b/src/api/eam/device/deviceMaintenanceMain/index.ts @@ -87,5 +87,8 @@ export const verifyOrder = async (params) => { } - +// 确认维修工单 +export const confirmOrder = async (params) => { + return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params}) +} diff --git a/src/api/eam/device/deviceRepair/index.ts b/src/api/eam/device/deviceRepair/index.ts index 42b4864..149e64b 100644 --- a/src/api/eam/device/deviceRepair/index.ts +++ b/src/api/eam/device/deviceRepair/index.ts @@ -59,4 +59,10 @@ export const importTemplate = () => { // 撤销申请 export const rejected = (id: Number) => { return request.delete({ url: '/eam/device-repair-request/rejected?id=' + id }) -} \ No newline at end of file +} + + +// 根据单号查询申请工单信息 +export const getOrderByNumber = (number: Number) => { + return request.get({ url: '/eam/device-repair-request/getOrderByNumber?number=' + number }) +} diff --git a/src/api/eam/mold/moldMaintainOrderMain/index.ts b/src/api/eam/mold/moldMaintainOrderMain/index.ts index 87a13ef..91f5c03 100644 --- a/src/api/eam/mold/moldMaintainOrderMain/index.ts +++ b/src/api/eam/mold/moldMaintainOrderMain/index.ts @@ -71,3 +71,10 @@ export const orderClickFinish = (id: number) => { return request.get({ url: '/eam/device-maintain-job-main/orderClickFinish?id=' + id }) } +// 验证 +export const orderClickApprove = (id: number,status: string,verifyContent: string) => { + return request.get({ url: '/eam/device-maintain-job-main/orderClickApprove?id=' + id + '&status=' + status + '&approveOpinion=' + verifyContent }) +} + + + diff --git a/src/api/eam/mold/moldMaintenanceMain/index.ts b/src/api/eam/mold/moldMaintenanceMain/index.ts index c131617..783a57f 100644 --- a/src/api/eam/mold/moldMaintenanceMain/index.ts +++ b/src/api/eam/mold/moldMaintenanceMain/index.ts @@ -80,6 +80,12 @@ export const finishOrder = async (params) => { } +// 申请人确认工单 +export const confirmOrder = async (params) => { + return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params}) +} + + // 校验维修工单 export const verifyOrder = async (params) => { return await request.get({ url: `/eam/device-maintenance-job-main/orderClick`, params}) diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 2deef46..5ba2ead 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -1039,6 +1039,34 @@ export function selectQrCodeBatchBtn(option:any) { }) } +// 保养 +export function maintainBtn(option:any) { + return __defaultBtnOption(option,{ + label: '保养', + name: 'maintain', + hide: false, + type: 'warning', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 确认 +export function confirmOrderBtn(option:any) { + return __defaultBtnOption(option,{ + label: '确认', + name: 'confirmOrder', + hide: false, + type: 'success', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + + + // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/eam/basic/deviceMaintenance/index.vue b/src/views/eam/basic/deviceMaintenance/index.vue index 31f473a..a1f4fbe 100644 --- a/src/views/eam/basic/deviceMaintenance/index.vue +++ b/src/views/eam/basic/deviceMaintenance/index.vue @@ -88,9 +88,9 @@ import download from '@/utils/download' import { DeviceMaintenance,DeviceMaintenanceRules } from './deviceMaintenance.data' import * as DeviceMaintenanceApi from '@/api/eam/basic/deviceMaintenance' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import TableHead from '@/components/TableHead/src/TableHead.vue' -import Detail from '@/components/Detail/src/Detail.vue' +import { useUserStore } from '@/store/modules/user' import { updateForm } from '@/api/bpm/form' +const userStore = useUserStore() // 用户信息 defineOptions({ name: 'DeviceMaintenance' }) @@ -309,6 +309,8 @@ const judgeSame = () => { return isSame; }; + + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/basic/moldMaintenance/index.vue b/src/views/eam/basic/moldMaintenance/index.vue index 3921e0c..a13e77b 100644 --- a/src/views/eam/basic/moldMaintenance/index.vue +++ b/src/views/eam/basic/moldMaintenance/index.vue @@ -87,8 +87,8 @@ import download from '@/utils/download' import { MoldMaintenance,MoldMaintenanceRules } from './moldMaintenance.data' import * as MoldMaintenanceApi from '@/api/eam/basic/moldMaintenance' import * as defaultButtons from '@/utils/disposition/defaultButtons' -import TableHead from '@/components/TableHead/src/TableHead.vue' -import Detail from '@/components/Detail/src/Detail.vue' +import { useUserStore } from '@/store/modules/user' +const userStore = useUserStore() // 用户信息 defineOptions({ name: 'MoldMaintenance' }) @@ -303,6 +303,21 @@ const judgeSame = () => { }; + + + +const judgeIsTheClassEngineer = (row) => { + const rolesOk = userStore.roles.find(item => { + return item == 'device_class_Engineer_role' + }) + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts index 473fb31..5c953fa 100644 --- a/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts +++ b/src/views/eam/device/devicemaintainjob/deviceMaintainOrderMain.data.ts @@ -215,6 +215,37 @@ export const DeviceMaintainOrderMain = useCrudSchemas(reactive([ dateFormat:'YYYY-MM-DD HH:mm:ss' } }, + { + label: '审批人', + field: 'verifyer', + sort: 'custom', + isSearch: false, + isTableForm: false, + isForm: false, + isDetail: false, + api: () => userListAll, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userListAll.find((account) => account.id == cellValue)?.nickname + }, + }, + { + label: '审批人', + field: 'verifyerDetail', + sort: 'custom', + isDetail: true, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: false, + }, + { + label: '审批意见', + field: 'verifyContent', + sort: 'custom', + isSearch: false, + isTableForm: false, + isForm: false, + }, { label: '操作', field: 'action', @@ -250,7 +281,6 @@ export const DeviceMaintainOrderDetailRules = reactive({ ], chargePeoples: [required], completionTime: [required], - engineer: [required], uncompleted: [required], contents: [required], }) @@ -489,7 +519,7 @@ export const DeviceMaintainOrderDetail = useCrudSchemas(reactive([ form: { component: 'Input', componentProps: { - type:'TextArea' + type:'textarea' } } }, diff --git a/src/views/eam/device/devicemaintainjob/index.vue b/src/views/eam/device/devicemaintainjob/index.vue index aa5c2ad..99768b0 100644 --- a/src/views/eam/device/devicemaintainjob/index.vue +++ b/src/views/eam/device/devicemaintainjob/index.vue @@ -96,6 +96,33 @@ @success="importSuccess" /> + + + + + + + + @@ -114,6 +141,7 @@ import { useUserStore } from '@/store/modules/user' import * as UserApi from '@/api/system/user' import * as DeviceAccountsApi from '@/api/eam/device/deviceAccounts' + defineOptions({ name: 'DeviceMaintainOrderMain' }) const message = useMessage() // 消息弹窗 const { t } = useI18n() // 国际化 @@ -124,6 +152,11 @@ const formRef = ref() routeName.value = route.name const tableColumns = ref(DeviceMaintainOrderMain.allSchemas.tableColumns) const tableData = ref([]) +const dialogVisible = ref(false) +const dialogRowData = ref() +const updateFormValue = ref({ + verifyContent:'' +}) // 字段设置 更新主列表字段 const updataTableColumns = (val) => { tableColumns.value = val @@ -229,20 +262,16 @@ const butttondata = (row) => { row.status == 'PENDING' && judgeIsTheClass(row) ) }), // 接单 - // defaultButtons.turnOrderBtn({ - // hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) - // }), // 转办 - // defaultButtons.repairBtn({ - // hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) - // }), // 维修 - // defaultButtons.verifyOrderBtn({ - // hide: !( - // row.status == 'COMPLETED' - // ) - // }), // 验证 + defaultButtons.maintainBtn({ + hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) + }),// 保养 defaultButtons.finishOrderBtn({ hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) - }) // 完成 + }), // 完成 + defaultButtons.verifyOrderBtn({ + hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row)) + }), // 验证 + ] } const onChange = (field, cur, item) => { @@ -266,6 +295,10 @@ const buttonTableClick = async (val, row) => { acceptOrder(row) } else if (val == 'turnOrder') { openForm('turnOrder', row) + } else if (val == 'maintain') { + openDetail(row, '代码', row.number) + } else if (val == 'verifyOrder') { + openDialog(row) } else if (val == 'finishOrder') { finishOrder(row) } @@ -283,6 +316,7 @@ const detailRef = ref() const openDetail =async (row: any, titleName: any, titleValue: any) => { const userListAll = await UserApi.getSimpleUserList() row.maintenanceName = userListAll.find((account) => account.id == row.maintenance)?.nickname + row.verifyerDetail = userListAll.find((account) => account.id == row.verifyer)?.nickname detailRef.value.openDetail(row, titleName, titleValue,'DeviceMaintainOrderMain') } @@ -576,4 +610,32 @@ const openFormCallBack = (type, row, masterParmas, callback) => { callback() } + + +const judgeIsTheClassEngineer = (row) => { + const rolesOk = userStore.roles.find(item => { + return item == 'device_class_Engineer_role' + }) + if (rolesOk != undefined && rolesOk != null) { + return true + } else { + return false + } +} + +const openDialog = (row) => { + dialogRowData.value = row + dialogVisible.value = true +} + +const onCancel = () => { + dialogVisible.value = false +} + +const onSubmit = () => { + DeviceMaintainOrderMainApi.orderClickApprove(dialogRowData.value.id,'VERIFIED',updateFormValue.value.verifyContent) + dialogVisible.value = false + getList() +} + diff --git a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts index 5e052e9..bedc9dd 100644 --- a/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts +++ b/src/views/eam/device/devicemaintenancejob/deviceMaintenanceMain.data.ts @@ -334,6 +334,129 @@ export const DeviceMaintenanceMain = useCrudSchemas(reactive([ dictType: DICT_TYPE.ORDER_COMPLETE_RESULT, dictClass: 'string', }, + { + label: '报修人', + field: 'declarer', + 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: 'declarerDetail', + sort: 'custom', + isDetail: true, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: false, + table: { + width: 150 + } + }, + { + label: '报修人意见', + field: 'applyContent', + sort: 'custom', + table: { + width: 150 + } + }, + { + label: '验证人', + field: 'verifyer', + 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: 'verifyerDetail', + sort: 'custom', + table: { + width: 150 + }, + isDetail: true, + isForm: false, + isSearch: false, + isTable: false, + isTableForm: false, + }, + { + label: '验证人意见', + field: 'verifyContent', + sort: 'custom', + table: { + width: 150 + } + }, + { label: '操作', field: 'action', diff --git a/src/views/eam/device/devicemaintenancejob/index.vue b/src/views/eam/device/devicemaintenancejob/index.vue index 817110d..909b6f8 100644 --- a/src/views/eam/device/devicemaintenancejob/index.vue +++ b/src/views/eam/device/devicemaintenancejob/index.vue @@ -143,6 +143,68 @@ + + + + + + 通过 + 驳回 + + + + + + + + + + + + + + + + +