index.js 2.2 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. userid: wx.getStorageSync('userMsg').userid
  21. })
  22. this.getDetail();
  23. getApp().globalData.Language.getLanguagePackage(this, '跟进动态详情');
  24. }
  25. },
  26. getDetail() {
  27. _Http.basic({
  28. "id": 20221026085601,
  29. "content": {
  30. "sys_datafollowupid": this.data.sys_datafollowupid
  31. }
  32. }).then(res => {
  33. console.log("跟进详情", res)
  34. if (res.code != '1') return wx.showToast({
  35. title: res.data,
  36. icon: "none"
  37. })
  38. this.selectComponent("#Yl_files").initData()
  39. this.selectComponent("#Yl_files").handleFiles(res.data.attinfos)
  40. this.setData({
  41. detail: res.data,
  42. briefs: [{
  43. label: "跟进类型",
  44. value: res.data.type
  45. }, {
  46. label: "跟进内容",
  47. value: res.data.content
  48. }]
  49. })
  50. })
  51. },
  52. /* tab 切换回调 */
  53. tabbarOnClick({
  54. detail
  55. }) {
  56. const item = this.data.detail;
  57. switch (detail.label) {
  58. case "编辑":
  59. wx.navigateTo({
  60. url: `/packageA/setclient/modules/trace/add/index?ownertable=${this.data.ownertable}&ownerid=${this.data.ownerid}&sys_datafollowupid=${item.sys_datafollowupid}`
  61. });
  62. break;
  63. case "删除":
  64. _Http.traceHandleDelete(item).then(res => {
  65. if (res) setTimeout(() => {
  66. wx.navigateBack()
  67. }, 300)
  68. })
  69. break;
  70. }
  71. }
  72. })