幸运礼物-额外数组-配置
This commit is contained in:
@@ -4,17 +4,14 @@
|
||||
<!-- 分区 -->
|
||||
<div class="inquire">
|
||||
<span>奖池</span>
|
||||
<el-select
|
||||
v-model="inquire.value"
|
||||
placeholder="请选择"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.type"
|
||||
:label="item.name"
|
||||
:value="item.type"
|
||||
>
|
||||
<el-select v-model="inquire.value"
|
||||
placeholder="请选择"
|
||||
@change="handleChange">
|
||||
<el-option v-for="item in inquire.options"
|
||||
:key="item.type"
|
||||
:label="item.name"
|
||||
:value="item.type"
|
||||
:disabled="item.disabled">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -23,7 +20,9 @@
|
||||
<!-- 总分组 -->
|
||||
<div class="allArr">
|
||||
目前数组 <span>{{ allArr.length }} </span> 组:
|
||||
<span class="span" v-for="(item, index) in allArr" :key="index">
|
||||
<span class="span"
|
||||
v-for="(item, index) in allArr"
|
||||
:key="index">
|
||||
{{ item.expect }},
|
||||
</span>
|
||||
</div>
|
||||
@@ -33,7 +32,9 @@
|
||||
|
||||
<!-- 数组内容 -->
|
||||
<div class="boxs">
|
||||
<div class="arrContent" v-for="(item, index) in arr" :key="index">
|
||||
<div class="arrContent"
|
||||
v-for="(item, index) in arr"
|
||||
:key="index">
|
||||
<div class="arrBox">
|
||||
<div class="left">
|
||||
<div class="left_in1">
|
||||
@@ -43,14 +44,14 @@
|
||||
得到率: <b class="b2">{{ (item.winRate * 100).toFixed(2) }}%</b> ,
|
||||
</div>
|
||||
</div>
|
||||
<div class="right" v-for="(arrInItem, i) in item.itemList" :key="i">
|
||||
<div class="right"
|
||||
v-for="(arrInItem, i) in item.itemList"
|
||||
:key="i">
|
||||
<span>{{ arrInItem.multi }}</span>
|
||||
<el-input
|
||||
@input="handleInput(index, i, $event)"
|
||||
v-model="arrInItem.num"
|
||||
placeholder=""
|
||||
class="input"
|
||||
/>
|
||||
<el-input @input="handleInput(index, i, $event)"
|
||||
v-model="arrInItem.num"
|
||||
placeholder=""
|
||||
class="input" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,8 +59,9 @@
|
||||
|
||||
<!-- 按钮 -->
|
||||
<div class="but">
|
||||
<el-button class="primary" type="primary" @click="saveFun()"
|
||||
>保存
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="saveFun()">保存
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -73,7 +75,7 @@ import { ElMessage } from "element-plus";
|
||||
import moment from "moment-timezone";
|
||||
export default {
|
||||
name: "luckGiftArrange",
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
@@ -84,7 +86,7 @@ export default {
|
||||
arr: [], //处理下面总数组
|
||||
};
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
listType().then((res) => {
|
||||
this.inquire.options = res.data;
|
||||
this.inquire.value = res.data[0].type;
|
||||
@@ -93,20 +95,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
getData () {
|
||||
list({ type: this.inquire.value }).then((res) => {
|
||||
this.allArr = res.data;
|
||||
this.arr = res.data;
|
||||
});
|
||||
},
|
||||
handleInput(index, i, val) {
|
||||
handleInput (index, i, val) {
|
||||
// 期望值 expectedvalue = 倍数 * 5 * num / 2500
|
||||
// 中奖率 winRate =不为θ的倍数的num / 500
|
||||
this.arr[index].expect = this.calculationFun(index, i, val).expect;
|
||||
this.arr[index].winRate = this.calculationFun(index, i, val).winRate;
|
||||
},
|
||||
// 计算函数
|
||||
calculationFun(index, i, val) {
|
||||
calculationFun (index, i, val) {
|
||||
var expectNum = 0;
|
||||
var winRate = 0;
|
||||
this.arr[index].itemList.forEach((res) => {
|
||||
@@ -120,7 +122,7 @@ export default {
|
||||
};
|
||||
},
|
||||
// 保存
|
||||
saveFun() {
|
||||
saveFun () {
|
||||
//
|
||||
save(
|
||||
JSON.stringify({ poolList: this.arr, type: this.inquire.value })
|
||||
@@ -142,7 +144,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 监听类型
|
||||
handleChange(value) {
|
||||
handleChange (value) {
|
||||
this.inquire.value = value;
|
||||
this.getData();
|
||||
},
|
||||
@@ -208,7 +210,7 @@ export default {
|
||||
}
|
||||
}
|
||||
.left_in2 {
|
||||
margin-bottom: 10px
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
|
@@ -1,28 +1,23 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<div class="condition">
|
||||
<div class="inquire">
|
||||
<div class="inquire">
|
||||
<span>用户上线列表</span>
|
||||
<!-- @input="handleInput" -->
|
||||
<el-input
|
||||
v-model="inquire.followErbanNoList"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
<el-button
|
||||
class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
<el-input v-model="inquire.followErbanNoList"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
editDialog = true;
|
||||
butClick = false;
|
||||
type = 11;
|
||||
editDialogTitle = '用户上线列表';
|
||||
value = inquire.followErbanNoList;
|
||||
"
|
||||
>
|
||||
编辑</el-button
|
||||
>
|
||||
">
|
||||
编辑</el-button>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>用户W级列表</span>
|
||||
@@ -33,47 +28,39 @@
|
||||
class="input"
|
||||
disabled
|
||||
></el-input> -->
|
||||
<el-button class="primary" type="primary" @click="detailsClick">
|
||||
查看详情</el-button
|
||||
>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="detailsClick">
|
||||
查看详情</el-button>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>用户B级列表</span>
|
||||
<!-- @input="handleInput" -->
|
||||
<el-input
|
||||
v-model="inquire.blackErbanNoList"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
<el-button
|
||||
class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
<el-input v-model="inquire.blackErbanNoList"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
editDialog = true;
|
||||
butClick = false;
|
||||
type = 13;
|
||||
editDialogTitle = '用户B级列表';
|
||||
value = inquire.blackErbanNoList;
|
||||
"
|
||||
>
|
||||
编辑</el-button
|
||||
>
|
||||
">
|
||||
编辑</el-button>
|
||||
</div>
|
||||
<!-- 分区 -->
|
||||
<div class="inquire">
|
||||
<span>分区</span>
|
||||
<el-select
|
||||
v-model="inquire.value"
|
||||
placeholder="请选择"
|
||||
@change="handleChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
<el-select v-model="inquire.value"
|
||||
placeholder="请选择"
|
||||
@change="handleChange">
|
||||
<el-option v-for="item in inquire.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -81,47 +68,37 @@
|
||||
<div class="inquire">
|
||||
<span>对比值N</span>
|
||||
<!-- @input="handleInput" -->
|
||||
<el-input
|
||||
v-model="inquire.comparisonValue"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
<el-button
|
||||
class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
<el-input v-model="inquire.comparisonValue"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
editDialog = true;
|
||||
butClick = false;
|
||||
type = 1;
|
||||
editDialogTitle = '对比值N';
|
||||
value = inquire.comparisonValue;
|
||||
"
|
||||
>
|
||||
编辑</el-button
|
||||
>
|
||||
">
|
||||
编辑</el-button>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>幸运24金币库存</span>
|
||||
<el-input
|
||||
v-model="inquire.goldInventory"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
<el-button
|
||||
class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
<el-input v-model="inquire.goldInventory"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
editDialog = true;
|
||||
butClick = false;
|
||||
type = 2;
|
||||
editDialogTitle = '幸运24金币库存';
|
||||
value = inquire.goldInventory;
|
||||
"
|
||||
>编辑</el-button
|
||||
>
|
||||
">编辑</el-button>
|
||||
</div>
|
||||
|
||||
<!-- <div class="inquire">
|
||||
@@ -149,70 +126,55 @@
|
||||
|
||||
<div class="inquire">
|
||||
<span>平台抽成</span>
|
||||
<el-input
|
||||
v-model="inquire.platformCommission"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
<el-button
|
||||
class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
<el-input v-model="inquire.platformCommission"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
editDialog = true;
|
||||
butClick = false;
|
||||
type = 3;
|
||||
editDialogTitle = '平台抽成';
|
||||
value = inquire.platformCommission;
|
||||
"
|
||||
>编辑</el-button
|
||||
>
|
||||
">编辑</el-button>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>用户收益比例</span>
|
||||
<el-input
|
||||
v-model="inquire.userRevenueRatio"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
<el-button
|
||||
class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
<el-input v-model="inquire.userRevenueRatio"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
editDialog = true;
|
||||
butClick = false;
|
||||
type = 4;
|
||||
editDialogTitle = '用户收益比例';
|
||||
value = inquire.userRevenueRatio;
|
||||
"
|
||||
>编辑</el-button
|
||||
>
|
||||
">编辑</el-button>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>通知制定金额</span>
|
||||
<!-- @input="handleInput" -->
|
||||
<el-input
|
||||
v-model="inquire.warnMulti"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
<el-button
|
||||
class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
<el-input v-model="inquire.warnMulti"
|
||||
placeholder=""
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
editDialog = true;
|
||||
butClick = false;
|
||||
type = 9;
|
||||
editDialogTitle = '通知制定金额';
|
||||
value = inquire.warnMulti;
|
||||
"
|
||||
>
|
||||
编辑</el-button
|
||||
>
|
||||
">
|
||||
编辑</el-button>
|
||||
</div>
|
||||
|
||||
<!-- <div class="inquire">
|
||||
@@ -238,92 +200,170 @@
|
||||
>
|
||||
</div> -->
|
||||
|
||||
|
||||
<div class="inquire">
|
||||
<span>赠送1000倍奖励</span>
|
||||
<el-button
|
||||
class="primary"
|
||||
type="primary"
|
||||
:disabled="butClick"
|
||||
@click="
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
:disabled="butClick"
|
||||
@click="
|
||||
editDialog = true;
|
||||
type = 12;
|
||||
editDialogTitle = '赠送1000倍奖励';
|
||||
value = inquire.x;
|
||||
"
|
||||
>
|
||||
赠送</el-button
|
||||
>
|
||||
">
|
||||
赠送</el-button>
|
||||
</div>
|
||||
|
||||
<el-divider content-position="left">额外数组</el-divider>
|
||||
|
||||
<div class="inquire">
|
||||
<span>额外库存</span>
|
||||
<el-input v-model="inquire.extraStock"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
editDialog = true;
|
||||
butClick = false;
|
||||
type = 15;
|
||||
editDialogTitle = '额外库存';
|
||||
value = inquire.extraStock;
|
||||
">编辑</el-button>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>开关</span>
|
||||
<el-switch v-model="inquire.extraPoolConfig.isOpen"
|
||||
size="large"
|
||||
active-text="开"
|
||||
inactive-text="关"
|
||||
disabled />
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>库存蓄水比例</span>
|
||||
<el-input v-model="inquire.extraPoolConfig.storeRatio"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>开始活跃小时(当地时区)</span>
|
||||
<el-input v-model="inquire.extraPoolConfig.startHour"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>结束活跃小时(当地时区)</span>
|
||||
<el-input v-model="inquire.extraPoolConfig.endHour"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>单次投入金币门槛</span>
|
||||
<el-input v-model="inquire.extraPoolConfig.inputThreshold"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>用户充值等级</span>
|
||||
<el-input v-model="inquire.extraPoolConfig.userRechargeLevels"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>当天退出率</span>
|
||||
<el-input v-model="inquire.extraPoolConfig.todayProductionRatio"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>当天差额</span>
|
||||
<el-input v-model="inquire.extraPoolConfig.todayDiff"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<div class="inquire">
|
||||
<span>近两天获得次数限制</span>
|
||||
<el-input v-model="inquire.extraPoolConfig.twoDayCountLimit"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
</div>
|
||||
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="
|
||||
extraPoolDialog = true;
|
||||
">
|
||||
编辑</el-button>
|
||||
|
||||
</div>
|
||||
<!-- 编辑弹窗 -->
|
||||
<el-dialog v-model="editDialog" :title="editDialogTitle" width="36%" center>
|
||||
<el-dialog v-model="editDialog"
|
||||
:title="editDialogTitle"
|
||||
width="36%"
|
||||
center>
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>{{ editDialogTitle }}</span
|
||||
>
|
||||
<el-input
|
||||
v-model="value"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请输入"
|
||||
></el-input>
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">{{ editDialogTitle }}</span>
|
||||
<el-input v-model="value"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请输入"></el-input>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button
|
||||
@click="
|
||||
<el-button @click="
|
||||
editDialog = false;
|
||||
butClick = false;
|
||||
"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="butClick"
|
||||
@click="editDialogClick()"
|
||||
>
|
||||
">取消</el-button>
|
||||
<el-button type="primary"
|
||||
:disabled="butClick"
|
||||
@click="editDialogClick()">
|
||||
保存
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog v-model="detailsDialog" title="用户W级列表" width="36%" center>
|
||||
<el-button class="primary" type="primary" @click="addDetail">
|
||||
新增</el-button
|
||||
>
|
||||
<el-table :data="detailsTable" style="width: 100%">
|
||||
<el-dialog v-model="detailsDialog"
|
||||
title="用户W级列表"
|
||||
width="36%"
|
||||
center>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="addDetail">
|
||||
新增</el-button>
|
||||
<el-table :data="detailsTable"
|
||||
style="width: 100%">
|
||||
<el-table-column label="用户ID">
|
||||
<template v-slot="scope">
|
||||
<el-input
|
||||
v-model="scope.row.userId"
|
||||
type="number"
|
||||
@blur="handleEdit(scope.$index, scope.row)"
|
||||
></el-input>
|
||||
<el-input v-model="scope.row.userId"
|
||||
type="number"
|
||||
@blur="handleEdit(scope.$index, scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="值">
|
||||
<template v-slot="scope">
|
||||
<el-input
|
||||
v-model="scope.row.val"
|
||||
type="number"
|
||||
@blur="handleEdit(scope.$index, scope.row)"
|
||||
></el-input>
|
||||
<el-input v-model="scope.row.val"
|
||||
type="number"
|
||||
@blur="handleEdit(scope.$index, scope.row)"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
class="danger"
|
||||
type="danger"
|
||||
@click="delDetail(scope.$index, scope.row)"
|
||||
>
|
||||
删除</el-button
|
||||
>
|
||||
<el-button class="danger"
|
||||
type="danger"
|
||||
@click="delDetail(scope.$index, scope.row)">
|
||||
删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- 其他列 -->
|
||||
@@ -332,25 +372,90 @@
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="detailsDialog = false">取消</el-button>
|
||||
<el-button type="primary" :disabled="butClick" @click="sevaDetail()">
|
||||
<el-button type="primary"
|
||||
:disabled="butClick"
|
||||
@click="sevaDetail()">
|
||||
保存
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog v-model="extraPoolDialog"
|
||||
title="额外数组配置"
|
||||
width="36%"
|
||||
center>
|
||||
<el-form :model="inquire.extraPoolConfig"
|
||||
label-width="auto"
|
||||
style="max-width: 600px">
|
||||
<el-form-item label="开关">
|
||||
<el-switch v-model="inquire.extraPoolConfig.isOpen"
|
||||
size="large"
|
||||
active-text="开"
|
||||
inactive-text="关" />
|
||||
</el-form-item>
|
||||
<el-form-item label="库存蓄水比例">
|
||||
<el-input v-model="inquire.extraPoolConfig.storeRatio"
|
||||
class="input"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="活跃小时">
|
||||
<el-col :span="10">
|
||||
<el-input type="number"
|
||||
v-model="inquire.extraPoolConfig.startHour"
|
||||
class="input"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="2"
|
||||
class="text-center">
|
||||
<span class="text-gray-500">-</span>
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<el-input type="number"
|
||||
v-model="inquire.extraPoolConfig.endHour"
|
||||
class="input" />
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="单次投入金币门槛">
|
||||
<el-input v-model="inquire.extraPoolConfig.inputThreshold" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户充值等级">
|
||||
<el-input v-model="inquire.extraPoolConfig.userRechargeLevels" />
|
||||
</el-form-item>
|
||||
<el-form-item label="当天退出率">
|
||||
<el-input v-model="inquire.extraPoolConfig.todayProductionRatio"
|
||||
class="input"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="当天差额">
|
||||
<el-input v-model="inquire.extraPoolConfig.todayDiff"
|
||||
class="input"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="近两天获得次数限制">
|
||||
<el-input v-model="inquire.extraPoolConfig.twoDayCountLimit"
|
||||
class="input"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="extraPoolDialog = false">取消</el-button>
|
||||
<el-button type="primary"
|
||||
:disabled="!extraDialogButClick"
|
||||
@click="saveExtraPoolConfig()">
|
||||
保存
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getConfig, updateSet, updateUserMulti } from "@/api/luckGift/luckGift";
|
||||
import { listAll} from "@/api/partition/partitionInfo";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
import { listAll } from "@/api/partition/partitionInfo";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
import moment from "moment-timezone";
|
||||
export default {
|
||||
name: "luckGiftSet",
|
||||
data() {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
butClick: false,
|
||||
@@ -377,7 +482,7 @@ export default {
|
||||
// },
|
||||
],
|
||||
comparisonValue: "",
|
||||
goldInventory: "",
|
||||
goldInventory: 0,
|
||||
giftId: "",
|
||||
platformCommission: "",
|
||||
userRevenueRatio: "",
|
||||
@@ -385,10 +490,14 @@ export default {
|
||||
followErbanNoList: "",
|
||||
whiteErbanNoProductionRatioMap: "",
|
||||
blackErbanNoList: "",
|
||||
extraStock: 0,
|
||||
extraPoolConfig: {}
|
||||
},
|
||||
editDialog: false,
|
||||
editDialogTitle: "",
|
||||
detailsDialog: false,
|
||||
extraPoolDialog: false,
|
||||
extraDialogButClick: true,
|
||||
value: "",
|
||||
type: null,
|
||||
// 详情
|
||||
@@ -396,7 +505,7 @@ export default {
|
||||
whiteErbanNoProductionRatioMap: null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
this.getData();
|
||||
listAll().then((res) => {
|
||||
this.inquire.options = res.data;
|
||||
@@ -404,7 +513,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
getData () {
|
||||
getConfig({ partitionId: this.inquire.value }).then((res) => {
|
||||
this.inquire.comparisonValue = res.data.productionRatio;
|
||||
this.inquire.goldInventory = res.data.stock;
|
||||
@@ -424,25 +533,27 @@ export default {
|
||||
newArr[i] = res;
|
||||
});
|
||||
this.detailsTable = newArr;
|
||||
this.inquire.extraStock = res.data.extraStock;
|
||||
this.inquire.extraPoolConfig = res.data.extraPoolConfig;
|
||||
});
|
||||
},
|
||||
// 查看详情按钮
|
||||
detailsClick() {
|
||||
detailsClick () {
|
||||
this.getData();
|
||||
this.detailsDialog = true;
|
||||
this.type = 14;
|
||||
// this.value = inquire.whiteErbanNoProductionRatioMap;
|
||||
},
|
||||
// 详情新增按钮
|
||||
addDetail() {
|
||||
addDetail () {
|
||||
this.detailsTable.unshift([]);
|
||||
},
|
||||
// 详情删除按钮
|
||||
delDetail(index, val) {
|
||||
delDetail (index, val) {
|
||||
this.detailsTable.splice(index, 1);
|
||||
},
|
||||
// 详情确认保存按钮
|
||||
sevaDetail() {
|
||||
sevaDetail () {
|
||||
var map = {};
|
||||
var lock = true;
|
||||
this.detailsTable.forEach((res) => {
|
||||
@@ -464,13 +575,13 @@ export default {
|
||||
}
|
||||
},
|
||||
// 详情编辑监听
|
||||
handleEdit(index, row) {
|
||||
handleEdit (index, row) {
|
||||
// 这里可以添加保存逻辑,例如调用API更新服务器数据等。
|
||||
console.log(index, "保存行数据", row);
|
||||
// 示例:更新本地数据或其他操作...
|
||||
},
|
||||
// 确认保存
|
||||
editDialogClick() {
|
||||
editDialogClick () {
|
||||
var obj = {};
|
||||
obj.partitionId = this.inquire.value;
|
||||
if (this.type == 12) {
|
||||
@@ -514,6 +625,8 @@ export default {
|
||||
this.whiteErbanNoProductionRatioMap;
|
||||
} else if (this.type == 13) {
|
||||
obj.blackErbanNoList = this.value.split(",");
|
||||
} else if (this.type == 15) {
|
||||
obj.extraStock = this.value;
|
||||
}
|
||||
updateSet(obj).then((res) => {
|
||||
if (res.code == 200) {
|
||||
@@ -536,10 +649,36 @@ export default {
|
||||
}
|
||||
},
|
||||
// 监听类型
|
||||
handleChange(value) {
|
||||
handleChange (value) {
|
||||
this.inquire.value = value;
|
||||
this.getData();
|
||||
},
|
||||
// 确认保存
|
||||
saveExtraPoolConfig () {
|
||||
this.extraDialogButClick = false;
|
||||
var obj = {};
|
||||
obj.partitionId = this.inquire.value;
|
||||
obj.extraPoolConfig = this.inquire.extraPoolConfig;
|
||||
updateSet(obj).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
this.extraPoolDialog = false;
|
||||
this.getData();
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
}).finally(() => {
|
||||
this.extraDialogButClick = true;
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user