index.js 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. list: Array,
  5. ownertable: String,
  6. ownerid: Number,
  7. teamleaderId: String
  8. },
  9. options: {
  10. addGlobalClass: true
  11. },
  12. data: {
  13. userid: wx.getStorageSync('userMsg').userid
  14. },
  15. methods: {
  16. /* 处理删除 */
  17. handleDelete(e) {
  18. const {
  19. item
  20. } = e.currentTarget.dataset;
  21. wx.showModal({
  22. title: '提示',
  23. content: `是否确认移除${item.name}?`,
  24. complete: ({
  25. confirm
  26. }) => {
  27. if (confirm) {
  28. wx.showToast({
  29. title: '移除成功!',
  30. })
  31. }
  32. getCurrentPages().forEach(v => {
  33. switch (v.__route__) {
  34. case "packageA/group/index":
  35. v.getList();
  36. break;
  37. }
  38. })
  39. }
  40. })
  41. },
  42. /* 更换负责人 */
  43. changeUser() {
  44. wx.navigateTo({
  45. url: `/packageA/group/select?data=${JSON.stringify({
  46. ownertable:this.data.ownertable,
  47. ownerid:this.data.ownerid,
  48. })}&radio=true&model=List&principal=true`,
  49. })
  50. },
  51. /* 更换负责人 */
  52. handelSubmit(arr) {
  53. const that = this;
  54. wx.showModal({
  55. title: '提示',
  56. content: '是否确认更换负责人',
  57. complete: ({
  58. confirm
  59. }) => {
  60. if (confirm) _Http.basic({
  61. "id": 20220930103701,
  62. "content": {
  63. ownertable: that.data.ownertable,
  64. ownerid: that.data.ownerid,
  65. userid: arr[0]
  66. }
  67. }).then(res => {
  68. console.log("更换负责人", res)
  69. if (res.msg != '成功') return wx.showToast({
  70. title: res.data,
  71. icon: "none"
  72. });
  73. wx.showToast({
  74. title: '更换成功!',
  75. icon: "none"
  76. });
  77. setTimeout(() => {
  78. getCurrentPages().forEach(v => {
  79. if (["packageA/project/index", "ackageA/setclient/index", "packageA/group/index"].includes(v.__route__)) {
  80. v.getList(true);
  81. } else if (["packageA/setclient/detail", "packageA/project/detail"].includes(v.__route__)) {
  82. v.getDetail()
  83. }
  84. })
  85. wx.navigateBack();
  86. }, 300)
  87. })
  88. }
  89. })
  90. },
  91. }
  92. })