|
@@ -3,11 +3,13 @@
|
|
|
|
|
|
<!-- 查询和其他操作 -->
|
|
|
<div class="filter-container">
|
|
|
- <el-select @change="changepoolId" v-model="listQuery.poolId" placeholder="奖池" class="filter-item" style="width: 200px">
|
|
|
+ <el-select @change="changepoolId" v-model="listQuery.poolId" placeholder="奖池" class="filter-item"
|
|
|
+ style="width: 200px">
|
|
|
<el-option :key="item.id" v-for="item in dictNameList" :label="item.title" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">查找</el-button>
|
|
|
+ <el-button class="filter-item" type="primary" v-waves icon="el-icon-search"
|
|
|
+ @click="handleFilter">查找</el-button>
|
|
|
<el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-edit">添加</el-button>
|
|
|
<!-- <el-button class="filter-item" type="warning" icon="el-icon-delete" @click="delAll">批量删除</el-button> -->
|
|
|
|
|
@@ -35,12 +37,18 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" min-width="100px" label="剩余数量" prop="prizeStock">
|
|
|
</el-table-column>
|
|
|
+ <el-table-column align="center" min-width="100px" label="是否大奖">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.isGrandPrize == '0'">否</span>
|
|
|
+ <span v-if="scope.row.isGrandPrize == '1'">是</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align="center" min-width="100px" label="状态">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.status == '0'">关闭</span>
|
|
|
- <span v-else>开启</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if="scope.row.status == '0'">关闭</span>
|
|
|
+ <span v-else>开启</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" size="small" @click="handleUpdate(scope.row, false)">编辑</el-button>
|
|
@@ -59,63 +67,72 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 添加或修改对话框 -->
|
|
|
- <el-dialog
|
|
|
- :close-on-click-modal="false"
|
|
|
- :title="textMap[dialogStatus]"
|
|
|
- :visible.sync="dialogFormVisible"
|
|
|
- width="40%"
|
|
|
- >
|
|
|
- <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="80px" style='width: 700px; margin-left:50px;'>
|
|
|
- <el-form-item label="奖品类型" prop="prizeType">
|
|
|
- <el-select :disabled="dialogStatus == 'update'?true:false" v-model="dataForm.prizeType" clearable placeholder="请选择类型" class="filter-item" style="width: 300px" @change="clickPrizeType">
|
|
|
- <el-option :key="item.dictValue" v-for="item in dataTypeList" :label="item.dictLabel" :value="item.dictValue">
|
|
|
+ <el-dialog :close-on-click-modal="false" :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible"
|
|
|
+ width="40%">
|
|
|
+ <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left"
|
|
|
+ label-width="80px" style='width: 700px; margin-left:50px;'>
|
|
|
+ <el-form-item label="奖品类型" prop="prizeType">
|
|
|
+ <el-select :disabled="dialogStatus == 'update' ? true : false" v-model="dataForm.prizeType" clearable
|
|
|
+ placeholder="请选择类型" class="filter-item" style="width: 300px" @change="clickPrizeType">
|
|
|
+ <el-option :key="item.dictValue" v-for="item in dataTypeList" :label="item.dictLabel"
|
|
|
+ :value="item.dictValue">
|
|
|
</el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="奖品名称" prop="prizeName">
|
|
|
- <el-input style="width: 300px" v-model="dataForm.prizeName"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-if="dataForm.prizeType=='10'" label="兑换券" prop="couponId">
|
|
|
- <el-select v-model="dataForm.couponId" clearable placeholder="请选择兑换券" class="filter-item" style="width: 300px">
|
|
|
- <el-option :key="item.id" v-for="item in couponsList" :label="item.couponName" :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item style="width: 800px" label="商品图片" prop="imgUrl">
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="奖品名称" prop="prizeName">
|
|
|
+ <el-input style="width: 300px" v-model="dataForm.prizeName"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="dataForm.prizeType == '10'" label="兑换券" prop="couponId">
|
|
|
+ <el-select v-model="dataForm.couponId" clearable placeholder="请选择兑换券" class="filter-item"
|
|
|
+ style="width: 300px">
|
|
|
+ <el-option :key="item.id" v-for="item in couponsList" :label="item.couponName" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item style="width: 800px" label="商品图片" prop="imgUrl">
|
|
|
<el-upload :limit="1" :action="fileImgUrl" list-type="picture-card" :file-list="dataForm.images"
|
|
|
- :on-success="handleGallerySucess" :on-exceed="handleExceed" :before-upload="uploadBannerImg"
|
|
|
- :on-remove="handleRemove">
|
|
|
- <i class="el-icon-plus"></i>
|
|
|
- </el-upload>
|
|
|
+ :on-success="handleGallerySucess" :on-exceed="handleExceed" :before-upload="uploadBannerImg"
|
|
|
+ :on-remove="handleRemove">
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
+ </el-upload>
|
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="dataForm.prizeType=='20'" label="奖励积分" prop="integral">
|
|
|
- <el-input-number style="width: 300px" :precision="0" :step="1" v-model="dataForm.integral"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="奖品权重" prop="prizeWeight">
|
|
|
- <el-input-number style="width: 300px" :precision="0" :step="1" v-model="dataForm.prizeWeight"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="奖品数量" prop="prizeActualStock">
|
|
|
- <el-input-number style="width: 300px" :precision="0" :step="1" v-model="dataForm.prizeActualStock"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态">
|
|
|
- <el-radio-group v-model="dataForm.status">
|
|
|
- <el-radio :label="'0'">关闭</el-radio>
|
|
|
- <el-radio :label="'1'">开启</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
-
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
- <el-button v-if="dialogStatus == 'create'" type="primary" @click="createData">确定</el-button>
|
|
|
- <el-button v-else type="primary" @click="updateData">确定</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
+ <el-form-item v-if="dataForm.prizeType == '20'" label="奖励积分" prop="integral">
|
|
|
+ <el-input-number style="width: 300px" :precision="0" :step="1"
|
|
|
+ v-model="dataForm.integral"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="奖品权重" prop="prizeWeight">
|
|
|
+ <el-input-number style="width: 300px" :precision="0" :step="1"
|
|
|
+ v-model="dataForm.prizeWeight"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="奖品数量" prop="prizeActualStock">
|
|
|
+ <el-input-number style="width: 300px" :precision="0" :step="1"
|
|
|
+ v-model="dataForm.prizeActualStock"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否大奖">
|
|
|
+ <el-radio-group v-model="dataForm.isGrandPrize">
|
|
|
+ <el-radio :label="'0'">否</el-radio>
|
|
|
+ <el-radio :label="'1'">是</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态">
|
|
|
+ <el-radio-group v-model="dataForm.status">
|
|
|
+ <el-radio :label="'0'">关闭</el-radio>
|
|
|
+ <el-radio :label="'1'">开启</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
+ <el-button v-if="dialogStatus == 'create'" type="primary" @click="createData">确定</el-button>
|
|
|
+ <el-button v-else type="primary" @click="updateData">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
+
|
|
|
<style>
|
|
|
.demo-table-expand {
|
|
|
font-size: 0;
|
|
@@ -131,10 +148,10 @@
|
|
|
margin-bottom: 0;
|
|
|
}
|
|
|
</style>
|
|
|
-
|
|
|
+
|
|
|
<script>
|
|
|
import { dataList, dataAdd, dataEdit, dataRemove, optionSelect } from "@/api/raffleManage";
|
|
|
-import { dataTypeList,couponsList } from "@/api/public";
|
|
|
+import { dataTypeList, couponsList } from "@/api/public";
|
|
|
import waves from "@/directive/waves"; // 水波纹指令
|
|
|
import Tinymce from '@/components/Tinymce'
|
|
|
|
|
@@ -143,10 +160,10 @@ export default {
|
|
|
directives: { waves },
|
|
|
data() {
|
|
|
return {
|
|
|
- couponsList:[],
|
|
|
- dataTypeList:[],
|
|
|
- isCoupon:false,
|
|
|
- poolId:'',
|
|
|
+ couponsList: [],
|
|
|
+ dataTypeList: [],
|
|
|
+ isCoupon: false,
|
|
|
+ poolId: '',
|
|
|
dictNameList: [],
|
|
|
list: [
|
|
|
],
|
|
@@ -161,13 +178,14 @@ export default {
|
|
|
},
|
|
|
dataForm: {
|
|
|
prizeType: undefined,
|
|
|
- couponId:undefined,
|
|
|
+ couponId: undefined,
|
|
|
prizeName: undefined,
|
|
|
imgUrl: undefined,
|
|
|
integral: undefined,
|
|
|
prizeWeight: undefined,
|
|
|
prizeActualStock: undefined,
|
|
|
prizeStock: undefined,
|
|
|
+ isGrandPrize: '0',
|
|
|
status: '0',
|
|
|
images: [],
|
|
|
},
|
|
@@ -197,13 +215,14 @@ export default {
|
|
|
this.getCouponsList();
|
|
|
},
|
|
|
methods: {
|
|
|
- clickPrizeType(){
|
|
|
- this.dataForm.couponId = undefined;
|
|
|
+ clickPrizeType() {
|
|
|
+ this.dataForm.couponId = undefined;
|
|
|
this.dataForm.prizeName = undefined;
|
|
|
this.dataForm.imgUrl = undefined;
|
|
|
this.dataForm.integral = undefined;
|
|
|
this.dataForm.prizeActualStock = undefined;
|
|
|
this.dataForm.prizeStock = undefined;
|
|
|
+ this.dataForm.isGrandPrize = '0';
|
|
|
this.dataForm.status = '0';
|
|
|
this.dataForm.images = [];
|
|
|
},
|
|
@@ -252,32 +271,33 @@ export default {
|
|
|
}).catch(() => { });
|
|
|
},
|
|
|
getDataTypeList() {
|
|
|
- dataTypeList({dictType:'prize_type'}).then(response => {
|
|
|
+ dataTypeList({ dictType: 'prize_type' }).then(response => {
|
|
|
this.dataTypeList = response.data.data;
|
|
|
- }).catch(() => {});
|
|
|
+ }).catch(() => { });
|
|
|
},
|
|
|
- changepoolId(val){
|
|
|
+ changepoolId(val) {
|
|
|
this.poolId = val;
|
|
|
this.listQuery.poolId = val;
|
|
|
this.getList();
|
|
|
},
|
|
|
- getOptionSelect(){
|
|
|
+ getOptionSelect() {
|
|
|
optionSelect().then(response => {
|
|
|
this.dictNameList = response.data.data;
|
|
|
this.listQuery.poolId = this.poolId;
|
|
|
this.getList();
|
|
|
- }).catch(() => {})
|
|
|
+ }).catch(() => { })
|
|
|
},
|
|
|
resetForm() {
|
|
|
this.dataForm = {
|
|
|
prizeType: undefined,
|
|
|
- couponId:undefined,
|
|
|
+ couponId: undefined,
|
|
|
prizeName: undefined,
|
|
|
imgUrl: undefined,
|
|
|
integral: undefined,
|
|
|
prizeWeight: undefined,
|
|
|
prizeActualStock: undefined,
|
|
|
prizeStock: undefined,
|
|
|
+ isGrandPrize: '0',
|
|
|
status: '0',
|
|
|
images: [],
|
|
|
};
|
|
@@ -384,7 +404,7 @@ export default {
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- dataRemove({ prizeIds:row.id}).then(response => {
|
|
|
+ dataRemove({ prizeIds: row.id }).then(response => {
|
|
|
this.$notify({
|
|
|
title: '成功',
|
|
|
message: '删除成功',
|
|
@@ -412,8 +432,8 @@ export default {
|
|
|
for (let i = 0; i < length; i++) {
|
|
|
this.delarr.push(this.multipleSelection[i].id);
|
|
|
}
|
|
|
- const ids = this.delarr.join(",");
|
|
|
- dataRemove({ prizeIds: ids })
|
|
|
+ const ids = this.delarr.join(",");
|
|
|
+ dataRemove({ prizeIds: ids })
|
|
|
.then(() => {
|
|
|
this.$notify({
|
|
|
title: "成功",
|
|
@@ -465,5 +485,4 @@ export default {
|
|
|
.ad-avatar {
|
|
|
display: block;
|
|
|
}
|
|
|
-</style>
|
|
|
-
|
|
|
+</style>
|