person.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. year: null
  8. },
  9. /**
  10. * 生命周期函数--监听页面加载
  11. */
  12. onLoad(options) {
  13. this.setData({
  14. year: options.year,
  15. yearArr: options.yearArr.split(","),
  16. pickerIndex: options.pickerIndex
  17. })
  18. this.getData();
  19. },
  20. getData() {
  21. _Http.basic({
  22. "id": 20220920161302,
  23. "content": {
  24. "year": this.data.year,
  25. "targettype": "人员目标",
  26. "hrid": wx.getStorageSync('userMsg').hrid
  27. },
  28. }).then(res => {
  29. if (res.msg != '成功') return wx.showToast({
  30. title: res.data,
  31. icon: "none"
  32. })
  33. this.setData({
  34. person: res.data
  35. })
  36. })
  37. },
  38. /* 选择年份 */
  39. bindDateChange({
  40. detail
  41. }) {
  42. let index = detail.value;
  43. if (this.data.pickerIndex == detail.value) return;
  44. this.setData({
  45. "year": this.data.yearArr[detail.value],
  46. pickerIndex: index
  47. });
  48. this.getData();
  49. },
  50. /**
  51. * 生命周期函数--监听页面初次渲染完成
  52. */
  53. onReady() {
  54. },
  55. /**
  56. * 生命周期函数--监听页面显示
  57. */
  58. onShow() {
  59. },
  60. /**
  61. * 生命周期函数--监听页面隐藏
  62. */
  63. onHide() {
  64. },
  65. /**
  66. * 生命周期函数--监听页面卸载
  67. */
  68. onUnload() {
  69. },
  70. /**
  71. * 页面相关事件处理函数--监听用户下拉动作
  72. */
  73. onPullDownRefresh() {
  74. },
  75. /**
  76. * 页面上拉触底事件的处理函数
  77. */
  78. onReachBottom() {
  79. },
  80. /**
  81. * 用户点击右上角分享
  82. */
  83. onShareAppMessage() {
  84. }
  85. })