123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- // pages/xungengdetails/xungengdetails.js
- import http from '../../base/httputil'
- const app = getApp()
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- id: null,
- host: app.globalData.host,
- //店铺经纬度
- latitude: 43.8691319,
- longitude: 125.3504459,
- businessName: null,
- busEnterpriseId: null,
- busPatrolstationId: null,
- busPatrolstationName: null,
- orgCode: null,
- remark:null,
- //标记点
- markers: [{
- id: 0,
- name: "编程小石头",
- address: "长春首佳科技有限公司",
- latitude: 43.8691319,
- longitude: 125.3504459,
- width: 35,
- height: 50
- }]
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad(options) {
- this.data.id=options.id
- },
- onShow(){
- this.getDetails()
- },
- getDetails() {
- wx.showLoading()
- let obj = new Object();
- obj.busPatrolstationCode = this.data.id
- http.post("/system/AppPatrolstationController/getPatrolstationDetail", obj, this.getDetailsSuccess)
- },
- getDetailsSuccess(res) {
-
- wx.hideLoading()
- debugger
- if (res.data.length == 0) {
- wx.showToast({
- title: '暂无巡更点',
- icon: 'none'
- })
- setTimeout(() => {
- wx.navigateBack()
- }, 2000);
- } 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,
- remark:res.data[0].remarks,
- 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() {
-
- wx.navigateTo({
- url: '../update_patrol_point/update_patrol_point?enterpriseId=' + this.data.busEnterpriseId + "&code=" + this.data.orgCode,
- })
- },
- 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) {
- 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) {
-
- wx.showToast({
- title: res.msg,
- icon: 'none'
- })
- setTimeout(() => {
- if (res.code == 200) {
- wx.navigateBack()
- }
- }, 1000);
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady() {
- },
- /**
- * 生命周期函数--监听页面隐藏
- */
- onHide() {
- },
- /**
- * 生命周期函数--监听页面卸载
- */
- onUnload() {
- },
- /**
- * 页面相关事件处理函数--监听用户下拉动作
- */
- onPullDownRefresh() {
- },
- /**
- * 页面上拉触底事件的处理函数
- */
- onReachBottom() {
- },
- /**
- * 用户点击右上角分享
- */
- onShareAppMessage() {
- }
- })
|