index.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. ownerid: null,
  5. ownertable: null,
  6. sys_datafollowupid: 0,
  7. type: "",
  8. content: "",
  9. actions: [{
  10. name: "上门拜访"
  11. }, {
  12. name: "电话拜访"
  13. }, {
  14. name: "微信联系"
  15. }, {
  16. name: "QQ联系"
  17. }],
  18. show: false
  19. },
  20. onLoad(options) {
  21. if (options.ownertable) {
  22. this.setData({
  23. ...options
  24. })
  25. }
  26. },
  27. openSelect() {
  28. this.setData({
  29. show: true
  30. })
  31. },
  32. onCancel() {
  33. this.setData({
  34. show: false
  35. })
  36. },
  37. onSelect({
  38. detail
  39. }) {
  40. this.setData({
  41. type: detail.name
  42. })
  43. this.onCancel();
  44. },
  45. onInput(e) {
  46. this.setData({
  47. content: e.detail.value
  48. })
  49. },
  50. selectUser() {
  51. wx.navigateTo({
  52. url: `/packageA/group/index?ownertable=${this.data.ownertable}&ownerid=${this.data.ownerid}&radio`,
  53. })
  54. },
  55. submit() {
  56. const content = {
  57. type: this.data.type,
  58. content: this.data.content,
  59. ownerid: this.data.ownerid,
  60. ownertable: this.data.ownertable,
  61. sys_datafollowupid: this.data.sys_datafollowupid
  62. };
  63. if (!content.content) return;
  64. _Http.basic({
  65. "id": 20220930121601,
  66. content
  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. wx.navigateBack();
  79. return;
  80. const detail = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/modules/trace/detail/index');
  81. if (detail) wx.navigateBack();
  82. const list = getCurrentPages().find(v => v.__route__ == 'packageA/setclient/detail');
  83. if (list) list.selectComponent("#Trace").getList(this.data.sys_datafollowupid)
  84. }, 500)
  85. })
  86. },
  87. })