Browse Source

修改bug

QuKatie 3 years ago
parent
commit
b9dbd5f958

+ 51 - 26
src/views/finance/charge/kaihe-detail.vue

@@ -257,6 +257,7 @@
           size="mini"
           @click="submit"
           :disabled="form.fBillstatus >= 4 || readOnly == 0"
+          :loading="subLoading"
         >
           确认收费
         </el-button>
@@ -265,6 +266,7 @@
           size="mini"
           @click="backrRconciliation"
           v-if="form.fBillstatus === '6'"
+          :loading="subLoading"
           >撤销收费</el-button
         >
         <el-button
@@ -287,7 +289,14 @@
           @click="addOrUpdateHandle('f_billstatus')"
           >查看审批流</el-button
         >
-        <el-button type="success" size="mini" @click="save"> 保存 </el-button>
+        <el-button
+          type="success"
+          size="mini"
+          @click="save"
+          :loading="subLoading"
+        >
+          保存
+        </el-button>
         <el-button
           type="warning"
           size="mini"
@@ -480,6 +489,7 @@ export default {
       approve: false,
       addOrUpdateVisib: false,
       readOnly: null,
+      subLoading: false,
     };
   },
   components: {
@@ -699,14 +709,19 @@ export default {
     // 撤销收费
     backrRconciliation() {
       this.form.fBillstatus = "1";
+      this.subLoading = true;
       let formDate = new window.FormData();
       formDate.append("tFee", JSON.stringify(this.form));
       formDate.append("tFeeDo", JSON.stringify(this.tableData));
-      revoke(formDate).then((response) => {
-        this.msgSuccess("撤回成功");
-        Object.assign(this.$data, this.$options.data());
-        this.$emit("goBack", false);
-      });
+      revoke(formDate)
+        .then((response) => {
+          this.msgSuccess("撤回成功");
+          Object.assign(this.$data, this.$options.data());
+          this.$emit("goBack", false);
+        })
+        .finally(() => {
+          this.subLoading = false;
+        });
     },
     Search() {
       const data = {
@@ -758,17 +773,22 @@ export default {
       if (this.form.fId == null) {
         return this.$message.error("数据未保存,不能进行确认收费");
       }
+      this.subLoading = true;
       let formDate = new window.FormData();
       formDate.append("tFee", JSON.stringify(this.form));
       formDate.append("tFeeDo", JSON.stringify(this.tableData));
       formDate.append("billsType", JSON.stringify("KHDZ"));
-      confirm(formDate).then((res) => {
-        if (res.code == 200) {
-          this.$message.success("收费成功");
-          Object.assign(this.$data, this.$options.data());
-          this.$emit("goBack", false);
-        }
-      });
+      confirm(formDate)
+        .then((res) => {
+          if (res.code == 200) {
+            this.$message.success("收费成功");
+            Object.assign(this.$data, this.$options.data());
+            this.$emit("goBack", false);
+          }
+        })
+        .finally(() => {
+          this.subLoading = false;
+        });
     },
     save(type) {
       if (this.form.fCorpid == null) {
@@ -787,25 +807,30 @@ export default {
         this.form.fToDate = this.form.date[1];
       }
       this.lumpSum();
+      this.subLoading = true;
       let formDate = new window.FormData();
       formDate.append("tFee", JSON.stringify(this.form));
       formDate.append("tFeeDo", JSON.stringify(this.tableData));
       formDate.append("billsType", JSON.stringify("KHDZ"));
-      save(formDate).then((res) => {
-        if (res.code == 200) {
-          if (!type) {
-            if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
-              const date = [];
-              date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
-              res.data.tFee.date = date;
+      save(formDate)
+        .then((res) => {
+          if (res.code == 200) {
+            if (!type) {
+              if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
+                const date = [];
+                date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
+                res.data.tFee.date = date;
+              }
             }
+            this.form = res.data.tFee;
+            this.tableData = res.data.tFeeDo;
+            this.$emit("refFresh");
+            this.$message.success("保存成功");
           }
-          this.form = res.data.tFee;
-          this.tableData = res.data.tFeeDo;
-          this.$emit("refFresh");
-          this.$message.success("保存成功");
-        }
-      });
+        })
+        .finally(() => {
+          this.subLoading = false;
+        });
     },
     cancel() {
       if (this.readOnly != 0) {

+ 51 - 26
src/views/finance/contrast/kaihe-detail.vue

@@ -239,6 +239,7 @@
           size="mini"
           @click="submit"
           :disabled="form.fBillstatus >= 4 || readOnly == 0"
+          :loading="subLoading"
         >
           确认对账
         </el-button>
@@ -247,6 +248,7 @@
           size="mini"
           @click="backrRconciliation"
           v-if="form.fBillstatus === '6'"
+          :loading="subLoading"
           >撤销对账</el-button
         >
         <el-button
@@ -269,7 +271,14 @@
           @click="addOrUpdateHandle('f_billstatus')"
           >查看审批流</el-button
         >
-        <el-button type="success" size="mini" @click="save"> 保存 </el-button>
+        <el-button
+          type="success"
+          size="mini"
+          @click="save"
+          :loading="subLoading"
+        >
+          保存
+        </el-button>
         <el-button
           type="warning"
           size="mini"
@@ -463,6 +472,7 @@ export default {
       approve: false,
       addOrUpdateVisib: false,
       readOnly: null,
+      subLoading: false,
     };
   },
   components: {
@@ -682,14 +692,19 @@ export default {
     // 撤销对账
     backrRconciliation() {
       this.form.fBillstatus = "1";
+      this.subLoading = true;
       let formDate = new window.FormData();
       formDate.append("tFee", JSON.stringify(this.form));
       formDate.append("tFeeDo", JSON.stringify(this.tableData));
-      revoke(formDate).then((response) => {
-        this.msgSuccess("撤回成功");
-        Object.assign(this.$data, this.$options.data());
-        this.$emit("goBack", false);
-      });
+      revoke(formDate)
+        .then((response) => {
+          this.msgSuccess("撤回成功");
+          Object.assign(this.$data, this.$options.data());
+          this.$emit("goBack", false);
+        })
+        .finally(() => {
+          this.subLoading = false;
+        });
     },
     Search() {
       const data = {
@@ -740,17 +755,22 @@ export default {
       if (this.form.fId == null) {
         return this.$message.error("数据未保存,不能进行确认对账");
       }
+      this.subLoading = true;
       let formDate = new window.FormData();
       formDate.append("tFee", JSON.stringify(this.form));
       formDate.append("tFeeDo", JSON.stringify(this.tableData));
       formDate.append("billsType", JSON.stringify("KHDZ"));
-      confirm(formDate).then((res) => {
-        if (res.code == 200) {
-          this.$message.success("对账成功");
-          Object.assign(this.$data, this.$options.data());
-          this.$emit("goBack", false);
-        }
-      });
+      confirm(formDate)
+        .then((res) => {
+          if (res.code == 200) {
+            this.$message.success("对账成功");
+            Object.assign(this.$data, this.$options.data());
+            this.$emit("goBack", false);
+          }
+        })
+        .finally(() => {
+          this.subLoading = false;
+        });
     },
     save(type) {
       if (this.form.fCorpid == null) {
@@ -766,25 +786,30 @@ export default {
         this.form.fToDate = this.form.date[1];
       }
       this.lumpSum();
+      this.subLoading = true;
       let formDate = new window.FormData();
       formDate.append("tFee", JSON.stringify(this.form));
       formDate.append("tFeeDo", JSON.stringify(this.tableData));
       formDate.append("billsType", JSON.stringify("KHDZ"));
-      save(formDate).then((res) => {
-        if (res.code == 200) {
-          if (!type) {
-            if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
-              const date = [];
-              date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
-              res.data.tFee.date = date;
+      save(formDate)
+        .then((res) => {
+          if (res.code == 200) {
+            if (!type) {
+              if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
+                const date = [];
+                date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
+                res.data.tFee.date = date;
+              }
             }
+            this.form = res.data.tFee;
+            this.tableData = res.data.tFeeDo;
+            this.$emit("refFresh");
+            this.$message.success("保存成功");
           }
-          this.form = res.data.tFee;
-          this.tableData = res.data.tFeeDo;
-          this.$emit("refFresh");
-          this.$message.success("保存成功");
-        }
-      });
+        })
+        .finally(() => {
+          this.subLoading = false;
+        });
     },
     cancel() {
       if (this.readOnly != 0) {

+ 51 - 26
src/views/finance/payment/kaihe-detail.vue

@@ -257,6 +257,7 @@
           size="mini"
           @click="submit"
           :disabled="form.fBillstatus >= 4 || readOnly == 0"
+          :loading="subLoading"
         >
           确认付费
         </el-button>
@@ -265,6 +266,7 @@
           size="mini"
           @click="backrRconciliation"
           v-if="form.fBillstatus === '6'"
+          :loading="subLoading"
           >撤销付费</el-button
         >
         <el-button
@@ -287,7 +289,14 @@
           @click="addOrUpdateHandle('f_billstatus')"
           >查看审批流</el-button
         >
-        <el-button type="success" size="mini" @click="save"> 保存 </el-button>
+        <el-button
+          type="success"
+          size="mini"
+          @click="save"
+          :loading="subLoading"
+        >
+          保存
+        </el-button>
         <el-button
           type="warning"
           size="mini"
@@ -480,6 +489,7 @@ export default {
       approve: false,
       addOrUpdateVisib: false,
       readOnly: null,
+      subLoading: false,
     };
   },
   components: {
@@ -699,14 +709,19 @@ export default {
     // 撤销付费
     backrRconciliation() {
       this.form.fBillstatus = "1";
+      this.subLoading = true;
       let formDate = new window.FormData();
       formDate.append("tFee", JSON.stringify(this.form));
       formDate.append("tFeeDo", JSON.stringify(this.tableData));
-      revoke(formDate).then((response) => {
-        this.msgSuccess("撤回成功");
-        Object.assign(this.$data, this.$options.data());
-        this.$emit("goBack", false);
-      });
+      revoke(formDate)
+        .then((response) => {
+          this.msgSuccess("撤回成功");
+          Object.assign(this.$data, this.$options.data());
+          this.$emit("goBack", false);
+        })
+        .finally(() => {
+          this.subLoading = false;
+        });
     },
     Search() {
       const data = {
@@ -758,17 +773,22 @@ export default {
       if (this.form.fId == null) {
         return this.$message.error("数据未保存,不能进行确认付费");
       }
+      this.subLoading = true;
       let formDate = new window.FormData();
       formDate.append("tFee", JSON.stringify(this.form));
       formDate.append("tFeeDo", JSON.stringify(this.tableData));
       formDate.append("billsType", JSON.stringify("KHDZ"));
-      confirm(formDate).then((res) => {
-        if (res.code == 200) {
-          this.$message.success("付费成功");
-          Object.assign(this.$data, this.$options.data());
-          this.$emit("goBack", false);
-        }
-      });
+      confirm(formDate)
+        .then((res) => {
+          if (res.code == 200) {
+            this.$message.success("付费成功");
+            Object.assign(this.$data, this.$options.data());
+            this.$emit("goBack", false);
+          }
+        })
+        .finally(() => {
+          this.subLoading = false;
+        });
     },
     save(type) {
       if (this.form.fCorpid == null) {
@@ -787,25 +807,30 @@ export default {
         this.form.fToDate = this.form.date[1];
       }
       this.lumpSum();
+      this.subLoading = true;
       let formDate = new window.FormData();
       formDate.append("tFee", JSON.stringify(this.form));
       formDate.append("tFeeDo", JSON.stringify(this.tableData));
       formDate.append("billsType", JSON.stringify("KHDZ"));
-      save(formDate).then((res) => {
-        if (res.code == 200) {
-          if (!type) {
-            if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
-              const date = [];
-              date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
-              res.data.tFee.date = date;
+      save(formDate)
+        .then((res) => {
+          if (res.code == 200) {
+            if (!type) {
+              if (res.data.tFee.fFromDate && res.data.tFee.fToDate) {
+                const date = [];
+                date.push(res.data.tFee.fFromDate, res.data.tFee.fToDate);
+                res.data.tFee.date = date;
+              }
             }
+            this.form = res.data.tFee;
+            this.tableData = res.data.tFeeDo;
+            this.$emit("refFresh");
+            this.$message.success("保存成功");
           }
-          this.form = res.data.tFee;
-          this.tableData = res.data.tFeeDo;
-          this.$emit("refFresh");
-          this.$message.success("保存成功");
-        }
-      });
+        })
+        .finally(() => {
+          this.subLoading = false;
+        });
     },
     cancel() {
       if (this.readOnly != 0) {

+ 36 - 20
src/views/startApproval.vue

@@ -48,8 +48,8 @@
     </el-form>
     <span slot="footer" class="dialog-footer">
       <el-button @click="closeDia">关闭</el-button>
-      <el-button @click="approvalRejected">审批驳回</el-button>
-      <el-button @click="approved">审批通过</el-button>
+      <el-button @click="approvalRejected" :loading="subLoading">审批驳回</el-button>
+      <el-button @click="approved" :loading="subLoading">审批通过</el-button>
     </span>
   </el-dialog>
 </template>
@@ -76,6 +76,7 @@ export default {
       },
       visible: false,
       optionsBranch: [],
+      subLoading: false,
     };
   },
   components: {},
@@ -124,24 +125,40 @@ export default {
       })
         .then(() => {
           this.getTime();
-          return listCharge(this.dataForm, "/warehouse/paths/approved");
-        })
-        .then((data) => {
-          if (data && data.code == 200) {
-            this.$message({
-              message: "审核通过",
-              type: "success",
-              duration: 600,
-              onClose: () => {
+          this.subLoading = true;
+          listCharge(this.dataForm, "/warehouse/paths/approved")
+            .then((res) => {
+              if (res.code) {
+                this.$message({
+                  message: "审核通过",
+                  type: "success",
+                  duration: 600,
+                });
                 this.closeDia();
-              },
+                this.visible = true;
+              }
+            })
+            .finally(() => {
+              this.subLoading = false;
+              // this.closeDia();
             });
-            this.visible = true;
-            // this.homePage()
-          } else {
-            this.$message.error(data.msg);
-          }
-        });
+          return;
+        })
+        // .then((data) => {
+        //   console.log(data);
+        //   if (data && data.code == 200) {
+        //     this.$message({
+        //       message: "审核通过",
+        //       type: "success",
+        //       duration: 600,
+        //     });
+        //     this.closeDia();
+        //     this.visible = true;
+        //     // this.homePage()
+        //   } else {
+        //     this.$message.error(data.msg);
+        //   }
+        // });
     },
     // homePage(){
     //   let view = {
@@ -205,5 +222,4 @@ export default {
 };
 </script>
 
-<style scoped>
-</style>
+<style scoped></style>