Commit ea943f32 by cwq0219

优惠券

1 parent b584d0b3
......@@ -3,24 +3,35 @@ import { http } from '@/main'
// const defaultPath = 'scrm.api.live.'
const getOrderListApi = params => {
// params.method = `${defaultPath}goods.list`
// params.method = `${defaultPath}goods.list`
params.method = `scrm.api.equity.merchant.order.list.with.page`
return http({
url: 'rop-scrm-equity/router',
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true
})
}
const getOrderPageDetail=params=>{
params.method=`scrm.api.equity.merchant.order.select`
const getOrderPageDetail = params => {
params.method = `scrm.api.equity.merchant.order.select`
return http({
url: 'rop-scrm-equity/router',
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
returnAll: true
})
}
export { getOrderListApi ,getOrderPageDetail}
\ No newline at end of file
// 订单列表-导出
const orderExportApi = params => {
params.method = 'scrm.api.equity.merchant.order.list.with.page.export'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
export { getOrderListApi, getOrderPageDetail, orderExportApi }
\ No newline at end of file
......@@ -26,7 +26,7 @@ const getVerificationCode = params => {
// 核销详情-导出
const verificationExportApi = params => {
params.method = 'scrm.api.coupon.verification.code.export.list'
params.method = 'scrm.api.coupon.verification.member.export.list'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
......
......@@ -41,7 +41,7 @@
</span>
<span style="margin-left:10px">
已过期:
<span class="red-txt">{{ }}&nbsp;</span>
<span class="red-txt">{{ coupon.overdueAmount || 0 }}&nbsp;</span>
</span>
<span style="margin-left:10px">
使用限制:
......@@ -67,7 +67,8 @@ export default {
coupon: {
couponName: '',
stock: '',
getAmount: ''
getAmount: '',
overdueAmount: ''
},
effective: '',
useB: '',
......@@ -96,6 +97,17 @@ export default {
prop: 'phone'
},
{
label: '用户昵称',
prop: 'userName'
},
{
label: '优惠券状态',
prop: 'userStatus',
formatter: cellValue => {
return this.baseData.userStatusList.find(item => +item.confId == cellValue.userStatus).confName
}
},
{
label: '领取时间',
prop: 'createdDate',
formatter: cellValue => {
......@@ -105,7 +117,26 @@ export default {
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {},
baseData: {
userStatusList: [
{
confId: '0',
confName: '未领取'
},
{
confId: '1',
confName: '已领取'
},
{
confId: '2',
confName: '已使用'
},
{
confId: '3',
confName: '已过期'
}
]
},
exportLoading: false
}
},
......
......@@ -26,6 +26,7 @@
<el-form-item size="small" style="float: right">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-row>
......@@ -54,7 +55,7 @@
<script>
import { orderTypesList, orderStatusList } from '@/common/constant'
import url from '@/assets/empty.png'
import { getOrderListApi } from '@/api/modules/order'
import { getOrderListApi, orderExportApi } from '@/api/modules/order'
export default {
data() {
return {
......@@ -181,16 +182,22 @@ export default {
}
this.handleSearch()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.startTime = this.searchForm.daterange[0] + ' 00:00:00'
params.endTime = this.searchForm.daterange[1] + ' 23:59:59'
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
delete params.daterange
return params
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchFormTable.daterange) {
this.searchFormTable.startTime = this.searchForm.daterange[0] + ' 00:00:00'
this.searchFormTable.endTime = this.searchForm.daterange[1] + ' 23:59:59'
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
delete this.searchFormTable.daterange
this.searchFormTable = this.getParams()
resolve()
})
},
......@@ -205,6 +212,17 @@ export default {
})
},
handleExport(row) {
var params = this.getParams()
orderExportApi(params).then(res => {
var a = document.createElement('a')
a.setAttribute('href', res)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
})
},
handleSearch() {
this.$refs.memberOrderRef.refreshTable()
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!