index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <view class="content">
  3. <web-view :src="src"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. id: null,
  11. title: null,
  12. option: {},
  13. show: false,
  14. page: 1,
  15. limit: 10,
  16. recordList: [],
  17. src: null
  18. }
  19. },
  20. onLoad(options) {
  21. this.id = options.id
  22. this.title = options.title
  23. const randomId=this.GetQueryString('randomId')
  24. const printArea=this.GetQueryString('printArea')
  25. const printAreaValue=this.GetQueryString('printAreaValue')
  26. this.src = `/static/webview/report-wv.html?id=${this.id}&randomId=${randomId}&printArea=${printArea}&printAreaValue=${printAreaValue}`
  27. // this.getReportTable()
  28. },
  29. onReady() {
  30. setTimeout(() => {
  31. uni.setNavigationBarTitle({
  32. title: this.title
  33. });
  34. }, 500)
  35. },
  36. methods: {
  37. //返回按钮
  38. handelBack() {
  39. uni.switchTab({
  40. url: '/pages/reportForm/index'
  41. });
  42. },
  43. //报表详情
  44. getReportTable() {
  45. uni.$http.get('/reportTable/getReportTableById', {
  46. id: this.id
  47. }).then(res => {
  48. console.log(res, 'res');
  49. if (res.data.code === 200) {
  50. // this.title=res.data.data.reportTableName
  51. }
  52. })
  53. },
  54. GetQueryString(name) {
  55. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  56. var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
  57. var context = "";
  58. if (r != null)
  59. context = decodeURIComponent(r[2]);
  60. reg = null;
  61. r = null;
  62. return context == null || context == "" || context == "undefined" ? "" : context;
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. ::v-deep .luckysheet_info_detail_back {
  69. display: none !important;
  70. }
  71. ::v-deep .u-button {
  72. width: 160rpx;
  73. height: 60rpx
  74. }
  75. .btn {
  76. position: absolute;
  77. left: 50%;
  78. bottom: 2%;
  79. margin-left: -80rpx;
  80. }
  81. .uni-td {
  82. width: 600rpx;
  83. overflow: hidden;
  84. text-overflow: ellipsis;
  85. }
  86. </style>