indexRouter.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <!-- 底部tab导航 -->
  3. <view>
  4. <Home :dataList="dataList" :genreTitle="genreTitle" ref="home" @tankFilling="tankFilling" v-if="nowchos === 0">
  5. </Home>
  6. <!-- isorders == 0 同时userType == 3 送气员 -->
  7. <Order ref="waybill" v-else-if="nowchos === 1 && isorders == 0 && userType == 3"></Order>
  8. <Information ref="cylinder" :tabNumber="tabNumber" v-else-if="steelCylinder(isorders,userType)"></Information>
  9. <Mine :token="token" :userInfo="userInfo" v-else-if="getType(isorders,userType)"></Mine>
  10. <view class="bottomboxs">
  11. <x-navbottom :nowchos='nowchos' @botomchos='botomchos'></x-navbottom>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import Home from './home/index.vue' // 引入首页
  17. import Order from './order/index.vue' // 引入收益首页
  18. import Information from './information/index.vue' // 记录
  19. import Mine from './mine/index.vue' // 记录
  20. export default {
  21. components: { //在这里注册相应的组件
  22. Home,
  23. Order,
  24. Information,
  25. Mine,
  26. },
  27. data() {
  28. return {
  29. nowchos: 0, //当前选择了那个底部菜单
  30. userInfo: {},
  31. isorders: 0,
  32. userType: 3,
  33. token: '',
  34. aspirated: [{
  35. id: '25',
  36. title: '送气员领重瓶出库',
  37. icon: 'icon-chukudan',
  38. color: '#f4b237',
  39. }, {
  40. id: '27',
  41. title: '送气员回收空瓶',
  42. icon: 'icon-recycling',
  43. color: '#8ac247',
  44. }],
  45. shopList: [{
  46. id: '37',
  47. title: '重瓶出库',
  48. icon: 'icon-peizaizhuangche',
  49. color: '#f4b237',
  50. }, {
  51. id: '10',
  52. title: '空瓶出库',
  53. icon: 'icon-peizaizhuangche-xianxing',
  54. color: '#6db1ff',
  55. }, {
  56. id: '31',
  57. title: '重瓶入库',
  58. icon: 'icon-fankudengji',
  59. color: '#6db1ff',
  60. }, {
  61. id: '21',
  62. title: '回收空瓶',
  63. icon: 'icon-recycling',
  64. color: '#8ac247',
  65. }, {
  66. id: '35',
  67. // 未配送
  68. title: '重瓶返库',
  69. icon: 'icon-fankudengji',
  70. color: '#22b9f9',
  71. }, {
  72. id: '33',
  73. title: '重瓶退回',
  74. icon: 'icon-tuihuo',
  75. color: '#f3553e',
  76. }, ],
  77. driverList: [{
  78. id: '17',
  79. title: '确定重瓶气站出库',
  80. icon: 'icon-chukudan',
  81. color: '#6db1ff',
  82. }, {
  83. id: '033',
  84. title: '确定重瓶门店出库',
  85. icon: 'icon-owNote',
  86. color: '#8ac247',
  87. }, {
  88. id: '19',
  89. title: '司机钢瓶交付门店',
  90. icon: 'icon-yunsonghejiaofu',
  91. color: '#f4b237',
  92. }, {
  93. id: '12',
  94. title: '运输空瓶到达气站',
  95. icon: 'icon-yidaoda',
  96. color: '#83e908',
  97. }, {
  98. id: '11',
  99. title: '司机空瓶装车',
  100. icon: 'icon-owNote',
  101. color: '#22b9f9',
  102. }, {
  103. id: '16',
  104. title: '重瓶退回气站',
  105. icon: 'icon-tuihuo',
  106. color: '#f3553e',
  107. }],
  108. stationList: [{
  109. id: '13',
  110. title: '确定空瓶到达气站',
  111. icon: 'icon-daichuku',
  112. color: '#37c4f4',
  113. }, {
  114. id: '016',
  115. title: '确定重瓶到达气站',
  116. icon: 'icon-yidaoda',
  117. color: '#c7be16',
  118. }, {
  119. id: '14',
  120. title: '气站充装空瓶',
  121. icon: 'icon-peizaizhuangche-xianxing',
  122. color: '#6db1ff',
  123. }, {
  124. id: '15',
  125. title: '气站重瓶出库',
  126. icon: 'icon-owNote',
  127. color: '#8ac247',
  128. }, {
  129. id: 'inspect',
  130. title: '充气前后检查',
  131. icon: 'icon-jianchaxiang',
  132. color: '#f4b237',
  133. }, ],
  134. dataList: [],
  135. genreTitle: '',
  136. tabNumber: 0,
  137. }
  138. },
  139. onReachBottom() {
  140. if (this.$refs.cylinder) {
  141. this.$refs.cylinder.bottomingEvent()
  142. }
  143. if (this.$refs.waybill) {
  144. this.$refs.waybill.bottomingEvent()
  145. }
  146. },
  147. onLoad(value) {
  148. if (value.page) {
  149. this.nowchos = Number(value.page)
  150. }
  151. var userInfo = this.$cache.getCache('userInfo')
  152. if (userInfo.provUser) {
  153. if (userInfo.provUser.isorders == 0 && userInfo.provUser.userType == 3) {
  154. this.dataList = this.aspirated
  155. this.genreTitle = '送气员端'
  156. } else if (userInfo.provUser.userType == 3) {
  157. this.dataList = this.shopList
  158. this.genreTitle = '门店端'
  159. } else if (userInfo.provUser.userType == 4) {
  160. this.dataList = this.driverList
  161. this.genreTitle = '司机端'
  162. } else if (userInfo.provUser.userType == 5) {
  163. this.dataList = this.stationList
  164. this.genreTitle = '气站端'
  165. }
  166. } else {
  167. this.dataList = this.aspirated
  168. this.genreTitle = '送气员端'
  169. }
  170. },
  171. onShow() {
  172. if (this.nowchos == 1) {
  173. if (this.$refs.cylinder) {
  174. this.$refs.cylinder.refreshList()
  175. }
  176. }
  177. if (this.nowchos == 2) {
  178. if (this.$refs.cylinder) {
  179. this.$refs.cylinder.refreshList()
  180. }
  181. }
  182. var token = this.$cache.getToken()
  183. this.token = token
  184. var userInfo = this.$cache.getCache('userInfo')
  185. if (userInfo) {
  186. this.userInfo = userInfo
  187. }
  188. },
  189. mounted() {
  190. var userInfo = this.$cache.getCache('userInfo')
  191. if (userInfo.provUser) {
  192. this.isorders = userInfo.provUser.isorders
  193. this.userType = userInfo.provUser.userType
  194. }
  195. },
  196. methods: {
  197. // tab
  198. botomchos(e) {
  199. uni.setStorageSync('nowchos', e);
  200. this.nowchos = e
  201. },
  202. // 充装
  203. tankFilling() {
  204. this.nowchos = 1
  205. this.tabNumber = 1
  206. },
  207. getType(isorders, userType) {
  208. if (isorders == 0) {
  209. if (userType == 3) {
  210. if (this.nowchos == 3) {
  211. return true
  212. }
  213. } else {
  214. if (this.nowchos == 2) {
  215. return true
  216. }
  217. }
  218. } else {
  219. if (this.nowchos == 2) {
  220. return true
  221. }
  222. }
  223. },
  224. steelCylinder(isorders, userType) {
  225. if (isorders == 0) {
  226. if (userType == 3) {
  227. if (this.nowchos == 2) {
  228. return true
  229. }
  230. } else {
  231. if (this.nowchos == 1) {
  232. return true
  233. }
  234. }
  235. } else {
  236. if (this.nowchos == 1) {
  237. return true
  238. }
  239. }
  240. }
  241. }
  242. }
  243. </script>
  244. <style lang="scss">
  245. .bottomboxs {
  246. position: relative;
  247. bottom: 0;
  248. z-index: 2023;
  249. height: 100rpx;
  250. }
  251. </style>