From a896211bbd81d73b98d2b09ce382624e1008dd12 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Fri, 19 Apr 2024 17:13:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=85=BB=E5=92=8C=E6=A3=80=E4=BF=AE?= =?UTF-8?q?=E5=B7=A5=E5=8D=95=E6=89=93=E5=8D=B0=E5=8A=9F=E8=83=BD=E8=A1=A5?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/eam/mold/moldinspectionjob/index.vue | 13 +++++++++++++ .../moldinspectionjob/moldInspectionMain.data.ts | 2 +- src/views/eam/mold/moldmaintainjob/index.vue | 13 ++++++++++++- .../moldmaintainjob/moldMaintainOrderMain.data.ts | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) 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,