index.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. sat_orderclueid: {
  8. type: Number
  9. },
  10. list: {
  11. type: Array
  12. },
  13. endChange: {
  14. type: Function
  15. }
  16. },
  17. /**
  18. * 组件的初始数据
  19. */
  20. data: {
  21. radio: '',
  22. loading: false
  23. },
  24. /**
  25. * 组件的方法列表
  26. */
  27. methods: {
  28. onChange(event) {
  29. this.setData({
  30. radio: event.detail,
  31. });
  32. },
  33. onClick(event) {
  34. const {
  35. name
  36. } = event.currentTarget.dataset;
  37. this.setData({
  38. radio: name,
  39. });
  40. },
  41. submit() {
  42. if (!this.data.radio || this.data.loading) return;
  43. const that = this;
  44. wx.showModal({
  45. title: "提示",
  46. content: "是否确认转移",
  47. success: ({
  48. confirm
  49. }) => {
  50. if (confirm) that.changeClue();
  51. }
  52. })
  53. },
  54. changeClue() {
  55. this.setData({
  56. loading: true
  57. });
  58. _Http.basic({
  59. "classname": "saletool.orderclue.web.orderclue",
  60. "method": "changeClue",
  61. "content": {
  62. "sat_orderclueid": [this.data.sat_orderclueid],
  63. "sa_agent_hrid": this.data.radio
  64. }
  65. }).then(res => {
  66. this.setData({
  67. loading: false
  68. });
  69. if (res.msg != '成功') return wx.showToast({
  70. title: res.msg,
  71. icon: "none"
  72. });
  73. wx.showToast({
  74. title: '转移成功!',
  75. })
  76. setTimeout(() => {
  77. this.triggerEvent("endChange");
  78. wx.navigateBack();
  79. }, 300);
  80. })
  81. },
  82. }
  83. })