diff --git a/src/views/eam/mold/moldinspectionjob/index.vue b/src/views/eam/mold/moldinspectionjob/index.vue index 66596ff..ae40292 100644 --- a/src/views/eam/mold/moldinspectionjob/index.vue +++ b/src/views/eam/mold/moldinspectionjob/index.vue @@ -123,6 +123,7 @@ import * as DeviceInspectionDetailApi from '@/api/eam/device/deviceInspectionDet import * as DeviceInspectionMainApi from '@/api/eam/device/deviceInspectionMain' import * as MoldAccountsApi from '@/api/eam/mold/moldAccounts' import * as MoldMaintenanceMainApi from '@/api/eam/mold/moldMaintenanceMain' +import { getAccessToken } from '@/utils/auth' import { MoldMaintenanceMain, MoldMaintenanceMainRules, @@ -153,6 +154,8 @@ const verifyFormValue = ref({ verifyContent: '', }) const openRowValue = ref() +const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL +const src = ref(BASE_URL + '/jmreport/view/941184370359353344?token=' + getAccessToken()) // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { nextTick(() => { @@ -247,6 +250,9 @@ const butttondata = (row) => { defaultButtons.verifyOrderBtn({ hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row)) }), // 验证 + defaultButtons.orderPrintBtn({ + hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED') && judgeIsTheClassEngineer(row)) + }) // 打印 ] } @@ -260,6 +266,8 @@ const buttonTableClick = async (val, row) => { handleFinishOrder(row) } else if (val == 'verifyOrder') { // 验证 verifyOrder(row) + } else if (val == 'orderPrint') { + orderPrint(row) } } @@ -669,6 +677,11 @@ const judgeIsTheClassEngineer = (row) => { } } + +const orderPrint = (row) => { + window.open(src.value + "&id=" + row.id) +} + /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts index fb6867d..0fa0432 100644 --- a/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts +++ b/src/views/eam/mold/moldinspectionjob/moldInspectionMain.data.ts @@ -363,7 +363,7 @@ export const MoldInspectionMain = useCrudSchemas(reactive([ field: 'action', isForm: false, table: { - width: 150, + width: 200, fixed: 'right' }, isDetail:false diff --git a/src/views/eam/mold/moldmaintainjob/index.vue b/src/views/eam/mold/moldmaintainjob/index.vue index af3fb66..2bef166 100644 --- a/src/views/eam/mold/moldmaintainjob/index.vue +++ b/src/views/eam/mold/moldmaintainjob/index.vue @@ -141,6 +141,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons' import { useUserStore } from '@/store/modules/user' import { selectAllFactoryArea } from '@/api/system/dept' import * as UserApi from '@/api/system/user' +import { getAccessToken } from '@/utils/auth' defineOptions({ name: 'MoldMaintainOrderMain' }) const message = useMessage() // 消息弹窗 @@ -159,6 +160,8 @@ const updateFormValue = ref({ }) const dialogVisible = ref(false) const dialogRowData = ref() +const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL +const src = ref(BASE_URL + '/jmreport/view/940395429096013824?token=' + getAccessToken()) // 字段设置 更新主列表字段 const updataTableColumns = (val) => { tableColumns.value = val @@ -272,6 +275,9 @@ const butttondata = (row) => { defaultButtons.verifyOrderBtn({ hide: !(row.status == 'COMPLETED' && judgeIsTheClassEngineer(row)) }), // 验证 + defaultButtons.orderPrintBtn({ + hide: !(row.status == 'PECEIVED' && row.maintenance == userStore.getUser.id) || !((row.status == 'COMPLETED' || row.status == 'PECEIVED') && judgeIsTheClassEngineer(row)) + }) // 打印 ] } const onChange = (field, cur, item) => { @@ -303,7 +309,9 @@ const buttonTableClick = async (val, row) => { openDialog(row) } else if (val == 'finishOrder') { finishOrder(row) - } + } else if (val == 'orderPrint') { + orderPrint(row) + } } /** 添加/修改操作 */ @@ -649,6 +657,9 @@ const onSubmit = (val) => { getList() } +const orderPrint = (row) => { + window.open(src.value + "&id=" + row.id) +} /** 初始化 **/ onMounted(async () => { diff --git a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts index 3f7c1de..64393a2 100644 --- a/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts +++ b/src/views/eam/mold/moldmaintainjob/moldMaintainOrderMain.data.ts @@ -289,7 +289,7 @@ export const MoldMaintainOrderMain = useCrudSchemas(reactive([ field: 'action', isForm: false, table: { - width: 150, + width: 200, fixed: 'right' }, isDetail: false,