index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: {
  5. type: Boolean
  6. }
  7. },
  8. data: {
  9. sa_projectid: null,
  10. "content": {
  11. nocache: true,
  12. pageSize: 9999,
  13. "isAll": 0,
  14. "total": null
  15. }
  16. },
  17. lifetimes: {
  18. attached: function () {
  19. getApp().globalData.Language.getLanguagePackage(this)
  20. }
  21. },
  22. methods: {
  23. getList(id, init) {
  24. let content = this.data.content;
  25. content.sa_projectid = id;
  26. if (init) content.pageNumber = 1
  27. _Http.basic({
  28. "id": "20221201140104",
  29. content
  30. }).then(res => {
  31. console.log("工作任务列表", res)
  32. if (res.code != '1') return wx.showToast({
  33. title: res.data,
  34. icon: "none"
  35. })
  36. this.setData({
  37. list: res.data.rows,
  38. "content.total": res.data.sumscore,
  39. sa_projectid: id
  40. })
  41. console.log(this.data.sumscore, this.data.list)
  42. })
  43. },
  44. onChange() {
  45. this.setData({
  46. "content.isAll": this.data.content.isAll == 0 ? 1 : 0
  47. });
  48. this.getList(this.data.sa_projectid, true)
  49. },
  50. handleSelectProject(item, list) {
  51. this.selectComponent("#List").handleAdd(list.map(v => v.sa_project_partiesid))
  52. }
  53. }
  54. })