wzh il y a 2 ans
Parent
commit
34d29226c9
1 fichiers modifiés avec 30 ajouts et 18 suppressions
  1. 30 18
      pages/device/detail.vue

+ 30 - 18
pages/device/detail.vue

@@ -1104,6 +1104,9 @@ export default {
     }
   },
   methods:{
+    closeDeviceYuyueIngPop(){
+      this.deviceYuyueIngPop = false;
+    },
     closeDevicePlanPop(){
       this.devicePlanPopDlg = false;
     },
@@ -1116,7 +1119,8 @@ export default {
       if(this.devicePlanTime == 0){
         this.$modal.showToast('预约时间不能为空')
       }else{
-        let obj = {deviceNo:this.deviceInfo.serialNumber,minute:this.devicePlanTime};
+        let child = this.childId;
+        let obj = {deviceNo:this.deviceInfo.serialNumber+"&&"+child,minute:this.devicePlanTime};
         addDevicePlan(obj).then(res=>{
           self.getDevicePlanInfo();
           self.$modal.showToast('预约成功')
@@ -1389,16 +1393,9 @@ export default {
     },
     isMulTab(index){
       let type = this.deviceType;
-      if(index == 2){
-       if(this.secondMachine){
+       if(this.secondMachine || this.secondMachine){
          return true;
        }
-      }
-      if(index == 3){
-        if(this.thirdMachine){
-          return true;
-        }
-      }
       return false;
 
     },
@@ -1566,7 +1563,6 @@ export default {
       if(!tag){
         return;
       }
-      debugger;
       let type = this.deviceType;
       let self = this;
       if(index == 2 || index == 3){
@@ -1600,6 +1596,7 @@ export default {
            self.firstTab = true;
            self.tabActive[index-1] = true;
            self.$forceUpdate();
+           self.getDevicePlanInfo();
          });
        }else{
          this.getDeviceStatus(function(){
@@ -1607,6 +1604,7 @@ export default {
            self.firstTab = true;
            self.tabActive[index-1] = true;
            self.$forceUpdate();
+           self.getDevicePlanInfo();
          })
        }
 
@@ -1747,12 +1745,8 @@ export default {
     },
 
     toDevicePlan(){
-      if(!this.jianyaoOpen()){
-        this.$modal.showToast('煎药机已经关机')
-        return;
-      }
       let self = this;
-      getDevicePlan(this.deviceInfo.serialNumber).then(res=>{
+      getDevicePlan(this.deviceInfo.serialNumber+"&&"+this.childId).then(res=>{
 
         if(res.data != null){
           self.deviceYuyueIngPop = true;
@@ -1775,9 +1769,12 @@ export default {
       })
     },
     getDevicePlanInfo(){
+      if(this.boardType != 4){
+        return;
+      }
       let self = this;
       self.devicePlanInfo = null;
-      getDevicePlan(this.deviceInfo.serialNumber).then(res=>{
+      getDevicePlan(this.deviceInfo.serialNumber+"&&"+self.childId).then(res=>{
         if(res.data != null){
           self.devicePlanInfo = res.data;
           let minute = self.devicePlanInfo.minute;
@@ -2053,6 +2050,17 @@ export default {
       console.log("减少预约时间")
       this.planTime--;
     },
+    subDevicePlanTime(){
+      this.devicePlanTime--;
+      if(this.devicePlanTime<0){
+        this.devicePlanTime = 1;
+      }
+      console.log("减少预约时间")
+    },
+    addDevicePlanTime(){
+      console.log("增加预约时间")
+      this.devicePlanTime++;
+    },
     sendBaozhuang(targetKey){
       let self = this;
       let arr = [];
@@ -2508,7 +2516,6 @@ export default {
         self.productImage = self.imgUrl+'/detail/product.png'
         if(self.deviceType == 13 || self.deviceType == 14){
           self.boardType = 4;
-          self.getDevicePlanInfo();
         }
         if(self.deviceType == 14 ){
           self.secondMachine = true;
@@ -2562,9 +2569,10 @@ export default {
       uni.showLoading({title:"加载中"});
       getDeviceStatus(this.id,this.childId).then(res=>{
         let data =res.data;
+        debugger;
         this.deviceInfo = data;
         self.parseStatusData(data)
-
+        self.getDevicePlanInfo();
         setTimeout(function () {
           uni.hideLoading();
           if(typeof func == "function"){
@@ -2662,6 +2670,7 @@ export default {
               if(!this.firstTab){
                 if(shadow == 1){
                   this.decoctControlOnOffStatus = true;
+                  this.getDevicePlanInfo();
                 }else if(shadow == 0){
                   this.decoctControlOnOffStatus = false;
                 }
@@ -2669,6 +2678,7 @@ export default {
             }else{
               if(shadow == 1){
                 this.decoctControlOnOffStatus = true;
+                this.getDevicePlanInfo();
               }else if(shadow == 0){
                 this.decoctControlOnOffStatus = false;
               }
@@ -2679,9 +2689,11 @@ export default {
             let shadow = enumListElement.shadow;
             if(shadow == 1){
               this.decoctControlOnOffStatus = true;
+              this.getDevicePlanInfo();
             }else if(shadow == 0){
               this.decoctControlOnOffStatus = false;
             }
+
           }
 
         }