日任务中心-活动奖励配置,奖励发放记录新增相关内容
This commit is contained in:
@@ -63,4 +63,13 @@ export const getAwardRecordList = query => {
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 导出
|
||||
export const exportActivityAwardRecord = query => {
|
||||
return request({
|
||||
url: `/activityH5AwardRecord/export`,
|
||||
method: 'post',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
};
|
@@ -27,6 +27,11 @@
|
||||
<el-table-column prop="level" align="center" label="等级" />
|
||||
<el-table-column prop="partitionDesc" align="center" label="分区" />
|
||||
<el-table-column prop="awardTypeName" align="center" label="奖励类型" />
|
||||
<el-table-column prop="awardStatus" align="center" label="奖励状态" >
|
||||
<template v-slot="scope">
|
||||
{{ scope.row.awardStatus === 1 ? '有效' : '无效' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="awardId" align="center" label="奖励ID" />
|
||||
<el-table-column prop="awardPic" align="center" label="奖励样式">
|
||||
<template v-slot="scope">
|
||||
@@ -81,6 +86,19 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label">奖励状态</span>
|
||||
<el-select v-model="addFormData.awardStatus" placeholder="请选择">
|
||||
<el-option label="有效" :value="1"></el-option>
|
||||
<el-option label="无效" :value="2"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px" v-if="addFormData.type == 20">
|
||||
<span style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label">兑换积分</span>
|
||||
<el-input v-model="addFormData.referenceValue" style="width: 50%" class="input"></el-input>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label">奖励ID</span>
|
||||
@@ -126,8 +144,9 @@ export default {
|
||||
awardType: '',
|
||||
awardId: '',
|
||||
awardNum: '',
|
||||
level: ''
|
||||
|
||||
level: '',
|
||||
awardStatus:'',
|
||||
referenceValue:undefined
|
||||
})
|
||||
const tableData = reactive({
|
||||
data: [],
|
||||
@@ -162,7 +181,9 @@ export default {
|
||||
awardId: '',
|
||||
awardNum: '',
|
||||
level: '',
|
||||
id:null
|
||||
id:null,
|
||||
awardStatus:'',
|
||||
referenceValue:undefined
|
||||
});
|
||||
}
|
||||
// 新增
|
||||
|
@@ -15,14 +15,24 @@
|
||||
<span>分区</span>
|
||||
<partition-select v-model:partition-id="formData.partitionId" @update:partitionId="changeLevel" />
|
||||
</div>
|
||||
<div class="inquire" v-if="levelList.length > 0 && formData.type !=''">
|
||||
<div class="inquire">
|
||||
<div class="block">
|
||||
<span class="demonstration">日期</span>
|
||||
<el-date-picker v-model="dateTime" type="datetimerange" range-separator="至"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inquire" v-if="levelList.length > 0 && formData.type != ''">
|
||||
<span>等级</span>
|
||||
<el-select v-model="formData.level" placeholder="请选择">
|
||||
<el-option v-for="item in levelList" :key="item.level" :label="item.level + '('+item.name + ')'" :value="item.level">
|
||||
<el-option v-for="item in levelList" :key="item.level" :label="item.level + '(' + item.name + ')'"
|
||||
:value="item.level">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<el-button class="primary" type="primary" @click="getData()">查询</el-button>
|
||||
<el-button class="primary" type="primary" @click="confirmExport2Excel()">导出</el-button>
|
||||
<!-- 表格数据 -->
|
||||
<el-table v-loading="tableData.loading" :data="tableData.data" ref="multipleTable"
|
||||
@selection-change="handleSelectionChange" border style="width: 100%; margin-top: 25px">
|
||||
@@ -39,14 +49,15 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="awardNum" align="center" label="奖励数量&天数" />
|
||||
<el-table-column prop="createTime" align="center" label="发放时间" >
|
||||
<el-table-column prop="referenceValue" align="center" label="消耗积分" />
|
||||
<el-table-column prop="createTime" align="center" label="发放时间">
|
||||
<template v-slot="scope">
|
||||
{{dateFormat(scope.row.createTime)}}
|
||||
{{ dateFormat(scope.row.createTime) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="rewardStatus" align="center" label="发放状态" >
|
||||
<el-table-column prop="rewardStatus" align="center" label="发放状态">
|
||||
<template v-slot="scope">
|
||||
{{scope.row.rewardStatus == 1 ? '成功' : '失败'}}
|
||||
{{ scope.row.rewardStatus == 1 ? '成功' : '失败' }}
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -62,8 +73,11 @@
|
||||
<script>
|
||||
import { ref, onMounted, reactive } from 'vue'
|
||||
import PartitionSelect from "@/views/common/partitionSelect.vue";
|
||||
import { getActivitylList, getLevelList,getAwardRecordList} from "@/api/SsGuild/rewardConfiguration.js";
|
||||
import { getActivitylList, getLevelList, getAwardRecordList ,exportActivityAwardRecord} from "@/api/SsGuild/rewardConfiguration.js";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
import { formatDate } from "@/utils/relDate";
|
||||
|
||||
export default {
|
||||
name: 'rewardDistributionRecord',
|
||||
components: {
|
||||
@@ -75,9 +89,12 @@ export default {
|
||||
erbanNo: '',
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
level:'',
|
||||
type:''
|
||||
level: '',
|
||||
type: '',
|
||||
startTime:'',
|
||||
endTime:''
|
||||
})
|
||||
const dateTime = ref([])
|
||||
const tableData = reactive({
|
||||
data: [],
|
||||
total: 0,
|
||||
@@ -86,12 +103,12 @@ export default {
|
||||
const activitylList = ref([])
|
||||
const levelList = ref([])
|
||||
const changeLevel = (e) => {
|
||||
if(e){
|
||||
if (e) {
|
||||
formData.partitionId = e;
|
||||
}
|
||||
levelList.value = []
|
||||
formData.level = ''
|
||||
const { type ,partitionId} = formData
|
||||
const { type, partitionId } = formData
|
||||
getLevelList({ partitionId, type }).then(res => {
|
||||
if (res.code == 200) {
|
||||
levelList.value = res.data
|
||||
@@ -100,7 +117,16 @@ export default {
|
||||
}
|
||||
const getData = () => {
|
||||
tableData.loading = true
|
||||
getAwardRecordList(formData).then(res=>{
|
||||
let time = dateTime.value;
|
||||
if (time && time.length > 0) {
|
||||
formData.startTime = dateFormat(time[0], "yyyy-MM-dd hh:mm:ss");
|
||||
formData.endTime = dateFormat(time[1], "yyyy-MM-dd hh:mm:ss");
|
||||
}else{
|
||||
formData.startTime ='';
|
||||
formData.endTime ='';
|
||||
}
|
||||
|
||||
getAwardRecordList(formData).then(res => {
|
||||
if (res.code == 200) {
|
||||
tableData.data = res.data.records
|
||||
tableData.total = res.data.total
|
||||
@@ -111,9 +137,37 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
// 导出
|
||||
const confirmExport2Excel = async () => {
|
||||
// Object.assign(formData, { pageSize: 10000, pageNo: 1 });
|
||||
try {
|
||||
const res = await exportActivityAwardRecord(formData)
|
||||
if (res) {
|
||||
ElMessage({
|
||||
message: '导出成功',
|
||||
type: 'success',
|
||||
});
|
||||
let time = formatDate(new Date());
|
||||
let alink = document.createElement("a");
|
||||
alink.download = `奖励发放记录${time}.xls`;
|
||||
alink.style.display = "none";
|
||||
const blob = new Blob([res]);
|
||||
alink.href = URL.createObjectURL(blob);
|
||||
document.body.appendChild(alink);
|
||||
alink.click();
|
||||
URL.revokeObjectURL(alink.href);
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
ElMessage({
|
||||
message: error.message,
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
}
|
||||
const dateFormat = (row) => {
|
||||
const date = new Date(row);
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
return date.format("yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
const handleSizeChange = (val) => {
|
||||
formData.pageSize = val;
|
||||
@@ -139,7 +193,9 @@ export default {
|
||||
changeLevel,
|
||||
dateFormat,
|
||||
handleSizeChange,
|
||||
handleCurrentChange
|
||||
handleCurrentChange,
|
||||
dateTime,
|
||||
confirmExport2Excel
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user