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. YL: JSON.parse(options.UYL)
  12. })
  13. this.getData();
  14. getApp().globalData.Language.getLanguagePackage(this, '人员目标');
  15. },
  16. getData() {
  17. _Http.basic({
  18. "id": 20220920161302,
  19. "content": {
  20. "year": this.data.year,
  21. "targettype": "人员目标",
  22. "hrid": wx.getStorageSync('userMsg').hrid
  23. },
  24. }).then(res => {
  25. if (res.code != '1') return wx.showToast({
  26. title: res.data,
  27. icon: "none"
  28. })
  29. this.setData({
  30. person: res.data
  31. })
  32. })
  33. },
  34. /* 选择年份 */
  35. bindDateChange({
  36. detail
  37. }) {
  38. let index = detail.value;
  39. if (this.data.pickerIndex == detail.value) return;
  40. this.setData({
  41. "year": this.data.yearArr[detail.value],
  42. pickerIndex: index
  43. });
  44. this.getData();
  45. },
  46. })