index.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. viewHistory(e) {
  58. const {
  59. sa_projectid,
  60. sa_projtaskmagid,
  61. sa_projstagemagid
  62. } = e.currentTarget.dataset.item,
  63. content = {
  64. nocheca: true,
  65. sa_projectid,
  66. sa_projtaskmagid,
  67. sa_projstagemagid,
  68. pageNumber: 1,
  69. pageTotal: 1,
  70. pageSize: 20
  71. };
  72. if (!content.sa_projectid) {
  73. let page = getCurrentPages().find(v => v.__route__ == 'packageA/project/detail');
  74. content.sa_projectid = page.data.detail.sa_projectid;
  75. }
  76. wx.navigateTo({
  77. url: '/packageA/project/modules/task/history?content=' + JSON.stringify(content),
  78. })
  79. }
  80. }
  81. })