| | |
| | | var Constant = require('../../utils/constant.js'); |
| | | var app = getApp(); |
| | | import Request from "../../utils/api" |
| | | Page({ |
| | | data: { |
| | | userInfo: null, |
| | |
| | | // [ |
| | | // {id:1,text:"今日巡检", icon:"icon-xunjiandian", iconcolor:"#16b5cb",badgeNum: 0, cb:"onTodayInspection", type:'navigate'}, |
| | | // {id:2,text:"巡检记录",icon: "icon-lishi2", iconcolor:"#16b5cb", badgeNum:0,cb: "onHistoryInspection", type:'navigate'}, |
| | | |
| | | // ], |
| | | [ |
| | | {id:3,text:"新建报修", icon:"icon-zengjia", iconcolor:"#16b5cb", badgeNum:0, cb:"onAddRepairRequest", type:'navigate'}, |
| | | {id:4,text:"我的报修", icon:"icon-wangshangbaoming", iconcolor:"#16b5cb", badgeNum:0, cb:"onMyReport", type:'navigate'}, |
| | | ], |
| | | [ |
| | | {id:5,text:"我的维修", icon:"icon-baoxiu", iconcolor:"#16b5cb", badgeNum:0, cb:"onMyRepairTask", type:'navigate'} |
| | | ] |
| | | ] |
| | | }, |
| | | |
| | | |
| | | // |
| | | // ], |
| | | [{ |
| | | id: 3, |
| | | text: "新建报修", |
| | | icon: "icon-zengjia", |
| | | iconcolor: "#16b5cb", |
| | | badgeNum: 0, |
| | | cb: "onAddRepairRequest", |
| | | type: 'navigate' |
| | | }, |
| | | { |
| | | id: 4, |
| | | text: "我的报修", |
| | | icon: "icon-wangshangbaoming", |
| | | iconcolor: "#16b5cb", |
| | | badgeNum: 0, |
| | | cb: "onMyReport", |
| | | type: 'navigate' |
| | | }, |
| | | ], |
| | | [{ |
| | | id: 5, |
| | | text: "我的维修", |
| | | icon: "icon-baoxiu", |
| | | iconcolor: "#16b5cb", |
| | | badgeNum: 0, |
| | | cb: "onMyRepairTask", |
| | | type: 'navigate' |
| | | }] |
| | | ], |
| | | timer: null, |
| | | modalName: false |
| | | }, |
| | | onLoad: function (options) { |
| | | //判断app中的CropID是否和全局的CropID相同,不同则跳转到登陆界面 |
| | | var userInfo = app.globalData.userInfo; |
| | |
| | | url: '/login/login/index', |
| | | }) |
| | | return; |
| | | } |
| | | |
| | | } |
| | | this.getAssignDialog() |
| | | this.setData({ |
| | | userInfo: app.globalData.userInfo, |
| | | }); |
| | | }); |
| | | }, |
| | | // |
| | | refreshUserInfo: function () { |
| | |
| | | userInfo: userInfo |
| | | }); |
| | | }, |
| | | //通知 |
| | | //任务通知 |
| | | onNotice() { |
| | | var userInfo = this.data.userInfo; |
| | | // |
| | |
| | | url: '/other/notice/index', |
| | | }) |
| | | }, |
| | | //工单派单通知弹窗 |
| | | getAssignDialog: function () { |
| | | Request({ |
| | | url: Constant.BASE_SERVER_URL + "Repair/Task/Form/GetMyAssignedPageList@V1.0", |
| | | data: { |
| | | PageIndex: 1, |
| | | PageSize: 1 |
| | | }, |
| | | success: res => { |
| | | let result = res.data |
| | | if (result.Data.Total == 0 && result.Data.List == null) { |
| | | this.setData({ |
| | | modalName: false |
| | | }) |
| | | return |
| | | } |
| | | if (result.Data.Total > 0) { |
| | | this.setData({ |
| | | modalName: true |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | //跳转到我的维修 |
| | | workSure(){ |
| | | wx.navigateTo({ |
| | | url: '/repair/myTask/index' |
| | | }); |
| | | this.setData({ |
| | | modalName: false |
| | | }) |
| | | }, |
| | | //工单任务取消弹窗 |
| | | hideModal() { |
| | | this.setData({ |
| | | modalName: false |
| | | }) |
| | | }, |
| | | //消息通知弹窗 |
| | | getMonitorDialog() { |
| | | this.data.timer = setInterval( |
| | | function () { |
| | | wx.showModal({ |
| | | title: '暂无报警数据', |
| | | |
| | | }); |
| | | }, 500) |
| | | }, |
| | | // 今日巡检 |
| | | onTodayInspection() { |
| | | var userInfo = this.data.userInfo; |
| | |
| | | }); |
| | | return; |
| | | } |
| | | var inspection_url = '/inspection/todayProductList/index'; |
| | | var inspection_url = '/inspection/todayProductList/index'; |
| | | wx.getSystemInfo({ |
| | | success: function (res) { |
| | | // console.log(res, res.locationEnabled) |
| | |
| | | }) |
| | | }, |
| | | //进入泵房考核 |
| | | onTodayAssess(){ |
| | | onTodayAssess() { |
| | | wx.navigateTo({ |
| | | url: '../../inspection/todayAssess/index', |
| | | }) |
| | |
| | | return; |
| | | } |
| | | |
| | | var repair_url = '/repair/addReport/index'; |
| | | var repair_url = '/repair/addReport/index'; |
| | | wx.getSystemInfo({ |
| | | success: function (res) { |
| | | // console.log(res, res.locationEnabled) |
| | |
| | | wx.navigateTo({ |
| | | url: '/repair/myReport/index', |
| | | }); |
| | | |
| | | |
| | | }, |
| | | |
| | | onShareAppMessage: function () { |