Files
dvcp_v2_webapp/project/fengdu/app/AppIntegratingTask/components/Detail.vue

194 lines
6.4 KiB
Vue
Raw Normal View History

2023-03-28 17:01:52 +08:00
<template>
2023-03-29 09:24:13 +08:00
<ai-detail class="activitiesAdd">
2023-03-28 17:01:52 +08:00
<template slot="title">
2023-03-29 09:24:13 +08:00
<ai-title title="活动详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)"></ai-title>
2023-03-28 17:01:52 +08:00
</template>
<template slot="content">
2023-03-30 15:13:34 +08:00
<AiSidebar :tabTitle="tabList" v-model="currIndex"></AiSidebar>
<ai-card title="基本信息" v-if="currIndex === 0">
2023-03-28 17:01:52 +08:00
<template #content>
2023-03-29 09:24:13 +08:00
<ai-wrapper>
<ai-info-item label="活动名称" :value="info.title"></ai-info-item>
<ai-info-item label="创建人" :value="info.createUserName"></ai-info-item>
<ai-info-item label="活动说明" isLine :value="info.detail"></ai-info-item>
<ai-info-item label="活动图片" isLine>
<ai-uploader
disabled
:instance="instance"
:value="info.files">
</ai-uploader>
</ai-info-item>
2023-03-30 09:56:50 +08:00
<ai-info-item label="活动地区" isLine :value="info.areaName"></ai-info-item>
2023-03-29 09:24:13 +08:00
<ai-info-item label="活动地点" :value="info.address"></ai-info-item>
2023-03-30 14:39:02 +08:00
<ai-info-item label="地图位置" isLine><div id="mapDetail"></div></ai-info-item>
2023-03-29 09:24:13 +08:00
<ai-info-item label="积分类型" isLine :value="info.type === '0' ? '打卡得积分' : '报名得积分'"></ai-info-item>
<ai-info-item label="活动状态">
2023-03-30 12:02:20 +08:00
{{ dict.getLabel('fdIntegralTaskStatus',info.status) }}
2023-03-29 09:24:13 +08:00
</ai-info-item>
2023-03-30 14:39:40 +08:00
<ai-info-item v-if="info.type === '0'" label="打卡范围">{{ info.clockRange }}</ai-info-item>
2023-03-30 14:36:09 +08:00
<ai-info-item :label="info.type === '0' ? '进场打卡时间' : '报名时间'">{{ info.intoBegintime }}{{ info.intoEndtime}}</ai-info-item>
2023-03-30 15:14:15 +08:00
<ai-info-item v-if="info.type === '0'" label="进场得积分">{{ info.intoIntegral || 0 }}</ai-info-item>
2023-03-30 14:36:09 +08:00
<ai-info-item v-if="info.type === '0'" :label="info.type === '0' ? '离场打卡时间' : '离场时间'">{{ info.exitBegintime }}{{ info.exitEndtime}}</ai-info-item>
2023-03-30 15:14:15 +08:00
<ai-info-item v-if="info.type === '0'" label="离场得积分">{{ info.exitIntegral || 0 }}</ai-info-item>
<ai-info-item v-if="info.type === '1'" label="报名得积分">{{ info.enrollIntegral || 0 }}</ai-info-item>
2023-03-29 09:24:13 +08:00
</ai-wrapper>
2023-03-28 17:01:52 +08:00
</template>
</ai-card>
2023-03-30 15:13:34 +08:00
<ai-card title="打卡记录" v-if="currIndex === 1 && info.type === '0'">
<template #content>
<ai-wrapper>
<ai-info-item label="参与人数" :value="search1.total"></ai-info-item>
</ai-wrapper>
<ai-table
:tableData="tableData1"
:col-configs="colConfigs1"
:total="search1.total"
:current.sync="search1.current"
:size.sync="search1.size"
@getList="getList1">
</ai-table>
</template>
</ai-card>
<ai-card title="报名记录" v-if="currIndex === 1 && info.type === '1'">
<template #content>
<ai-wrapper>
<ai-info-item label="参与人数" :value="search1.total"></ai-info-item>
</ai-wrapper>
<ai-table
:tableData="tableData1"
:col-configs="colConfigs2"
:total="search1.total"
:current.sync="search1.current"
:size.sync="search1.size"
@getList="getList1">
</ai-table>
</template>
</ai-card>
2023-03-28 17:01:52 +08:00
</template>
</ai-detail>
</template>
<script>
2023-03-29 09:24:13 +08:00
import AMapLoader from '@amap/amap-jsapi-loader'
2023-03-28 17:01:52 +08:00
export default {
props: {
instance: Function,
dict: Object,
2023-03-29 09:24:13 +08:00
params: Object,
2023-03-28 17:01:52 +08:00
},
data () {
return {
2023-03-29 09:24:13 +08:00
id: '',
2023-03-28 17:01:52 +08:00
info: {},
2023-03-29 09:24:13 +08:00
mapDetail: null,
2023-03-30 15:13:34 +08:00
map: null,
currIndex: 0,
search1: {
total: 0,
current: 1,
size: 10
},
tableData1: [],
colConfigs1: [
{prop: 'realName', label: '姓名', align: 'center' },
{prop: 'phone', label: '联系方式', align: 'center' },
{prop: 'areaName', label: '所属地区', align: 'center' },
{prop: 'clockTime', label: '打卡时间', align: 'center' }
],
colConfigs2: [
{prop: 'realName', label: '姓名', align: 'center' },
{prop: 'phone', label: '联系方式', align: 'center' },
{prop: 'areaName', label: '所属地区', align: 'center' },
{prop: 'clockTime', label: '报名时间', align: 'center' }
],
tabList: ['基本信息', '参与任务情况']
2023-03-28 17:01:52 +08:00
}
},
created () {
2023-03-29 09:24:13 +08:00
this.id = this.params.id
this.$dict.load('tfx_activityStatus').then(() => {
this.getDetail()
})
2023-03-30 15:13:34 +08:00
this.getList1()
2023-03-28 17:01:52 +08:00
},
methods: {
2023-03-29 09:24:13 +08:00
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
2023-03-28 17:01:52 +08:00
})
},
2023-03-30 15:13:34 +08:00
getList1 () {
this.instance.post(`/app/appintegraltask/clockList?taskId=${this.params.id}`,null, {
params: {
...this.search1,
}
}).then(res=> {
if(res?.data) {
this.tableData1 = res.data.records
this.search1.total = res.data.total
}
})
},
2023-03-29 09:24:13 +08:00
getMap(lng,lat,address) {
AMapLoader.load({
key: '54a02a43d9828a8f9cd4f26fe281e74e',
version: '2.0',
plugins: ['AMap.PlaceSearch', 'AMap.AutoComplete', 'AMap.Geocoder'],
}).then((AMap) => {
this.mapDetail = new AMap.Map(document.getElementById("mapDetail"), {
resizeEnable: true,
zooms: [6, 20],
zoom: 11,
})
let marker = new AMap.Marker({
position: new AMap.LngLat(lng,lat),
title: address
})
this.mapDetail.add(marker);
2023-03-28 17:01:52 +08:00
})
},
2023-03-29 09:24:13 +08:00
update() {
this.isEdit = true
this.getDetail()
2023-03-28 17:01:52 +08:00
},
2023-03-29 09:24:13 +08:00
getDetail() {
this.instance.post(`/app/appintegraltask/queryDetailById?id=${this.params.id}`).then((res) => {
if(res.data) {
this.info = res.data
this.getMap(this.info.lng, this.info.lat, this.info.address)
}
2023-03-28 17:01:52 +08:00
})
2023-03-29 09:24:13 +08:00
}
2023-03-28 17:01:52 +08:00
}
}
</script>
2023-03-29 09:24:13 +08:00
<style lang="scss" scope>
.activitiesAdd {
height: 100%;
:deep( .amap-logo ){
display: none!important;
2023-03-28 17:01:52 +08:00
}
2023-03-29 09:24:13 +08:00
:deep( .amap-copyright ){
display: none!important;
2023-03-28 17:01:52 +08:00
}
2023-03-29 09:24:13 +08:00
:deep( .el-date-editor .el-input ){
width: 100%;
}
2023-03-28 17:01:52 +08:00
2023-03-29 09:24:13 +08:00
.amap-container {
height: 380px;
2023-03-28 17:01:52 +08:00
}
}
</style>