Commit c59eefa7 by 李伟康

提交

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