This commit is contained in:
liuye
2022-11-04 16:18:26 +08:00
2 changed files with 166 additions and 9 deletions

View File

@@ -14,17 +14,16 @@
<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 :value="info.address"></ai-info-item>
<ai-info-item label="打卡范围" :value="info.detail">
{{ info.clockRange }}
</ai-info-item>
<ai-info-item label="活动地点" :value="info.address"></ai-info-item>
<ai-info-item label="标绘地址" isLine><div id="mapDetail"></div></ai-info-item>
<ai-info-item label="活动状态">
{{ dict.getLabel('tfx_activityStatus',info.status) }}
</ai-info-item>
<ai-info-item label="打卡范围">{{ info.clockRange }}</ai-info-item>
<ai-info-item label="进场打卡时间">{{ info.intoBegintime }}{{ info.intoEndtime}}</ai-info-item>
<ai-info-item label="进场得积分">{{ info.intoIntegral }}</ai-info-item>
<ai-info-item label="离场打卡时间">{{ info.exitBegintime }}{{ info.exitEndtime}}</ai-info-item>
<ai-info-item label="离场得积分">{{ info.exitIntegral }}</ai-info-item>
<ai-info-item label="离场得积分">{{ info.exitIntegral }}</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
@@ -72,7 +71,6 @@
</el-form-item>
<el-form-item label="离场打卡时间" prop="exitTime">
<!-- { start: formData.startTime, minTime: formData.startTime} -->
<el-date-picker v-model="form.exitTime" type="datetimerange" start-placeholder="开始日期" :picker-options="timeOption"
end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
</el-form-item>
@@ -146,7 +144,7 @@ export default {
exitTime: [],
exitBegintime: '',
exitEndtime: '',
exitIntegral: '',
exitIntegral: '',
},
formRules: {
title: [{required: true, message: "请输入活动名称", trigger: "blur"}],
@@ -160,6 +158,7 @@ export default {
id: '',
isEdit: false,
info: {},
mapDetail: null,
map: null,
placeSearch: null,
placeDetail: {
@@ -181,6 +180,8 @@ export default {
if(this.params && this.params.id) {
this.id = this.params.id
this.getDetail()
setTimeout(() => {
},500)
}
},
watch: {
@@ -264,6 +265,25 @@ export default {
})
},
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,
})
var marker = new AMap.Marker({
position: new AMap.LngLat(lng,lat),
title: address
})
this.mapDetail.add(marker);
})
},
update() {
this.isEdit = true
this.getDetail()
@@ -278,6 +298,9 @@ export default {
this.form.intoTime = [res.data.intoBegintime,res.data.intoEndtime]
this.form.exitTime = [res.data.exitBegintime,res.data.exitEndtime]
this.info = res.data
this.placeDetail.lng = res.data.lng
this.placeDetail.lat = res.data.lat
this.getMap(this.info.lng,this.info.lat,this.info.address)
}
})
},
@@ -287,7 +310,7 @@ export default {
selectVote(e) {
this.form.voteUsers = e
},
handleAreaSelect(v) {
this.form.areaName = v?.[0]?.label
},
@@ -394,4 +417,4 @@ export default {
}
}
}
</style>
</style>

View File

@@ -0,0 +1,134 @@
<template>
<section class="AppMerchantDiscounts">
<ai-list>
<ai-title slot="title" title="商户优惠" isShowBottomBorder />
<template #content>
<ai-search-bar>
<template #left>
<el-input
v-model="search.title"
class="search-input"
size="small"
v-throttle="() => {page.current = 1, getList()}"
placeholder="请输入商户名称、优惠标题"
clearable
@change="getList"
@clear="page.current = 1, page.content = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
<ai-select
v-model="search.status"
@change="page.current = 1, getList()"
placeholder="状态"
:selectList="dict.getDict('integralDeclareStatus')">
</ai-select>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current"
:size.sync="page.size" @getList="getList" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="options" label="操作" fixed="right" align="center">
<template slot-scope="{ row }">
<el-button type="text" v-show="row.status==0" @click.native="examine(row.id,1)">审核通过</el-button>
<el-button type="text" v-show="row.status==0" @click.native="examine(row.id,0)">审核拒绝</el-button>
<el-button type="text" @click.native="delBtn(row.id)">删除</el-button>
</template>
</el-table-column>
</ai-table>
<div class="qrCode" v-viewer="{movable: true}" v-show="false">
<img :src="img">
</div>
</template>
</ai-list>
</section>
</template>
<script>
export default {
name: 'AppMerchantDiscounts',
label: '商户优惠',
props: {
instance: Function,
dict: Object
},
data () {
return {
page: {
current: 1,
size: 10,
total: 0,
},
tableData: [],
img: '',
isLoading: false,
search: {
title: '',
status: ''
}
}
},
created () {
this.$dict.load('integralDeclareStatus').then(()=> {
this.getList()
})
},
computed: {
colConfigs() {
return [
{prop: "merchantName", label: "商户名称", align: "left", showOverflowTooltip: true},
{prop: "title", label: "优惠标题", align: "center"},
{prop: "content", label: "优惠内容", align: "center",showOverflowTooltip: true},
{prop: "status", label: "状态", align: "center", dict:"integralDeclareStatus"},
{slot: "options"},
]
}
},
methods: {
getList() {
this.instance.post(`/appmerchantinfo/discountList`,null, {
params: {
...this.page,
}
}).then(res=> {
if(res?.data) {
this.tableData = res.data.records
this.page.total = res.data.total
}
})
},
// 删除
delBtn(id) {
this.$confirm('确定删除该记录?').then(() => {
this.instance.post(`/appmerchantinfo/deleteDiscount?ids=${id}`).then(res=>{
if(res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
// 审核
examine(id,pass) {
let title = ''
if(pass=='1') {
title = '确定要审核通过该活动吗?'
} else if(pass=='0') {
title = '确定要审核拒绝该活动吗?'
}
this.$confirm(title).then(() => {
this.instance.post(`/appmerchantinfo/examineDiscount?id=${id}&pass=${pass}`).then(res=>{
if(res.code == 0) {
this.$message.success('审核成功!')
this.getList()
}
})
})
},
}
}
</script>
<style lang="scss" scoped>
.AppMerchantDiscounts {
height: 100%;
}
</style>