Bladeren bron

巡更记录 已经巡更点删除

zhanghongrui 2 jaren geleden
bovenliggende
commit
a2236854ad

+ 2 - 1
app.json

@@ -40,7 +40,8 @@
     "pages/fcdetail/fcdetail",
     "pages/patrol_list/patrol_list",
     "pages/new_patrol_point/new_patrol_point",
-    "pages/xungengdetails/xungengdetails"
+    "pages/xungengdetails/xungengdetails",
+    "pages/xungengjilu/xungengjilu"
   ],
   "requiredPrivateInfos": [
     "getLocation"

+ 6 - 0
app.wxss

@@ -175,6 +175,12 @@ color: #666;
     color: rgb(238, 148, 125);
     width: 10%;
   }
+  .list_li3 .icon-anfangxungeng{
+    font-size: 50rpx;
+    color: rgb(238, 148, 125);
+    width: 10%;
+    line-height: 86rpx;
+  }
   .list_li3  .list_right{
     width: 10%;
     text-align: right;

+ 69 - 13
pages/xungengdetails/xungengdetails.js

@@ -13,10 +13,11 @@ Page({
     //店铺经纬度
     latitude: 43.8691319,
     longitude: 125.3504459,
-    businessName:null,
-    busEnterpriseId:null,
-    busPatrolstationId:null,
-    orgCode:null,
+    businessName: null,
+    busEnterpriseId: null,
+    busPatrolstationId: null,
+    busPatrolstationName: null,
+    orgCode: null,
     //标记点
     markers: [{
       id: 0,
@@ -64,16 +65,17 @@ Page({
     } else {
 
       this.setData({
-        businessName:res.data[0].busEnterpriseName,
-        orgCode:res.data[0].busPatrolstationCode,
-        busEnterpriseId:res.data[0].busEnterpriseId,
-        busPatrolstationId:res.data[0].busPatrolstationId,
+        businessName: res.data[0].busEnterpriseName,
+        orgCode: res.data[0].busPatrolstationCode,
+        busEnterpriseId: res.data[0].busEnterpriseId,
+        busPatrolstationId: res.data[0].busPatrolstationId,
+        busPatrolstationName: res.data[0].busPatrolstationName,
         latitude: res.data[0].latitude,
         longitude: res.data[0].longitude,
         markers: [{
           id: Number(res.data[0].busPatrolstationId),
           name: res.data[0].busPatrolstationName,
-          
+
           latitude: res.data[0].latitude,
           longitude: res.data[0].longitude,
           width: 35,
@@ -83,12 +85,66 @@ Page({
 
     }
   },
-  bindViewEdit(){
-    console.log("@@@",this.data.busEnterpriseId)
-    console.log("@@@",this.data.busPatrolstationId)
+  bindViewEdit() {
+    console.log("@@@", this.data.busEnterpriseId)
+    console.log("@@@", this.data.busPatrolstationId)
     wx.navigateTo({
-       url: '../new_patrol_point/new_patrol_point?enterpriseId='+this.data.busEnterpriseId +"&busPatrolstationId="+this.data.busPatrolstationId+"&isEdit=y",
+      url: '../new_patrol_point/new_patrol_point?enterpriseId=' + this.data.busEnterpriseId + "&busPatrolstationId=" + this.data.busPatrolstationId + "&isEdit=y",
+    })
+  },
+  bindViewXungeng() {
+    // this.data.lasttime=util.formatDate(new Date(e.data.zgtzs.lastTime),'yyyy年MM月dd日') ;
+    wx.showLoading()
+    let obj = new Object();
+    obj.busPatrolstationId = this.data.busPatrolstationId
+    http.post("/system/AppXungengController/doXungeng", obj, this.getXunGengSuccess)
+  },
+  getXunGengSuccess(res) {
+    console.log("@@@", res)
+    wx.hideLoading()
+    wx.showToast({
+      title: res.msg,
+      icon: 'none'
     })
+    setTimeout(() => {
+      if (res.code == 200) {
+        wx.navigateBack()
+      }
+    }, 1000);
+
+  },
+  bindViewXunGengJiLu() {
+    wx.navigateTo({
+      url: '../xungengjilu/xungengjilu?busPatrolstationId=' + this.data.busPatrolstationId,
+    })
+  },
+  bindViewQiYeDelete() {
+    let that = this
+    wx.showModal({
+      title: "提示",
+      content: "确定要删除编号为" + this.data.orgCode + "的巡更点吗?",
+      success: function (sm) {
+        if (sm.confirm) {
+          let obj = new Object()
+          obj.busPatrolstationId = that.data.busPatrolstationId
+          http.post("/system/AppPatrolstationController/deletePatrolstationList", obj, that.deleteSuccess)
+        }
+      }
+    })
+  },
+  deleteSuccess(res) {
+
+    console.log("@@", res)
+    wx.showToast({
+      title: res.msg,
+      icon: 'none'
+    })
+    setTimeout(() => {
+      if (res.code == 200) {
+        wx.navigateBack()
+      }
+    }, 1000);
+
   },
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 2 - 2
pages/xungengdetails/xungengdetails.wxml

@@ -5,7 +5,7 @@
     <map longitude="{{longitude}}" latitude="{{latitude}}" scale="17" markers="{{markers}}" show-location />
 
     <view class="map_btn">
-    <text class="iconfont icon-wenjianguanli" bindtap="bindViewXunChaJiLu"></text>
+    <text class="iconfont icon-wenjianguanli" bindtap="bindViewXunGengJiLu"></text>
     <text class="iconfont icon-icon-test" bindtap="bindViewEdit"></text>
     <text class="iconfont icon-pinleishanchu" bindtap="bindViewQiYeDelete"></text>
     </view>
@@ -44,6 +44,6 @@
   </view>
   
     <!-- 巡检悬浮按钮 -->
-    <view class="float_btn" bindtap="bindViewXunJian">更</view>
+    <view class="float_btn" bindtap="bindViewXungeng">更</view>
   </view>
 </view>

+ 162 - 0
pages/xungengjilu/xungengjilu.js

@@ -0,0 +1,162 @@
+import http from '../../base/httputil'
+const app = getApp()
+
+Page({
+  data: {
+
+    /**
+     * 控制上拉到底部时是否出现 "数据加载中..."
+     */
+    hidden: true,
+    /**
+     * 数据是否正在加载中,避免数据多次加载
+     */
+    busPatrolstationId:null,
+    loadingData: false,
+    enterpriseList: [],
+    isRefresh: true,
+    total: 0,
+    pageNum: 1 // 页码
+  },
+  onLoad: function (e) {
+    // wx.showLoading({
+    //   title: '加载中'
+    // })
+console.log("@@@",e.busPatrolstationId)
+this.setData({
+  busPatrolstationId:e.busPatrolstationId
+})
+    this.loadData()
+  },
+  //加载数据
+  loadData: function () {
+    let obj = new Object()
+    obj.pageNum = this.data.pageNum
+    obj.pageSize = 10
+    obj.reasonable= false
+    obj.busPatrolstationId=this.data.busPatrolstationId
+    http.send_get("/system/AppXungengController/getXungengInfo", obj, this.getXunGengListSuccess)
+
+
+  },
+
+  getXunGengListSuccess(res) {
+
+console.log("@@@@",res)
+if(res.code==200){
+     // 显示加载图标
+     wx.showLoading({
+      title: '玩命加载中',
+    })
+  
+    var that = this
+
+    if(res.data.rows.length==0){
+      wx.showToast({
+        title: '暂无更多数据',
+        icon:"none"
+      })
+      wx.hideLoading()
+    }
+    if (this.data.isRefresh) {
+      this.setData({
+        enterpriseList: res.data.rows,
+        total: res.data.total
+      })
+
+
+
+      // 隐藏导航栏加载框
+      setTimeout(function () {
+        that.setData({
+          loadingData: false
+        });
+        wx.hideNavigationBarLoading();
+        // 停止下拉动作
+        wx.stopPullDownRefresh();
+        wx.hideLoading()
+
+      }, 1000)
+
+    } else {
+      this.setData({
+        enterpriseList: this.data.enterpriseList.concat(res.data.rows)
+      })
+      // 隐藏加载框
+
+      setTimeout(function () {
+        that.setData({
+          hidden: true,
+          loadingData: false
+        });
+
+        wx.hideLoading();
+      }, 1000)
+
+    }
+  }else{
+    console.log("@@!","请求失败")
+  }
+  },
+  onPullDownRefresh: function () {
+    // 显示顶部刷新图标
+    wx.showNavigationBarLoading();
+    var that = this;
+    var loadingData = this.data.loadingData
+    if (loadingData) {
+      return;
+    }
+    that.setData({
+      pageNum: 1,
+      isRefresh: true
+    })
+    this.loadData()
+  },
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    let that = this
+    var loadingData = that.data.loadingData
+   
+    var hidden = that.data.hidden
+    // 页数+1
+    that.setData({
+      pageNum: that.data.pageNum + 1,
+      isRefresh: false
+    })
+    if (hidden) {
+      that.setData({
+        hidden: false
+      });
+      console.info(that.data.hidden);
+    }
+
+    if (loadingData) {
+      return;
+    }
+    that.setData({
+      loadingData: true
+    });
+
+    
+    //console.log("@@@@"+Math.ceil(this.data.total/10))
+   // if(Math.ceil(that.data.total/10)>=that.data.pageNum){
+      that.loadData();
+  
+    // }else{
+     
+    //   setTimeout(function () {
+    //     that.setData({
+    //       hidden: true,
+    //     });
+
+    //   }, 2000)
+    // }
+
+   
+  },
+
+
+ 
+})

+ 14 - 0
pages/xungengjilu/xungengjilu.json

@@ -0,0 +1,14 @@
+{
+  "component": true, 
+  "usingComponents": {
+  },
+
+
+  "navigationBarBackgroundColor": "#f94b0e",
+  "navigationBarTextStyle": "white",
+  "enablePullDownRefresh": true,
+  "onPullDownRefresh": true,
+  "onReachBottom": true,
+  "navigationBarTitleText": "巡更记录"
+
+}

+ 39 - 0
pages/xungengjilu/xungengjilu.wxml

@@ -0,0 +1,39 @@
+<!--pages/xungengjilu/xungengjilu.wxml-->
+<view class="container">
+  <!-- 搜索 -->
+  <!-- <view class="search-container">
+    <view class="search-left">
+      <input type="text" bindtap="bindViewSearchEnd" placeholder="搜索" />
+    </view>
+    <button bindtap="bindViewSearchEnd" class="search-right">
+      <text class="iconfont icon-sousuo"></text>
+    </button>
+  </view> -->
+  <!-- 列表 -->
+  <view class="list_vi">
+    <view class="list_li3" wx:for="{{enterpriseList}}" wx:key="index" data-index="{{item}}">
+      <!-- <i class="list_icon iconfont icon-queding" wx:if="{{item.riskCount == 0}}"></i>
+      <i class="list_icon iconfont icon-yingjipingtai" wx:if="{{item.riskCount > 0}}"></i> -->
+      <i class="iconfont icon-anfangxungeng"></i>
+      <view class="notice_li">
+      
+      <view class="li_tit">{{item.busPatrolstationName}}</view>
+      <view class="li_time">
+      <text>巡更时间:{{item.createTimeStr}}</text>
+      </view>
+      </view>
+
+    </view>
+</view>
+    <view class='data-loading' hidden='{{hidden}}'>
+    数据加载中...
+  </view>
+    </view>
+
+
+
+
+
+
+
+

+ 48 - 0
pages/xungengjilu/xungengjilu.wxss

@@ -0,0 +1,48 @@
+/* pages/xungengjilu/xungengjilu.wxss */
+.qy_con {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-around;
+  text-align: center;
+  margin: 30rpx 30rpx;
+}
+
+.qy_con view {
+  height: 140rpx;
+  color: #fff;
+  display: flex;
+  flex-direction: column;
+  padding: 15rpx 40rpx;
+  position: relative;
+}
+
+.qy_con view image {
+  position: absolute;
+  top: 0px;
+  left: 0px;
+  width: 100%;
+  height: 100%;
+  z-index: -1;
+}
+
+.qy_con view h2 {
+  font-size: 58rpx;
+  font-weight: bolder;
+  padding-top: 10rpx;
+}
+
+.qy_con view p {
+  font-size: 35rpx;
+}
+
+.icon-jiahao {
+  font-size: 60rpx;
+}
+
+.data-loading {
+  height: 100rpx;
+  line-height: 100rpx;
+  background-color: #fff;
+  text-align: center;
+  font-size: 14px;
+}