Przeglądaj źródła

物料分类 小修正

liangyan0105 3 lat temu
rodzic
commit
45317f17fb

+ 15 - 12
src/app/routes/basedata/material-file/add/add.component.ts

@@ -17,7 +17,7 @@ export class BasedataMaterialFileAddComponent implements OnInit {
   @Input() isOne = 0; //标题
   @Input() materialId = ''; //分类id
 
-  //初始化 物料分类对象
+  //初始化 物料分类对象  里面内容不写也可
   baseMaterialFileClassification: BaseMaterialFileClassification = {
     id: '',
     code: '',
@@ -66,18 +66,21 @@ export class BasedataMaterialFileAddComponent implements OnInit {
   submitForm() {
     //根据标题判断 新增 or 修改
     if (this.isOne == 2) {
-      //修改
-      this.baseMaterialFileClassificationService.update(this.baseMaterialFileClassification).then(res => {
-        if (res.success) {
-          this.notification.success(this.i18NService.fanyi('successful.revision'), '');
-          this.modal.destroy();
-        } else {
-          this.notification.error(
-            this.i18NService.fanyi('modification.failed'),
-            messageShared(this.i18NService, res.message),
-          );
-        }
+      return new Promise(resolve => {
+        //修改
+        this.baseMaterialFileClassificationService.update(this.baseMaterialFileClassification).then(res => {
+          if (res.success) {
+            this.notification.success(this.i18NService.fanyi('successful.revision'), '');
+            this.modal.destroy();
+          } else {
+            this.notification.error(
+              this.i18NService.fanyi('modification.failed'),
+              messageShared(this.i18NService, res.message),
+            );
+          }
+        });
       });
+      // resolve();
     } else {
       //新增
       return new Promise(resolve => {

+ 1 - 2
src/app/routes/basedata/material-file/material-file.component.ts

@@ -48,8 +48,7 @@ export class BasedataMaterialFileComponent implements OnInit {
   ) {}
 
   ngOnInit() {
-    this.getProductList(); // 产品生育金
-    //客商行业数 树
+    this.getProductList(); // 产品数据
     this.getMaterialTree(); //物料分类树
 
     // 物料分类