index.js 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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) _Http.basic({
  28. "accesstoken": "7eb155cb0a9ed5895056afc151af7d7f",
  29. "id": 20220930103801,
  30. "content": {
  31. "ownertable": item.ownertable,
  32. "ownerid": item.ownerid,
  33. "userids": [item.userid]
  34. }
  35. }).then(s => {
  36. wx.showToast({
  37. title: s.msg == '成功' ? '移除成功!' : s.msg,
  38. icon: "none"
  39. });
  40. if (s.msg == '成功') getCurrentPages().find(v => v.__route__ == "pages/group/index").getList();
  41. })
  42. }
  43. })
  44. },
  45. /* 更换负责人 */
  46. changeUser() {
  47. wx.navigateTo({
  48. url: `/pages/group/select?data=${JSON.stringify({
  49. ownertable:this.data.ownertable,
  50. ownerid:this.data.ownerid,
  51. })}&radio=true&model=List&principal=true`,
  52. })
  53. },
  54. /* 更换负责人 */
  55. handelSubmit(arr) {
  56. const that = this;
  57. wx.showModal({
  58. title: '提示',
  59. content: '是否确认更换负责人',
  60. complete: ({
  61. confirm
  62. }) => {
  63. if (confirm) _Http.basic({
  64. "id": 20220930103701,
  65. "content": {
  66. ownertable: that.data.ownertable,
  67. ownerid: that.data.ownerid,
  68. userid: arr[0]
  69. }
  70. }).then(res => {
  71. console.log("更换负责人", res)
  72. if (res.msg != '成功') return wx.showToast({
  73. title: res.data,
  74. icon: "none"
  75. });
  76. wx.showToast({
  77. title: '更换成功!',
  78. icon: "none"
  79. });
  80. setTimeout(() => {
  81. getCurrentPages().forEach(v => {
  82. if (["packageA/project/index", "ackageA/setclient/index", "pages/group/index"].includes(v.__route__)) {
  83. v.getList(true);
  84. } else if (["packageA/setclient/detail", "packageA/project/detail"].includes(v.__route__)) {
  85. v.getDetail()
  86. }
  87. })
  88. wx.navigateBack();
  89. }, 300)
  90. })
  91. }
  92. })
  93. },
  94. }
  95. })