var Api = require("../../../utils/util.js");
const app = getApp();
Page({
  data: {
    orderObj: {}
  },
  onLoad: function(){
    // wx.hideHomeButton()
  },
  onShow: function() {
    var that = this;    
    that.getNum();
    that.setData({        
      userId: wx.getStorageSync('userId')
    }) 
  },  
  //获取统计数量
  getNum: function() {
    var that = this;
    wx.showLoading({
      title: '加载中...',
    })   
    Api.req('sf/operationOrder/orderHomeIndex', {}, 'get')
      .then(res => {
        wx.hideLoading()
        if(res.code == 200){
          that.setData({
            orderObj: res.data
          })
        }else{
          wx.showToast({
            title: res.msg,
            icon: 'none'
          })
        }
      })
  },
  //本月工单列表
  monthOrder: function(e) {
    let type = e.currentTarget.dataset.type    
    wx.navigateTo({
      url: '/monitor/pages/workOrder/order/order?tab='+type
    })
  },    
  
  //通知公告
  notice: function() {    
    wx.navigateTo({
      url: '/monitor/pages/notice/notice',
    })
  },
  //技术资料
  technicalData: function() {    
    wx.navigateTo({
      url: '/monitor/pages/technicalData/technicalData',
    })    
  },
 //物料申请
  materialApply(){
    wx.navigateTo({
      url: '/monitor/pages/materialApply/materialApply',
    })    
  },
  //我的物料
  myMaterial(){
    wx.navigateTo({
      url: '/monitor/pages/myMaterial/myMaterial',
    })    
  }
})