index.js 1.3 KB

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