Browse Source

学校设备管理解除绑定优化

gzb
wangzhonglu 7 months ago
parent
commit
2aba177704
1 changed files with 14 additions and 8 deletions
  1. 14
    8
      src/views/schoolSection/deviceManage/deviceManage.vue

+ 14
- 8
src/views/schoolSection/deviceManage/deviceManage.vue View File

1616
       controlWSMsg.removeBind();
1616
       controlWSMsg.removeBind();
1617
       controlWSMsg.send((isSend) => {
1617
       controlWSMsg.send((isSend) => {
1618
         if (isSend) {
1618
         if (isSend) {
1619
-          this.searchList();
1620
           this.$Message.success("推送成功");
1619
           this.$Message.success("推送成功");
1621
         } else {
1620
         } else {
1622
           this.$Message.error("推送失败");
1621
           this.$Message.error("推送失败");
1628
         pushObj: 1
1627
         pushObj: 1
1629
       };
1628
       };
1630
       form.userids = useridList;
1629
       form.userids = useridList;
1631
-      this.addPushLog(form);
1630
+      this.addPushLog(form).then(() => {
1631
+        this.searchList();
1632
+      });
1632
     },
1633
     },
1633
     // 添加推送日志
1634
     // 添加推送日志
1634
     addPushLog(form) {
1635
     addPushLog(form) {
1635
-      if (form.userids && form.userids.length === 0) {
1636
-        return;
1637
-      }
1638
-      logPush_add(form).then((data) => {
1639
-        if (data.code !== 0) {
1640
-          this.$Message.error(data.msg);
1636
+      return new Promise((resolve) => {
1637
+        if (form.userids && form.userids.length === 0) {
1638
+          resolve();
1639
+          return;
1641
         }
1640
         }
1641
+        logPush_add(form).then((data) => {
1642
+          if (data.code === 0) {
1643
+            resolve();
1644
+          } else {
1645
+            this.$Message.error(data.msg);
1646
+          }
1647
+        });
1642
       });
1648
       });
1643
     },
1649
     },
1644
     strategyPadTimes(id) {
1650
     strategyPadTimes(id) {

Loading…
Cancel
Save