Просмотр исходного кода

refactor: 出库入库新增统一使用返回方法替代直接路由跳转

liujt 8 месяцев назад
Родитель
Сommit
766bab370b

+ 4 - 2
src/views/warehouseManagement/outgoingManagement/add.vue

@@ -1038,12 +1038,14 @@
                 } else {
                 } else {
                   this.$message.success('保存成功!');
                   this.$message.success('保存成功!');
                 }
                 }
-                this.$router.push('/warehouseManagement/outgoingManagement');
+                // this.$router.push('/warehouseManagement/outgoingManagement');
+                this.$router.go(-1);
               }
               }
               this.saveLoading = false;
               this.saveLoading = false;
             } catch (error) {
             } catch (error) {
               this.saveLoading = false;
               this.saveLoading = false;
-              this.$router.push('/warehouseManagement/outgoingManagement');
+              // this.$router.push('/warehouseManagement/outgoingManagement');
+              this.$router.go(-1);
               this.$message.error('保存失败!');
               this.$message.error('保存失败!');
             }
             }
           } else {
           } else {

+ 4 - 2
src/views/warehouseManagement/stockManagement/add.vue

@@ -2357,10 +2357,12 @@
                     // 委外入库(非采购)
                     // 委外入库(非采购)
 
 
                     this.saveLoading = false;
                     this.saveLoading = false;
-                    this.$router.push('/warehouseManagement/stockManagement');
+                    // this.$router.push('/warehouseManagement/stockManagement');
+                    this.back();
                   } catch (error) {
                   } catch (error) {
                     this.saveLoading = false;
                     this.saveLoading = false;
-                    this.$router.push('/warehouseManagement/stockManagement');
+                    // this.$router.push('/warehouseManagement/stockManagement');
+                    this.back();
                     console.log('提交流程失败', error);
                     console.log('提交流程失败', error);
                   }
                   }
                 }
                 }