Commit ea943f32 by cwq0219

优惠券

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