From 9e61b3449bcf50b2dafc1290f4a0d81a41c3d6e2 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Thu, 22 Aug 2024 15:08:55 +0800 Subject: [PATCH] =?UTF-8?q?HL-5520=E5=9C=A8PC=E7=AB=AF=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E8=AE=B0=E5=BD=95=E4=B8=AD=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=EF=BC=9A=E6=A3=80=E9=AA=8C=E5=8D=95=E8=A1=A5=E6=89=93=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E4=B8=8EPDA=E7=9A=84=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E5=8D=95=E6=A8=A1=E6=9D=BF=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/disposition/defaultButtons.ts | 11 +++++++++++ .../purchasereceiptRecordMain/index.vue | 15 +++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index cf8050651..5fe8852ca 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -1054,6 +1054,17 @@ export function mainListPointBtn(option: any) { hasPermi: '' }) } +export function mainListPrintInspectionBtn(option: any) { + return __defaultBtnOption(option, { + label: t(`ts.打印检验指引单`).replace('ts.', ''), + name: 'printInspection', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 主列表-回收 export function mainListRecoveryBtn(option: any) { return __defaultBtnOption(option, { diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue index 26461e987..a7e9b2013 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRecordMain/index.vue @@ -114,10 +114,12 @@ import * as PurchasereceiptRecordDetailApi from '@/api/wms/purchasereceiptRecord import * as defaultButtons from '@/utils/disposition/defaultButtons' import { PurchasereceiptRequestTabsList } from '@/utils/disposition/tabsList' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' -import { getReportUrl } from '@/utils/systemParam' +import {getJmreportBaseUrl, getReportUrl} from '@/utils/systemParam' import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' +import {mainListPointBtn, mainListPrintInspectionBtn} from "@/utils/disposition/defaultButtons"; +import {getAccessToken} from "@/utils/auth"; const { loadStart, loadDone } = usePageLoading() // 采购收货记录主 defineOptions({ name: 'PurchasereceiptRecordMain' }) @@ -181,13 +183,14 @@ const isShowSourceTypeButton = (row) => { const butttondata = (row,$index) => { const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 if(findIndex>-1&&findIndex<$index){ - return [] + return [defaultButtons.mainListPrintInspectionBtn(null)] } return [ defaultButtons.mainInspectRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createInspectRequest',hide:row.inspectRequestFlag == "FALSE" }),// 生成到货检验申请 defaultButtons.mainPutawayRequestBtn({hasPermi:'wms:purchasereceipt-record-main:createPutawayRequest',hide:row.putawayRequestFlag == "FALSE" }),// 生成采购上架申请 //defaultButtons.mainListPlanCheckQualityReportBtn({hide:row.orderTypeM == "2"}), // 查看质检报告 defaultButtons.mainListPlanCheckQualityReportBtn({hide:isShowSourceTypeButton(row)}), // 查看质检报告 + defaultButtons.mainListPrintInspectionBtn(null), ] } @@ -200,6 +203,8 @@ const buttonTableClick = async (val, row) => { }else if(val == 'mainPlanCheckQualityReport'){ // 查看质检报告 checkQualityReport(row) + }else if (val == 'printInspection'){ + handlePrint(row) } } // 查看质检报告 @@ -212,6 +217,12 @@ const checkQualityReport = async (row)=>{ qualityReport.value = `${getReportUrl()}/purchasereceiptReport?asnNumber=${row.asnNumber}` } +const BASE_URL = getJmreportBaseUrl() +const src = ref(BASE_URL + '/jmreport/view/986481894320525312?token=' + getAccessToken()) +const handlePrint = async (row) => { + window.open(src.value+'&jobNumber='+row.jobNumber) +} + /** 生成采购上架申请按钮操作 */ const handleCreatePutawayRequest = async (number:string) => { try{