Commit 7c658190 by chenwq

领取详情,核销列表

1 parent eecda43d
...@@ -25,6 +25,28 @@ const couponExportApi = params => { ...@@ -25,6 +25,28 @@ const couponExportApi = params => {
}) })
} }
//优惠券列表-集团-导出
const couponGroupExportApi = params => {
params.method = 'scrm.api.coupon.gh.group.list.export'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
//优惠券列表-门店-导出
const couponStoreExportApi = params => {
params.method = 'scrm.api.coupon.gh.store.list.export'
return http({
url: 'rop-scrm-coupon/router',
method: 'GET',
data: params,
sign: true
})
}
//生效/失效 //生效/失效
const effectiveCouponApi = params => { const effectiveCouponApi = params => {
params.method = `${defaultPath}effective` params.method = `${defaultPath}effective`
...@@ -151,4 +173,4 @@ const getAllGoodsApi = params => { ...@@ -151,4 +173,4 @@ const getAllGoodsApi = params => {
}) })
} }
export default { getCouponListApi, couponExportApi, getVerificationListApi, verificationExportApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi, getAllGoodsApi, getListReceiveRecordApi, exportReceiveRecordApi } export default { getCouponListApi, couponExportApi, couponGroupExportApi, couponStoreExportApi, getVerificationListApi, verificationExportApi, effectiveCouponApi, codeVerificationApi, getCouponDetailApi, deleteCouponApi, createCouponApi, updateCouponApi, getAllGoodsApi, getListReceiveRecordApi, exportReceiveRecordApi }
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title">优惠券列表</span> <span class="table-title">优惠券列表</span>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button> <el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">全部导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
...@@ -475,7 +475,8 @@ export default { ...@@ -475,7 +475,8 @@ export default {
handleExport(row) { handleExport(row) {
var params = this.getParams() var params = this.getParams()
this.$apis.couponManage.couponExportApi(params).then(res => { var apiName = this.$isGroupUp ? 'couponGroupExportApi' : 'couponStoreExportApi'
this.$apis.couponManage[apiName](params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
......
<!-- 领取详情 --> <!-- 领取详情 -->
<template> <template>
<div class="marketing pro-group p-t-20"> <div class="marketing pro-group p-t-20">
<div class="edit-container">
<div class="marketing edit-box"> <div class="marketing edit-box">
<div class="container edit-container m-b-20"> <div class="container edit-container m-b-20">
<p class="edit-title">优惠券信息</p> <p class="edit-title">优惠券信息</p>
...@@ -9,6 +10,7 @@ ...@@ -9,6 +10,7 @@
<div v-if="item.name == 'discountType' && coupon[item.name]"> <div v-if="item.name == 'discountType' && coupon[item.name]">
<img style="vertical-align: middle;" :src="require(`@/assets/coupon/icon-${attrToIcon[coupon[item.name]]}.png`)" /> <img style="vertical-align: middle;" :src="require(`@/assets/coupon/icon-${attrToIcon[coupon[item.name]]}.png`)" />
</div> </div>
<div v-else-if="item.formatter">{{ item.formatter() }}</div>
<div v-else>{{ coupon[item.name] }}</div> <div v-else>{{ coupon[item.name] }}</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -16,7 +18,8 @@ ...@@ -16,7 +18,8 @@
</div> </div>
<div class="container"> <div class="container">
<div> <div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"> <glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData"></glsx-combi-form>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormDataTwo">
<span slot="footer" class="footer-btns"> <span slot="footer" class="footer-btns">
<el-button :size="size" @click="handleReset">重置</el-button> <el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button> <el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
...@@ -24,50 +27,15 @@ ...@@ -24,50 +27,15 @@
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<!-- <div class="icon-tips icon-green" style="width: 98%;display: inline-block; margin-bottom: 20px;">
<img src="../../images/comment.png" />
<span>优惠券名称:<i>{{coupon.couponName}}</i></span>
<span>发行总量:<i>{{coupon.stock}}</i></span>
<span>领取量:<i>{{coupon.getAmount}}</i></span>
<span>有效期:<i>{{effective}}</i></span>
<span>使用限制:<i>{{useB}}</i></span>
</div> -->
<!-- <div class="list-tips">
<img class="tips-img" src="@/assets/icon-info.png" />
<span>
优惠券名称:
<span class="red-txt">{{ coupon.couponName }}</span>
</span>
<span style="margin-left:10px">
发行总量:
<span class="red-txt">{{ coupon.stock || 0 }}&nbsp;</span>
</span>
<span style="margin-left:10px">
领取量:
<span class="red-txt">{{ coupon.getAmount || 0 }}&nbsp;</span>
</span>
<span style="margin-left:10px">
有效期:
<span class="red-txt">{{ effective }}&nbsp;</span>
</span>
<span style="margin-left:10px">
已过期:
<span class="red-txt">{{ coupon.overdueAmount || 0 }}&nbsp;</span>
</span>
<span style="margin-left:10px">
使用限制:
<span class="red-txt">{{ useB }}&nbsp;</span>
</span>
</div> -->
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title">领取详情列表</span> <span class="table-title">领取详情列表</span>
<el-button :size="size" class="default-blue-btn" type="default" @click="exportExcel">导出</el-button> <el-button :size="size" class="default-blue-btn" type="default" @click="exportExcel">全部导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="receiveList" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable> <GLTable ref="receiveList" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
</div>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }"> <div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button type="primary" :size="size" @click="goback">返回</el-button> <el-button type="primary" :size="size" @click="goback">返回</el-button>
</div> </div>
...@@ -115,11 +83,21 @@ export default { ...@@ -115,11 +83,21 @@ export default {
}, },
{ {
label: '适用范围', label: '适用范围',
name: '' name: 'scopeApplicationTxt'
}, },
{ {
label: '发行库存', label: '发行库存',
name: 'stock' name: 'limitStockFlag',
formatter: () => {
switch (this.coupon.limitStockFlag) {
case 1:
return this.coupon.stock
case 2:
return '无库存限制'
default:
return '-'
}
}
}, },
{ {
label: '已领取', label: '已领取',
...@@ -127,23 +105,24 @@ export default { ...@@ -127,23 +105,24 @@ export default {
}, },
{ {
label: '已使用', label: '已使用',
name: '' name: 'usedAmount'
} }
], ],
// 表格 // 表格
searchForm: { searchForm: {
phone: '', userInfo: '',
wechatUserFlag: '', wechatUserFlag: '',
status: '' userStatus: '',
daterange: ''
}, },
tableSearchForm: {}, tableSearchForm: {},
// 搜索 // 搜索
searchFormData: [ searchFormData: [
{ {
label: '手机号', label: '用户信息',
name: 'phone', name: 'userInfo',
type: 'input', type: 'input',
maxlength: 11 maxlength: 50
}, },
{ {
label: '是否加企微', label: '是否加企微',
...@@ -156,12 +135,21 @@ export default { ...@@ -156,12 +135,21 @@ export default {
}, },
{ {
label: '使用状态', label: '使用状态',
name: 'status', name: 'userStatus',
type: 'select', type: 'select',
optionList: [], optionList: [],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
optionsName: 'statusList' optionsName: 'userStatusList'
}
],
searchFormDataTwo: [
{
label: '领取日期',
name: 'daterange',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
} }
], ],
// 表格 // 表格
...@@ -171,29 +159,28 @@ export default { ...@@ -171,29 +159,28 @@ export default {
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: '手机号', label: '领取用户',
prop: 'phone' prop: 'userName',
}, formatter: cellValue => {
{ return cellValue.userName + ' ' + cellValue.phone
label: '用户昵称', }
prop: 'userName'
}, },
{ {
label: '是否加入企微', label: '是否已加企微',
prop: 'wechatUserFlag', prop: 'wechatUserFlag',
formatter: cellValue => { formatter: cellValue => {
return this.baseData.wechatUserFlagList.find(item => item.statusId == cellValue.wechatUserFlag).statusName return this.baseData.wechatUserFlagList.find(item => item.statusId == cellValue.wechatUserFlag).statusName
} }
}, },
{ {
label: '优惠券状态', label: '使用状态',
prop: 'userStatus', prop: 'userStatus',
formatter: cellValue => { formatter: cellValue => {
return this.baseData.userStatusList.find(item => +item.confId == cellValue.userStatus).confName return this.baseData.userStatusList.find(item => +item.confId == cellValue.userStatus).confName
} }
}, },
{ {
label: '领取时间', label: '领取日期',
prop: 'createdDate', prop: 'createdDate',
formatter: cellValue => { formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
...@@ -204,10 +191,10 @@ export default { ...@@ -204,10 +191,10 @@ export default {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: { baseData: {
userStatusList: [ userStatusList: [
{ // {
confId: '0', // confId: '0',
confName: '未领取' // confName: '未领取'
}, // },
{ {
confId: '1', confId: '1',
confName: '已领取' confName: '已领取'
...@@ -230,16 +217,6 @@ export default { ...@@ -230,16 +217,6 @@ export default {
statusId: '1', statusId: '1',
statusName: '否' statusName: '否'
} }
],
statusList: [
{
confId: '1',
confName: '已使用'
},
{
confId: '2',
confName: '未使用'
}
] ]
}, },
exportLoading: false exportLoading: false
...@@ -248,6 +225,13 @@ export default { ...@@ -248,6 +225,13 @@ export default {
components: {}, components: {},
created() {
if (!this.$isGroupUp) {
let idx = this.couponFormData.findIndex(item => item.label == '适用范围')
this.couponFormData.splice(idx, 1)
}
},
mounted() { mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft this.footerWidth = document.documentElement.clientWidth - this.footerLeft
...@@ -259,6 +243,13 @@ export default { ...@@ -259,6 +243,13 @@ export default {
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
params.couponId = this.$route.params.id params.couponId = this.$route.params.id
if (params.daterange) {
params.receiveTimeBegin = this.searchForm.daterange[0]
params.receiveTimeEnd = this.searchForm.daterange[1]
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
delete params.daterange
return params return params
}, },
beforeSearchFn() { beforeSearchFn() {
...@@ -314,6 +305,13 @@ export default { ...@@ -314,6 +305,13 @@ export default {
this.useB = '有效期内' + coupon.useLimitDays + '天可使用' + coupon.usedAmount + '次' this.useB = '有效期内' + coupon.useLimitDays + '天可使用' + coupon.usedAmount + '次'
} }
} }
// 适用范围
if (this.$isGroupUp) {
this.coupon.scopeApplicationTxt = {
1: '旗下所有店通用',
2: '旗下品牌店通用'
}[coupon.scopeApplication]
}
}) })
}, },
...@@ -368,8 +366,10 @@ export default { ...@@ -368,8 +366,10 @@ export default {
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
phone: '', userInfo: '',
wechatUserFlag: '' wechatUserFlag: '',
userStatus: '',
daterange: ''
} }
this.handleSearch() this.handleSearch()
}, },
......
...@@ -47,6 +47,9 @@ ...@@ -47,6 +47,9 @@
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">全部导出</el-button> <el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">全部导出</el-button>
</div> </div>
<GLTable ref="memberRecordRef" v-if="isReload" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="tableSearchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="memberRecordRef" v-if="isReload" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="tableSearchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<template slot="discountType" slot-scope="scope">
<img :src="require(`@/assets/coupon/icon-${attrToIcon[scope.scope.discountType]}.png`)" />
</template>
<span slot="orderCodeHtml" slot-scope="scope"> <span slot="orderCodeHtml" slot-scope="scope">
<span class="cursor-pointer" @click="couponNameHandleDetail(scope.scope)" v-if="scope.scope.directionalGiftId">{{ scope.scope.directionalGiftName }}</span> <span class="cursor-pointer" @click="couponNameHandleDetail(scope.scope)" v-if="scope.scope.directionalGiftId">{{ scope.scope.directionalGiftName }}</span>
<span class="cursor-pointer" @click="orderCodeHandleDetail(scope.scope)" v-else>{{ scope.scope.orderCode }}</span> <span class="cursor-pointer" @click="orderCodeHandleDetail(scope.scope)" v-else>{{ scope.scope.orderCode }}</span>
...@@ -111,16 +114,16 @@ export default { ...@@ -111,16 +114,16 @@ export default {
searchFormData: [ searchFormData: [
{ {
label: '核销码', label: '核销码',
name: '', name: 'verificationCode',
type: 'input', type: 'input',
labelWidth: 56, labelWidth: 56,
maxlength: 20 maxlength: 50
}, },
{ {
label: '券名称', label: '券名称',
name: 'couponName', name: 'couponName',
type: 'input', type: 'input',
maxlength: 20 maxlength: 50
}, },
{ {
label: '券类型', label: '券类型',
...@@ -178,37 +181,66 @@ export default { ...@@ -178,37 +181,66 @@ export default {
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: '服务名称', label: '核销码',
prop: 'couponName', prop: 'verificationCode',
width: '180' width: 200
// formatter: cellValue => {
// return cellValue.startTime + '-' + cellValue.endTime
// }
}, },
{ {
label: '剩余待核销次数', label: '用户信息',
prop: 'residueAmount', prop: 'userName',
formatter: cellValue => { formatter: cellValue => {
return cellValue.residueAmount || cellValue.residueAmount == 0 ? cellValue.residueAmount : '不限制次数' return cellValue.userName + ' ' + cellValue.phone
} }
}, },
{ {
label: '核销用户', label: '券类型',
prop: 'phone' name: 'discountType',
width: '100',
addHtml: 'discountType'
}, },
{ {
label: '核销员', label: '券名称',
prop: 'verificationOperator' prop: 'couponName',
width: 200,
line: 2
}, },
{ {
label: '关联信息', label: '核销门店',
addHtml: 'orderCodeHtml' prop: 'verificationMerchantName'
},
{
label: '券来源',
prop: ''
}, },
{ {
label: '核销日期', label: '核销日期',
prop: 'verificationTime', prop: 'verificationTime',
addHtml: 'verificationTime' addHtml: 'verificationTime'
} },
// {
// label: '剩余待核销次数',
// prop: 'residueAmount',
// formatter: cellValue => {
// return cellValue.residueAmount || cellValue.residueAmount == 0 ? cellValue.residueAmount : '不限制次数'
// }
// },
// {
// label: '核销用户',
// prop: 'phone'
// },
// {
// label: '核销员',
// prop: 'verificationOperator'
// },
// {
// label: '关联信息',
// addHtml: 'orderCodeHtml'
// },
// {
// label: '核销日期',
// prop: 'verificationTime',
// addHtml: 'verificationTime'
// }
] ]
}, },
merchantId: 0, merchantId: 0,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!