index.js 3.6 KB

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