123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- <template>
- <!-- 底部tab导航 -->
- <view>
- <Home :dataList="dataList" :genreTitle="genreTitle" ref="home" @tankFilling="tankFilling" v-if="nowchos === 0">
- </Home>
- <!-- isorders == 0 同时userType == 3 送气员 -->
- <Order ref="waybill" v-else-if="nowchos === 1 && isorders == 0 && userType == 3"></Order>
- <Information ref="cylinder" :tabNumber="tabNumber" v-else-if="steelCylinder(isorders,userType)"></Information>
- <Mine :token="token" :userInfo="userInfo" v-else-if="getType(isorders,userType)"></Mine>
- <view class="bottomboxs">
- <x-navbottom :nowchos='nowchos' @botomchos='botomchos'></x-navbottom>
- </view>
- </view>
- </template>
- <script>
- import Home from './home/index.vue' // 引入首页
- import Order from './order/index.vue' // 引入收益首页
- import Information from './information/index.vue' // 记录
- import Mine from './mine/index.vue' // 记录
- export default {
- components: { //在这里注册相应的组件
- Home,
- Order,
- Information,
- Mine,
- },
- data() {
- return {
- nowchos: 0, //当前选择了那个底部菜单
- userInfo: {},
- isorders: 0,
- userType: 3,
- token: '',
- aspirated: [{
- id: '25',
- title: '送气员领重瓶出库',
- icon: 'icon-chukudan',
- color: '#f4b237',
- }, {
- id: '27',
- title: '送气员回收空瓶',
- icon: 'icon-recycling',
- color: '#8ac247',
- }],
- shopList: [{
- id: '37',
- title: '重瓶出库',
- icon: 'icon-peizaizhuangche',
- color: '#f4b237',
- }, {
- id: '10',
- title: '空瓶出库',
- icon: 'icon-peizaizhuangche-xianxing',
- color: '#6db1ff',
- }, {
- id: '31',
- title: '重瓶入库',
- icon: 'icon-fankudengji',
- color: '#6db1ff',
- }, {
- id: '21',
- title: '回收空瓶',
- icon: 'icon-recycling',
- color: '#8ac247',
- }, {
- id: '35',
- // 未配送
- title: '重瓶返库',
- icon: 'icon-fankudengji',
- color: '#22b9f9',
- }, {
- id: '33',
- title: '重瓶退回',
- icon: 'icon-tuihuo',
- color: '#f3553e',
- }, ],
- driverList: [{
- id: '17',
- title: '确定重瓶气站出库',
- icon: 'icon-chukudan',
- color: '#6db1ff',
- }, {
- id: '033',
- title: '确定重瓶门店出库',
- icon: 'icon-owNote',
- color: '#8ac247',
- }, {
- id: '19',
- title: '司机钢瓶交付门店',
- icon: 'icon-yunsonghejiaofu',
- color: '#f4b237',
- }, {
- id: '12',
- title: '运输空瓶到达气站',
- icon: 'icon-yidaoda',
- color: '#83e908',
- }, {
- id: '11',
- title: '司机空瓶装车',
- icon: 'icon-owNote',
- color: '#22b9f9',
- }, {
- id: '16',
- title: '重瓶退回气站',
- icon: 'icon-tuihuo',
- color: '#f3553e',
- }],
- stationList: [{
- id: '13',
- title: '确定空瓶到达气站',
- icon: 'icon-daichuku',
- color: '#37c4f4',
- }, {
- id: '016',
- title: '确定重瓶到达气站',
- icon: 'icon-yidaoda',
- color: '#c7be16',
- }, {
- id: '14',
- title: '气站充装空瓶',
- icon: 'icon-peizaizhuangche-xianxing',
- color: '#6db1ff',
- }, {
- id: '15',
- title: '气站重瓶出库',
- icon: 'icon-owNote',
- color: '#8ac247',
- }, {
- id: 'inspect',
- title: '充气前后检查',
- icon: 'icon-jianchaxiang',
- color: '#f4b237',
- }, ],
- dataList: [],
- genreTitle: '',
- tabNumber: 0,
- }
- },
- onReachBottom() {
- if (this.$refs.cylinder) {
- this.$refs.cylinder.bottomingEvent()
- }
- if (this.$refs.waybill) {
- this.$refs.waybill.bottomingEvent()
- }
- },
- onLoad(value) {
- if (value.page) {
- this.nowchos = Number(value.page)
- }
- var userInfo = this.$cache.getCache('userInfo')
- if (userInfo.provUser) {
- if (userInfo.provUser.isorders == 0 && userInfo.provUser.userType == 3) {
- this.dataList = this.aspirated
- this.genreTitle = '送气员端'
- } else if (userInfo.provUser.userType == 3) {
- this.dataList = this.shopList
- this.genreTitle = '门店端'
- } else if (userInfo.provUser.userType == 4) {
- this.dataList = this.driverList
- this.genreTitle = '司机端'
- } else if (userInfo.provUser.userType == 5) {
- this.dataList = this.stationList
- this.genreTitle = '气站端'
- }
- } else {
- this.dataList = this.aspirated
- this.genreTitle = '送气员端'
- }
- },
- onShow() {
- if (this.nowchos == 1) {
- if (this.$refs.cylinder) {
- this.$refs.cylinder.refreshList()
- }
- }
- if (this.nowchos == 2) {
- if (this.$refs.cylinder) {
- this.$refs.cylinder.refreshList()
- }
- }
- var token = this.$cache.getToken()
- this.token = token
- var userInfo = this.$cache.getCache('userInfo')
- if (userInfo) {
- this.userInfo = userInfo
- }
- },
- mounted() {
- var userInfo = this.$cache.getCache('userInfo')
- if (userInfo.provUser) {
- this.isorders = userInfo.provUser.isorders
- this.userType = userInfo.provUser.userType
- }
- },
- methods: {
- // tab
- botomchos(e) {
- uni.setStorageSync('nowchos', e);
- this.nowchos = e
- },
- // 充装
- tankFilling() {
- this.nowchos = 1
- this.tabNumber = 1
- },
- getType(isorders, userType) {
- if (isorders == 0) {
- if (userType == 3) {
- if (this.nowchos == 3) {
- return true
- }
- } else {
- if (this.nowchos == 2) {
- return true
- }
- }
- } else {
- if (this.nowchos == 2) {
- return true
- }
- }
- },
- steelCylinder(isorders, userType) {
- if (isorders == 0) {
- if (userType == 3) {
- if (this.nowchos == 2) {
- return true
- }
- } else {
- if (this.nowchos == 1) {
- return true
- }
- }
- } else {
- if (this.nowchos == 1) {
- return true
- }
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .bottomboxs {
- position: relative;
- bottom: 0;
- z-index: 2023;
- height: 100rpx;
- }
- </style>
|