detail.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. ownertable: null,
  5. ownerid: null,
  6. sys_datafollowupid: null,
  7. detail: {},
  8. tabbarList: [{
  9. icon: "icon-bianji",
  10. label: "编辑"
  11. }, {
  12. icon: "icon-shanchu",
  13. label: "删除"
  14. }]
  15. },
  16. onLoad(options) {
  17. if (options.data) {
  18. this.setData({
  19. ...JSON.parse(options.data)
  20. })
  21. this.getDetail();
  22. }
  23. },
  24. getDetail() {
  25. _Http.basic({
  26. "id": 20221026085601,
  27. "content": {
  28. "sys_datafollowupid": this.data.sys_datafollowupid
  29. }
  30. }).then(res => {
  31. console.log("跟进详情", res)
  32. if (res.msg != '成功') return wx.showToast({
  33. title: res.data,
  34. icon: "none"
  35. })
  36. res.data.names = res.data.contacts.map(n => n.name)
  37. this.selectComponent("#Yl_files").handleFiles(res.data.attinfos)
  38. this.setData({
  39. detail: res.data,
  40. briefs: [{
  41. label: "跟进对象",
  42. value: res.data.names
  43. }, {
  44. label: "跟进类型",
  45. value: res.data.type
  46. }, {
  47. label: "跟进内容",
  48. value: res.data.content
  49. }]
  50. })
  51. })
  52. },
  53. /* tab 切换回调 */
  54. tabbarOnClick({
  55. detail
  56. }) {
  57. const item = this.data.detail;
  58. switch (detail.label) {
  59. case "编辑":
  60. _Http.editItem(item);
  61. break;
  62. case "删除":
  63. wx.navigateTo({
  64. url: `/packageA/setclient/modules/trace/list/delete?item=${JSON.stringify({
  65. "sys_datafollowupid": item.sys_datafollowupid,
  66. "ownertable": this.data.ownertable,
  67. "ownerid": this.data.ownerid
  68. })}`,
  69. })
  70. break;
  71. }
  72. },
  73. onShareAppMessage() {}
  74. })