index.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. sys_enterprise_financeid: 0,
  5. item: {},
  6. tabbarList: [{
  7. icon: "icon-bodadianhua",
  8. label: "呼叫",
  9. alias: "call"
  10. }, {
  11. icon: "icon-a-yingxiaowuliaofuzhi",
  12. label: "复制",
  13. alias: "copy"
  14. }, {
  15. icon: "icon-bianji",
  16. label: "编辑",
  17. alias: "edit"
  18. }, {
  19. icon: "icon-shanchu",
  20. label: "作废",
  21. alias: "delete"
  22. }]
  23. },
  24. onLoad(options) {
  25. if (options.sys_enterprise_financeid) {
  26. this.setData({
  27. sys_enterprise_financeid: options.sys_enterprise_financeid
  28. });
  29. this.getDetail();
  30. }
  31. },
  32. //获取详情
  33. getDetail() {
  34. _Http.basic({
  35. "id": 20221026105702,
  36. "content": {
  37. "sys_enterprise_financeid": this.data.sys_enterprise_financeid
  38. },
  39. }).then(res => {
  40. if (res.msg != '成功') return wx.showToast({
  41. title: res.data,
  42. icon: "none"
  43. })
  44. const item = res.data;
  45. this.setData({
  46. list: [{
  47. label: "名称",
  48. value: item.enterprisename
  49. }, {
  50. label: "纳税人识别号",
  51. value: item.taxno
  52. }, {
  53. label: "地址",
  54. value: item.address
  55. }, {
  56. label: "开户行",
  57. value: item.bank
  58. }, {
  59. label: "账号",
  60. value: item.bankcardno
  61. }, {
  62. label: "联系人号码",
  63. value: item.phonenumber
  64. }],
  65. item: res.data
  66. })
  67. })
  68. },
  69. //详情按钮回调
  70. tabbarOnClick({
  71. detail
  72. }) {
  73. let page = getCurrentPages().find(v => v.__route__ == "packageA/setclient/detail");
  74. if (page) page.selectComponent('#Financing').selectComponent('#List').handleItem({
  75. target: {
  76. dataset: {
  77. name: detail.alias,
  78. item: this.data.item
  79. }
  80. }
  81. });
  82. },
  83. //详情单元格单击复制
  84. clickItem({
  85. detail
  86. }) {
  87. wx.setClipboardData({
  88. data: detail.value,
  89. success: () => {
  90. wx.hideToast();
  91. wx.showToast({
  92. title: `已复制${detail.label}`,
  93. icon: "none"
  94. })
  95. }
  96. })
  97. },
  98. })