quwangxin 2 lat temu
rodzic
commit
14db3b095e
1 zmienionych plików z 25 dodań i 5 usunięć
  1. 25 5
      src/views/saleOrder/salesToProduction.vue

+ 25 - 5
src/views/saleOrder/salesToProduction.vue

@@ -606,11 +606,31 @@
                 }
 
                 await releaseSave(data)
-                  .then(() => {
-                    this.$message.success('发布成功!');
-                    this.$router.push({
-                      path: '/productionPlan'
-                    });
+                  .then((res) => {
+                    if (res === 1) {
+                      this.$message.success('工单已发布!');
+                      this.$router.push({
+                        path: '/productionPlan'
+                      });
+                    } else {
+                      this.$confirm(
+                        '生产计划创建成功,但工单发布失败。请前往【生产计划】列表【重新发布】工单',
+                        '提示',
+                        {
+                          confirmButtonText: '返回',
+                          cancelButtonText: '立即前往',
+                          type: 'warning'
+                        }
+                      )
+                        .then(() => {
+                          this.$router.push({
+                            path: '/productionPlan'
+                          });
+                        })
+                        .catch(() => {
+                          this.$router.go(-1);
+                        });
+                    }
                     removePageTab({ key });
                   })
                   .catch(() => {