浏览代码

改bug180

mainqaq 3 年前
父节点
当前提交
56c1716e2b
共有 1 个文件被更改,包括 17 次插入14 次删除
  1. 17 14
      src/xt_pages/supply/components/addSupply.vue

+ 17 - 14
src/xt_pages/supply/components/addSupply.vue 查看文件

565
       let params = {
565
       let params = {
566
         id: data.id,
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
           } else {
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