yxh
3 天以前 45d4fe24016c03fcccbe7c9798533ca97e2e7aea
src/views/project/fund/performancedetails/index.vue
@@ -435,7 +435,24 @@
                </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"
@@ -706,7 +723,7 @@
                </el-upload>
                <el-table
                  :data="fileListto"
                  @row-click="downFile"
                  @row-click="previewInline" @row-dblclick="downFile"
                  style="width: 100%"
                  height="400"
                >
@@ -794,7 +811,7 @@
                </el-upload>
                <el-table
                  :data="invoicefileListto"
                  @row-click="downFile"
                  @row-click="previewInline" @row-dblclick="downFile"
                  style="width: 100%"
                  height="400"
                >
@@ -1256,6 +1273,7 @@
      invoicefileListto: [],
      invoicepdfimg: "",
      invoicepdfimgsrcList: [],
      previewToken: 0,
      activeName: 2, //文件类型:默认发票文件
      //上传附件路径
      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
@@ -2687,6 +2705,9 @@
        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++) {
@@ -2961,12 +2982,8 @@
      };
      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;
@@ -2991,6 +3008,10 @@
        );
        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");
@@ -3024,6 +3045,10 @@
        );
        Promise.all(fetchPromises).then(invoicefileListto => {
          // 2026-11-30:切换行后丢弃过期结果
          if (previewToken !== this.previewToken) {
            return;
          }
          this.invoicefileListto = invoicefileListto.filter(
            item => item !== null
          );
@@ -3051,6 +3076,30 @@
    },
    // 点击已上传文件:在附件弹窗右侧内嵌预览
    /**
     * 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 =