index.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. this.selectComponent("#Yl_files").handleFiles(res.data.attinfos)
  37. this.setData({
  38. detail: res.data,
  39. briefs: [{
  40. label: "跟进类型",
  41. value: res.data.type
  42. }, {
  43. label: "跟进内容",
  44. value: res.data.content
  45. }]
  46. })
  47. })
  48. },
  49. /* tab 切换回调 */
  50. tabbarOnClick({
  51. detail
  52. }) {
  53. const item = this.data.detail;
  54. switch (detail.label) {
  55. case "编辑":
  56. wx.navigateTo({
  57. url: `/packageA/setclient/modules/trace/add/index?ownertable=${this.data.ownertable}&ownerid=${this.data.ownerid}&sys_datafollowupid=${item.sys_datafollowupid}`
  58. });
  59. break;
  60. case "作废":
  61. wx.navigateTo({
  62. url: `/packageA/setclient/modules/trace/list/delete?item=${JSON.stringify({
  63. "sys_datafollowupid": item.sys_datafollowupid,
  64. "ownertable": this.data.ownertable,
  65. "ownerid": this.data.ownerid
  66. })}`,
  67. })
  68. break;
  69. }
  70. },
  71. onShareAppMessage() {}
  72. })