index.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. list: Array
  5. },
  6. data: {
  7. viewIndex: null
  8. },
  9. options: {
  10. addGlobalClass: true
  11. },
  12. methods: {
  13. selectClient(e) {
  14. const {
  15. item
  16. } = e.currentTarget.dataset,
  17. pages = getCurrentPages(),
  18. page = pages[pages.length - 1];
  19. this.setData({
  20. taskname: item.taskname,
  21. content: {
  22. sa_projectid: page.data.detail.sa_projectid,
  23. "sa_projtaskmagid": item.sa_projtaskmagid,
  24. "sa_projstagemagid": item.sa_projstagemagid,
  25. }
  26. })
  27. if (item.partiestype.length != 0) {
  28. wx.navigateTo({
  29. url: '/packageA/select/setclient/select?params=' + JSON.stringify({
  30. "id": 20221129152204,
  31. content: {
  32. model: "#Task",
  33. nocache: true,
  34. sa_projectid: page.data.detail.sa_projectid,
  35. "sa_projtaskmagid": item.sa_projtaskmagid,
  36. pageNumber: 1,
  37. pageTotal: 1,
  38. pageSize: 20,
  39. total: null,
  40. where: {
  41. condition: "",
  42. }
  43. },
  44. }),
  45. });
  46. } else {
  47. this.handleAdd([]);
  48. }
  49. },
  50. handleAdd(ids) {
  51. let content = this.data.content;
  52. content.sa_project_partiesids = ids
  53. wx.redirectTo({
  54. url: '/packageA/project/modules/task/add?content=' + JSON.stringify(content) + '&taskname=' + this.data.taskname,
  55. })
  56. }
  57. }
  58. })