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{