person.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. year: null
  5. },
  6. onLoad(options) {
  7. this.setData({
  8. year: options.year,
  9. yearArr: options.yearArr.split(","),
  10. pickerIndex: options.pickerIndex
  11. })
  12. this.getData();
  13. getApp().globalData.Language.getLanguagePackage(this, 'E-订单');
  14. },
  15. getData() {
  16. _Http.basic({
  17. "id": 20220920161302,
  18. "content": {
  19. "year": this.data.year,
  20. "targettype": "人员目标",
  21. "hrid": wx.getStorageSync('userMsg').hrid
  22. },
  23. }).then(res => {
  24. if (res.code != '1') return wx.showToast({
  25. title: res.data,
  26. icon: "none"
  27. })
  28. this.setData({
  29. person: res.data
  30. })
  31. })
  32. },
  33. /* 选择年份 */
  34. bindDateChange({
  35. detail
  36. }) {
  37. let index = detail.value;
  38. if (this.data.pickerIndex == detail.value) return;
  39. this.setData({
  40. "year": this.data.yearArr[detail.value],
  41. pickerIndex: index
  42. });
  43. this.getData();
  44. },
  45. })