yxh
3 天以前 45d4fe24016c03fcccbe7c9798533ca97e2e7aea
src/views/project/fund/applyDetail/index.vue
@@ -304,7 +304,7 @@
                <i class="el-icon-warning-outline" />
                当前为查看模式,不能上传附件
              </div>
              <el-table ref="annexTable" :data="fileListto" :row-class-name="annexRowClass" @row-click="downFile" style="width: 100%" height="400">
              <el-table ref="annexTable" :data="fileListto" :row-class-name="annexRowClass" @row-click="previewInline" @row-dblclick="downFile" style="width: 100%" height="400">
                <el-table-column prop="name" :show-overflow-tooltip="true" label="名称">
                  <template slot-scope="scope">
                    <i style="color:#409EFF" class=" el-icon-s-order" />{{
@@ -616,7 +616,7 @@
                <i class="el-icon-warning-outline" />
                当前为查看模式,不能上传附件
              </div>
                <el-table ref="annexTable2" :data="fileListto" :row-class-name="annexRowClass" @row-click="downFile" style="width: 100%" height="400">
                <el-table ref="annexTable2" :data="fileListto" :row-class-name="annexRowClass" @row-click="previewInline" @row-dblclick="downFile" style="width: 100%" height="400">
                  <el-table-column prop="name" :show-overflow-tooltip="true" label="名称">
                    <template slot-scope="scope">
                      <i style="color:#409EFF" class=" el-icon-s-order" />
@@ -664,7 +664,7 @@
                <i class="el-icon-warning-outline" />
                当前为查看模式,不能上传附件
              </div>
                <el-table ref="invoiceTable" :data="invoicefileListto" :row-class-name="invoiceRowClass" @row-click="downFile" style="width: 100%" height="400">
                <el-table ref="invoiceTable" :data="invoicefileListto" :row-class-name="invoiceRowClass" @row-click="previewInline" @row-dblclick="downFile" style="width: 100%" height="400">
                  <el-table-column prop="name" :show-overflow-tooltip="true" label="名称">
                    <template slot-scope="scope">
                      <i style="color:#409EFF" class=" el-icon-s-order" />
@@ -1144,6 +1144,7 @@
      flashInvoiceName: "",
      invoicepdfimg: "",
      invoicepdfimgsrcList: [],
      previewToken: 0,
      invoDatatop: [],
      activeName: "invoice", //文件类型:默认发票文件
      //上传附件路径
@@ -2807,6 +2808,9 @@
      } else {
        this.rbDetails.splice(rowIndex + 1, 0, rowData);
      }
      // 2026-11-30:新增行后把当前操作行切到新行,并清空上一次的预览态
      this.atpresent = this.rbDetails.indexOf(rowData);
      this.resetPreviewState();
      this.Reminderquantity++;
      this.totalquantity++;
      for (let i = 0; i < this.rbDetails.length; i++) {
@@ -3239,18 +3243,33 @@
    },
    // 点击票据
    /**
     * 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 = "";
      // 递增令牌:让上一行尚未返回的 fetch 结果失效,避免异步回写覆盖
      this.previewToken = (this.previewToken || 0) + 1;
    },
    Filepopup(index, rows, row) {
      const config = {
        headers: { Authorization: "Bearer " + this.ICDtoken }
      };
      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;
@@ -3298,6 +3317,11 @@
        );
        Promise.all(fetchPromises).then(fileListto => {
          // 2026-11-30:切换行后旧请求返回,丢弃过期结果,避免覆盖当前行预览
          if (previewToken !== this.previewToken) {
            return;
          }
          this.fileListto = fileListto.filter(item => item !== null);
          this.pdfimg =
            this.fileListto.length > 0 ? this.fileListto[0].previewUrl : "";
@@ -3334,6 +3358,11 @@
        );
        Promise.all(fetchPromises).then(invoicefileListto => {
          // 2026-11-30:切换行后旧请求返回,丢弃过期结果,避免覆盖当前行预览
          if (previewToken !== this.previewToken) {
            return;
          }
          this.invoicefileListto = invoicefileListto.filter(
            item => item !== null
          );
@@ -3364,6 +3393,30 @@
    },
    // 费用报销:附件统一使用独立 FilePreview(录入、审批、详情一致)
    /**
     * 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 == "common") {
        this.embeddedFile = file;
      } else {
        this.invoiceEmbeddedFile = file;
      }
    },
    downFile(item) {
      const source =
        this.activeName == "common" ? this.fileListto : this.invoicefileListto;