WXL
3 天以前 5e093dcc9f4177bfd5f9ab2927914d2bf852770b
src/views/project/travelexpenseapply/travelexpensedetail/index.vue
@@ -1282,7 +1282,8 @@
  exportReimbursement,
  getdownload,
  checkfund,
  fundSubmit
  fundSubmit,
  listbypowerone
} from "@/api/project/reimbursement";
import {
  addReimbursementdetail,
@@ -1492,6 +1493,8 @@
        flowconclusion: null,
        fundid: null
      },
      //连续审批:待审批列表
      pendingList: [],
      jurisdiction: false,
      //保存按钮控制
@@ -2575,7 +2578,15 @@
      this.reset();
      this.open = true;
      const id = ids || this.ids;
      this.checkObj.fundid = id;
      // 重置审批信息,避免上一单的审批结果带入下一单
      this.checkObj = {
        flowlevelone: null,
        flowconclusion: null,
        fundid: id
      };
      // 连续审批:加载当前用户的待审批列表
      this.getPendingList();
      getReimbursement(id).then(response => {
        this.form = response.data;
@@ -2665,9 +2676,8 @@
        if (res.code == 200) {
          this.$modal.closeLoading();
          this.$modal.msgSuccess("提交审核成功!");
          // 关闭窗口
          this.$store.dispatch("tagsView/delView", this.$route);
          this.$router.go(-1);
          // 连续审批:询问是否继续审批下一单
          this.continueOrExit();
        } else {
          this.$modal.closeLoading();
          if (res.msg) {
@@ -2679,6 +2689,66 @@
      });
    },
    // 获取当前用户待审批列表(用于连续审批)
    getPendingList() {
      listbypowerone({
        pageNum: 1,
        pageSize: 1000,
        CHECKFLAG: 1
      })
        .then(res => {
          this.pendingList = res.rows || [];
        })
        .catch(() => {
          this.pendingList = [];
        });
    },
    // 审批完成后:询问是否继续审批下一单
    continueOrExit() {
      const list = this.pendingList || [];
      const curId = String(this.checkObj.fundid);
      const idx = list.findIndex(item => String(item.id) === curId);
      let next = null;
      if (idx > -1 && idx + 1 < list.length) {
        next = list[idx + 1];
      } else {
        // 当前已是末位(或从中间开始),取剩余列表中第一条非当前单据
        next = list.find(item => String(item.id) !== curId) || null;
      }
      if (next) {
        this.$confirm("审批已完成,是否继续审批下一张待审批单据?", "提示", {
          confirmButtonText: "继续审批",
          cancelButtonText: "返回列表",
          type: "info"
        })
          .then(() => {
            // 直接在当前页面加载下一张待审批单据
            this.handleCheck(next.id);
            // 同步更新地址栏,避免刷新后回到上一单
            this.$router
              .replace({
                path: this.$route.path,
                query: { id: next.id, pos: 4 }
              })
              .catch(() => {});
          })
          .catch(() => {
            this.exitToPage();
          });
      } else {
        this.$modal.msgSuccess("已无待审批单据,返回列表");
        this.exitToPage();
      }
    },
    // 返回列表页
    exitToPage() {
      this.$store.dispatch("tagsView/delView", this.$route);
      this.$router.go(-1);
    },
    /** 提交保存按钮 */
    submitForm: debounce(function (data) {
      this.$refs["form"].validate(valid => {