138 lines
3.9 KiB
Vue
138 lines
3.9 KiB
Vue
<template>
|
|
<section class="AppMerchantDiscounts">
|
|
<ai-list>
|
|
<ai-title slot="title" title="商户优惠" isShowBottomBorder />
|
|
<template #content>
|
|
<ai-search-bar>
|
|
<template #left>
|
|
<ai-select
|
|
v-model="search.status"
|
|
@change="page.current = 1, getList()"
|
|
placeholder="状态"
|
|
:selectList="dict.getDict('tfx_status')">
|
|
</ai-select>
|
|
</template>
|
|
<template #right>
|
|
<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>
|
|
</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" v-show="row.status==1" @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('tfx_status').then(()=> {
|
|
this.getList()
|
|
})
|
|
},
|
|
computed: {
|
|
colConfigs() {
|
|
return [
|
|
{prop: "merchantName", label: "商户名称", align: "left", showOverflowTooltip: true},
|
|
{prop: "title", label: "优惠标题", align: "center"},
|
|
{prop: "content", label: "优惠内容", align: "center"},
|
|
{prop: "status", label: "状态", align: "center", dict:"tfx_status"},
|
|
{slot: "options"},
|
|
]
|
|
}
|
|
},
|
|
methods: {
|
|
getList() {
|
|
this.instance.post(`api/appmerchantinfo/discountList`,null, {
|
|
params: {
|
|
...this.page,
|
|
...this.search
|
|
}
|
|
}).then(res=> {
|
|
if(res?.data) {
|
|
this.tableData = res.data.records
|
|
this.page.total = res.data.total
|
|
}
|
|
})
|
|
},
|
|
// 删除
|
|
delBtn(id) {
|
|
this.$confirm('确定删除该记录?').then(() => {
|
|
this.instance.post(`api/appmerchantinfo/deleteDiscount?id=${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(`api/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>
|