Browse Source

详情获取
编辑巡更点
巡更点详情数据展示调整
页面逻辑处理
commit

menc 2 năm trước cách đây
mục cha
commit
0dc74e4f04

+ 1 - 0
app.json

@@ -40,6 +40,7 @@
     "pages/fcdetail/fcdetail",
     "pages/patrol_list/patrol_list",
     "pages/new_patrol_point/new_patrol_point",
+    "pages/update_patrol_point/update_patrol_point",
     "pages/xungengdetails/xungengdetails",
     "pages/xungengjilu/xungengjilu"
   ],

+ 1 - 1
pages/fcdetail/fcdetail.js

@@ -42,7 +42,7 @@ Page({
     console.log(JSON.stringify(e))
     if(e.code == 200){
       this.data.lasttime=util.formatDate(new Date(e.data.fcyjgzs.lasttime),'yyyy年MM月dd日') ;
-      // this.data.deptName=e.fcyjgzs.deptName;
+      this.data.deptName=e.data.dept_jd;
       this.data.askCompany=e.data.fcyjgzs.askCom;
       this.data.opinion=e.data.fcyjgzs.myoption;
       this.data.nickname=e.data.fcyjgzs.checker1Sign;

+ 1 - 1
pages/fcdetail/fcdetail.wxml

@@ -22,7 +22,7 @@
     <text bindtap="bindQianming1">被复查单位负责人(签名):</text>
     <image wx:if="{{qianming1 != undefined && qianming1 != null}}" src="{{qianming1}}" class="qm_img"></image>
   </view>
-  <view class="flex_row mar_top" style="text-align: right;"><input type="text" style="width: 370rpx;"  disabled="disabled" value="{{deptName}}"/>部门</view>
+  <view class="flex_row mar_top" style="text-align: right;"><input type="text" style="width: 370rpx;"  disabled="disabled" value="{{deptName}}"/></view>
   <!-- <view class="flex_row mar_top2" style="text-align: right;"><input type="number" style="width: 100rpx;" />年<input type="number" style="width: 100rpx;" />月<input type="number" style="width: 100rpx;" />日</view> -->
   <view class="flex_row mar_top" style="text-align: right;"><input type="text" style="width: 340rpx;"  disabled="disabled" value="{{checkTime}}"/></view>
 

+ 1 - 1
pages/patrol_list/patrol_list.js

@@ -65,7 +65,7 @@ Page({
   },
   bindViewToDetails(e){
     let id = e.currentTarget.dataset.id
-
+    console.log('XXXX',id)
     wx.navigateTo({
       url: '../xungengdetails/xungengdetails?id='+ id,
     })

+ 1 - 1
pages/patrol_list/patrol_list.wxml

@@ -15,7 +15,7 @@
     <!-- <i class="iconfont icon-wushuju zwsj"></i>
   <text class="zwsj_text">暂无数据</text> -->
     <view class="list_li flex-c"  wx:for="{{mList}}" wx:key="index"
-    bindtap="bindViewToDetails" data-buslogid="{{item.id}}">
+    bindtap="bindViewToDetails" data-id="{{item.busPatrolstationCode}}">
       <view class="list_li_1">
         <!-- <i class="list_icon iconfont icon-queding" wx:if="{{item.isRisk != 1}}"></i> -->
         <!-- <i class="list_icon iconfont icon-yingjipingtai" wx:if="{{item.isRisk == 1}}"></i> -->

+ 0 - 131
pages/patrol_record_list/patrol_record_list.js

@@ -1,131 +0,0 @@
-import http from '../../base/httputil'
-const app = getApp()
-
-Page({
-  data: {
-
-    /**
-     * 控制上拉到底部时是否出现 "数据加载中..."
-     */
-    hidden: true,
-    /**
-     * 数据是否正在加载中,避免数据多次加载
-     */
-    loadingData: false,
-    mList: [],
-    isRefresh: true,
-    total: 0,
-    pageNum: 1 // 页码
-  },
-  onLoad: function () {
-    // wx.showLoading({
-    //   title: '加载中'
-    // })
-    this.loadData()
-  },
-  //加载数据
-  loadData: function () {
-    let obj = new Object()
-    obj.pageNum = this.data.pageNum
-    obj.pageSize = 10
-    obj.reasonable= false
-    http.send_get("/system/AppNoticeController/getNotice", obj, this.getRecordListSuccess)
-
-
-  },
-
-  getRecordListSuccess(res) {
-
-     wx.showLoading({
-      title: '玩命加载中',
-    })
-    var that = this
-
-    if(res.data.rows.length==0){
-      wx.showToast({
-        title: '暂无更多数据',
-        icon:"none"
-      })
-    }
-    if (this.data.isRefresh) {
-      this.setData({
-        mList: 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)
-
-    }
-
-  },
-  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
-    });
- 
-      that.loadData();
-  },
-
-})

+ 0 - 15
pages/patrol_record_list/patrol_record_list.json

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

+ 0 - 27
pages/patrol_record_list/patrol_record_list.wxml

@@ -1,27 +0,0 @@
-<!-- 列表 -->
-<view class="list_vi">
-    <view class="list_li3" catchtap="bindViewDetails" wx:for="{{mList}}" 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-tongzhigonggao"></i>
-      <view class="notice_li">
-      
-      <view class="li_tit">{{item.noticeTitle}}</view>
-      <view class="li_time">
-      <text>发布人:{{item.createBy}}</text>
-      <text>{{item.createTime}}</text>
-      </view>
-      </view>
-  
-      <i class="iconfont icon-xiangyou list_right"></i>
-    </view>
-    <view class='data-loading' hidden='{{hidden}}'>
-    数据加载中...
-  </view>
-    </view>
-
-
-
-
-
-

+ 0 - 47
pages/patrol_record_list/patrol_record_list.wxss

@@ -1,47 +0,0 @@
-.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;
-}

+ 195 - 0
pages/update_patrol_point/update_patrol_point.js

@@ -0,0 +1,195 @@
+import http from '../../base/httputil'
+const app = getApp()
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    host: app.globalData.host,
+    enterpriseId: null,
+    pageCode:null,
+    // details: {
+      id: null,
+      longitude: Number,
+      latitude: Number,
+      name: null,
+      code: null,
+      remark: null,
+    // },
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.data.pageCode = options.code
+    this.getDetails()
+  },
+  getDetails() {
+    wx.showLoading()
+    let obj = new Object();
+    obj.busPatrolstationCode = this.data.pageCode
+    http.post("/system/AppPatrolstationController/getPatrolstationDetail", obj, this.getDetailsSuccess)
+  },
+  getDetailsSuccess(res) {
+    console.log("!!!", res)
+    wx.hideLoading()
+    if (res.data.length == 0) {
+
+      wx.showToast({
+        title: '暂无巡更点',
+        icon: 'none'
+      })
+    } else {
+      // this.data.details.name= res.data[0].busEnterpriseName,
+      // this.data.enterpriseId= res.data[0].busEnterpriseId,
+      this.data.id= res.data[0].busPatrolstationId,
+      this.data.code= res.data[0].busPatrolstationCode,
+      this.data.name= res.data[0].busPatrolstationName,
+      this.data.latitude= res.data[0].latitude,
+      this.data.longitude= res.data[0].longitude,
+      this.data.remark=res.data[0].remarks,
+      this.setData({
+        remark: res.data[0].remarks,
+        code:res.data[0].busPatrolstationCode,
+        name:res.data[0].busPatrolstationName,
+        latitude: res.data[0].latitude,
+        longitude: res.data[0].longitude,})
+    }
+  },
+  //-----------------------------------------
+  bindInputName(e) {
+    this.data.name = e.detail.value
+  },
+  bindInputRemark(e) {
+    this.data.remark = e.detail.value
+  },
+  bindInputCode(e) {
+    this.data.code = e.detail.value
+  },
+  bindViewScan(){
+    wx.scanCode({
+      onlyFromCamera: true,
+      success: (res) => {
+       this.setData({
+        ['details.code']:res.result,
+      })
+      },
+      fail: (res) => {
+        wx.showToast({
+          title: '扫描失败请重试',
+          icon:'none'
+        })
+      }
+    })
+  },
+  //------------------------------------------
+
+  updateDetails() {
+    if(this.data.name==null){
+      wx.showToast({
+        title:'请输入巡更点名称',
+        icon:'none'
+      })
+      return
+    }
+    
+    // if(this.data.details.code==null){
+    //   wx.showToast({
+    //     title:'请扫描巡更点编码',
+    //     icon:'none'
+    //   })
+    //   return
+    // }
+    
+    if(this.data.longitude==0||this.data.latitude==0){
+      wx.showToast({
+        title:'请点击定位当前位置',
+        icon:'none'
+      })
+      return
+    }
+  
+    let obj = new Object();
+    // obj.busEnterpriseId = this.data.enterpriseId
+    obj.busPatrolstationId = this.data.id
+    obj.busPatrolstationName = this.data.name
+    obj.busPatrolstationCode = this.data.code
+    obj.longitude=this.data.longitude
+    obj.latitude=this.data.latitude
+    obj.remarks = this.data.remark
+    
+    http.post("/system/AppPatrolstationController/edittPatrolstationList", obj, this.updateDetailsSuccess)
+  },
+  updateDetailsSuccess(res) {
+    wx.showToast({
+      title: res.msg,
+    })
+    if(res.code == 200){
+      wx.navigateBack()
+    }
+  },
+ 
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  },
+  
+  getLocation() {
+    let that = this
+    wx.getLocation({
+      type: 'wgs84', //返回可以用于wx.openLocation的经纬度
+      success: function (res) {
+        that.setData({
+          ['details.longitude']:  res.longitude,
+          ['details.latitude']:  res.latitude
+        })
+      },
+    })
+  },
+})

+ 8 - 0
pages/update_patrol_point/update_patrol_point.json

@@ -0,0 +1,8 @@
+{
+  "usingComponents": {},
+
+
+  "navigationBarBackgroundColor": "#f94b0e",
+  "navigationBarTextStyle": "white",
+  "navigationBarTitleText": "编辑巡更点"
+}

+ 32 - 0
pages/update_patrol_point/update_patrol_point.wxml

@@ -0,0 +1,32 @@
+<!--pages/qiyexqtable/qiyexqtanle.wxml-->
+<!-- 巡更点编辑页面 -->
+<view class="container">
+  <view class="page-section">
+    <view class="input_vi">
+      <view class="input_title">经度</view>
+      <input class="inp_txt" bindtap="getLocation" value="{{longitude}}" auto-focus placeholder="点击获取当前位置" disabled="true" />
+    </view>
+    <view class="input_vi">
+      <view class="input_title">纬度</view>
+      <input class="inp_txt" bindtap="getLocation"  value="{{latitude}}" placeholder="点击获取当前位置"disabled="true" />
+    </view>
+    <view class="input_vi">
+      <view class="input_title">巡更点名称</view>
+      <input class="inp_txt" bindinput="bindInputName" value="{{name}}"  placeholder="请输入巡更点名称"/>
+    </view>
+    <view class="input_vi">
+      <view class="input_title">巡更点编号</view>
+      <i class="iconfont"></i>
+      <input class="inp_txt inp_txt2" bindinput="bindInputCode" disabled="disabled" value="{{code}}"  placeholder="请扫描巡更点编号"/>
+    </view>
+    <view class="input_vi">
+      <view class="input_title">巡更点描述</view>
+      <input class="inp_txt" bindinput="bindInputRemark" value="{{remark}}"  placeholder="请输入巡更点描述"/>
+    </view>
+  </view>
+
+  <view class="table_btn">
+    <button type="primary" class="tj_btn" bindtap="updateDetails">提交</button>
+  </view>
+
+</view>

+ 69 - 0
pages/update_patrol_point/update_patrol_point.wxss

@@ -0,0 +1,69 @@
+/* pages/qiyexqtable/qiyexqtanle.wxss */
+.container{
+  padding: 30rpx 30rpx;
+}
+.page-section{
+  display: flex;
+  flex-direction: column;
+}
+.input_vi{
+  display: block;
+  border-bottom: 1px solid #f3f3f3;
+  height: 100rpx;
+  margin-bottom: 20rpx;
+}
+.input_vi .input_title{
+  font-size: 34rpx;
+  height: 100rpx;
+  line-height: 100rpx;
+  color: #181818;
+  float: left;
+}
+.input_vi input{
+  border:0px;
+  height: 100rpx;
+  line-height: 100rpx;
+ padding-left: 20rpx;
+ border-radius: 10rpx;
+ font-size: 34rpx;
+ color: #555;
+ text-align: right;
+}
+.input-placeholder, .input-placeholder-dark{
+ color: #c5c5c5!important;
+}
+.table_btn{
+  display: flex;
+  flex-direction: row;
+}
+.sc_btn{
+  width: 30%!important;
+  font-size: 32rpx;
+  margin: 60rpx auto;
+padding: 24rpx 0px!important;
+}
+.tj_btn{
+  width: 60%!important;
+  font-size: 32rpx;
+  margin: 60rpx auto;
+  padding: 24rpx 0px!important;
+}
+.input_vi input.inp_txt2{
+  border:0px;
+  height: 100rpx;
+  line-height: 100rpx;
+ padding-left: 20rpx;
+ border-radius: 10rpx;
+ font-size: 34rpx;
+ color: #555;
+ text-align: right;
+ float: right;
+}
+.input_vi i{
+  display: block;
+  float: right;
+  line-height: 100rpx;
+  margin-left: 14rpx;
+  color: #535353;
+  font-size: 48rpx;
+ }

+ 1 - 1
pages/xqzgdetail/xqzgdetail.js

@@ -27,7 +27,7 @@ Page({
     console.log(JSON.stringify(e))
     if(e.code == 200){
       this.data.lasttime=util.formatDate(new Date(e.data.zgtzs.lastTime),'yyyy年MM月dd日') ;
-       this.data.deptName="二道应急局";
+      this.data.deptName=e.data.dept_jd;
       this.data.askCompany=e.data.zgtzs.askCom;
       this.data.nickname=e.data.zgtzs.checker1Sign;
       this.data.qianming=e.data.zgtzs.checker2Sign;

+ 1 - 1
pages/xqzgdetail/xqzgdetail.wxml

@@ -18,7 +18,7 @@
   <view class="flex_row mar_top2 txt_vi"><text>被复查单位负责人(签名):</text>
     <image wx:if="{{qianming1 != undefined && qianming1 != null}}" src="{{qianming1}}" class="qm_img"></image>
   </view>
-  <view class="flex_row mar_top2" style="text-align: right;"><input type="text" style="width: 340rpx;"  disabled="disabled" value="{{deptName}}"/> (印章)</view>
+  <view class="flex_row mar_top2" style="text-align: right;"><input type="text" style="width: 340rpx;"  disabled="disabled" value="{{deptName}}"/></view>
   <view class="flex_row mar_top2" style="text-align: right;"><input type="text" style="width: 340rpx;"  disabled="disabled" value="{{checkTime}}"/></view>
   <view style="height: 10rpx;"></view>
 

+ 1 - 1
pages/xqzggzs/xqzggzs.wxml

@@ -27,7 +27,7 @@
     <!-- {{qianming1 != undefined && qianming1 != null}} -->
     <image wx:else src="{{qianming1}}" class="qm_img" bindtap="bindQianming1"></image>
   </view>
-  <view class="flex_row mar_top" style="text-align: right;"><text type="text" style="width: 370rpx;">{{deptName}}</text>部门</view>
+  <view class="flex_row mar_top" style="text-align: right;"><text type="text" style="width: 370rpx;">{{deptName}}</text></view>
   <!-- <view class="flex_row mar_top2" style="text-align: right;"><input type="number" style="width: 100rpx;" />年<input type="number" style="width: 100rpx;" />月<input type="number" style="width: 100rpx;" />日</view> -->
   <view class="flex_row mar_top" style="text-align: right;"><text type="text" style="width: 340rpx;" />{{time}}</view>
 

+ 1 - 1
pages/xqzggzs2/xqzggzs2.wxml

@@ -22,7 +22,7 @@
     <!-- ="{{qianming1 != undefined && qianming1 != null}}" -->
     <image wx:else src="{{qianming1}}" class="qm_img" bindtap="bindQianming1"></image>
   </view>
-  <view class="flex_row mar_top2" style="text-align: right;"><text type="text" style="width: 340rpx;" />部门:{{pageData.deptName}}</view>
+  <view class="flex_row mar_top2" style="text-align: right;"><text type="text" style="width: 340rpx;" />{{pageData.deptName}}</view>
   <view class="flex_row mar_top2" style="text-align: right;"><text type="text" style="width: 340rpx;" />{{time}}</view>
 
   <!-- <view class="flex_row mar_top2" style="text-align: right;"><text type="number" style="width: 100rpx;" />{{year}}年<text type="number" style="width: 100rpx;"/>{{month}}月<text type="number" style="width: 100rpx;"/>{{day}}日</view> -->

+ 8 - 16
pages/xungengdetails/xungengdetails.js

@@ -18,6 +18,7 @@ Page({
     busPatrolstationId: null,
     busPatrolstationName: null,
     orgCode: null,
+    remark:null,
     //标记点
     markers: [{
       id: 0,
@@ -34,15 +35,12 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad(options) {
-
-    this.setData({
-      id: options.id
-    })
-    this.getDetails(options.id)
-
+    this.data.id=options.id
   },
-
-  getDetails(id) {
+  onShow(){
+    this.getDetails()
+  },
+  getDetails() {
     wx.showLoading()
     let obj = new Object();
     obj.busPatrolstationCode = this.data.id
@@ -72,6 +70,7 @@ Page({
         busPatrolstationName: res.data[0].busPatrolstationName,
         latitude: res.data[0].latitude,
         longitude: res.data[0].longitude,
+        remark:res.data[0].remarks,
         markers: [{
           id: Number(res.data[0].busPatrolstationId),
           name: res.data[0].busPatrolstationName,
@@ -89,7 +88,7 @@ Page({
     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: '../update_patrol_point/update_patrol_point?enterpriseId=' + this.data.busEnterpriseId + "&code=" + this.data.orgCode,
     })
   },
   bindViewXungeng() {
@@ -154,13 +153,6 @@ Page({
   },
 
   /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow() {
-
-  },
-
-  /**
    * 生命周期函数--监听页面隐藏
    */
   onHide() {

+ 16 - 13
pages/xungengdetails/xungengdetails.wxml

@@ -10,27 +10,30 @@
     <text class="iconfont icon-pinleishanchu" bindtap="bindViewQiYeDelete"></text>
     </view>
 
-
-
     <view class="map_view">
-
-
-
       <view>
-        <span>经度:</span>
-        <i>{{longitude}}</i>
+        <span>企业:</span>
+        <i>{{businessName}}</i>
       </view>
       <view>
-        <span>纬度:</span>
-        <i>{{latitude}}</i>
+        <span>名称:</span>
+        <i>{{busPatrolstationName}}</i>
       </view>
       <view>
-        <span>企业名称:</span>
-        <i>{{businessName}}</i>
+        <span>编码:</span>
+        <i>{{orgCode}}</i>
       </view>
       <view>
-        <span>企业编码:</span>
-        <i>{{orgCode}}</i>
+        <span>描述:</span>
+        <i>{{remark}}</i>
+      </view> 
+      <view>
+        <span>经度:</span>
+        <i>{{longitude}}</i>
+      </view>
+      <view>
+        <span>纬度:</span>
+        <i>{{latitude}}</i>
       </view>
       <!-- <view>
         <span>巡更点地址:</span>

+ 1 - 1
project.private.config.json

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