index.js 1.9 KB

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