gasreport.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <view class="gas-report" name="gasreport">
  3. <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true"
  4. leftIcon="list" @leftClick="showPopup" > </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: '瓦斯日报',//标题
  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. showPopup(){
  56. this.showModel=!this.showModel
  57. },
  58. //导航栏点击
  59. handlerClick(data) {
  60. let that = this
  61. switch (data) {
  62. case '瓦斯巡检记录卡管理':
  63. that.loadComponent = 'gasRecordCard'
  64. that.gasTitle = '瓦斯巡检记录卡管理'
  65. that.showModel = false
  66. break;
  67. case '图片识别':
  68. that.loadComponent = 'taskBoard'
  69. that.gasTitle = '图片识别'
  70. that.showModel = false
  71. break;
  72. case '早班':
  73. that.loadComponent = 'gasTask'
  74. that.gasTitle = '早班巡检任务'
  75. that.firstAddress = that.taskTj.addressEarly1
  76. that.secondAddress = that.taskTj.addressEarly2
  77. that.firstTj = that.taskTj.arrayEarly1
  78. that.secondTj = that.taskTj.arrayEarly2
  79. that.showModel = false
  80. break;
  81. case '中班':
  82. that.loadComponent = 'gasTask'
  83. that.gasTitle = '中班巡检任务'
  84. that.firstAddress = that.taskTj.addressNoon1
  85. that.secondAddress = that.taskTj.addressNoon2
  86. that.firstTj = that.taskTj.arrayNoon1
  87. that.secondTj = that.taskTj.arrayNoon2
  88. that.showModel = false
  89. break;
  90. case '夜班':
  91. that.loadComponent = 'gasTask'
  92. that.gasTitle = '夜班巡检任务'
  93. that.firstAddress = that.taskTj.addressNight1
  94. that.secondAddress = that.taskTj.addressNight2
  95. that.firstTj = that.taskTj.arrayNight1
  96. that.secondTj = that.taskTj.arrayNight2
  97. that.showModel = false
  98. break;
  99. case '瓦斯巡检填报':
  100. that.loadComponent = 'gasFill'
  101. that.gasTitle = '瓦斯巡检填报'
  102. that.showModel = false
  103. break;
  104. }
  105. },
  106. //获取card列表
  107. queryNowGasInfoByUser() {
  108. let that = this
  109. new Promise((resolve, reject) => {
  110. api
  111. .queryNowGasInfoByUser({})
  112. .then((response) => {
  113. if (response.data.code == 200) {
  114. that.taskTj = response.data.result
  115. } else {
  116. reject(response);
  117. }
  118. })
  119. .catch((error) => {
  120. console.log("catch===>response", response);
  121. reject(error);
  122. });
  123. });
  124. },
  125. },
  126. };
  127. </script>
  128. <style lang="scss" scoped>
  129. .gas-report {
  130. position: relative;
  131. box-sizing: border-box;
  132. .gas-content {
  133. height: 666px;
  134. margin-top: 85px;
  135. overflow-y: auto;
  136. .popup-modal {
  137. position: absolute;
  138. top: 45px;
  139. left: 0;
  140. height: 748px;
  141. width: 240px;
  142. }
  143. }
  144. }
  145. </style>