From 36bc196756e788dbf89ed8fe79b52375c8b53256 Mon Sep 17 00:00:00 2001 From: linfso Date: Sun, 11 Aug 2024 11:16:26 +0800 Subject: [PATCH] md --- .../InvoiceChRecordList.vue | 49 +++++++++++- .../InvoiceChRecordListReadOnly.vue | 50 +++++++++++- .../CenterInvoiceRecordDealListPanel.vue | 63 ++++++++++++++- .../panel/InvoiceRecordApplyListPanel.vue | 76 +++++++++++++++---- 4 files changed, 217 insertions(+), 21 deletions(-) diff --git a/src/views/emis/emisSettleInvoiceChRecord/InvoiceChRecordList.vue b/src/views/emis/emisSettleInvoiceChRecord/InvoiceChRecordList.vue index 8a9c838f..6483638b 100644 --- a/src/views/emis/emisSettleInvoiceChRecord/InvoiceChRecordList.vue +++ b/src/views/emis/emisSettleInvoiceChRecord/InvoiceChRecordList.vue @@ -120,14 +120,23 @@ @@ -274,6 +283,42 @@ export default { }, handleDownPDF(row) { + + let downUrl=row.filePath; + if (navigator.clipboard && window.isSecureContext) { + // navigator clipboard 向剪贴板写文本 + this.$modal.msgSuccess('复制成功') + return navigator.clipboard.writeText(downUrl) + } else { + // 创建text area + const textArea = document.createElement('textarea') + textArea.value = downUrl + // 使text area不在viewport,同时设置不可见 + document.body.appendChild(textArea) + textArea.focus() + textArea.select() + this.$modal.msgSuccess('复制成功') + return new Promise((res, rej) => { + // 执行复制命令并移除文本框 + document.execCommand('copy') ? res() : rej() + textArea.remove() + }) + } + + }, + removeEndChar(str,char, type) { + if (char) { + if (type == 'left') { + return str.replace(new RegExp('^\\'+char+'+', 'g'), ''); + } else if (type == 'right') { + return str.replace(new RegExp('\\'+char+'+$', 'g'), ''); + } + return str.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), ''); + } + return str.replace(/^\s+|\s+$/g, ''); + }, + + handleDownPDFOld(row) { let settleBillName=row.companyName; let pdfUrl=row.filePath; let fileName=settleBillName+"-"+row.invoiceNo+".pdf"; diff --git a/src/views/emis/emisSettleInvoiceChRecord/InvoiceChRecordListReadOnly.vue b/src/views/emis/emisSettleInvoiceChRecord/InvoiceChRecordListReadOnly.vue index 6e290083..3bc72c43 100644 --- a/src/views/emis/emisSettleInvoiceChRecord/InvoiceChRecordListReadOnly.vue +++ b/src/views/emis/emisSettleInvoiceChRecord/InvoiceChRecordListReadOnly.vue @@ -81,14 +81,22 @@ @@ -230,8 +238,44 @@ export default { }); }, - handleDownPDF(row) { + let downUrl=row.filePath; + if (navigator.clipboard && window.isSecureContext) { + // navigator clipboard 向剪贴板写文本 + this.$modal.msgSuccess('复制成功') + return navigator.clipboard.writeText(downUrl) + } else { + // 创建text area + const textArea = document.createElement('textarea') + textArea.value = downUrl + // 使text area不在viewport,同时设置不可见 + document.body.appendChild(textArea) + textArea.focus() + textArea.select() + this.$modal.msgSuccess('复制成功') + return new Promise((res, rej) => { + // 执行复制命令并移除文本框 + document.execCommand('copy') ? res() : rej() + textArea.remove() + }) + } + + }, + removeEndChar(str,char, type) { + if (char) { + if (type == 'left') { + return str.replace(new RegExp('^\\'+char+'+', 'g'), ''); + } else if (type == 'right') { + return str.replace(new RegExp('\\'+char+'+$', 'g'), ''); + } + return str.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), ''); + } + return str.replace(/^\s+|\s+$/g, ''); + }, + + + + handleDownPDFOld(row) { let settleBillName=row.companyName; let pdfUrl=row.filePath; let fileName=settleBillName+"-"+row.invoiceNo+".pdf"; diff --git a/src/views/emis/emisSettleInvoiceRecord/panel/CenterInvoiceRecordDealListPanel.vue b/src/views/emis/emisSettleInvoiceRecord/panel/CenterInvoiceRecordDealListPanel.vue index 453a9159..9812c4a3 100644 --- a/src/views/emis/emisSettleInvoiceRecord/panel/CenterInvoiceRecordDealListPanel.vue +++ b/src/views/emis/emisSettleInvoiceRecord/panel/CenterInvoiceRecordDealListPanel.vue @@ -180,14 +180,22 @@ @@ -434,6 +442,57 @@ export default { this.getList(); }, handleDownPDF(row) { + let qParam = { + pageNum:1, + pageSize:50, + applySeqNo: row.applySeqNo, + openChStatus:'2' + } + listEmisSettleInvoiceChRecord(qParam).then(response => { + let list = response.rows; + if(list&&list.length>0){ + let downUrl=""; + list.forEach(item=>{ + downUrl=downUrl+item.filePath+","; + }); + + downUrl=this.removeEndChar(downUrl,',',''); + + if (navigator.clipboard && window.isSecureContext) { + // navigator clipboard 向剪贴板写文本 + this.$modal.msgSuccess('复制成功') + return navigator.clipboard.writeText(downUrl) + } else { + // 创建text area + const textArea = document.createElement('textarea') + textArea.value = downUrl + // 使text area不在viewport,同时设置不可见 + document.body.appendChild(textArea) + textArea.focus() + textArea.select() + this.$modal.msgSuccess('复制成功') + return new Promise((res, rej) => { + // 执行复制命令并移除文本框 + document.execCommand('copy') ? res() : rej() + textArea.remove() + }) + } + + } + }); + }, + removeEndChar(str,char, type) { + if (char) { + if (type == 'left') { + return str.replace(new RegExp('^\\'+char+'+', 'g'), ''); + } else if (type == 'right') { + return str.replace(new RegExp('\\'+char+'+$', 'g'), ''); + } + return str.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), ''); + } + return str.replace(/^\s+|\s+$/g, ''); + }, + handleDownPDFOld(row) { let settleBillName=row.settleBillName; let qParam = { diff --git a/src/views/emis/emisSettleInvoiceRecord/panel/InvoiceRecordApplyListPanel.vue b/src/views/emis/emisSettleInvoiceRecord/panel/InvoiceRecordApplyListPanel.vue index a1840495..ec666af2 100644 --- a/src/views/emis/emisSettleInvoiceRecord/panel/InvoiceRecordApplyListPanel.vue +++ b/src/views/emis/emisSettleInvoiceRecord/panel/InvoiceRecordApplyListPanel.vue @@ -182,24 +182,17 @@ @@ -284,6 +277,7 @@ import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker'; import emisSettleInvoiceRecordForm from '@/views/emis/emisSettleInvoiceRecord/emisSettleInvoiceRecordForm'; import { listEmisSettleInvoiceChRecord } from "@/api/emis/emisSettleInvoiceChRecord"; import elDateAdvPicker from '@/components/DatePickerAdv/elDateAdvPicker'; +import clip from '@/utils/clipboard' export default { name: "emisSettleInvoiceRecord", @@ -439,7 +433,61 @@ export default { this.openForm = true; this.titleForm = "修改"; }, + handleDownPDF(row) { + let qParam = { + pageNum:1, + pageSize:50, + applySeqNo: row.applySeqNo, + openChStatus:'2' + } + listEmisSettleInvoiceChRecord(qParam).then(response => { + let list = response.rows; + if(list&&list.length>0){ + let downUrl=""; + list.forEach(item=>{ + // this.downPdfFile(item.filePath); + downUrl=downUrl+item.filePath+","; + }); + + downUrl=this.removeEndChar(downUrl,',',''); + + if (navigator.clipboard && window.isSecureContext) { + // navigator clipboard 向剪贴板写文本 + this.$modal.msgSuccess('复制成功') + return navigator.clipboard.writeText(downUrl) + } else { + // 创建text area + const textArea = document.createElement('textarea') + textArea.value = downUrl + // 使text area不在viewport,同时设置不可见 + document.body.appendChild(textArea) + textArea.focus() + textArea.select() + this.$modal.msgSuccess('复制成功') + return new Promise((res, rej) => { + // 执行复制命令并移除文本框 + document.execCommand('copy') ? res() : rej() + textArea.remove() + }) + } + + } + }); + }, + removeEndChar(str,char, type) { + if (char) { + if (type == 'left') { + return str.replace(new RegExp('^\\'+char+'+', 'g'), ''); + } else if (type == 'right') { + return str.replace(new RegExp('\\'+char+'+$', 'g'), ''); + } + return str.replace(new RegExp('^\\'+char+'+|\\'+char+'+$', 'g'), ''); + } + return str.replace(/^\s+|\s+$/g, ''); + }, + + handleDownPDFOld(row) { let settleBillName=row.settleBillName;