Files
dvcp_v2_wxcp_app/library/apps/AppHelpEffect/helpDetail.vue

259 lines
6.5 KiB
Vue
Raw Normal View History

2022-07-21 10:19:50 +08:00
<template>
2022-07-21 15:03:23 +08:00
<div class="helpDetail">
<AiTopFixed>
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bar-width="150" @change="change"></u-tabs>
</AiTopFixed>
2022-07-22 09:45:14 +08:00
<div class="tab-content">
<div class="tab-content__item" v-if="list.length">
<div class="log-item" v-for="(item, index) in list" :key="index">
2022-07-21 15:03:23 +08:00
<div class="log-item__wrapper">
<div class="log-item__user">
<div class="left">
<div class="user">
<span>{{ item.createUserName.substr(item.createUserName.length - 2) }}</span>
</div>
<h2>{{ item.createUserName }}</h2>
</div>
<div class="right">
<span>{{ item.createTime }}</span>
2022-07-22 09:45:14 +08:00
<u-icon name="list" color="#999" size="28" @click="edit(item.id, '1')" style="margin-left:16px;" v-if="item.createUserId == user.id && currentTabs==0"></u-icon>
<u-icon name="list" color="#999" size="28" @click="edit(item.id, '0')" style="margin-left:16px;" v-if="item.createUserId == user.id && item.operationDesc == '走访排查' && currentTabs==1"></u-icon>
2022-07-21 15:03:23 +08:00
</div>
</div>
2022-07-22 09:45:14 +08:00
<p style="color: #999999;" v-if="currentTabs==0">帮扶措施{{ $dict.getLabel('fpAssistanceMeasures',item.operationDesc) }}</p>
<p style="color: #999999;" v-if="currentTabs==1">操作类型{{ item.operationDesc }}</p>
2022-07-21 15:03:23 +08:00
<p>{{ item.detail }}</p>
<div class="imgs" v-if="item.files && item.files.length">
<image :src="img.url" @click="prevImg(item.files, img.url)" v-for="(img, index) in item.files"
:key="index"/>
</div>
</div>
</div>
</div>
2022-07-22 09:45:14 +08:00
<AiEmpty v-else style="padding-top: 50px;" description="暂无数据"></AiEmpty>
2022-07-21 15:03:23 +08:00
</div>
<AiFixedBtn v-if="currentTabs === 0">
2022-07-21 16:03:34 +08:00
<div class="addBtn iconfont iconfont-iconfangda" @tap="toAddLog('1')" v-if="$permissions('app_apppreventionreturntopovertylog_edit')"></div>
2022-07-21 15:03:23 +08:00
</AiFixedBtn>
2022-07-21 16:03:34 +08:00
<!-- 走访日志0 帮扶措施1 -->
2022-07-21 15:03:23 +08:00
<AiFixedBtn v-if="currentTabs === 1">
2022-07-21 16:03:34 +08:00
<div class="addBtn iconfont iconfont-iconfangda" @tap="toAddLog('0')"></div>
2022-07-21 15:03:23 +08:00
</AiFixedBtn>
</div>
2022-07-21 10:19:50 +08:00
</template>
<script>
2022-07-21 15:03:23 +08:00
import {mapState} from 'vuex'
2022-07-21 10:19:50 +08:00
export default {
name: 'helpDetail',
data() {
2022-07-21 15:03:23 +08:00
return {
tabList: [
{
name: '帮扶措施',
},
{
name: '走访日志',
}
],
currentTabs: 0,
2022-07-22 09:45:14 +08:00
list: [],
2022-07-21 15:03:23 +08:00
id: '',
2022-07-22 09:45:14 +08:00
current: 1,
2022-07-21 15:03:23 +08:00
}
},
computed: {
...mapState(['user'])
},
onLoad(o) {
this.id = o.id
this.$dict.load('fpAssistanceMeasures')
},
methods: {
change(index) {
2022-07-22 09:45:14 +08:00
this.list = []
this.current = 1
2022-07-21 15:03:23 +08:00
this.currentTabs = index
2022-07-22 09:45:14 +08:00
this.getList()
2022-07-21 15:03:23 +08:00
},
2022-07-22 09:45:14 +08:00
getList() {
this.$http.post(`/app/apppreventionreturntopovertylog/list`,null,{
params: {
pid: this.id,
size: 1000,
current: this.current,
type: this.currentTabs==0? '1':'0'
2022-07-21 15:03:23 +08:00
}
2022-07-22 09:45:14 +08:00
}).then(res => {
if (res?.data) {
this.list = this.current==1? res.data.records : [...this.list, ...res.data.records]
2022-07-21 15:03:23 +08:00
}
})
},
toAddLog(type) {
uni.navigateTo({
url: `./addLog?pid=${this.id}&type=${type}`
})
},
prevImg(urls, img) {
const imgs = urls.map(v => v.url)
uni.previewImage({
urls: imgs,
current: img
})
},
2022-07-21 16:03:34 +08:00
edit(id,type) {
2022-07-21 15:03:23 +08:00
uni.showActionSheet({
itemList: ['编辑', '删除'],
success: res => {
if (res.tapIndex === 0) {
2022-07-22 09:45:14 +08:00
if (type == 0) {
2022-07-21 16:03:34 +08:00
uni.navigateTo({
url: `./addLog?pid=${this.id}&id=${id}&type=0`
})
2022-07-22 09:45:14 +08:00
} else if (type == 1) {
2022-07-21 16:03:34 +08:00
uni.navigateTo({
url: `./addLog?pid=${this.id}&id=${id}&type=1`
})
}
2022-07-22 09:45:14 +08:00
} else if (res.tapIndex == 1) {
2022-07-21 15:03:23 +08:00
this.$confirm('确定删除该数据?').then(() => {
uni.showLoading()
this.$http.post(`/app/apppreventionreturntopovertylog/delete?ids=${id}`).then(res => {
if (res.code === 0) {
this.$u.toast('删除成功')
2022-07-22 09:45:14 +08:00
this.getList()
2022-07-21 15:03:23 +08:00
}
uni.hideLoading()
})
}).catch(() => {
})
}
}
})
},
2022-07-21 10:19:50 +08:00
},
onShow() {
2022-07-21 15:03:23 +08:00
document.title = '帮扶情况'
if(this.id) {
2022-07-22 09:45:14 +08:00
this.getList()
2022-07-21 15:03:23 +08:00
}
2022-07-22 09:45:14 +08:00
this.getList()
},
onReachBottom() {
this.current ++
this.getList()
2022-07-21 10:19:50 +08:00
}
}
</script>
<style lang="scss" scoped>
2022-07-21 15:03:23 +08:00
.helpDetail {
::v-deep .AiTopFixed .content{
padding: 0;
}
.log-item {
padding: 0 0 0 32px;
background: #fff;
&:first-child {
margin-top: 16px;
}
&:last-child {
.log-item__wrapper {
border: none !important;
}
}
.log-item__wrapper {
padding: 32px 32px 32px 0;
border-bottom: 1px solid #E4E5E6;
.log-item__user {
display: flex;
align-items: center;
justify-content: space-between;
& > div {
display: flex;
align-items: center;
}
.left {
.user, image {
width: 80px;
height: 80px;
line-height: 80px;
margin-right: 16px;
text-align: center;
border-radius: 50%;
background: #2266FF;
span {
color: #fff;
font-size: 28px;
}
}
h2 {
color: #333;
font-size: 32px;
}
}
.right {
image {
width: 32px;
height: 32px;
}
span {
margin-right: 6px;
color: #999999;
font-size: 28px;
}
}
}
p {
margin: 4px 0 16px 96px;
color: #343D65;
font-size: 28px;
}
.imgs {
margin-left: 96px;
image {
width: 136px;
height: 136px;
margin-right: 8px;
margin-bottom: 8px;
}
}
}
}
.addBtn {
width: 96px;
height: 96px;
flex-shrink: 0;
background: $uni-color-primary;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
font-size: 48px;
color: #fff;
border-radius: 50%;
justify-content: center;
align-items: center;
display: flex;
}
}
2022-07-21 10:19:50 +08:00
</style>