Ver código fonte

退押审批审批后可自动跳转下一张未审批的单

chen 3 anos atrás
pai
commit
f8de24cbb4

+ 59 - 23
src/views/engin_deposit/components/refund_list-detail.vue

@@ -555,13 +555,6 @@ export default {
       checkNote: "",
     };
   },
-  computed: {
-    previewImages() {
-      const fileList = [];
-
-      return fileList;
-    },
-  },
   created() {
     console.log(this.$imageUrl, 8888);
     this.checkBy = this.name;
@@ -628,22 +621,65 @@ export default {
     },
     //审批通过
     async adoptFn() {
-      if (!this.detailList.installDate) {
-        this.$message.error("请选择安装时间");
-        return;
-      }
-      let data = {
-        ...this.detailList,
-        checkBy: this.checkBy,
-        // checkDate: this.checkDate,
-        isRefundDeposit: this.isRefundDeposit,
-        checkNote: this.checkNote,
-        examineResult: 1,
-      };
-      await getDepositManageExamine(data);
-      this.$message.success("审批通过");
-      this.goBack();
-      this.$emit("updateList");
+      this.$confirm("此操作将审批订单, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          if (!this.detailList.installDate) {
+            this.$message.error("请选择安装时间");
+            return;
+          }
+          let data = {
+            ...this.detailList,
+            checkBy: this.checkBy,
+            // checkDate: this.checkDate,
+            isRefundDeposit: this.isRefundDeposit,
+            checkNote: this.checkNote,
+            examineResult: 1,
+          };
+          getDepositManageExamine(data)
+            .then((res) => {
+              if (!res.data) {
+                this.goBack();
+                this.$emit("updateList");
+              } else {
+                this.$confirm("审批成功!是否跳转下一张待审批订单?", "提示", {
+                  confirmButtonText: "跳转",
+                  cancelButtonText: "取消",
+                  type: "warning",
+                })
+                  .then(() => {
+                    this.$successMsg("进入下一张待审批订单");
+                    this.detailList = res.data;
+                  })
+                  .catch(() => {
+                    this.goBack();
+                    this.$emit("updateList");
+                  });
+              }
+            })
+            .finally((res) => {});
+        })
+        .catch(() => {});
+
+      // if (!this.detailList.installDate) {
+      //   this.$message.error("请选择安装时间");
+      //   return;
+      // }
+      // let data = {
+      //   ...this.detailList,
+      //   checkBy: this.checkBy,
+      //   // checkDate: this.checkDate,
+      //   isRefundDeposit: this.isRefundDeposit,
+      //   checkNote: this.checkNote,
+      //   examineResult: 1,
+      // };
+      // await getDepositManageExamine(data);
+      // this.$message.success("审批通过");
+      // this.goBack();
+      // this.$emit("updateList");
     },
     async getData(data) {
       const res = await getDepositManageDetail(data);

+ 21 - 5
src/views/engin_deposit/refund_list.vue

@@ -138,6 +138,8 @@
             highlight-current-row
             stripe
             @selection-change="handleSelectionChange"
+            show-summary
+            :summary-method="$getSummaries"
           >
             >
             <el-table-column type="selection" align="center" width="55">
@@ -171,12 +173,16 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
-              align="center"
+              align="right"
               label="押金金额"
               prop="depositAmount"
               min-width="160"
               show-overflow-tooltip
-            ></el-table-column>
+            >
+              <template slot-scope="scope">
+                {{ scope.row.depositAmount | numToFixed }}
+              </template>
+            </el-table-column>
             <el-table-column
               align="center"
               label="状态"
@@ -186,9 +192,15 @@
             >
               <template v-slot="{ row }">
                 <el-tag v-show="row.examineStatus == 'SAVE'">保存</el-tag>
-                <el-tag v-show="row.examineStatus == 'WAIT'">待审核</el-tag>
-                <el-tag v-show="row.examineStatus == 'OK'">通过</el-tag>
-                <el-tag v-show="row.examineStatus == 'FAIL'">不通过</el-tag>
+                <el-tag v-show="row.examineStatus == 'WAIT'" type="warning"
+                  >待审核</el-tag
+                >
+                <el-tag v-show="row.examineStatus == 'OK'" type="success"
+                  >通过</el-tag
+                >
+                <el-tag v-show="row.examineStatus == 'FAIL'" type="danger"
+                  >不通过</el-tag
+                >
               </template>
             </el-table-column>
             <el-table-column
@@ -465,6 +477,10 @@ export default {
     },
     async getDataList(data) {
       const res = await getDepositManageList(data);
+      res.data.records.forEach((item) => {
+        item.sums1 = [];
+        item.sums2 = ["depositAmount"];
+      });
       this.dataList = res.data.records;
       this.listTotal = res.data.total;
     },