WXL
4 天以前 bb6b2def908504dee04d68b9c6b7742632787fdd
报销单附件删除问题维护
已修改1个文件
已添加1个文件
52 ■■■■ 文件已修改
SRMopo.zip 补丁 | 查看 | 原始文档 | blame | 历史
src/views/project/travelexpenseapply/travelexpensedetail/index.vue 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SRMopo.zip
Binary files differ
src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -1905,13 +1905,27 @@
        const index = this.getIndexInArray(this.fileListto, row);
        this.fileListto.splice(index, 1);
        console.log(this.rbDetails[this.atpresent].annexfilesList);
        indexvalue = this.rbDetails[this.atpresent].annexfilesList.find(
          (item, index) => {
            return item.name == row.name;
          }
        );
        console.log(indexvalue, "删除索引");
        this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1);
        // indexvalue = this.rbDetails[this.atpresent].annexfilesList.find(
        //   (item, index) => {
        //     return item.name == row.name;
        //   }
        // );
        // console.log(indexvalue, "删除索引");
        // this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1);
        const targetIndex = this.rbDetails[
          this.atpresent
        ].annexfilesList.findIndex(item => {
          return item.name === row.name; // 建议使用严格相等 ===
        });
        console.log(targetIndex, "删除索引"); // 现在打印的是索引号,例如 0, 1, 2...
        if (targetIndex > -1) {
          // 确保找到了元素
          this.rbDetails[this.atpresent].annexfilesList.splice(targetIndex, 1);
          console.log("删除成功");
        } else {
          console.log("未找到对应项目,无法删除");
        }
      } else {
        const indexlist = this.getIndexInArray(
          this.invoicepdfimgsrcList,
@@ -1921,13 +1935,23 @@
        const index = this.getIndexInArray(this.invoicefileListto, row);
        this.invoicefileListto.splice(index, 1);
        console.log(this.rbDetails[this.atpresent].invoicefilesList);
        indexvalue = this.rbDetails[this.atpresent].invoicefilesList.find(
          (item, index) => {
            return item.name == row.name;
          }
        );
        console.log(indexvalue, "删除索引");
        this.rbDetails[this.atpresent].invoicefilesList.splice(indexvalue, 1);
        const targetIndex = this.rbDetails[
          this.atpresent
        ].invoicefilesList.findIndex(item => {
          return item.name === row.name; // 建议使用严格相等 ===
        });
        console.log(targetIndex, "删除索引"); // 现在打印的是索引号,例如 0, 1, 2...
        if (targetIndex > -1) {
          // 确保找到了元素
          this.rbDetails[this.atpresent].invoicefilesList.splice(
            targetIndex,
            1
          );
          console.log("删除成功");
        } else {
          console.log("未找到对应项目,无法删除");
        }
      }
    },
    // 点击上移