gasreport.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view class="gas-report" name="gasreport">
  3. <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true"
  4. leftIcon="" > </u-navbar>
  5. <view class="gas-content">
  6. <component :is="loadComponent" :firstAddress="firstAddress" :secondAddress="secondAddress"
  7. :firstTj="firstTj" :secondTj="secondTj"></component>
  8. </view>
  9. <!-- 导航弹出层 -->
  10. <view class="popup-modal">
  11. <popupModal :showModel="showModel" @handlerClick="handlerClick"></popupModal>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import api from "@/api/api";
  17. import popupModal from './components/popupModal.vue'
  18. import gasFill from './components/gasFill.vue'
  19. import gasTask from './components/gasTask.vue'
  20. import gasRecordCard from './components/gasRecordCard.vue'
  21. import gasImgIdentify from './components/gasImgIdentify.vue'
  22. import taskBoard from './components/taskBoard.vue'
  23. export default {
  24. name: 'gasreport',
  25. components: {
  26. popupModal,
  27. gasFill,
  28. gasTask,
  29. gasRecordCard,
  30. gasImgIdentify,
  31. taskBoard
  32. },
  33. data() {
  34. return {
  35. backPic0: "url(/static/topnavbar0.png)",
  36. backPic: "url(../../static/topnavbar.png)",
  37. gasTitle: '瓦斯日报1',//标题
  38. showModel: false,//是否打开弹出层
  39. // loadComponent: 'gasFill',//默认加载组件
  40. // loadComponent: 'gasImgIdentify',//默认加载组件
  41. loadComponent: 'taskBoard',//默认加载组件
  42. taskTj: {},
  43. firstAddress: '',//一次线路
  44. secondAddress: '',//二次线路
  45. firstTj: [],//一次统计
  46. secondTj: [],//二次统计
  47. };
  48. },
  49. computed: {
  50. },
  51. mounted() {
  52. this.queryNowGasInfoByUser()
  53. },
  54. methods: {
  55. //导航栏点击
  56. handlerClick(data) {
  57. let that = this
  58. switch (data) {
  59. case '瓦斯巡检记录卡管理':
  60. that.loadComponent = 'gasRecordCard'
  61. that.gasTitle = '瓦斯巡检记录卡管理'
  62. that.showModel = false
  63. break;
  64. case '图片识别':
  65. that.loadComponent = 'taskBoard'
  66. that.gasTitle = '图片识别'
  67. that.showModel = false
  68. break;
  69. case '早班':
  70. that.loadComponent = 'gasTask'
  71. that.gasTitle = '早班巡检任务'
  72. that.firstAddress = that.taskTj.addressEarly1
  73. that.secondAddress = that.taskTj.addressEarly2
  74. that.firstTj = that.taskTj.arrayEarly1
  75. that.secondTj = that.taskTj.arrayEarly2
  76. that.showModel = false
  77. break;
  78. case '中班':
  79. that.loadComponent = 'gasTask'
  80. that.gasTitle = '中班巡检任务'
  81. that.firstAddress = that.taskTj.addressNoon1
  82. that.secondAddress = that.taskTj.addressNoon2
  83. that.firstTj = that.taskTj.arrayNoon1
  84. that.secondTj = that.taskTj.arrayNoon2
  85. that.showModel = false
  86. break;
  87. case '夜班':
  88. that.loadComponent = 'gasTask'
  89. that.gasTitle = '夜班巡检任务'
  90. that.firstAddress = that.taskTj.addressNight1
  91. that.secondAddress = that.taskTj.addressNight2
  92. that.firstTj = that.taskTj.arrayNight1
  93. that.secondTj = that.taskTj.arrayNight2
  94. that.showModel = false
  95. break;
  96. case '瓦斯巡检填报':
  97. that.loadComponent = 'gasFill'
  98. that.gasTitle = '瓦斯巡检填报'
  99. that.showModel = false
  100. break;
  101. }
  102. },
  103. //获取card列表
  104. queryNowGasInfoByUser() {
  105. let that = this
  106. new Promise((resolve, reject) => {
  107. api
  108. .queryNowGasInfoByUser({})
  109. .then((response) => {
  110. if (response.data.code == 200) {
  111. that.taskTj = response.data.result
  112. } else {
  113. reject(response);
  114. }
  115. })
  116. .catch((error) => {
  117. console.log("catch===>response", response);
  118. reject(error);
  119. });
  120. });
  121. },
  122. },
  123. };
  124. </script>
  125. <style lang="scss" scoped>
  126. .gas-report {
  127. position: relative;
  128. box-sizing: border-box;
  129. .gas-content {
  130. height: 666px;
  131. margin-top: 85px;
  132. overflow-y: auto;
  133. .popup-modal {
  134. position: absolute;
  135. top: 45px;
  136. left: 0;
  137. height: 748px;
  138. width: 240px;
  139. }
  140. }
  141. }
  142. </style>