Files
dvcp_v2_wxcp_app/library/apps/AppWorkOrderXbot/AppWorkOrderXbot.vue

146 lines
2.9 KiB
Vue
Raw Normal View History

2023-08-17 14:22:24 +08:00
<template>
2023-08-28 14:56:21 +08:00
<div class="AppWorkOrderXbot">
2023-08-28 16:01:40 +08:00
<component v-if="refresh" :is="component" @change="onChange" :params="params" :ref="component"/>
<div class="tabs" v-if="isTab">
2023-08-28 14:56:21 +08:00
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index">
<img :src="tabIndex == index ? item.activeImg : item.img" alt=""/>
<p :class="tabIndex == index ? 'color-3267F0' : ''">{{ item.text }}</p>
2023-08-17 14:22:24 +08:00
</div>
2023-08-28 14:56:21 +08:00
</div>
2023-08-17 14:22:24 +08:00
</div>
</template>
<script>
2023-08-28 14:56:21 +08:00
import List from './List.vue'
import Statistics from './Statistics.vue'
2023-08-17 14:22:24 +08:00
import {mapState} from 'vuex'
export default {
2023-08-25 17:36:18 +08:00
name: 'AppWorkOrderXbot',
appName: '工单管理',
2023-08-17 14:22:24 +08:00
data() {
return {
2023-08-28 14:56:21 +08:00
component: 'List',
params: {},
refresh: true,
tabIndex: 0,
tabs: [
2023-08-17 14:22:24 +08:00
{
2023-08-28 14:56:21 +08:00
img: require('./components/img/handle-icon.png'),
activeImg: require('./components/img/handle-icon-active.png'),
text: '办理',
component: 'List',
2023-08-17 14:22:24 +08:00
},
{
2023-08-28 14:56:21 +08:00
img: require('./components/img/statistics-icon.png'),
activeImg: require('./components/img/statistics-icon-active.png'),
text: '统计',
component: 'Statistics',
2023-08-17 14:22:24 +08:00
},
],
2023-08-28 14:56:21 +08:00
isTab: true,
2023-08-17 14:22:24 +08:00
}
},
computed: {
...mapState(['user']),
2023-08-28 14:56:21 +08:00
isGridMember() {
return this.user.girdCheckType > 0
2023-08-17 14:22:24 +08:00
}
},
2023-08-28 14:56:21 +08:00
components: {
List,
Statistics,
Set,
},
2023-08-17 14:22:24 +08:00
2023-08-28 14:56:21 +08:00
methods: {
onChange(e) {
this.params = e.params
this.component = e.type
},
tabClick(index, component) {
this.tabIndex = index
this.component = component
this.refresh = false
this.$nextTick(() => {
this.refresh = true
})
}
2023-08-17 14:22:24 +08:00
},
onShow() {
2023-08-25 17:36:18 +08:00
document.title = '工单管理'
2023-08-28 14:56:21 +08:00
uni.$on('hideTab', () => {
this.isTab = false
})
uni.$on('showTab', () => {
this.isTab = true
2023-08-25 15:40:14 +08:00
})
2023-08-28 14:56:21 +08:00
if (!this.tabIndex) {
this.$nextTick(() => this.$refs['List'].getListInit())
}
2023-08-17 14:22:24 +08:00
},
2023-08-28 14:56:21 +08:00
onReachBottom() {
if (!this.tabIndex) {
this.$nextTick(() => this.$refs['List'].nextPage())
}
2023-08-17 14:22:24 +08:00
},
}
</script>
2023-08-28 14:56:21 +08:00
<style lang="scss" scoped>
.AppWorkOrderXbot {
2023-08-17 14:22:24 +08:00
height: 100%;
2023-08-28 14:56:21 +08:00
}
2023-08-17 14:22:24 +08:00
2023-08-28 14:56:21 +08:00
.tabs {
width: 100%;
height: 98px;
background: #fff;
border-top: 1px solid #ddd;
position: fixed;
bottom: 0;
left: 0;
display: flex;
.item {
flex: 1;
text-align: center;
img {
width: 56px;
height: 56px;
margin-top: 8px;
2023-08-17 14:22:24 +08:00
}
2023-08-28 14:56:21 +08:00
p {
font-size: 22px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #c4cad4;
line-height: 8px;
2023-08-25 15:40:14 +08:00
}
2023-08-17 14:22:24 +08:00
2023-08-28 14:56:21 +08:00
.color-3267F0 {
color: #3267f0;
}
2023-08-25 17:36:18 +08:00
}
2023-08-28 14:56:21 +08:00
}
2023-08-25 17:36:18 +08:00
2023-08-28 14:56:21 +08:00
.empty {
text-align: center;
2023-08-25 17:36:18 +08:00
2023-08-28 14:56:21 +08:00
img {
width: 282px;
height: 306px;
margin: 136px auto 0;
2023-08-17 14:22:24 +08:00
}
2023-08-28 14:56:21 +08:00
p {
font-size: 28px;
font-family: PingFangSC-Regular, PingFang SC;
color: #999;
line-height: 40px;
2023-08-17 14:22:24 +08:00
}
}
</style>