parent
f4249e3d25
commit
f1986f7787
@ -1,206 +1,213 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="项目奖品管理">
|
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="项目奖品管理">
|
||||||
<div slot="content"></div>
|
<div slot="content"></div>
|
||||||
<slot>
|
<slot>
|
||||||
<div class="selects">
|
<div class="selects">
|
||||||
<div style="display: flex;align-items: center;" v-show="!sysInfo">
|
<div style="display: flex;align-items: center;" v-show="!sysInfo">
|
||||||
<span style="padding: 0 6px;word-break: keep-all;">
|
<span style="padding: 0 6px;word-break: keep-all;">
|
||||||
项目
|
项目
|
||||||
</span>
|
</span>
|
||||||
<Select v-model="select.activity_list_id" style="width: 180px;">
|
<Select v-model="select.activity_list_id" style="width: 180px;">
|
||||||
<Option v-for="(item,index) of listActivity" :key="item.id" :value="item.id" :label="item.name">
|
<Option v-for="(item,index) of listActivity" :key="item.id" :value="item.id" :label="item.name">
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span style="padding: 0 6px;word-break: keep-all;">
|
<span style="padding: 0 6px;word-break: keep-all;">
|
||||||
关键字
|
关键字
|
||||||
</span>
|
</span>
|
||||||
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
|
<Input v-model="select.keyword" placeholder="请输入关键字" style="width: 180px"></Input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">重置
|
<Button style="margin-left: 10px" type="primary" @click="select={page:1,keyword:''}">重置
|
||||||
</Button>
|
</Button>
|
||||||
<Button style="margin-left: 10px" type="primary" @click="doSearch">查询</Button>
|
<Button style="margin-left: 10px" type="primary" @click="doSearch">查询</Button>
|
||||||
<Button style="margin-left: 10px" type="primary" @click="add">新增</Button>
|
<Button style="margin-left: 10px" type="primary" @click="add">新增</Button>
|
||||||
</div>
|
</div>
|
||||||
</slot>
|
</slot>
|
||||||
</lx-header>
|
</lx-header>
|
||||||
|
|
||||||
|
|
||||||
<xy-table :list="list" :table-item="table" @pageSizeChange="pageSizeChange" @pageIndexChange="pageChange"
|
<xy-table :list="list" :table-item="table" @pageSizeChange="pageSizeChange" @pageIndexChange="pageChange"
|
||||||
:total="total" @delete="deleteitem"
|
:total="total" @delete="deleteitem"
|
||||||
@editor="(row)=>{$refs['addDrawPrize'].id = row.id;$refs['addDrawPrize'].isShow = true;$refs['addDrawPrize'].type = 'editor'}">
|
@editor="(row)=>{$refs['addDrawPrize'].id = row.id;$refs['addDrawPrize'].isShow = true;$refs['addDrawPrize'].type = 'editor'}">
|
||||||
<template v-slot:btns v-if="type==0 ">
|
<template v-slot:btns v-if="type==0 ">
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:btns v-else>
|
<template v-slot:btns v-else>
|
||||||
<el-table-column fixed="right" header-align="center" label="操作" width="200">
|
<el-table-column fixed="right" header-align="center" label="操作" width="200">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<Poptip :transfer="true" confirm placement="bottom" title="确认要删除吗" @on-ok="deleteitem(row)">
|
<Poptip :transfer="true" confirm placement="bottom" title="确认要删除吗" @on-ok="deleteitem(row)">
|
||||||
<Button ghost size="small" type="error">删除
|
<Button ghost size="small" type="error">删除
|
||||||
</Button>
|
</Button>
|
||||||
</Poptip>
|
</Poptip>
|
||||||
|
|
||||||
<Button style="margin-left: 4px;" size="small" type="primary" ghost
|
<Button style="margin-left: 4px;" size="small" type="primary" ghost
|
||||||
@click="$refs['addDrawPrize'].id = row.id,$refs['addDrawPrize'].isShow = true,$refs['addDrawPrize'].type = 'editor'">编辑
|
@click="$refs['addDrawPrize'].id = row.id,$refs['addDrawPrize'].isShow = true,$refs['addDrawPrize'].type = 'editor'">编辑
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button v-if="row.activity_list_id === 8" style="margin-left: 4px;" size="small" type="primary" ghost
|
<Button v-if="row.activity_list_id === 8 && (row.draw_logs_count < row.total)" style="margin-left: 4px;" size="small" type="primary" ghost
|
||||||
@click="$router.push('/mdLotteryDraw/'+row.id)">抽奖
|
@click="toDraw(1,row)">抽奖
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Button v-if="row.activity_list_id === 8" style="margin-left: 4px;" size="small" type="primary" ghost
|
<Button v-if="row.activity_list_id === 8 && !(row.draw_logs_count < row.total)" style="margin-left: 4px;" size="small" type="primary" ghost
|
||||||
@click="$router.push('/mdLotteryDraw/'+row.id+'?result=1')">中奖结果
|
@click="toDraw(2,row)">中奖结果
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
</xy-table>
|
</xy-table>
|
||||||
<addDrawPrize ref="addDrawPrize" :listActivity="listActivity" @refresh="load()"></addDrawPrize>
|
<addDrawPrize ref="addDrawPrize" :listActivity="listActivity" @refresh="load()"></addDrawPrize>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
index,
|
index,
|
||||||
destroy,
|
destroy,
|
||||||
show
|
show
|
||||||
} from "@/api/activity/drawPrize";
|
} from "@/api/activity/drawPrize";
|
||||||
import {
|
import {
|
||||||
index as activityIndex
|
index as activityIndex
|
||||||
} from "@/api/activity/index";
|
} from "@/api/activity/index";
|
||||||
|
|
||||||
|
|
||||||
import addDrawPrize from '@/views/activity/components/addDrawPrize'
|
import addDrawPrize from '@/views/activity/components/addDrawPrize'
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
addDrawPrize
|
addDrawPrize
|
||||||
},
|
},
|
||||||
data() {
|
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: ""
|
||||||
},
|
},
|
||||||
listActivity: [],
|
listActivity: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
list: [],
|
list: [],
|
||||||
table: [{
|
table: [{
|
||||||
prop: 'activity_list.name',
|
prop: 'activity_list.name',
|
||||||
label: '项目名称',
|
label: '项目名称',
|
||||||
fixed: 'left',
|
fixed: 'left',
|
||||||
align: 'left'
|
align: 'left'
|
||||||
}, {
|
}, {
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '奖品名称',
|
label: '奖品名称',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
prop: 'total',
|
prop: 'total',
|
||||||
label: '总数',
|
label: '总数',
|
||||||
align: 'right'
|
align: 'right'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'rate',
|
prop: 'rate',
|
||||||
label: '概率',
|
label: '概率',
|
||||||
align: 'right'
|
align: 'right'
|
||||||
}, {
|
}, {
|
||||||
prop: 'has_total',
|
prop: 'has_total',
|
||||||
label: '剩余数量',
|
label: '剩余数量',
|
||||||
align: 'right'
|
align: 'right'
|
||||||
}, {
|
}, {
|
||||||
prop: 'sort',
|
prop: 'sort',
|
||||||
label: '排序',
|
label: '排序',
|
||||||
align: 'right'
|
align: 'right'
|
||||||
}, {
|
}, {
|
||||||
prop: 'money',
|
prop: 'money',
|
||||||
label: '金额',
|
label: '金额',
|
||||||
align: 'right'
|
align: 'right'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'created_at',
|
prop: 'created_at',
|
||||||
label: '创建信息',
|
label: '创建信息',
|
||||||
width: 190,
|
width: 190,
|
||||||
formatter: (v1, v2, value) => {
|
formatter: (v1, v2, value) => {
|
||||||
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
return this.$moment(value).format("YYYY-MM-DD HH:mm:ss");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
toDraw (type = 1, row) {
|
||||||
async loadActivity() {
|
if (type === 1) {
|
||||||
const res = await activityIndex({
|
window.open(this.$router.resolve({path: '/mdLotteryDraw/'+row.id}).href,'_blank')
|
||||||
page: 1,
|
} else {
|
||||||
page_size: 999
|
window.open(this.$router.resolve({path: '/mdLotteryDraw/'+row.id+'?result=1'}).href,'_blank')
|
||||||
})
|
}
|
||||||
this.listActivity = res.data;
|
},
|
||||||
},
|
|
||||||
doSearch() {
|
async loadActivity() {
|
||||||
this.select.page = 1;
|
const res = await activityIndex({
|
||||||
this.load();
|
page: 1,
|
||||||
},
|
page_size: 999
|
||||||
add() {
|
})
|
||||||
this.$refs['addDrawPrize'].isShow = true
|
this.listActivity = res.data;
|
||||||
},
|
},
|
||||||
pageSizeChange(e) {
|
doSearch() {
|
||||||
this.select.page_size = e;
|
this.select.page = 1;
|
||||||
this.select.page = 1;
|
this.load();
|
||||||
this.load();
|
},
|
||||||
},
|
add() {
|
||||||
async load() {
|
this.$refs['addDrawPrize'].isShow = true
|
||||||
const res = await index(this.select)
|
},
|
||||||
this.total = res.total
|
pageSizeChange(e) {
|
||||||
this.list = res.data
|
this.select.page_size = e;
|
||||||
},
|
this.select.page = 1;
|
||||||
deleteitem(row) {
|
this.load();
|
||||||
destroy({
|
},
|
||||||
id: row.id
|
async load() {
|
||||||
}).then(res => {
|
const res = await index(this.select)
|
||||||
this.load();
|
this.total = res.total
|
||||||
this.$Message.success("操作成功");
|
this.list = res.data
|
||||||
})
|
},
|
||||||
},
|
deleteitem(row) {
|
||||||
pageChange(e) {
|
destroy({
|
||||||
this.select.page = e
|
id: row.id
|
||||||
this.load()
|
}).then(res => {
|
||||||
},
|
this.load();
|
||||||
},
|
this.$Message.success("操作成功");
|
||||||
mounted() {
|
})
|
||||||
this.load();
|
},
|
||||||
this.loadActivity()
|
pageChange(e) {
|
||||||
},
|
this.select.page = e
|
||||||
created() {
|
this.load()
|
||||||
let type = parseInt(this.$route.path.split("_")[1]);
|
},
|
||||||
this.type = this.select.is_auth = type;
|
},
|
||||||
|
mounted() {
|
||||||
let that = this;
|
this.load();
|
||||||
let sysInfo = sessionStorage.getItem('sys_info');
|
this.loadActivity()
|
||||||
console.log(sysInfo)
|
},
|
||||||
if (sysInfo && sysInfo != "") {
|
created() {
|
||||||
let _sys = JSON.parse(sysInfo);
|
let type = parseInt(this.$route.path.split("_")[1]);
|
||||||
that.select.activity_list_id = _sys.id;
|
this.type = this.select.is_auth = type;
|
||||||
that.sysInfo = _sys;
|
|
||||||
}
|
let that = this;
|
||||||
}
|
let sysInfo = sessionStorage.getItem('sys_info');
|
||||||
}
|
console.log(sysInfo)
|
||||||
</script>
|
if (sysInfo && sysInfo != "") {
|
||||||
|
let _sys = JSON.parse(sysInfo);
|
||||||
<style lang="scss" scoped>
|
that.select.activity_list_id = _sys.id;
|
||||||
.selects {
|
that.sysInfo = _sys;
|
||||||
display: flex;
|
}
|
||||||
flex-wrap: wrap;
|
}
|
||||||
|
}
|
||||||
&>div {
|
</script>
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
<style lang="scss" scoped>
|
||||||
}
|
.selects {
|
||||||
</style>
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
&>div {
|
||||||
|
margin-bottom: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
Loading…
Reference in new issue