index.js 1.4 KB

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