zhanghongrui пре 2 година
родитељ
комит
253d27db73

+ 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>

+ 51 - 7
pages/xungengdetails/xungengdetails.js

@@ -13,6 +13,10 @@ Page({
     //店铺经纬度
     latitude: 43.8691319,
     longitude: 125.3504459,
+    businessName:null,
+    busEnterpriseId:null,
+    busPatrolstationId:null,
+    orgCode:null,
     //标记点
     markers: [{
       id: 0,
@@ -30,21 +34,61 @@ 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,
+        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",
+    })
   },
   /**
    * 生命周期函数--监听页面初次渲染完成

+ 10 - 10
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-icon-test" bindtap="bindViewEdit"></text>
     <text class="iconfont icon-pinleishanchu" bindtap="bindViewQiYeDelete"></text>
     </view>
 
@@ -18,29 +18,29 @@
 
       <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>
   
     <!-- 巡检悬浮按钮 -->

+ 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",