Explorar o código

巡更点新增 接口

menc %!s(int64=2) %!d(string=hai) anos
pai
achega
9e9fac5203

+ 1 - 1
pages/details/details.js

@@ -72,7 +72,7 @@ Page({
   //巡更点跳转
   //巡更点跳转
   xungengList(){
   xungengList(){
     wx.navigateTo({
     wx.navigateTo({
-      url: '../patrol_list/patrol_list',
+      url: '../patrol_list/patrol_list?enterpriseId='+this.data.busEnterpriseId,
     })
     })
   },
   },
   //导航
   //导航

+ 29 - 22
pages/new_patrol_point/new_patrol_point.js

@@ -1,9 +1,5 @@
-
-// pages/new_patrol_point/new_patrol_point.js
-
 import http from '../../base/httputil'
 import http from '../../base/httputil'
 const app = getApp()
 const app = getApp()
-
 Page({
 Page({
 
 
   /**
   /**
@@ -18,21 +14,17 @@ Page({
       latitude: Number,
       latitude: Number,
       name: null,
       name: null,
       code: null,
       code: null,
-      address: null,
+      remark: null,
     },
     },
 
 
 
 
-
   },
   },
 
 
   /**
   /**
    * 生命周期函数--监听页面加载
    * 生命周期函数--监听页面加载
    */
    */
   onLoad(options) {
   onLoad(options) {
-
-
-
-    this.enterpriseId = options.id
+    this.data.enterpriseId = options.enterpriseId
     // this.getDetails()
     // this.getDetails()
   },
   },
 
 
@@ -50,8 +42,8 @@ Page({
   bindInputName(e) {
   bindInputName(e) {
     this.data.details.name = e.detail.value
     this.data.details.name = e.detail.value
   },
   },
-  bindInputAddress(e) {
-    this.data.details.address = e.detail.value
+  bindInputRemark(e) {
+    this.data.details.remark = e.detail.value
   },
   },
   bindInputCode(e) {
   bindInputCode(e) {
     this.data.details.code = e.detail.value
     this.data.details.code = e.detail.value
@@ -60,13 +52,33 @@ Page({
   //------------------------------------------
   //------------------------------------------
 
 
   updateDetails() {
   updateDetails() {
+    if(this.data.details.name==null){
+      wx.showToast({
+        title:'请输入巡更点名称',
+      })
+    }
+    
+    if(this.data.details.code==null){
+      wx.showToast({
+        title:'请扫描巡更点编码',
+      })
+    }
+    
+    if(this.data.details.longitude||this.data.details.latitude){
+      wx.showToast({
+        title:'请点击定位当前位置',
+      })
+    }
+  
     let obj = new Object();
     let obj = new Object();
-    obj.enterpriseId = this.data.details.enterpriseId
-    obj.name = this.data.details.name
-    obj.address = this.data.details.address
-    obj.code = this.data.details.code
+    obj.busEnterpriseId = this.data.enterpriseId
+    obj.busPatrolstationName = this.data.details.name
+    obj.busPatrolstationCode = this.data.details.code
+    obj.longitude=this.data.details.longitude
+    obj.latitude=this.data.details.latitude
+    obj.remarks = this.data.details.remark
     
     
-    // http.post("/system/AppEnterpriseController/updateEnterprise", obj, this.updateDetailsSuccess)
+    http.post("/system/AppPatrolstationController/addPatrolstation", obj, this.updateDetailsSuccess)
   },
   },
   updateDetailsSuccess(res) {
   updateDetailsSuccess(res) {
     wx.showToast({
     wx.showToast({
@@ -74,9 +86,6 @@ Page({
     })
     })
     if(res.code == 200){
     if(res.code == 200){
       wx.navigateBack()
       wx.navigateBack()
-      // wx.navigateTo({
-        // url: '../details/details?busEnterpriseId=' + this.busEnterpriseId,
-      // })
     }
     }
   },
   },
   deletePatrolPoint() {
   deletePatrolPoint() {
@@ -94,7 +103,6 @@ Page({
   //     })
   //     })
   //   }
   //   }
   // },
   // },
-
   /**
   /**
    * 生命周期函数--监听页面初次渲染完成
    * 生命周期函数--监听页面初次渲染完成
    */
    */
@@ -142,7 +150,6 @@ Page({
    */
    */
   onShareAppMessage() {
   onShareAppMessage() {
 
 
-
   },
   },
   
   
   getLocation() {
   getLocation() {

+ 0 - 3
pages/new_patrol_point/new_patrol_point.json

@@ -1,11 +1,8 @@
 {
 {
-
-  
   "usingComponents": {},
   "usingComponents": {},
 
 
 
 
   "navigationBarBackgroundColor": "#f94b0e",
   "navigationBarBackgroundColor": "#f94b0e",
   "navigationBarTextStyle": "white",
   "navigationBarTextStyle": "white",
   "navigationBarTitleText": "新增巡更点"
   "navigationBarTitleText": "新增巡更点"
-
 }
 }

+ 7 - 10
pages/new_patrol_point/new_patrol_point.wxml

@@ -1,17 +1,15 @@
-
-<!--pages/new_patrol_point/new_patrol_point.wxml-->
-
+<!--pages/qiyexqtable/qiyexqtanle.wxml-->
 <!-- 巡更点新增页面 -->
 <!-- 巡更点新增页面 -->
 <view class="container">
 <view class="container">
   <view class="page-section">
   <view class="page-section">
-    <!-- <view class="input_vi">
+    <view class="input_vi">
       <view class="input_title">经度</view>
       <view class="input_title">经度</view>
       <input class="inp_txt" bindtap="getLocation" value="{{details.longitude}}" auto-focus placeholder="点击获取当前位置" disabled="true" />
       <input class="inp_txt" bindtap="getLocation" value="{{details.longitude}}" auto-focus placeholder="点击获取当前位置" disabled="true" />
     </view>
     </view>
     <view class="input_vi">
     <view class="input_vi">
       <view class="input_title">纬度</view>
       <view class="input_title">纬度</view>
-      <input class="inp_txt" value="{{details.latitude}}" placeholder="点击获取当前位置"disabled="true" />
-    </view> -->
+      <input class="inp_txt" bindtap="getLocation"  value="{{details.latitude}}" placeholder="点击获取当前位置"disabled="true" />
+    </view>
     <view class="input_vi">
     <view class="input_vi">
       <view class="input_title">巡更点名称</view>
       <view class="input_title">巡更点名称</view>
       <input class="inp_txt" bindinput="bindInputName" value="{{details.name}}"  placeholder="请输入巡更点名称"/>
       <input class="inp_txt" bindinput="bindInputName" value="{{details.name}}"  placeholder="请输入巡更点名称"/>
@@ -21,8 +19,8 @@
       <input class="inp_txt" bindinput="bindInputCode" value="{{details.code}}"  placeholder="请输入巡更点编号"/>
       <input class="inp_txt" bindinput="bindInputCode" value="{{details.code}}"  placeholder="请输入巡更点编号"/>
     </view>
     </view>
     <view class="input_vi">
     <view class="input_vi">
-      <view class="input_title">巡更点地址</view>
-      <input class="inp_txt" bindinput="bindInputAddress" value="{{details.address}}"  placeholder="请输入巡更点地址"/>
+      <view class="input_title">巡更点描述</view>
+      <input class="inp_txt" bindinput="bindInputRemark" value="{{details.remark}}"  placeholder="请输入巡更点描述"/>
     </view>
     </view>
   </view>
   </view>
 
 
@@ -30,5 +28,4 @@
     <button type="primary" class="tj_btn" bindtap="updateDetails">提交</button>
     <button type="primary" class="tj_btn" bindtap="updateDetails">提交</button>
   </view>
   </view>
 
 
-</view>
-
+</view>

+ 2 - 5
pages/new_patrol_point/new_patrol_point.wxss

@@ -1,6 +1,4 @@
-
-/* pages/new_patrol_point/new_patrol_point.wxss */
-
+/* pages/qiyexqtable/qiyexqtanle.wxss */
 .container{
 .container{
   padding: 30rpx 30rpx;
   padding: 30rpx 30rpx;
 }
 }
@@ -49,5 +47,4 @@ padding: 24rpx 0px!important;
   font-size: 32rpx;
   font-size: 32rpx;
   margin: 60rpx auto;
   margin: 60rpx auto;
   padding: 24rpx 0px!important;
   padding: 24rpx 0px!important;
-}
-
+}

+ 5 - 7
pages/patrol_list/patrol_list.js

@@ -1,7 +1,3 @@
-
-// pages/patrol_list/patrol_list.js
-
-
 import http from '../../base/httputil'
 import http from '../../base/httputil'
 const app = getApp()
 const app = getApp()
 Page({
 Page({
@@ -10,10 +6,12 @@ Page({
    */
    */
   data: {
   data: {
     host: app.globalData.host,
     host: app.globalData.host,
+    enterpriseId:null,
     mList: null,
     mList: null,
   },
   },
 
 
-  onLoad() {
+  onLoad(options) {
+    this.data.enterpriseId=options.enterpriseId
     this.getPatrolPointList()
     this.getPatrolPointList()
   },
   },
 
 
@@ -23,6 +21,7 @@ Page({
     obj.busEnterpriseName = ""
     obj.busEnterpriseName = ""
     obj.pageSize = 10
     obj.pageSize = 10
     obj.reasonable = true
     obj.reasonable = true
+    obj.enterpriseId=this.data.enterpriseId
     // http.send_get("/system/AppXunchaController/getXunchaList", obj, this.getPatrolPointListSuccess)
     // http.send_get("/system/AppXunchaController/getXunchaList", obj, this.getPatrolPointListSuccess)
   },
   },
   getPatrolPointListSuccess(res) {
   getPatrolPointListSuccess(res) {
@@ -61,7 +60,7 @@ Page({
   // },
   // },
   bindViewAddPatrol(){
   bindViewAddPatrol(){
     wx.navigateTo({
     wx.navigateTo({
-      url: '../new_patrol_point/new_patrol_point'
+      url: '../new_patrol_point/new_patrol_point?enterpriseId='+this.data.enterpriseId
     })
     })
   },
   },
   bindViewToDetails(e){
   bindViewToDetails(e){
@@ -72,5 +71,4 @@ Page({
     })
     })
   }
   }
  
  
-
 })
 })

+ 0 - 4
pages/patrol_list/patrol_list.json

@@ -1,12 +1,8 @@
 {
 {
-
-
-
   "component": true, 
   "component": true, 
   "usingComponents": {},
   "usingComponents": {},
   "navigationBarBackgroundColor": "#f94b0e",
   "navigationBarBackgroundColor": "#f94b0e",
   "navigationBarTextStyle": "white",
   "navigationBarTextStyle": "white",
   "navigationBarTitleText": "巡更点列表"
   "navigationBarTitleText": "巡更点列表"
  
  
-
 }
 }

+ 1 - 5
pages/patrol_list/patrol_list.wxml

@@ -1,6 +1,3 @@
-
-<!--pages/patrol_list/patrol_list.wxml-->
-
 <view class="container">
 <view class="container">
   <!-- 搜索 -->
   <!-- 搜索 -->
   <view class="search-container" bindtap="bindViewSearchEnd" >
   <view class="search-container" bindtap="bindViewSearchEnd" >
@@ -39,5 +36,4 @@
 
 
   <!-- 巡检悬浮按钮 -->
   <!-- 巡检悬浮按钮 -->
   <view class="float_btn iconfont icon-jiahao" bindtap="bindViewAddPatrol"></view>
   <view class="float_btn iconfont icon-jiahao" bindtap="bindViewAddPatrol"></view>
-</view>
-
+</view>

+ 2 - 5
pages/patrol_list/patrol_list.wxss

@@ -1,6 +1,4 @@
-
-/* pages/patrol_list/patrol_list.wxss */
-
+/**index.wxss**/
 
 
 .qy_con{
 .qy_con{
   display: flex;
   display: flex;
@@ -57,5 +55,4 @@ position: relative;
   line-height: 60rpx;
   line-height: 60rpx;
   padding-bottom: 10rpx;
   padding-bottom: 10rpx;
 }
 }
-  
-
+