Files
peko-admin-web/src/views/luckGift/luckGiftSet.vue

980 lines
30 KiB
Vue
Raw Normal View History

2024-09-14 19:03:04 +08:00
<template>
<div class="box">
<div class="condition">
<div class="inquire">
<span>后台关注用户</span>
<!-- @input="handleInput" -->
<el-input v-model="inquire.adminFollowErbanNoList"
placeholder=""
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
editDialog = true;
butClick = false;
type = 16;
editDialogTitle = '后台关注用户';
value = inquire.adminFollowErbanNoList;
">
编辑</el-button>
</div>
2025-06-12 18:38:01 +08:00
<div class="inquire">
2025-02-12 19:01:17 +08:00
<span>用户上线列表</span>
<!-- @input="handleInput" -->
2025-06-12 18:38:01 +08:00
<el-input v-model="inquire.followErbanNoList"
placeholder=""
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
2025-02-12 19:01:17 +08:00
editDialog = true;
butClick = false;
type = 11;
editDialogTitle = '用户上线列表';
value = inquire.followErbanNoList;
2025-06-12 18:38:01 +08:00
">
编辑</el-button>
2025-02-12 19:01:17 +08:00
</div>
<div class="inquire">
<span>用户W级列表</span>
<!-- @input="handleInput" -->
<!-- <el-input
v-model="inquire.whiteErbanNoProductionRatioMap"
placeholder=""
class="input"
disabled
></el-input> -->
2025-06-12 18:38:01 +08:00
<el-button class="primary"
type="primary"
@click="detailsClick">
查看详情</el-button>
2025-02-12 19:01:17 +08:00
</div>
<div class="inquire">
<span>用户B级列表</span>
<!-- @input="handleInput" -->
2025-06-12 18:38:01 +08:00
<el-input v-model="inquire.blackErbanNoList"
placeholder=""
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
2025-02-12 19:01:17 +08:00
editDialog = true;
butClick = false;
type = 13;
editDialogTitle = '用户B级列表';
value = inquire.blackErbanNoList;
2025-06-12 18:38:01 +08:00
">
编辑</el-button>
2025-02-12 19:01:17 +08:00
</div>
2024-09-14 19:03:04 +08:00
<!-- 分区 -->
<div class="inquire">
<span>分区</span>
2025-06-12 18:38:01 +08:00
<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">
2024-09-14 19:03:04 +08:00
</el-option>
</el-select>
</div>
<div class="inquire">
<span>对比值N</span>
<!-- @input="handleInput" -->
2025-06-12 18:38:01 +08:00
<el-input v-model="inquire.comparisonValue"
placeholder=""
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
2024-09-14 19:03:04 +08:00
editDialog = true;
2024-09-19 19:12:43 +08:00
butClick = false;
2024-09-14 19:03:04 +08:00
type = 1;
editDialogTitle = '对比值N';
value = inquire.comparisonValue;
2025-06-12 18:38:01 +08:00
">
编辑</el-button>
2024-09-14 19:03:04 +08:00
</div>
<div class="inquire">
<span>幸运24金币库存</span>
2025-06-12 18:38:01 +08:00
<el-input v-model="inquire.goldInventory"
placeholder=""
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
2024-09-14 19:03:04 +08:00
editDialog = true;
2024-09-19 19:12:43 +08:00
butClick = false;
2024-09-14 19:03:04 +08:00
type = 2;
editDialogTitle = '幸运24金币库存';
value = inquire.goldInventory;
2025-06-12 18:38:01 +08:00
">编辑</el-button>
2024-09-14 19:03:04 +08:00
</div>
2024-09-19 19:12:43 +08:00
<!-- <div class="inquire">
<span>幸运礼物ID</span>
<el-input
v-model="inquire.x"
placeholder=""
class="input"
disabled
></el-input>
<el-button
class="primary"
type="primary"
@click="
editDialog = true;
butClick = false;
type = 8;
editDialogTitle = '幸运礼物ID';
value = inquire.x;
"
>
编辑</el-button
>
</div> -->
2024-09-14 19:03:04 +08:00
<div class="inquire">
<span>平台抽成</span>
2025-06-12 18:38:01 +08:00
<el-input v-model="inquire.platformCommission"
placeholder=""
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
2024-09-14 19:03:04 +08:00
editDialog = true;
2024-09-19 19:12:43 +08:00
butClick = false;
2024-09-14 19:03:04 +08:00
type = 3;
editDialogTitle = '平台抽成';
value = inquire.platformCommission;
2025-06-12 18:38:01 +08:00
">编辑</el-button>
2024-09-14 19:03:04 +08:00
</div>
<div class="inquire">
<span>用户收益比例</span>
2025-06-12 18:38:01 +08:00
<el-input v-model="inquire.userRevenueRatio"
placeholder=""
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
2024-09-14 19:03:04 +08:00
editDialog = true;
2024-09-19 19:12:43 +08:00
butClick = false;
2024-09-14 19:03:04 +08:00
type = 4;
editDialogTitle = '用户收益比例';
value = inquire.userRevenueRatio;
2025-06-12 18:38:01 +08:00
">编辑</el-button>
2024-09-14 19:03:04 +08:00
</div>
2024-09-19 19:12:43 +08:00
<div class="inquire">
<span>通知制定金额</span>
<!-- @input="handleInput" -->
2025-06-12 18:38:01 +08:00
<el-input v-model="inquire.warnMulti"
placeholder=""
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
2024-09-19 19:12:43 +08:00
editDialog = true;
butClick = false;
type = 9;
editDialogTitle = '通知制定金额';
value = inquire.warnMulti;
2025-06-12 18:38:01 +08:00
">
编辑</el-button>
2024-09-19 19:12:43 +08:00
</div>
<!-- <div class="inquire">
<span>库存告急通知</span>
<el-input
v-model="inquire.x"
placeholder=""
class="input"
disabled
></el-input>
<el-button
class="primary"
type="primary"
@click="
editDialog = true;
butClick = false;
type = 10;
editDialogTitle = '库存告急通知';
value = inquire.x;
"
>
编辑</el-button
>
</div> -->
<div class="inquire">
<span>赠送1000倍奖励</span>
2025-06-12 18:38:01 +08:00
<el-button class="primary"
type="primary"
:disabled="butClick"
@click="
2024-09-19 19:12:43 +08:00
editDialog = true;
type = 12;
editDialogTitle = '赠送1000倍奖励';
value = inquire.x;
2025-06-12 18:38:01 +08:00
">
赠送</el-button>
</div>
2025-07-01 20:42:07 +08:00
<el-divider content-position="left">个人库存</el-divider>
<div class="inquire">
<span>H</span>
<el-input v-model="inquire.preJudgeValue_H"
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
editDialog = true;
butClick = false;
type = 5;
editDialogTitle = 'H';
value = inquire.preJudgeValue_H;
">
编辑</el-button>
</div>
<div class="inquire">
<span>J</span>
<el-input v-model="inquire.totalInput_J"
class="input"
disabled></el-input>
<el-button class="primary"
type="primary"
@click="
editDialog = true;
butClick = false;
type = 6;
editDialogTitle = 'J';
value = inquire.totalInput_J;
">
编辑</el-button>
</div>
<div class="inquire">
<span>K1</span>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K1.S"
class="input"
disabled>
<template #prepend>S</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K1.A"
class="input"
disabled>
<template #prepend>A</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K1.B"
class="input"
disabled>
<template #prepend>B</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K1.C"
class="input"
disabled>
<template #prepend>C</template>
</el-input>
2025-07-02 15:01:43 +08:00
</div>
<div class="inquire">
<span></span>
2025-07-01 20:42:07 +08:00
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K1.D"
class="input"
disabled>
<template #prepend>D</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K1.E"
class="input"
disabled>
<template #prepend>E</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K1.F"
class="input"
disabled>
<template #prepend>F</template>
</el-input>
<el-button class="primary"
type="primary"
@click="
multiEditDialog = true;
butClick = false;
multiEditDialogTitle = 'K1';
multiEditObj = inquire.userRechargeLevel_totalInputOffset_K1;
">
编辑</el-button>
</div>
2025-07-02 15:01:43 +08:00
<el-divider />
2025-07-01 20:42:07 +08:00
<div class="inquire">
<span>K2</span>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K2.S"
class="input"
disabled>
<template #prepend>S</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K2.A"
class="input"
disabled>
<template #prepend>A</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K2.B"
class="input"
disabled>
<template #prepend>B</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K2.C"
class="input"
disabled>
<template #prepend>C</template>
</el-input>
2025-07-02 15:01:43 +08:00
</div>
<div class="inquire">
<span></span>
2025-07-01 20:42:07 +08:00
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K2.D"
class="input"
disabled>
<template #prepend>D</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K2.E"
class="input"
disabled>
<template #prepend>E</template>
</el-input>
<el-input v-model="inquire.userRechargeLevel_totalInputOffset_K2.F"
class="input"
disabled>
<template #prepend>F</template>
</el-input>
<el-button class="primary"
type="primary"
@click="
multiEditDialog = true;
butClick = false;
multiEditDialogTitle = 'K2';
multiEditObj = inquire.userRechargeLevel_totalInputOffset_K2;
">
编辑</el-button>
</div>
2025-06-12 18:38:01 +08:00
<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>
2024-09-19 19:12:43 +08:00
</div>
2025-06-12 18:38:01 +08:00
<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>
2024-09-14 19:03:04 +08:00
</div>
<!-- 编辑弹窗 -->
2025-06-12 18:38:01 +08:00
<el-dialog v-model="editDialog"
:title="editDialogTitle"
width="36%"
center>
2024-09-14 19:03:04 +08:00
<div style="margin-bottom: 25px; margin-top: 10px">
2025-06-12 18:38:01 +08:00
<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>
2024-09-14 19:03:04 +08:00
</div>
<template #footer>
<span class="dialog-footer">
2025-06-12 18:38:01 +08:00
<el-button @click="
2024-09-19 19:12:43 +08:00
editDialog = false;
butClick = false;
2025-06-12 18:38:01 +08:00
">取消</el-button>
<el-button type="primary"
:disabled="butClick"
@click="editDialogClick()">
2024-09-14 19:03:04 +08:00
保存
</el-button>
</span>
</template>
</el-dialog>
2025-07-01 20:42:07 +08:00
<!-- 编辑弹窗 -->
<el-dialog v-model="multiEditDialog"
:title="multiEditDialogTitle"
2025-07-02 15:01:43 +08:00
width="24%"
2025-07-01 20:42:07 +08:00
center>
<div style="margin-bottom: 25px; margin-top: 10px"
v-for="(val, key) in multiEditObj"
:key="key">
<span style="display: inline-block; margin-right: 20px"
class="col-sm-2 control-label">{{ key }}</span>
2025-07-02 15:01:43 +08:00
<el-input v-model="multiEditObj[key]"
style="width: 75%"
class="input"
placeholder="请输入" />
2025-07-01 20:42:07 +08:00
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="
multiEditDialog = false;
butClick = false;
">取消</el-button>
<el-button type="primary"
:disabled="butClick"
@click="multiEditDialogClick()">
保存
</el-button>
</span>
</template>
</el-dialog>
2025-02-12 16:02:02 +08:00
<!-- 详情弹窗 -->
2025-06-12 18:38:01 +08:00
<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%">
2025-02-12 16:02:02 +08:00
<el-table-column label="用户ID">
<template v-slot="scope">
2025-06-12 18:38:01 +08:00
<el-input v-model="scope.row.userId"
type="number"
@blur="handleEdit(scope.$index, scope.row)"></el-input>
2025-02-12 16:02:02 +08:00
</template>
</el-table-column>
<el-table-column label="值">
<template v-slot="scope">
2025-06-12 18:38:01 +08:00
<el-input v-model="scope.row.val"
type="number"
@blur="handleEdit(scope.$index, scope.row)"></el-input>
2025-02-12 16:02:02 +08:00
</template>
</el-table-column>
<el-table-column label="操作">
<template v-slot="scope">
2025-06-12 18:38:01 +08:00
<el-button class="danger"
type="danger"
@click="delDetail(scope.$index, scope.row)">
删除</el-button>
2025-02-12 16:02:02 +08:00
</template>
</el-table-column>
<!-- 其他列 -->
</el-table>
<template #footer>
<span class="dialog-footer">
<el-button @click="detailsDialog = false">取消</el-button>
2025-06-12 18:38:01 +08:00
<el-button type="primary"
:disabled="butClick"
@click="sevaDetail()">
2025-02-12 16:02:02 +08:00
保存
</el-button>
</span>
</template>
</el-dialog>
2025-06-12 18:38:01 +08:00
<!-- 详情弹窗 -->
<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>
2024-09-14 19:03:04 +08:00
</div>
</template>
<script>
2024-09-19 19:12:43 +08:00
import { getConfig, updateSet, updateUserMulti } from "@/api/luckGift/luckGift";
2025-06-12 18:38:01 +08:00
import { listAll } from "@/api/partition/partitionInfo";
2024-09-14 19:03:04 +08:00
// @ts-ignore
import { ElMessage } from "element-plus";
export default {
name: "luckGiftSet",
2025-06-12 18:38:01 +08:00
data () {
2024-09-14 19:03:04 +08:00
return {
loading: false,
2024-09-19 19:12:43 +08:00
butClick: false,
butClickTime: null,
2024-09-14 19:03:04 +08:00
//查询所需条件对象
inquire: {
value: 2,
options: [
2025-03-31 18:16:16 +08:00
// {
// name: "阿拉伯区",
// type: 2,
// },
// {
// name: "英语区",
// type: 1,
// },
// {
// name: "华语区",
// type: 4,
// },
// {
// name: "土耳其区",
// type: 8,
// },
2024-09-14 19:03:04 +08:00
],
comparisonValue: "",
2025-06-12 18:38:01 +08:00
goldInventory: 0,
2024-09-14 19:03:04 +08:00
giftId: "",
platformCommission: "",
userRevenueRatio: "",
2024-09-19 19:12:43 +08:00
warnMulti: "",
followErbanNoList: "",
adminFollowErbanNoList: "",
2025-02-12 16:02:02 +08:00
whiteErbanNoProductionRatioMap: "",
blackErbanNoList: "",
2025-07-01 20:42:07 +08:00
preJudgeValue_H: undefined,
totalInput_J: undefined,
userRechargeLevel_totalInputOffset_K1: {},
userRechargeLevel_totalInputOffset_K2: {},
2025-06-12 18:38:01 +08:00
extraStock: 0,
extraPoolConfig: {}
2024-09-14 19:03:04 +08:00
},
editDialog: false,
editDialogTitle: "",
2025-07-01 20:42:07 +08:00
multiEditDialog: false,
multiEditDialogTitle: "",
2025-02-12 16:02:02 +08:00
detailsDialog: false,
2025-06-12 18:38:01 +08:00
extraPoolDialog: false,
extraDialogButClick: true,
2024-09-14 19:03:04 +08:00
value: "",
type: null,
2025-02-12 16:02:02 +08:00
// 详情
detailsTable: [],
2025-02-12 17:32:24 +08:00
whiteErbanNoProductionRatioMap: null,
2024-09-14 19:03:04 +08:00
};
},
2025-06-12 18:38:01 +08:00
created () {
2024-09-14 19:03:04 +08:00
this.getData();
2025-03-31 18:16:16 +08:00
listAll().then((res) => {
this.inquire.options = res.data;
});
2024-09-14 19:03:04 +08:00
},
methods: {
// 查询接口
2025-06-12 18:38:01 +08:00
getData () {
2024-09-14 19:03:04 +08:00
getConfig({ partitionId: this.inquire.value }).then((res) => {
this.inquire.comparisonValue = res.data.productionRatio;
this.inquire.goldInventory = res.data.stock;
this.inquire.platformCommission = res.data.platformRatio;
this.inquire.userRevenueRatio = res.data.receiverRatio;
2024-09-19 19:12:43 +08:00
this.inquire.warnMulti = res.data.warnMulti;
this.inquire.followErbanNoList = res.data.followErbanNoList.join();
this.inquire.adminFollowErbanNoList = res.data.adminFollowErbanNoList.join();
2025-02-12 16:02:02 +08:00
// this.inquire.whiteErbanNoProductionRatioMap = res.data.whiteErbanNoProductionRatioMap.join();
this.inquire.blackErbanNoList = res.data.blackErbanNoList.join();
2025-02-12 17:38:58 +08:00
var newArr = [];
2025-02-12 16:02:02 +08:00
var obj = res.data.whiteErbanNoProductionRatioMap;
2025-02-12 17:38:58 +08:00
var arr = Object.keys(obj).map((key) => ({
2025-02-12 16:02:02 +08:00
userId: key,
val: obj[key],
}));
arr.forEach((res, i) => {
2025-02-12 17:38:58 +08:00
newArr[i] = res;
2025-02-12 16:02:02 +08:00
});
2025-02-12 17:32:24 +08:00
this.detailsTable = newArr;
2025-07-01 20:42:07 +08:00
this.inquire.preJudgeValue_H = res.data.preJudgeValue_H;
this.inquire.totalInput_J = res.data.totalInput_J;
2025-07-02 15:01:43 +08:00
this.inquire.userRechargeLevel_totalInputOffset_K1 = this.sortK12(res.data.userRechargeLevel_totalInputOffset_K1);
this.inquire.userRechargeLevel_totalInputOffset_K2 = this.sortK12(res.data.userRechargeLevel_totalInputOffset_K2);
2025-07-01 20:42:07 +08:00
2025-06-12 18:38:01 +08:00
this.inquire.extraStock = res.data.extraStock;
this.inquire.extraPoolConfig = res.data.extraPoolConfig;
this.inquire.extraPoolConfig.userRechargeLevels = res.data.extraPoolConfig.userRechargeLevels.join(',');
2024-09-14 19:03:04 +08:00
});
},
2025-07-02 15:01:43 +08:00
// 排序
sortK12 (kObj) {
// 创建一个新对象以保持排序后的键值对
const sortedKObj = {};
// 提取所有键并进行排序
const keys = Object.keys(kObj);
// 将 "S" 键单独提取出来
const sKey = keys.find(key => key === 'S');
// 过滤掉 "S" 键,剩下的键按字母顺序排序
const otherKeys = keys.filter(key => key !== 'S').sort();
// 如果存在 "S" 键,则将其放在第一位
if (sKey) {
sortedKObj[sKey] = kObj[sKey];
}
// 按照排序后的其他键填充对象
otherKeys.forEach(key => {
sortedKObj[key] = kObj[key];
});
return sortedKObj;
},
2025-02-12 17:32:24 +08:00
// 查看详情按钮
2025-06-12 18:38:01 +08:00
detailsClick () {
2025-02-12 17:32:24 +08:00
this.getData();
this.detailsDialog = true;
this.type = 14;
// this.value = inquire.whiteErbanNoProductionRatioMap;
},
2025-02-12 16:02:02 +08:00
// 详情新增按钮
2025-06-12 18:38:01 +08:00
addDetail () {
2025-02-12 16:02:02 +08:00
this.detailsTable.unshift([]);
},
// 详情删除按钮
2025-06-12 18:38:01 +08:00
delDetail (index, val) {
2025-02-12 16:02:02 +08:00
this.detailsTable.splice(index, 1);
},
// 详情确认保存按钮
2025-06-12 18:38:01 +08:00
sevaDetail () {
2025-02-12 16:02:02 +08:00
var map = {};
2025-02-12 17:32:24 +08:00
var lock = true;
2025-02-12 16:02:02 +08:00
this.detailsTable.forEach((res) => {
2025-02-12 17:32:24 +08:00
if (res.userId == (undefined || "") || res.val == undefined || "") {
lock = false;
}
2025-02-12 16:02:02 +08:00
map[res.userId] = res.val;
});
console.log(map);
this.whiteErbanNoProductionRatioMap = map;
2025-02-12 17:32:24 +08:00
if (lock) {
this.editDialogClick();
} else {
ElMessage({
showClose: true,
message: "用户ID和值不能为空",
type: "error",
});
}
2025-02-12 16:02:02 +08:00
},
// 详情编辑监听
2025-06-12 18:38:01 +08:00
handleEdit (index, row) {
2025-02-12 16:02:02 +08:00
// 这里可以添加保存逻辑例如调用API更新服务器数据等。
console.log(index, "保存行数据", row);
// 示例:更新本地数据或其他操作...
},
2024-09-14 19:03:04 +08:00
// 确认保存
2025-06-12 18:38:01 +08:00
editDialogClick () {
2024-09-14 19:03:04 +08:00
var obj = {};
obj.partitionId = this.inquire.value;
2024-09-19 19:12:43 +08:00
if (this.type == 12) {
this.butClick = true;
updateUserMulti({ erbanNo: this.value }).then((res) => {
if (res.code == 200) {
ElMessage({
showClose: true,
2025-02-12 16:02:02 +08:00
message: "赠送成功",
2024-09-19 19:12:43 +08:00
type: "success",
});
setTimeout(() => {
this.butClick = false;
}, 3000);
this.editDialog = false;
this.getData();
} else {
this.butClick = false;
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
} else {
if (this.type == 1) {
obj.productionRatio = this.value;
} else if (this.type == 2) {
obj.stock = this.value;
} else if (this.type == 3) {
obj.platformRatio = this.value;
} else if (this.type == 4) {
obj.receiverRatio = this.value;
2025-07-01 20:42:07 +08:00
} else if (this.type == 5) {
obj.preJudgeValue_H = this.value;
} else if (this.type == 6) {
obj.totalInput_J = this.value;
2024-09-19 19:12:43 +08:00
} else if (this.type == 9) {
obj.warnMulti = this.value;
} else if (this.type == 11) {
obj.followErbanNoList = this.value.split(",");
} else if (this.type == 16) {
obj.adminFollowErbanNoList = this.value.split(",");
2025-02-12 16:02:02 +08:00
} else if (this.type == 14) {
2025-02-12 17:32:24 +08:00
obj.whiteErbanNoProductionRatioMap =
this.whiteErbanNoProductionRatioMap;
2025-02-12 16:02:02 +08:00
} else if (this.type == 13) {
obj.blackErbanNoList = this.value.split(",");
2025-06-12 18:38:01 +08:00
} else if (this.type == 15) {
obj.extraStock = this.value;
2024-09-14 19:03:04 +08:00
}
2024-09-19 19:12:43 +08:00
updateSet(obj).then((res) => {
if (res.code == 200) {
ElMessage({
showClose: true,
message: "保存成功",
type: "success",
});
this.editDialog = false;
2025-02-12 16:02:02 +08:00
// this.detailsDialog = false;
2024-09-19 19:12:43 +08:00
this.getData();
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
}
2024-09-14 19:03:04 +08:00
},
2025-07-01 20:42:07 +08:00
// 确认保存
multiEditDialogClick () {
var obj = {};
obj.partitionId = this.inquire.value;
if (this.multiEditDialogTitle == "K1") {
obj.userRechargeLevel_totalInputOffset_K1 = this.multiEditObj;
} else if (this.multiEditDialogTitle == "K2") {
obj.userRechargeLevel_totalInputOffset_K2 = this.multiEditObj;
}
updateSet(obj).then((res) => {
if (res.code == 200) {
ElMessage({
showClose: true,
message: "保存成功",
type: "success",
});
this.multiEditDialog = false;
// this.detailsDialog = false;
this.getData();
} else {
ElMessage({
showClose: true,
message: res.message,
type: "error",
});
}
});
},
2024-09-14 19:03:04 +08:00
// 监听类型
2025-06-12 18:38:01 +08:00
handleChange (value) {
2024-09-14 19:03:04 +08:00
this.inquire.value = value;
this.getData();
},
2025-06-12 18:38:01 +08:00
// 确认保存
saveExtraPoolConfig () {
this.extraDialogButClick = false;
var obj = {};
obj.partitionId = this.inquire.value;
obj.extraPoolConfig = this.inquire.extraPoolConfig;
console.info(this.inquire.extraPoolConfig.userRechargeLevels)
obj.extraPoolConfig.userRechargeLevels = this.inquire.extraPoolConfig.userRechargeLevels.split(",");
2025-06-12 18:38:01 +08:00
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;
});
}
2024-09-14 19:03:04 +08:00
},
};
</script>
<style lang="less" scoped>
.box {
padding-top: 20px;
background: #ecf0f5;
.condition {
margin-bottom: 20px;
.inquire {
margin-right: 20px;
margin-bottom: 20px;
span {
display: inline-block;
width: 110px;
margin-right: 10px;
// text-align: right;
}
.input {
width: 180px;
margin-right: 10px;
}
}
}
.but {
margin-bottom: 20px;
}
}
</style>