master
commit
feb70a9b06
@ -1,209 +1,240 @@
|
|||||||
<template>
|
|
||||||
<div>
|
<template>
|
||||||
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="项目抽奖日志">
|
<div>
|
||||||
<div slot="content"></div>
|
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="项目抽奖日志">
|
||||||
<slot>
|
<div slot="content"></div>
|
||||||
<div class="selects">
|
<slot>
|
||||||
<div style="display: flex;align-items: center;" v-show="!sysInfo">
|
<div class="selects">
|
||||||
<span style="padding: 0 6px;word-break: keep-all;">
|
<div style="display: flex;align-items: center;" v-show="!sysInfo">
|
||||||
项目
|
<span style="padding: 0 6px;word-break: keep-all;">
|
||||||
</span>
|
项目
|
||||||
<Select v-model="select.activity_list_id" style="width: 180px;">
|
</span>
|
||||||
<Option v-for="(item,index) of listActivity" :key="item.id" :value="item.id" :label="item.name">
|
<Select v-model="select.activity_list_id" style="width: 180px;">
|
||||||
</Option>
|
<Option v-for="(item,index) of listActivity" :key="item.id" :value="item.id" :label="item.name">
|
||||||
</Select>
|
</Option>
|
||||||
</div>
|
</Select>
|
||||||
<div>
|
</div>
|
||||||
<span style="padding: 0 6px;word-break: keep-all;">
|
<div>
|
||||||
关键字
|
<span style="padding: 0 6px;word-break: keep-all;">
|
||||||
</span>
|
关键字
|
||||||
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
|
</span>
|
||||||
</div>
|
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
|
||||||
|
</div>
|
||||||
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">重置
|
|
||||||
</Button>
|
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">重置
|
||||||
<Button style="margin-left: 10px" type="primary" @click="doSearch">查询</Button>
|
</Button>
|
||||||
<Button style="margin-left: 10px" type="error" @click="doExcel">导出</Button>
|
<Button style="margin-left: 10px" type="primary" @click="doSearch">查询</Button>
|
||||||
<Button style="margin-left: 10px" type="primary" @click="doGet">设置已领取</Button>
|
<Button style="margin-left: 10px" type="error" @click="doExcel">导出</Button>
|
||||||
<Button style="margin-left: 10px" type="warning" @click="doNoGet">设置未领取</Button>
|
<Button style="margin-left: 10px" type="primary" @click="doGet">设置已领取</Button>
|
||||||
</div>
|
<Button style="margin-left: 10px" type="warning" @click="doNoGet">设置未领取</Button>
|
||||||
</slot>
|
<Button style="margin-left: 10px" type="warning" ghost @click="del">批量删除</Button>
|
||||||
</lx-header>
|
</div>
|
||||||
|
</slot>
|
||||||
|
</lx-header>
|
||||||
<xy-table :list="list" :table-item="table" @pageSizeChange="pageSizeChange" @pageIndexChange="pageChange"
|
|
||||||
:total="total" @delete="deleteitem" @selectAllClick="handleSelectionChange">>
|
|
||||||
<template v-slot:btns>
|
<xy-table ref="table" :list="list" :table-item="table" @pageSizeChange="pageSizeChange" @pageIndexChange="pageChange"
|
||||||
|
:total="total" @delete="deleteitem" @selectAllClick="handleSelectionChange">>
|
||||||
</template>
|
<template v-slot:btns>
|
||||||
</xy-table>
|
|
||||||
</div>
|
</template>
|
||||||
</template>
|
</xy-table>
|
||||||
|
</div>
|
||||||
<script>
|
</template>
|
||||||
import {
|
|
||||||
drawLog,
|
<script>
|
||||||
destroyDrawLog
|
import {
|
||||||
} from "@/api/activity/drawPrize";
|
drawLog,
|
||||||
import {
|
destroyDrawLog
|
||||||
index as activityIndex
|
} from "@/api/activity/drawPrize";
|
||||||
} from "@/api/activity/index";
|
import {
|
||||||
import {
|
index as activityIndex
|
||||||
download
|
} from "@/api/activity/index";
|
||||||
} from '@/utils/downloadRequest'
|
import {
|
||||||
export default {
|
download
|
||||||
data() {
|
} from '@/utils/downloadRequest'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
return {
|
return {
|
||||||
sysInfo:null,
|
sysInfo:null,
|
||||||
select: {
|
select: {
|
||||||
page: 1,
|
page: 1,
|
||||||
page_size: 20,
|
page_size: 20,
|
||||||
keyword: '',
|
keyword: '',
|
||||||
activity_list_id: "",
|
activity_list_id: "",
|
||||||
ids: []
|
ids: []
|
||||||
},
|
},
|
||||||
listActivity: [],
|
listActivity: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
list: [],
|
list: [],
|
||||||
table: [{
|
table: [{
|
||||||
width: 36,
|
width: 36,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
type: 'selection',
|
type: 'selection',
|
||||||
fixed: "left"
|
fixed: "left",
|
||||||
},
|
reserveSelection: true
|
||||||
{
|
},
|
||||||
prop: 'activity_list.name',
|
{
|
||||||
label: '项目名称',
|
prop: 'activity_list.name',
|
||||||
fixed: 'left',
|
label: '项目名称',
|
||||||
align: 'left'
|
fixed: 'left',
|
||||||
},
|
align: 'left'
|
||||||
{
|
},
|
||||||
prop: 'mobile',
|
{
|
||||||
label: '手机号',
|
prop: 'mobile',
|
||||||
align: 'center',
|
label: '手机号',
|
||||||
width: "120px"
|
align: 'center',
|
||||||
},
|
width: "120px"
|
||||||
{
|
},
|
||||||
prop: 'user.name',
|
{
|
||||||
label: '用户名称',
|
prop: 'user.name',
|
||||||
align: 'center',
|
label: '用户名称',
|
||||||
width: "120px"
|
align: 'center',
|
||||||
}, {
|
width: "120px"
|
||||||
prop: 'user.username',
|
}, {
|
||||||
label: '登录名',
|
prop: 'user.username',
|
||||||
align: 'center',
|
label: '登录名',
|
||||||
width: "120px"
|
align: 'center',
|
||||||
}, {
|
width: "120px"
|
||||||
prop: 'draw_prize.name',
|
}, {
|
||||||
label: '中奖信息',
|
prop: 'draw_prize.name',
|
||||||
align: 'center',
|
label: '中奖信息',
|
||||||
width: "200px"
|
align: 'center',
|
||||||
}, {
|
width: "200px"
|
||||||
prop: 'is_send',
|
}, {
|
||||||
label: '是否领奖',
|
prop: 'is_send',
|
||||||
align: 'center',
|
label: '是否领奖',
|
||||||
width: "120px",
|
align: 'center',
|
||||||
formatter: (v1, v2, value) => {
|
width: "120px",
|
||||||
return value == 1 ? "已领取" : "未领取";
|
formatter: (v1, v2, value) => {
|
||||||
}
|
return value == 1 ? "已领取" : "未领取";
|
||||||
},
|
}
|
||||||
|
},
|
||||||
{
|
|
||||||
prop: 'created_at',
|
{
|
||||||
label: '抽奖时间',
|
prop: 'created_at',
|
||||||
width: 190,
|
label: '抽奖时间',
|
||||||
formatter: (v1, v2, value) => {
|
width: 190,
|
||||||
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
formatter: (v1, v2, value) => {
|
||||||
}
|
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
||||||
}
|
}
|
||||||
],
|
}
|
||||||
}
|
],
|
||||||
},
|
}
|
||||||
methods: {
|
},
|
||||||
doGet() {
|
methods: {
|
||||||
|
del () {
|
||||||
},
|
let that = this
|
||||||
doNoGet() {
|
this.$confirm("确认删除吗?",{
|
||||||
|
beforeClose(action,instance,done){
|
||||||
},
|
if (action === 'confirm') {
|
||||||
//选择列表
|
instance.confirmButtonLoading = true;
|
||||||
handleSelectionChange(val) {
|
instance.confirmButtonText = '删除中..';
|
||||||
|
|
||||||
this.select.ids = val
|
instance.confirmButtonLoading = false;
|
||||||
|
let option = {}
|
||||||
},
|
that.$refs['table'].getSelection().forEach((i,index) => {
|
||||||
|
option[`id[${index}]`] = i.id
|
||||||
|
})
|
||||||
doExcel() {
|
destroyDrawLog(option).then(res => {
|
||||||
download(
|
done()
|
||||||
'/api/admin/draw-prize/draw-log',
|
})
|
||||||
'get', {
|
} else {
|
||||||
is_export: 1,
|
done()
|
||||||
...this.select
|
}
|
||||||
},
|
}
|
||||||
'中奖列表.xlsx')
|
}).then(res => {
|
||||||
},
|
this.$message({
|
||||||
async loadActivity() {
|
type: 'success',
|
||||||
const res = await activityIndex({
|
message: '删除成功'
|
||||||
page: 1,
|
})
|
||||||
page_size: 999
|
this.load()
|
||||||
})
|
})
|
||||||
this.listActivity = res.data;
|
},
|
||||||
},
|
doGet() {
|
||||||
doSearch() {
|
|
||||||
this.select.page = 1;
|
},
|
||||||
this.load();
|
doNoGet() {
|
||||||
},
|
|
||||||
add() {
|
},
|
||||||
this.$refs['addActivityUser'].isShow = true
|
//选择列表
|
||||||
},
|
handleSelectionChange(val) {
|
||||||
pageSizeChange(e) {
|
|
||||||
this.select.page_size = e;
|
this.select.ids = val
|
||||||
this.select.page = 1;
|
|
||||||
this.load();
|
},
|
||||||
},
|
|
||||||
async load() {
|
|
||||||
const res = await drawLog(this.select)
|
doExcel() {
|
||||||
this.total = res.total
|
download(
|
||||||
this.list = res.data
|
'/api/admin/draw-prize/draw-log',
|
||||||
},
|
'get', {
|
||||||
deleteitem(row) {
|
is_export: 1,
|
||||||
destroyDrawLog({
|
...this.select
|
||||||
id: row.id
|
},
|
||||||
}).then(res => {
|
'中奖列表.xlsx')
|
||||||
this.load();
|
},
|
||||||
this.$Message.success("操作成功");
|
async loadActivity() {
|
||||||
})
|
const res = await activityIndex({
|
||||||
},
|
page: 1,
|
||||||
pageChange(e) {
|
page_size: 999
|
||||||
this.select.page = e
|
})
|
||||||
this.load()
|
this.listActivity = res.data;
|
||||||
},
|
},
|
||||||
},
|
doSearch() {
|
||||||
mounted() {
|
this.select.page = 1;
|
||||||
this.load();
|
this.load();
|
||||||
this.loadActivity()
|
},
|
||||||
},
|
add() {
|
||||||
created() {
|
this.$refs['addActivityUser'].isShow = true
|
||||||
let type = parseInt(this.$route.path.split("_")[1]);
|
},
|
||||||
|
pageSizeChange(e) {
|
||||||
|
this.select.page_size = e;
|
||||||
|
this.select.page = 1;
|
||||||
|
this.load();
|
||||||
|
},
|
||||||
|
async load() {
|
||||||
|
const res = await drawLog(this.select)
|
||||||
|
this.total = res.total
|
||||||
|
this.list = res.data
|
||||||
|
},
|
||||||
|
deleteitem(row) {
|
||||||
|
destroyDrawLog({
|
||||||
|
id: row.id
|
||||||
|
}).then(res => {
|
||||||
|
this.load();
|
||||||
|
this.$Message.success("操作成功");
|
||||||
|
})
|
||||||
|
},
|
||||||
|
pageChange(e) {
|
||||||
|
this.select.page = e
|
||||||
|
this.load()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.load();
|
||||||
|
this.loadActivity()
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
let type = parseInt(this.$route.path.split("_")[1]);
|
||||||
this.type = this.select.is_auth = type;
|
this.type = this.select.is_auth = type;
|
||||||
let sysInfo = sessionStorage.getItem('sys_info')
|
let sysInfo = sessionStorage.getItem('sys_info')
|
||||||
if (sysInfo && sysInfo != "") {
|
if (sysInfo && sysInfo != "") {
|
||||||
let _sys = JSON.parse(sysInfo);
|
let _sys = JSON.parse(sysInfo);
|
||||||
that.select.activity_list_id = _sys.id;
|
that.select.activity_list_id = _sys.id;
|
||||||
that.sysInfo=_sys;
|
that.sysInfo=_sys;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.selects {
|
.selects {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
&>div {
|
&>div {
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in new issue