index.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. switch (v.__route__) {
  80. case 'packageA/setclient/index':
  81. v.getList(true)
  82. break;
  83. case 'packageA/setclient/detail':
  84. v.getDetail()
  85. break;
  86. case 'packageA/group/index':
  87. v.getList(true)
  88. break;
  89. default:
  90. break;
  91. }
  92. })
  93. wx.navigateBack();
  94. }, 300)
  95. })
  96. }
  97. })
  98. },
  99. }
  100. })