index.js 1.3 KB

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