This commit is contained in:
liuye
2023-08-25 17:36:18 +08:00
parent b627e05395
commit 5139f883e4

View File

@@ -1,151 +1,290 @@
<template> <template>
<div class="AppHandSnapshot"> <div class="AppWorkOrder">
<component v-if="refresh && isGridMember" :is="component" @change="onChange" :params="params" :ref="component"/> <AiTopFixed>
<div class="tabs" v-if="isTab && isGridMember"> <u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff"
<div class="item" @click="tabClick(index, item.component)" v-for="(item, index) in tabs" :key="index"> @change="change"></u-tabs>
<img :src="tabIndex == index ? item.activeImg : item.img" alt=""/> <div class="select-top">
<p :class="tabIndex == index ? 'color-3267F0' : ''">{{ item.text }}</p> <!-- <div class="tab-item">
<AiPagePicker type="gird" v-model="searchGrid" @change="confirm" valueObj nodeKey="id" formType="2">
<AiMore v-model="searchGrid.girdName" icon="arrow-down" placeholder="所属网格"/>
</AiPagePicker>
</div> -->
<div class="tab-item" @click="showType = true">
<AiMore v-model="eventStatusText" icon="arrow-down" placeholder="办件状态"/>
</div>
<u-select v-model="showType" :list="listType" value-name="dictValue" label-name="dictName" @confirm="confirm"></u-select>
</div> </div>
</div> </AiTopFixed>
<div v-if="!isGridMember" class="empty"> <template>
<img src="./components/img/no-admin.png" alt=""> <AiCard v-for="(item, i) in datas" :key="i" @click.native="goDetail(item, 1)">
<p>没有网格员权限<br/>无法查看巡查上报信息哦~</p> <template #custom>
</div> <div class="card-top">
<div class="titles">{{ item.content }}</div>
<div class="types">
<span>事件类型</span>
<span class="types-right">{{ $dict.getLabel('xbotReportEventType', item.type)}}</span>
</div>
<div class="types">
<span>所属群聊</span>
<span class="types-right">{{ item.groupName }}</span>
</div>
<div class="gards">
<span>上报时间</span>
<span class="gards-right">{{ item.createTime }}</span>
</div>
</div>
<div class="status" :class="item.eventStatus == 0 ? 'status0' : item.eventStatus == 1 ? 'status1' : item.eventStatus == 2 ? 'status2' : 'status3'"
v-if="item.eventStatus">
<span class="icon"></span>
<span>
{{ $dict.getLabel('clapEventStatus', item.eventStatus) }}
</span>
</div>
</template>
</AiCard>
<AiEmpty v-if="!datas.length"></AiEmpty>
</template>
<div class="pad-b120" v-if="datas.length"></div>
</div> </div>
</template> </template>
<script> <script>
import List from './List.vue'
import Statistics from './Statistics.vue'
import {mapState} from 'vuex' import {mapState} from 'vuex'
export default { export default {
name: "AppWorkOrder", name: 'AppWorkOrderXbot',
appName: "工单管理", appName: '工单管理',
data() { data() {
return { return {
component: 'List', datas: [],
params: {}, tabList: [
refresh: true,
tabIndex: 0,
tabs: [
{ {
img: require('./components/img/handle-icon.png'), name: '全部待办',
activeImg: require('./components/img/handle-icon-active.png'),
text: '办理',
component: 'List',
}, },
{ {
img: require('./components/img/statistics-icon.png'), name: '办件历史',
activeImg: require('./components/img/statistics-icon-active.png'),
text: '统计',
component: 'Statistics',
}, },
], ],
isTab: true, currentTabs: 0,
current: 1,
pages: 0,
searchGrid: {},
showType: false,
eventStatus: '',
eventStatusText: '',
} }
}, },
computed: { computed: {
...mapState(['user']), ...mapState(['user']),
isGridMember() { listType() {
return this.user.girdCheckType > 0 return this.$dict.getDict(this.currentTabs == 0 ? 'clapEventStatusAll' : 'clapEventStatusHistory')
} }
}, },
components: { onLoad() {
List, uni.$on('nextList', () => {
Statistics, this.current++
Set, this.getList()
},
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
})
}
},
onShow() {
document.title = '巡查上报'
uni.$on('hideTab', () => {
this.isTab = false
})
uni.$on('showTab', () => {
this.isTab = true
}) })
uni.$on('getListInit', () => { uni.$on('getListInit', () => {
this.$nextTick(() => this.$refs['List'].getListInit()) this.current = 1
this.getList()
}) })
this.$nextTick(() => this.$refs['List'].getListInit())
}, },
onReachBottom() { onShow() {
if (!this.tabIndex) { document.title = '工单管理'
this.$nextTick(() => this.$refs['List'].nextPage()) },
} created() {
this.$dict.load('clapEventStatus', 'clapEventStatusAll', 'clapEventStatusHistory', 'xbotReportEventType').then(() => {
this.getList()
})
},
methods: {
getListInit() {
this.current = 1
this.getList()
},
nextPage() {
this.current++
this.getList()
},
getList() {
let {current, eventStatus, searchGrid: {id: girdId}} = this
this.$http.post(`/app/appsessionarchivereportinfo/list`, null, {
params: {
size: 10,
current, searchType: this.currentTabs == 1 ? '1' : '0',
eventStatus, girdId
},
})
.then((res) => {
if (res.code == 0) {
this.datas = this.current > 1 ? [...this.datas, ...res.data.records] : res.data.records
this.pages = res.data.pages
this.$forceUpdate()
}
})
},
confirm(e) {
if (this.showType) {
this.eventStatus = e[0].value
this.eventStatusText = e[0].label
}
this.current = 1
this.getList()
},
goDetail(item) {
uni.navigateTo({url: `./Detail?id=${item.id}`})
},
change(index) {
this.current = 1
this.datas = []
this.eventStatus = ''
this.currentTabs = index
this.getList()
},
linkTo(url) {
uni.navigateTo({url})
},
}, },
} }
</script> </script>
<style lang="scss" scoped> <style scoped lang="scss">
.AppHandSnapshot { .AppWorkOrder {
height: 100%; height: 100%;
} padding: 0;
width: 100vw;
.tabs { .select-top {
width: 100%; background: #fff;
height: 98px; display: flex;
background: #fff; padding: 24px 0;
border-top: 1px solid #ddd;
position: fixed;
bottom: 0;
left: 0;
display: flex;
.item { .tab-item {
flex: 1; flex: 1;
text-align: center; text-align: center;
line-height: 48px;
font-size: 26px;
font-family: PingFangSC-Regular, PingFang SC;
color: #666;
img { img {
width: 56px; width: 32px;
height: 56px; height: 32px;
margin-top: 8px; margin-left: 8px;
vertical-align: middle;
}
} }
p { .tab-item:nth-of-type(1) {
font-size: 22px; border-right: 1px solid #eee;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #c4cad4;
line-height: 8px;
}
.color-3267F0 {
color: #3267f0;
} }
} }
}
.empty { ::v-deep .AiTopFixed .content {
text-align: center; padding: 0;
img {
width: 282px;
height: 306px;
margin: 136px auto 0;
} }
p { ::v-deep .AiCard {
font-size: 28px; background: #f3f6f9;
font-family: PingFangSC-Regular, PingFang SC; padding: 24px 40px 0 32px;
color: #999;
line-height: 40px; .start {
background: #fff;
border-radius: 16px;
.card-top {
padding: 32px;
.titles {
margin-bottom: 34px;
font-size: 32px;
font-weight: 500;
color: #333333;
line-height: 1.4;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.types,
.gards {
margin-top: 8px;
font-size: 26px;
.types-right,
.gards-right {
margin-left: 32px;
color: #333333;
}
}
}
.status {
padding: 32px;
border-top: 1px solid #dddddd;
.icon {
display: inline-block;
width: 8px;
height: 8px;
vertical-align: middle;
margin-right: 8px;
}
}
.status0 {
color: #ff883c;
.icon {
background: #ff883c;
}
}
.status1 {
color: #1aaaff;
.icon {
background: #1aaaff;
}
}
.status2 {
color: #42d784;
.icon {
background: #42d784;
}
}
.status3 {
color: #ff4466;
.icon {
background: #ff4466;
}
}
}
}
// ::v-deep .AiCard:last-child {
// padding-bottom: 24px;
// }
.pad-b120 {
background-color: #f3f6f9;
padding-bottom: 120px;
} }
} }
</style> </style>