menc 2 lat temu
rodzic
commit
4d5b4d0d4c

+ 1 - 2
app.json

@@ -40,8 +40,7 @@
     "pages/fcdetail/fcdetail",
     "pages/patrol_list/patrol_list",
     "pages/new_patrol_point/new_patrol_point",
-    "pages/xungengdetails/xungengdetails",
-    "pages/patrol_record_list/patrol_record_list"
+    "pages/xungengdetails/xungengdetails"
   ],
   "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;

+ 4 - 4
pages/index/index.js

@@ -204,10 +204,10 @@ Page({
       fail: (res) => {
 
        // console.log(res);
-       wx.showToast({
-        title: '扫描失败',
-        icon:'none'
-      })
+      //  wx.showToast({
+      //   title: '扫描失败',
+      //   icon:'none'
+      // })
 
       }
 

+ 21 - 19
pages/qiyemore/qiyemore.js

@@ -17,18 +17,18 @@ Page({
     form: {
       longitude: Number,
       latitude: Number,
-      businessName: null,
-      orgCode: null,
-      qrCode:null,
-      officeAddress: null,
-      businessAddress: null,
-      supervisor: null,
-      tradeDept: null,
-      deptId: null,
-      mainPerson: null,
-      mainPersonPhone: null,
-      headSecurity: null,
-      headSecurityPhone: null,
+      businessName: '',
+      orgCode: '',
+      enterpriseCode:'',
+      officeAddress: '',
+      businessAddress: '',
+      supervisor: '',
+      tradeDept: '',
+      deptId: '',
+      mainPerson: '',
+      mainPersonPhone: '',
+      headSecurity: '',
+      headSecurityPhone: '',
 
     }
   },
@@ -40,7 +40,7 @@ Page({
     this.data.form.orgCode = e.detail.value
   },
   get_qrCode(e) {
-    this.data.form.qrCode = e.detail.value
+    this.data.form.enterpriseCode = e.detail.value
   },
   get_officeAddress(e) {
     this.data.form.officeAddress = e.detail.value
@@ -78,8 +78,8 @@ Page({
         console.log("$$$",res);
        //this.data.form.qrCode=res.result
        this.setData({
-        ['form.qrCode']:  res.result
-      })
+        ['form.enterpriseCode']:  res.result
+       })
     
           
 
@@ -101,9 +101,10 @@ Page({
   },
 
   addEnterprise(e) {
-   console.log("###1",this.data.form.qrCode)
+   console.log("###1",this.data.form.enterpriseCode)
+   console.log("@@@1",this.data)
     let obj = new Object()
-    obj.enterpriseCode=this.data.form.qrCode
+    obj.enterpriseCode=this.data.form.enterpriseCode
     obj.latitude = this.data.form.latitude
     obj.longitude = this.data.form.longitude
     obj.businessName = this.data.form.businessName
@@ -141,8 +142,9 @@ console.log("@@@@",obj)
       success: function (res) {
         that.setData({
 
-          ['form.longitude']:  res.longitude,
-          ['form.latitude']:  res.latitude
+           ['form.longitude']:  res.longitude,
+           ['form.latitude']:  res.latitude
+          
           
         })
       },

+ 1 - 1
pages/qiyemore/qiyemore.wxml

@@ -17,7 +17,7 @@
     <view class="input_vi">
       <view class="input_title">企业编码</view>
       <i class="iconfont icon-saoyisao1" bindtap="saoyisao"></i>
-      <input bindinput="get_qrCode" class="inp_txt inp_txt2" placeholder="请输入或扫描"value="{{form.qrCode}}" />
+      <input bindinput="get_qrCode" class="inp_txt inp_txt2" placeholder="请输入或扫描"value="{{form.enterpriseCode}}" />
      
    
     </view>

+ 107 - 7
pages/xungengdetails/xungengdetails.js

@@ -13,6 +13,11 @@ Page({
     //店铺经纬度
     latitude: 43.8691319,
     longitude: 125.3504459,
+    businessName: null,
+    busEnterpriseId: null,
+    busPatrolstationId: null,
+    busPatrolstationName: null,
+    orgCode: null,
     //标记点
     markers: [{
       id: 0,
@@ -30,21 +35,116 @@ Page({
    */
   onLoad(options) {
 
-    console.log("@@@",options.id)
     this.setData({
-      id:options.id
+      id: options.id
     })
     this.getDetails(options.id)
 
   },
 
-  getDetails(id){
+  getDetails(id) {
+    wx.showLoading()
     let obj = new Object();
-    obj.id = this.data.id
-    http.post("/system/AppEnterpriseController/getEnterpriseDetails", obj, this.getDetailsSuccess)
+    obj.busPatrolstationCode = this.data.id
+    http.post("/system/AppPatrolstationController/getPatrolstationDetail", obj, this.getDetailsSuccess)
   },
-  getDetailsSuccess(res){
-    
+  getDetailsSuccess(res) {
+    console.log("!!!", res)
+    wx.hideLoading()
+    if (res.data.length == 0) {
+
+      wx.showToast({
+        title: '暂无巡更点',
+        icon: 'none'
+      })
+
+      setTimeout(() => {
+        wx.navigateBack()
+      }, 1000);
+
+    } else {
+
+      this.setData({
+        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,
+          height: 50
+        }]
+      })
+
+    }
+  },
+  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",
+    })
+  },
+  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);
+
   },
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 12 - 12
pages/xungengdetails/xungengdetails.wxml

@@ -2,11 +2,11 @@
 <!-- 巡更点详情页面 -->
 <view class="container">
   <view class="map">
-    <map longitude="{{enterpriseDetails.longitude}}" latitude="{{enterpriseDetails.latitude}}" scale="17" markers="{{markers}}" bindmarkertap="navRoad" data-marker="{{markers[0]}}" show-location />
+    <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-icon-test" bindtap="bindViewQiYeXiangQingTable"></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>
 
@@ -18,32 +18,32 @@
 
       <view>
         <span>经度:</span>
-        <i>{{enterpriseDetails.longitude}}</i>
+        <i>{{longitude}}</i>
       </view>
       <view>
         <span>纬度:</span>
-        <i>{{enterpriseDetails.latitude}}</i>
+        <i>{{latitude}}</i>
       </view>
       <view>
         <span>企业名称:</span>
-        <i>{{enterpriseDetails.businessName}}</i>
+        <i>{{businessName}}</i>
       </view>
       <view>
         <span>企业编码:</span>
-        <i>{{enterpriseDetails.orgCode}}</i>
+        <i>{{orgCode}}</i>
       </view>
-      <view>
+      <!-- <view>
         <span>巡更点地址:</span>
         <i>{{enterpriseDetails.officeAddress}}</i>
-      </view>
+      </view> -->
    
-      <view>
+      <!-- <view>
         <span>监管人员:</span>
         <i>{{enterpriseDetails.supervisor}}</i>
-      </view>
+      </view> -->
   </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;
+}

+ 1 - 1
project.private.config.json

@@ -1,7 +1,7 @@
 {
   "projectname": "sooka_edyj_minapp",
   "setting": {
-    "compileHotReLoad": true,
+    "compileHotReLoad": false,
     "urlCheck": false
   },
   "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",