ycm 2 yıl önce
ebeveyn
işleme
f8aa7c281b

+ 22 - 6
pages/cabinet/celldetail.js

@@ -12,8 +12,8 @@ Page({
         title:"",
         edit:"",
         id:0,
-        remark:""
-        
+        remark:"",
+        cold:0,  // 1:能冻结,2:能解冻
     },
 
     /**
@@ -23,7 +23,7 @@ Page({
         this.setData({
             id:options.id
         })
-      this. gettaskdetail(options.id)
+      this. gettaskdetail()
     },
 
     /**
@@ -40,6 +40,14 @@ Page({
             url:'Frozen'
         })
     },
+    show3: function () {
+        this.setData({
+            show: !this.data.show,
+            title:'解冻格口',
+            edit:'解冻',
+            url:'Thaw'
+        })
+    },
     show1: function () {
             this.setData({
                 show: !this.data.show,
@@ -48,10 +56,10 @@ Page({
                 url:'Overhaul'
             })
     },
-    gettaskdetail(id) {
+    gettaskdetail() {
         var that = this
         app.api.useApi(app.globalData.baseAppUrl + "api/admin/LatticeDetails", {
-            id: id,
+            id: that.data.id,
         }, "post").then(function (res) {
             console.log(res);
             if (res.code != 200) {
@@ -64,6 +72,12 @@ Page({
 
             } else {
                 wx.hideLoading();
+                  // 1:能冻结,2:能解冻
+                if(res.message.data.status=='空闲'){
+                    that.setData({cold: 1})
+                }else{
+                    that.setData({cold: 2})
+                }
                 that.setData({
                     taskInfo: res.message.data
                 })
@@ -95,8 +109,10 @@ Page({
             } else {
                 wx.hideLoading();
                 that.setData({
-                    taskInfo: res.message.data
+                    show: !that.data.show,
+                    // taskInfo: res.message.data
                 })
+                that.gettaskdetail()
             }
         }).catch(function (err) {
 

+ 2 - 1
pages/cabinet/celldetail.wxml

@@ -8,7 +8,8 @@
             <text lines="1" class="word3" bindtap="show1">检修开柜</text>
           </view>
           <view class="group2">
-            <text lines="1" class="info2" bindtap="show">冻结格口</text>
+            <text lines="1" wx:if="{{cold==1}}" class="info2" bindtap="show">冻结格口</text>
+            <text lines="1" wx:if="{{cold==2}}" class="info2" bindtap="show3">解冻格口</text>
           </view>
         </view>
       </view>

+ 2 - 0
pages/take/lattice.wxss

@@ -1,3 +1,4 @@
+
 .page {
   position: relative;
   width: 750rpx;
@@ -352,6 +353,7 @@
   display: flex;
   margin-top:21rpx;
   margin-left: 54rpx;
+  margin-bottom: 160rpx;
 
   flex-direction: row;
 }