qukaidi 4 سال پیش
والد
کامیت
4f8bbd7c75
1فایلهای تغییر یافته به همراه33 افزوده شده و 28 حذف شده
  1. 33 28
      src/views/Warehousing/inStock/AddOrUpdate.vue

+ 33 - 28
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -3785,7 +3785,7 @@ export default {
         }
       });
     },
-    saveForm() {
+    saveForm(status) {
       this.$refs["form"].validate((valid) => {
         if (valid) {
           this.form.fBillingway = this.form.fFeetUnit;
@@ -3880,38 +3880,43 @@ export default {
                   });
                 });
             } else {
-              this.mblnoStatus = "";
-              this.form = response.data.warehouseBills;
-              this.$set(this.form, "fEta", Date.parse(this.form.fEta));
-              this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
-              this.$set(this.form, "fBstime", Date.parse(this.form.fBstime));
-              this.$set(this.form, "fFeetUnit", this.form.fFeetunit);
-              this.$set(
-                this.form,
-                "createTime",
-                Date.parse(this.form.createTime)
-              );
-              this.$set(
-                this.form,
-                "fChargedate",
-                Date.parse(this.form.fChargedate)
-              );
-              if (this.form.fTrademodeid) {
+              if ((response.code = 200)) {
+                this.mblnoStatus = "";
+                this.form = response.data.warehouseBills;
+                this.$set(this.form, "fEta", Date.parse(this.form.fEta));
+                this.$set(this.form, "fBsdate", Date.parse(this.form.fBsdate));
+                this.$set(this.form, "fBstime", Date.parse(this.form.fBstime));
+                this.$set(this.form, "fFeetUnit", this.form.fFeetunit);
                 this.$set(
                   this.form,
-                  "fTrademodeid",
-                  this.form.fTrademodeid.toString()
+                  "createTime",
+                  Date.parse(this.form.createTime)
                 );
-              }
-              if (this.form.fStltypeid || this.form.fStltypeid == 0) {
                 this.$set(
                   this.form,
-                  "fStltypeid",
-                  this.form.fStltypeid.toString()
+                  "fChargedate",
+                  Date.parse(this.form.fChargedate)
                 );
+                if (this.form.fTrademodeid) {
+                  this.$set(
+                    this.form,
+                    "fTrademodeid",
+                    this.form.fTrademodeid.toString()
+                  );
+                }
+                if (this.form.fStltypeid || this.form.fStltypeid == 0) {
+                  this.$set(
+                    this.form,
+                    "fStltypeid",
+                    this.form.fStltypeid.toString()
+                  );
+                }
+                this.detailList = response.data.warehousebillsitems;
+                this.msgSuccess("保存成功");
+                if (status == "goBack") {
+                  this.cancel();
+                }
               }
-              this.detailList = response.data.warehousebillsitems;
-              this.msgSuccess("保存成功");
             }
           });
         }
@@ -4670,12 +4675,12 @@ export default {
     },
     goBack() {
       this.$confirm("是否确定返回列表?", "提示", {
-        confirmButtonText: "确定",
+        confirmButtonText: "保存",
         cancelButtonText: "取消",
         type: "warning",
       })
         .then(() => {
-          this.cancel();
+          this.saveForm("goBack");
         })
         .catch(() => {});
     },