mainqaq 3 лет назад
Родитель
Сommit
56c1716e2b
1 измененных файлов: 17 добавлений и 14 удалений
  1. 17 14
      src/xt_pages/supply/components/addSupply.vue

+ 17 - 14
src/xt_pages/supply/components/addSupply.vue Просмотреть файл

@@ -565,22 +565,25 @@ export default {
565 565
       let params = {
566 566
         id: data.id,
567 567
       };
568
-
569
-      if (this.show_type == 1) {
570
-        if (this.recordInfo.contacts.length <= 1) {
571
-          return;
572
-        } else {
573
-          this.recordInfo.contacts.splice(index, 1);
574
-        }
575
-      } else if (this.show_type == 2) {
576
-        delcontactone(params).then((res) => {
577
-          if (res.data.state == 1) {
578
-            this.$message.success("删除成功");
579
-            this.getcontacts(this.supplier_ids);
568
+      if (params.id==undefined||params.id=="undefined") {
569
+        this.recordInfo.contacts.splice(index, 1);
570
+      }else {
571
+        if (this.show_type == 1) {
572
+          if (this.recordInfo.contacts.length <= 1) {
573
+            return;
580 574
           } else {
581
-            this.$message.error(res.data.data.list);
575
+            this.recordInfo.contacts.splice(index, 1);
582 576
           }
583
-        });
577
+        } else if (this.show_type == 2) {
578
+          delcontactone(params).then((res) => {
579
+            if (res.data.state == 1) {
580
+              this.$message.success("删除成功!!:",index);
581
+              this.getcontacts(this.supplier_ids);
582
+            } else {
583
+              this.$message.error(res.data.data.list);
584
+            }
585
+          });
586
+        }
584 587
       }
585 588
     },
586 589