| | |
| | | </el-button> |
| | | <el-button |
| | | @click.native.prevent=" |
| | | Filepopup(scope.$index, rbDetails, scope.row) |
| | | /** |
| | | * 2026-11-30:清空票据弹窗预览状态(含 embeddedFile / invoiceEmbeddedFile), |
| | | * 避免再次打开弹窗时仍显示上一次选择的票据图片。 |
| | | */ |
| | | resetPreviewState() { |
| | | this.fileListto = []; |
| | | this.invoicefileListto = []; |
| | | this.pdfimg = ""; |
| | | this.invoicepdfimg = ""; |
| | | this.pdfimgsrcList = []; |
| | | this.invoicepdfimgsrcList = []; |
| | | this.embeddedFile = null; |
| | | this.invoiceEmbeddedFile = null; |
| | | this.pdftitle = ""; |
| | | this.previewToken = (this.previewToken || 0) + 1; |
| | | }, |
| | | |
| | | Filepopup(scope.$index, rbDetails, scope.row) |
| | | " |
| | | type="text" |
| | | size="small" |
| | |
| | | </el-upload> |
| | | <el-table |
| | | :data="fileListto" |
| | | @row-click="downFile" |
| | | @row-click="previewInline" @row-dblclick="downFile" |
| | | style="width: 100%" |
| | | height="400" |
| | | > |
| | |
| | | </el-upload> |
| | | <el-table |
| | | :data="invoicefileListto" |
| | | @row-click="downFile" |
| | | @row-click="previewInline" @row-dblclick="downFile" |
| | | style="width: 100%" |
| | | height="400" |
| | | > |
| | |
| | | invoicefileListto: [], |
| | | invoicepdfimg: "", |
| | | invoicepdfimgsrcList: [], |
| | | previewToken: 0, |
| | | activeName: 2, //文件类型:默认发票文件 |
| | | //上传附件路径 |
| | | uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", |
| | |
| | | this.rbDetails.splice(rowIndex + 1, 0, rowData); |
| | | console.log(14); |
| | | } |
| | | // 2026-11-30:新增行后把当前操作行切到新行,并清空上一次的预览态 |
| | | this.atpresent = this.rbDetails.indexOf(rowData); |
| | | this.resetPreviewState(); |
| | | this.Reminderquantity++; |
| | | this.totalquantity++; |
| | | for (let i = 0; i < this.rbDetails.length; i++) { |
| | |
| | | }; |
| | | |
| | | this.tableDatatop = []; |
| | | this.fileListto = []; |
| | | this.invoicefileListto = []; |
| | | this.pdfimg = ""; |
| | | this.invoicepdfimg = []; |
| | | this.pdfimgsrcList = []; |
| | | this.invoicepdfimgsrcList = []; |
| | | this.resetPreviewState(); |
| | | const previewToken = ++this.previewToken; |
| | | this.tableDatatop.push(row); |
| | | this.atpresent = index; |
| | | this.pdfVisible = true; |
| | |
| | | ); |
| | | |
| | | Promise.all(fetchPromises).then(fileListto => { |
| | | // 2026-11-30:切换行后丢弃过期结果 |
| | | if (previewToken !== this.previewToken) { |
| | | return; |
| | | } |
| | | this.fileListto = fileListto.filter(item => item !== null); |
| | | this.pdfimg = this.fileListto[0].url; |
| | | console.log(this.pdfimg, "pdfimg"); |
| | |
| | | ); |
| | | |
| | | Promise.all(fetchPromises).then(invoicefileListto => { |
| | | // 2026-11-30:切换行后丢弃过期结果 |
| | | if (previewToken !== this.previewToken) { |
| | | return; |
| | | } |
| | | this.invoicefileListto = invoicefileListto.filter( |
| | | item => item !== null |
| | | ); |
| | |
| | | }, |
| | | |
| | | // 点击已上传文件:在附件弹窗右侧内嵌预览 |
| | | /** |
| | | * 2026-11-30:单击列表项 → 在本页预览(右侧 preview-pane)。 |
| | | * 双击才打开独立的预览页面(downFile → $previewFile)。 |
| | | */ |
| | | previewInline(row) { |
| | | if (!row) { |
| | | return; |
| | | } |
| | | const url = row.previewUrl || row.url; |
| | | if (!url) { |
| | | return; |
| | | } |
| | | const file = { |
| | | name: row.name || "", |
| | | url, |
| | | type: /\.pdf$/i.test(row.name || "") ? "pdf" : "image" |
| | | }; |
| | | if (this.activeName == 2) { |
| | | this.invoiceEmbeddedFile = file; |
| | | } else { |
| | | this.embeddedFile = file; |
| | | } |
| | | }, |
| | | |
| | | downFile(item) { |
| | | if (this.operationType == "detail") { |
| | | const source = |