Commit c59eefa7 by 李伟康

提交

1 parent 78ece7a6
......@@ -79,5 +79,25 @@ export default {
data: params
})
},
/**
* 导出群接龙中奖明细列表
*/
exportSolitaireAewardList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.record.export'
return http({
url,
data: params
})
},
/**
* 导出查询接龙明细列表
*/
exportSolitaireUserList (params) {
params.method = 'marketing.api.activityRedEnvelope.relay.lottery.record.all.export'
return http({
url,
data: params
})
},
}
\ No newline at end of file
......@@ -204,13 +204,19 @@ export default {
}]
})
let description = decodeURIComponent(data.description),
endTimeType = 0
endTimeType = 0,
numWin = data.numWin,
endTime = data.endTime
this.$refs.formRef.$refs.descriptionTextBox[0].setEdit(description)
if (data.endTime) endTimeType = 1
if (endTime) {
if (endTime != data.lotteryTime) endTimeType = 1
endTime = dayjs(endTime).format('YYYY/MM/DD HH:mm:ss')
}
if (data.numType == 1) numWin = 0
this.configForm = {
description,
merchantId: data.merchantId,
gameplayType: data.gameplayType,
gameplayType: data.gameplayType || 1,
title: data.title,
cover: data.cover,
numLimit: data.numLimit,
......@@ -218,7 +224,9 @@ export default {
lotteryTime: dayjs(data.lotteryTime).format('YYYY/MM/DD HH:mm:ss'),
groupLimitOpen: data.groupLimitOpen,
rewardType: data.rewardType,
rewardId: data.rewardId
rewardId: data.rewardId,
numWin,
endTime
}
this.$refs.prizeRef.rewardType = data.rewardType
this.$refs.prizeRef.init()
......
......@@ -173,6 +173,7 @@ export const rule = that => {
endTimeType: [{
required,
validator: (rule, value, callback) => {
if(that.disabled) callback()
try {
if (value == 1) {
if (!that.configForm.endTime) throw '请选择接龙结束时间'
......@@ -190,6 +191,7 @@ export const rule = that => {
required, trigger,
validator: (rule, value, callback) => {
try {
if(that.disabled) callback()
if (!value) throw '请选择接龙开奖时间'
else {
const valueTimestamp = dayjs(value).valueOf()
......
......@@ -43,21 +43,21 @@
<GLTable
ref="listRef"
:getListApi="getListApi"
:searchForm="searchForm"
:searchForm="tableSearchForm"
:noDataImg="url"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
>
<template
slot="status"
slot="claimState"
slot-scope="scope"
>
<div :class="`status status-${scope.scope.status}`">
<div :class="`status status-${scope.scope.claimState}`">
{{{
'0':'未领取',
'1':'已领取'
}[scope.scope.status]}}
}[scope.scope.claimState]}}
</div>
</template>
</GLTable>
......@@ -74,88 +74,101 @@ import * as dayjs from 'dayjs'
const solitaireTableColumns = [
{
label: '手机号码',
prop: 'name',
prop: 'phone',
minWidth: 120
},
{
label: '用户名称',
prop: 'cardTitle',
prop: 'name',
minWidth: 100
},
{
label: '接龙数字',
prop: 'cardTitle',
prop: 'relayContent',
minWidth: 100
},
{
label: '接龙时间',
prop: 'cardTitle',
minWidth: 100
minWidth: 100,
formatter (cell) {
return dayjs(cell.relayTime).format('YYYY/MM/DD HH:mm:ss')
}
},
], winningTableColumns = [
{
label: '手机号码',
prop: 'name',
prop: 'phone',
minWidth: 120
},
{
label: '用户名称',
prop: 'cardTitle',
prop: 'name',
minWidth: 100
},
{
label: '接龙数字',
prop: 'cardTitle',
prop: 'relayContent',
minWidth: 100
},
{
label: '接龙时间',
prop: 'cardTitle',
minWidth: 100
minWidth: 100,
formatter (cell) {
return dayjs(cell.relayTime).format('YYYY/MM/DD HH:mm:ss')
}
},
{
label: '状态',
minWidth: 100,
addHtml: 'status'
addHtml: 'claimState'
},
]
export default {
name: 'Questionnaire',
name: 'detail',
data () {
return {
url,
data: {},
tableSearchForm: {},
fixedForm: [
{
label: '卡片标题',
key: ''
key: 'title'
},
{
label: '创建时间',
formatter (cell) {
return cell
return dayjs(cell.createdTime).format('YYYY/MM/DD HH:mm:ss')
}
},
{
label: '开奖时间',
formatter (cell) {
return cell
return dayjs(cell.lotteryTime).format('YYYY/MM/DD HH:mm:ss')
}
},
{
label: '中奖数字',
key: ''
formatter (cell) {
return cell.numType == 1 ? `随机(${cell.numWin || '--'})` : cell.numWin || '--'
}
},
{
label: '关联奖品',
key: ''
formatter: cell => {
return `${{
1: '红包活动',
2: '优惠券',
3: '权益卡券'
}[cell.rewardType]}-${cell.rewardName}`
}
},
{
label: '所属渠道',
key: ''
key: 'merchantName'
},
],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'count' },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchForm: {
phone: '',
name: '',
......@@ -196,9 +209,20 @@ export default {
}
},
mounted () {
console.log(this.$route)
this.getSolitaireDetail()
},
methods: {
async getSolitaireDetail () {
try {
const { relayLotteryId } = this.$route.query,
data = await this.$apis.solitaire.getSolitaireDetail({ relayLotteryId })
this.data = data
this.$loading().close()
} catch (error) {
this.$loading().close()
}
},
getParams () {
let params = JSON.parse(JSON.stringify(this.searchForm))
if (params.activityTime) {
......@@ -212,7 +236,7 @@ export default {
},
beforeSearchFn () {
return new Promise(resolve => {
this.searchForm = this.getParams()
this.tableSearchForm = this.getParams()
resolve()
})
},
......@@ -224,7 +248,8 @@ export default {
this.handleSearch()
},
handleExport () {
this.$apis.questionnaire.exportQuestionnaireList({ ...this.searchForm, ...this.$refs.listRef.page }).then(res => {
const target = this.$route.query.type ? 'exportSolitaireAewardList' : 'exportSolitaireUserList'
this.$apis.solitaire[target]({ ...this.getParams(), ...this.$refs.listRef.page }).then(res => {
exportFn(res)
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!