Browse Source

这是汇率的修改

Hongxilin
donghaolin 5 months ago
parent
commit
9bbced4b7a
  1. 28
      vue/gold-system/src/views/managerecharge/rate.vue
  2. 563
      vue/gold-system/src/views/recharge/addRecharge.vue

28
vue/gold-system/src/views/managerecharge/rate.vue

@ -101,6 +101,20 @@ const search = function () {
const rateAdd = ref({});
const addRate = async function () {
rateAdd.value.adminId = adminData.value.adminId;
if (rateAdd.value.startTime) {
const date = new Date(rateAdd.value.startTime);
date.setHours(0, 0, 0, 0);
rateAdd.value.startTime = `${date.getFullYear()}-${String(
date.getMonth() + 1
).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")} 00:00:00`;
}
if (rateAdd.value.endTime) {
const date = new Date(rateAdd.value.endTime);
date.setHours(23, 59, 59, 999);
rateAdd.value.endTime = `${date.getFullYear()}-${String(
date.getMonth() + 1
).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")} 23:59:59`;
}
try {
console.log("搜索参数", getObj.value);
// POST
@ -171,6 +185,20 @@ const getEditData = async function (row) {
}
};
const editRate = async function () {
if (rateEdit.value.startTime) {
const date = new Date(rateEdit.value.startTime);
date.setHours(0, 0, 0, 0);
rateEdit.value.startTime = `${date.getFullYear()}-${String(
date.getMonth() + 1
).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")} 00:00:00`;
}
if (rateEdit.value.endTime) {
const date = new Date(rateEdit.value.endTime);
date.setHours(23, 59, 59, 999);
rateEdit.value.endTime = `${date.getFullYear()}-${String(
date.getMonth() + 1
).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")} 23:59:59`;
}
try {
console.log("搜索参数", rateEdit.value);
// POST

563
vue/gold-system/src/views/recharge/addRecharge.vue

@ -7,8 +7,8 @@ import { ElMessageBox } from "element-plus";
import API from "../../api/index.js";
import moment from "moment";
import { range, re } from "mathjs";
import { _debounce } from '../../util/index.js';
import * as xlsx from 'xlsx';
import { _debounce } from "../../util/index.js";
import * as xlsx from "xlsx";
//
const imageUrl = ref("");
@ -251,6 +251,17 @@ function handleActivityChange(value) {
getActivityById(value);
console.log("看看", addRecharge.value);
}
// paidGold
watch(
() => addRecharge.value.paidGold,
(newValue) => {
// paidGold freeGold rechargeGold
addRecharge.value.freeGold = newValue % addRecharge.value.rechargeRatio;
console.log("剩余金币", addRecharge.value.freeGold);
addRecharge.value.rechargeGold = newValue * addRecharge.value.Rate;
console.log("充值金币", addRecharge.value.rechargeGold);
}
);
//
const deleteRecharge = function () {
@ -285,7 +296,10 @@ const getJwcodeList = async function () {
console.log("请求成功", result);
//
jwcodeList.value = result.data;
jwcodeList.value = jwcodeList.value.map(item => ({ value: item, label: item }))
jwcodeList.value = jwcodeList.value.map((item) => ({
value: item,
label: item,
}));
console.log("精网号", jwcodeList.value);
} catch (error) {
console.log("请求失败", error);
@ -346,7 +360,9 @@ const batchInit = function () {
//
const addScrollListener = () => {
const SELECTWRAP_DOM = document.querySelector(".el-select-dropdown .el-select-dropdown__wrap");
const SELECTWRAP_DOM = document.querySelector(
".el-select-dropdown .el-select-dropdown__wrap"
);
if (SELECTWRAP_DOM) {
SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight;
@ -359,7 +375,9 @@ const vJwcodeLoadmore = {
mounted(el, binding) {
nextTick(() => {
console.log("el===", el, "binding===", binding);
const SELECTWRAP_DOM = el.querySelector(".el-select-dropdown .el-select-dropdown__wrap");
const SELECTWRAP_DOM = el.querySelector(
".el-select-dropdown .el-select-dropdown__wrap"
);
console.log("SELECTWRAP_DOM===", SELECTWRAP_DOM);
if (SELECTWRAP_DOM) {
SELECTWRAP_DOM.addEventListener("scroll", function () {
@ -371,12 +389,13 @@ const vJwcodeLoadmore = {
* 如果元素滚动到底, 下面等式返回true, 没有则返回false:
* ele.scrollHeight - ele.scrollTop === ele.clientHeight;
*/
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight;
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) binding.value();
});
}
})
}
});
},
};
//
// const jwcodeSelectScrollerListener = () => {
@ -417,13 +436,15 @@ const addLines = async function () {
const addLinesPromises = [];
for (let j = 0; j < addLineObj.value; j++) {
addLinesPromises.push(new Promise((resolve) => {
addLinesPromises.push(
new Promise((resolve) => {
batchData.value.unshift({
line: ++i.value,
showInput: true,
});
resolve();
}));
})
);
}
await Promise.all(addLinesPromises);
@ -445,32 +466,32 @@ const excelList = ref([]);
// upload Ref
const handleSetUploadRefMap = (el) => {
if (el) {
uploadRefMap.value[`Upload_Ref`] = el
uploadRefMap.value[`Upload_Ref`] = el;
}
}
};
//
const httpExcelRequest = async (op) => {
//
console.log(op.data)
console.log(op.data);
// excel
let file = op.file
let file = op.file;
let dataBinary = await readFile(file);
let workBook = xlsx.read(dataBinary, { type: "binary", cellDates: true })
let workSheet = workBook.Sheets[workBook.SheetNames[0]]
const excelData = xlsx.utils.sheet_to_json(workSheet, { header: 1 })
excelList.value = excelData
console.log(excelData)
}
let workBook = xlsx.read(dataBinary, { type: "binary", cellDates: true });
let workSheet = workBook.Sheets[workBook.SheetNames[0]];
const excelData = xlsx.utils.sheet_to_json(workSheet, { header: 1 });
excelList.value = excelData;
console.log(excelData);
};
const readFile = (file) => {
return new Promise((resolve) => {
let reader = new FileReader()
reader.readAsBinaryString(file)
let reader = new FileReader();
reader.readAsBinaryString(file);
reader.onload = (ev) => {
resolve(ev.target?.result)
}
})
}
resolve(ev.target?.result);
};
});
};
//
const handleSelectionChangebatch = function (val) {
@ -615,11 +636,13 @@ const changeRate = function (row) {
row.rechargeGold = Math.ceil(Number(row.paidGold) * rate);
}
}
};
//
const changeVoucher = function (row) {
if ((imageUrl.value != "" && rechargeVoucher.value != "") || (imageUrl.value != null && rechargeVoucher.value != null)) {
if (
(imageUrl.value != "" && rechargeVoucher.value != "") ||
(imageUrl.value != null && rechargeVoucher.value != null)
) {
console.log("row===", row);
row.imageUrl = imageUrl.value;
row.rechargeVoucher = rechargeVoucher.value;
@ -627,10 +650,9 @@ const changeVoucher = function (row) {
imageUrl.value = "";
rechargeVoucher.value = "";
}
}
};
//
const handleBatchAvatarSuccess = (response, uploadFile) => {
imageUrl.value = URL.createObjectURL(uploadFile.raw);
console.log("图片上传成功", response, uploadFile);
rechargeVoucher.value = `http://192.168.8.93:10010/upload/${response.data}`;
@ -673,7 +695,10 @@ const batchAdd = async function () {
}
console.log("batchData===", batchData.value);
const result = await API.post("http://192.168.8.93:10010/recharge/recharge/addmore", { ...batchData.value });
const result = await API.post(
"http://192.168.8.93:10010/recharge/recharge/addmore",
{ ...batchData.value }
);
if (result.code === 0) {
ElMessage.error("添加失败");
@ -703,7 +728,7 @@ const closeBatchSettingVisible = function () {
//
const batchSettingInit = function () {
openBatchSettingVisible();
}
};
//
const batchSettingHandleAvatarSuccess = (response, uploadFile) => {
batchSettingObj.value.imageUrl = URL.createObjectURL(uploadFile.raw);
@ -715,48 +740,81 @@ const batchSettingHandleAvatarSuccess = (response, uploadFile) => {
const cancelBatchSetting = function () {
batchSettingObj.value = {};
closeBatchSettingVisible();
}
};
//
const batchSettingConfirm = function () {
for (let i = 0; i < batchData.value.length; i++) {
if (batchSettingObj.value.jwcode != "" && batchSettingObj.value.jwcode != null) {
if (
batchSettingObj.value.jwcode != "" &&
batchSettingObj.value.jwcode != null
) {
batchData.value[i].jwcode = batchSettingObj.value.jwcode;
}
if (batchSettingObj.value.activityId != "" && batchSettingObj.value.activityId != null) {
if (
batchSettingObj.value.activityId != "" &&
batchSettingObj.value.activityId != null
) {
batchData.value[i].activityId = batchSettingObj.value.activityId;
}
if (batchSettingObj.value.paidGold != "" && batchSettingObj.value.paidGold != null) {
if (
batchSettingObj.value.paidGold != "" &&
batchSettingObj.value.paidGold != null
) {
batchData.value[i].paidGold = batchSettingObj.value.paidGold;
}
if (batchSettingObj.value.freeGold != "" && batchSettingObj.value.freeGold != null) {
if (
batchSettingObj.value.freeGold != "" &&
batchSettingObj.value.freeGold != null
) {
batchData.value[i].freeGold = batchSettingObj.value.freeGold;
}
if (batchSettingObj.value.rate != "" && batchSettingObj.value.rate != null) {
if (
batchSettingObj.value.rate != "" &&
batchSettingObj.value.rate != null
) {
batchData.value[i].rate = batchSettingObj.value.rate;
}
if (batchSettingObj.value.rechargeGold != "" && batchSettingObj.value.rechargeGold != null) {
if (
batchSettingObj.value.rechargeGold != "" &&
batchSettingObj.value.rechargeGold != null
) {
batchData.value[i].rechargeGold = batchSettingObj.value.rechargeGold;
}
if (batchSettingObj.value.payWay != "" && batchSettingObj.value.payWay != null) {
if (
batchSettingObj.value.payWay != "" &&
batchSettingObj.value.payWay != null
) {
batchData.value[i].payWay = batchSettingObj.value.payWay;
}
if (batchSettingObj.value.rechargeTime != "" && batchSettingObj.value.rechargeTime != null) {
if (
batchSettingObj.value.rechargeTime != "" &&
batchSettingObj.value.rechargeTime != null
) {
batchData.value[i].rechargeTime = batchSettingObj.value.rechargeTime;
}
if (batchSettingObj.value.imageUrl != "" && batchSettingObj.value.imageUrl != null) {
if (
batchSettingObj.value.imageUrl != "" &&
batchSettingObj.value.imageUrl != null
) {
batchData.value[i].imageUrl = batchSettingObj.value.imageUrl;
}
if (batchSettingObj.value.rechargeVoucher != "" && batchSettingObj.value.rechargeVoucher != null) {
batchData.value[i].rechargeVoucher = batchSettingObj.value.rechargeVoucher;
if (
batchSettingObj.value.rechargeVoucher != "" &&
batchSettingObj.value.rechargeVoucher != null
) {
batchData.value[i].rechargeVoucher =
batchSettingObj.value.rechargeVoucher;
}
if (batchSettingObj.value.remark != "" && batchSettingObj.value.remark != null) {
if (
batchSettingObj.value.remark != "" &&
batchSettingObj.value.remark != null
) {
batchData.value[i].remark = batchSettingObj.value.remark;
}
}
batchSettingObj.value = {};
closeBatchSettingVisible();
}
};
//
onMounted(async function () {
@ -770,14 +828,36 @@ onMounted(async function () {
<el-button type="primary" plain @click="batchInit()">批量充值</el-button>
</div>
<el-form :model="addRecharge" ref="Ref" :rules="rules" label-width="auto" style="max-width: 600px" class="add-form">
<el-form
:model="addRecharge"
ref="Ref"
:rules="rules"
label-width="auto"
style="max-width: 600px"
class="add-form"
>
<el-form-item prop="jwcode" label="精网号">
<el-input v-model="addRecharge.jwcode" style="width: 220px" />
<el-button type="primary" @click="getUser(addRecharge.jwcode)" style="margin-left: 20px">查询</el-button>
<el-button
type="primary"
@click="getUser(addRecharge.jwcode)"
style="margin-left: 20px"
>查询</el-button
>
</el-form-item>
<el-form-item prop="activityId" label="活动名称">
<el-select v-model="addRecharge.activityId" placeholder="请选择" style="width: 300px" @change="handleActivityChange">
<el-option v-for="item in activity" :key="item.value" :label="item.activityName" :value="item.activityId" />
<el-select
v-model="addRecharge.activityId"
placeholder="请选择"
style="width: 300px"
@change="handleActivityChange"
>
<el-option
v-for="item in activity"
:key="item.value"
:label="item.activityName"
:value="item.activityId"
/>
</el-select>
</el-form-item>
<el-form-item prop="paidGold" label="充值金币">
@ -788,24 +868,66 @@ onMounted(async function () {
<p></p>
</el-form-item>
<el-form-item prop="rechargeGold" label="充值金额">
<el-select prop="rechargeGold" v-model="Rate" placeholder="货币名称" style="width: 95px; margin-right: 5px">
<el-option v-for="item in currency" :key="item.value" :label="item.currency" :value="item.exchangeRate" />
<el-select
prop="rechargeGold"
v-model="Rate"
placeholder="货币名称"
style="width: 95px; margin-right: 5px"
>
<el-option
v-for="item in currency"
:key="item.value"
:label="item.currency"
:value="item.exchangeRate"
/>
</el-select>
<el-input v-model="addRecharge.rechargeGold" style="width: 200px" />
</el-form-item>
<el-form-item prop="payWay" label="收款方式">
<el-select v-model="addRecharge.payWay" placeholder="请选择" style="width: 300px">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
<el-select
v-model="addRecharge.payWay"
placeholder="请选择"
style="width: 300px"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item prop="rechargeTime" label="交款时间">
<el-date-picker v-model="addRecharge.rechargeTime" type="date" style="width: 300px" />
<el-date-picker
v-model="addRecharge.rechargeTime"
type="date"
style="width: 300px"
/>
</el-form-item>
<el-form-item prop="rechargeVoucher" label="交款凭证" style="margin-bottom: 5px">
<el-upload action="http://192.168.8.93:10010/upload" class="avatar-uploader" :show-file-list="false"
:on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload" style="width: 100px; height: 115px">
<img v-if="imageUrl" :src="imageUrl" class="avatar" style="width: 100px; height: 115px" />
<el-icon v-else class="avatar-uploader-icon" style="width: 100px; height: 100px">
<el-form-item
prop="rechargeVoucher"
label="交款凭证"
style="margin-bottom: 5px"
>
<el-upload
action="http://192.168.8.93:10010/upload"
class="avatar-uploader"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
style="width: 100px; height: 115px"
>
<img
v-if="imageUrl"
:src="imageUrl"
class="avatar"
style="width: 100px; height: 115px"
/>
<el-icon
v-else
class="avatar-uploader-icon"
style="width: 100px; height: 100px"
>
<Plus />
</el-icon>
</el-upload>
@ -814,19 +936,41 @@ onMounted(async function () {
</p>
</el-form-item>
<el-form-item prop="remark" label="备注">
<el-input v-model="addRecharge.remark" style="width: 300px" :rows="2" maxlength="100" show-word-limit
type="textarea" />
<el-input
v-model="addRecharge.remark"
style="width: 300px"
:rows="2"
maxlength="100"
show-word-limit
type="textarea"
/>
</el-form-item>
<el-form-item prop="submitter" label="提交人">
<el-input style="width: 300px" :value="adminData.name" disabled placeholder="提交人姓名" />
<el-input
style="width: 300px"
:value="adminData.name"
disabled
placeholder="提交人姓名"
/>
</el-form-item>
<el-button @click="deleteRecharge" style="margin-left: 280px">重置</el-button>
<el-button @click="deleteRecharge" style="margin-left: 280px"
>重置</el-button
>
<el-button type="primary" @click="addBefore"> 提交 </el-button>
</el-form>
<!-- 客户信息栏 -->
<el-card style="width: 1200px; float: right" class="customer-info" width="3000px">
<el-form :model="user" label-width="auto" style="max-width: 1200px" label-position="left">
<el-card
style="width: 1200px; float: right"
class="customer-info"
width="3000px"
>
<el-form
:model="user"
label-width="auto"
style="max-width: 1200px"
label-position="left"
>
<el-text size="large" style="margin-left: 20px">客户信息</el-text>
<el-row style="margin-top: 20px">
<el-col :span="10">
@ -849,10 +993,13 @@ onMounted(async function () {
<span style="color: #2fa1ff; margin-right: 5px" v-if="user.buyJb">{{
user.buyJb + user.free6 + user.free12 + user.coreJb
}}</span>
<span style="display: inline; white-space: nowrap; color: #b1b1b1" v-if="user.buyJb">(充值金币:{{ user.buyJb
}};免费金币:{{
<span
style="display: inline; white-space: nowrap; color: #b1b1b1"
v-if="user.buyJb"
>(充值金币:{{ user.buyJb }};免费金币:{{
user.free6 + user.free12
}};任务金币:{{ user.coreJb }})</span>
}};任务金币:{{ user.coreJb }})</span
>
</el-form-item>
</el-col>
<el-col :span="10">
@ -893,26 +1040,50 @@ onMounted(async function () {
</el-form>
</el-card>
<el-dialog v-model="batchRechargeVisible" title="批量充值" width="1800px" style="height: 700px"
:close-on-click-modal="false">
<el-dialog
v-model="batchRechargeVisible"
title="批量充值"
width="1800px"
style="height: 700px"
:close-on-click-modal="false"
>
<el-row style="margin-bottom: 10px">
<!-- <el-button type="primary" @click="addLine()" style="margin-right: 10px">新增一行</el-button> -->
<div style="font-weight: bold; font-size: 20px;">
<div style="font-weight: bold; font-size: 20px">
<span>添加</span>
<el-input style="width: 60px;" v-model="addLineObj"></el-input>
<el-input style="width: 60px" v-model="addLineObj"></el-input>
<span></span>
<el-button type="primary" @click="addLines()" style="margin-right: 10px;">添加</el-button>
<el-button type="primary" @click="addLines()" style="margin-right: 10px"
>添加</el-button
>
</div>
<el-button type="warning" @click="batchSettingInit()" style="margin-right: 10px;">批量设置</el-button>
<el-button
type="warning"
@click="batchSettingInit()"
style="margin-right: 10px"
>批量设置</el-button
>
<!-- <el-upload :ref="(el) => handleSetUploadRefMap(el)" action="" :http-request="httpExcelRequest" :limit="1" :show-file-list="false"
class="uploadExcelContent" :data={} style="margin-right: auto">
<el-button type="success" >导入jwcode</el-button>
</el-upload> -->
<el-button type="danger" plain @click="batchDel()" style="margin-right: 10px; width: 130px">批量删除</el-button>
<el-button
type="danger"
plain
@click="batchDel()"
style="margin-right: 10px; width: 130px"
>批量删除</el-button
>
</el-row>
<el-row >
<el-table v-loading="loading" :data="batchData" border max-height="540px" style="height: 540px"
@selection-change="handleSelectionChangebatch">
<el-row>
<el-table
v-loading="loading"
:data="batchData"
border
max-height="540px"
style="height: 540px"
@selection-change="handleSelectionChangebatch"
>
<el-table-column type="selection" width="50px" />
<el-table-column property="index" label="序号" width="55px">
<template #default="scope">
@ -931,18 +1102,35 @@ onMounted(async function () {
<el-option v-for="item in jwcodeList.slice(0, rangeNumber)" :key="item" :label="item" :value="item">
</el-option>
</el-select> -->
<el-select-v2 v-if="scope.row.showInput" filterable clearable v-model="scope.row.jwcode"
placeholder="请选择精网号" style="widows: 110px;" :options="jwcodeList">
<el-select-v2
v-if="scope.row.showInput"
filterable
clearable
v-model="scope.row.jwcode"
placeholder="请选择精网号"
style="widows: 110px"
:options="jwcodeList"
>
</el-select-v2>
<span v-else>{{ scope.row.jwcode }}</span>
</template>
</el-table-column>
<el-table-column property="activityName" label="活动名称" width="150px">
<template #default="scope">
<el-select v-if="scope.row.showInput" filterable clearable v-model="scope.row.activityId"
placeholder="请选择活动名称" @change="changeActivity(scope.row)">
<el-option v-for="item in activity" :key="item.activityId" :label="item.activityName"
:value="item.activityId">
<el-select
v-if="scope.row.showInput"
filterable
clearable
v-model="scope.row.activityId"
placeholder="请选择活动名称"
@change="changeActivity(scope.row)"
>
<el-option
v-for="item in activity"
:key="item.activityId"
:label="item.activityName"
:value="item.activityId"
>
</el-option>
</el-select>
<span v-else>{{ scope.row.activityName }}</span>
@ -950,23 +1138,41 @@ onMounted(async function () {
</el-table-column>
<el-table-column property="paidGold" label="充值金币" width="110px">
<template #default="scope">
<el-input v-if="scope.row.showInput" v-model="scope.row.paidGold" style="width: 70px"
@change="changePaidGold(scope.row)" />
<el-input
v-if="scope.row.showInput"
v-model="scope.row.paidGold"
style="width: 70px"
@change="changePaidGold(scope.row)"
/>
<span v-else>{{ scope.row.paidGold }}</span>
</template>
</el-table-column>
<el-table-column property="freeGold" label="免费金币" width="110px">
<template #default="scope">
<el-input v-if="scope.row.showInput" v-model="scope.row.freeGold" style="width: 70px" />
<el-input
v-if="scope.row.showInput"
v-model="scope.row.freeGold"
style="width: 70px"
/>
<span v-else>{{ scope.row.paidGold }}</span>
</template>
</el-table-column>
<el-table-column property="rate" label="货币名称">
<template #default="scope">
<el-select v-if="scope.row.showInput" filterable clearable v-model="scope.row.rate" placeholder="请选择币种"
@change="changeRate(scope.row)">
<el-option v-for="item in currency" :key="item.exchangeRate" :label="item.currency"
:value="item.exchangeRate">
<el-select
v-if="scope.row.showInput"
filterable
clearable
v-model="scope.row.rate"
placeholder="请选择币种"
@change="changeRate(scope.row)"
>
<el-option
v-for="item in currency"
:key="item.exchangeRate"
:label="item.currency"
:value="item.exchangeRate"
>
</el-option>
</el-select>
<span v-else>{{ scope.row.rate }}</span>
@ -979,8 +1185,19 @@ onMounted(async function () {
</el-table-column>
<el-table-column property="payWay" label="收款方式" width="130px">
<template #default="scope">
<el-select v-if="scope.row.showInput" filterable clearable v-model="scope.row.payWay" placeholder="请选择收款方式">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
<el-select
v-if="scope.row.showInput"
filterable
clearable
v-model="scope.row.payWay"
placeholder="请选择收款方式"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
<span v-else>{{ scope.row.payWay }}</span>
@ -988,8 +1205,13 @@ onMounted(async function () {
</el-table-column>
<el-table-column property="rechargeTime" label="交款时间" width="150px">
<template #default="scope">
<el-date-picker v-if="scope.row.showInput" type="date" v-model="scope.row.rechargeTime" style="width: 120px"
placeholder="请选择交款时间">
<el-date-picker
v-if="scope.row.showInput"
type="date"
v-model="scope.row.rechargeTime"
style="width: 120px"
placeholder="请选择交款时间"
>
</el-date-picker>
<span v-else>{{
moment(scope.row.rechargeTime).format("YYYY-MM-DD HH:mm:ss")
@ -998,9 +1220,19 @@ onMounted(async function () {
</el-table-column>
<el-table-column property="rechargeVoucher" label="充值凭证">
<template #default="scope">
<el-upload action="http://192.168.8.93:10010/upload" class="avatar-uploader" :show-file-list="false"
:on-success="handleBatchAvatarSuccess" v-if="scope.row.showInput" @change="changeVoucher(scope.row)">
<img v-if="scope.row.imageUrl" :src="scope.row.imageUrl" class="avatar" />
<el-upload
action="http://192.168.8.93:10010/upload"
class="avatar-uploader"
:show-file-list="false"
:on-success="handleBatchAvatarSuccess"
v-if="scope.row.showInput"
@change="changeVoucher(scope.row)"
>
<img
v-if="scope.row.imageUrl"
:src="scope.row.imageUrl"
class="avatar"
/>
<el-icon v-else class="avatar-uploader-icon">
<Plus />
</el-icon>
@ -1010,18 +1242,32 @@ onMounted(async function () {
</el-table-column>
<el-table-column property="remark" label="备注" width="130px">
<template #default="scope">
<el-input type="textarea" v-if="scope.row.showInput" v-model="scope.row.remark" style="max-width: 90px"
:rows="1" cols="12"></el-input>
<el-input
type="textarea"
v-if="scope.row.showInput"
v-model="scope.row.remark"
style="max-width: 90px"
:rows="1"
cols="12"
></el-input>
<span v-else>{{ scope.row.remark }}</span>
</template>
</el-table-column>
<el-table-column property="submitter" label="提交人">
<el-input :value="adminData.name" disabled />
</el-table-column>
<el-table-column fixed="right" prop="operation" label="操作" width="150px">
<el-table-column
fixed="right"
prop="operation"
label="操作"
width="150px"
>
<template #default="scope">
<div style="display: flex">
<el-popconfirm title="确定将此条信息删除吗?" @confirm="delConfirm">
<el-popconfirm
title="确定将此条信息删除吗?"
@confirm="delConfirm"
>
<template #reference>
<el-button type="danger" text @click="del(scope.row)">
删除
@ -1034,7 +1280,10 @@ onMounted(async function () {
</el-button>
</template>
</el-popconfirm>
<el-popconfirm title="确定将此条信息重置吗?" @confirm="resetConfirm">
<el-popconfirm
title="确定将此条信息重置吗?"
@confirm="resetConfirm"
>
<template #reference>
<el-button type="primary" text @click="reset(scope.row)">
重置
@ -1060,58 +1309,116 @@ onMounted(async function () {
</el-row>
</el-dialog>
<el-dialog v-model="batchSettingVisible" title="批量设置" :close-on-click-modal="false" style="width: 550px;">
<el-dialog
v-model="batchSettingVisible"
title="批量设置"
:close-on-click-modal="false"
style="width: 550px"
>
<el-form label-position="left" label-width="auto">
<el-form-item label="活动名称">
<el-select v-model="batchSettingObj.activityId" placeholder="请选择活动名称" clearable>
<el-option v-for="item in activity" :key="item.activityId" :label="item.activityName"
:value="item.activityId">
<el-select
v-model="batchSettingObj.activityId"
placeholder="请选择活动名称"
clearable
>
<el-option
v-for="item in activity"
:key="item.activityId"
:label="item.activityName"
:value="item.activityId"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="充值金币">
<el-input v-model="batchSettingObj.paidGold" placeholder="请输入充值金币"></el-input>
<el-input
v-model="batchSettingObj.paidGold"
placeholder="请输入充值金币"
></el-input>
</el-form-item>
<el-form-item label="免费金币">
<el-input v-model="batchSettingObj.freeGold"></el-input>
</el-form-item>
<el-form-item label="充值金额">
<div style="display: flex;">
<el-select v-model="batchSettingObj.rate" placeholder="请选择币种" style="width: 120px; margin-right: 10px;"
clearable>
<el-option v-for="item in currency" :key="item.exchangeRate" :label="item.currency"
:value="item.exchangeRate"></el-option>
<div style="display: flex">
<el-select
v-model="batchSettingObj.rate"
placeholder="请选择币种"
style="width: 120px; margin-right: 10px"
clearable
>
<el-option
v-for="item in currency"
:key="item.exchangeRate"
:label="item.currency"
:value="item.exchangeRate"
></el-option>
</el-select>
<el-input v-model="batchSettingObj.rechargeGold" placeholder="请输入充值金额"></el-input>
<el-input
v-model="batchSettingObj.rechargeGold"
placeholder="请输入充值金额"
></el-input>
</div>
</el-form-item>
<el-form-item prop="payWay" label="收款方式">
<el-select v-model="batchSettingObj.payWay" placeholder="请选择收款方式" clearable>
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
<el-select
v-model="batchSettingObj.payWay"
placeholder="请选择收款方式"
clearable
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="rechargeTime" label="交款时间">
<el-date-picker v-model="batchSettingObj.rechargeTime" type="date" placeholder="请选择交款时间"></el-date-picker>
<el-date-picker
v-model="batchSettingObj.rechargeTime"
type="date"
placeholder="请选择交款时间"
></el-date-picker>
</el-form-item>
<el-form-item prop="rechargeVoucher" label="交款凭证">
<el-upload action="http://192.168.8.93:10010/upload" class="avatar-uploader" :show-file-list="false"
:on-success="batchSettingHandleAvatarSuccess" :before-upload="beforeAvatarUpload"
style="width: 100px; height: 115px;">
<img v-if="batchSettingObj.imageUrl" :src="batchSettingObj.imageUrl" class="avatar"
style="width: 100px; height: 115px;" />
<el-icon v-else class="avatar-uploader-icon" style="width: 100px; height: 100px;">
<el-upload
action="http://192.168.8.93:10010/upload"
class="avatar-uploader"
:show-file-list="false"
:on-success="batchSettingHandleAvatarSuccess"
:before-upload="beforeAvatarUpload"
style="width: 100px; height: 115px"
>
<img
v-if="batchSettingObj.imageUrl"
:src="batchSettingObj.imageUrl"
class="avatar"
style="width: 100px; height: 115px"
/>
<el-icon
v-else
class="avatar-uploader-icon"
style="width: 100px; height: 100px"
>
<Plus />
</el-icon>
</el-upload>
</el-form-item>
<el-form-item prop="remark" label="备注">
<el-input type="textarea" v-model="batchSettingObj.remark" placeholder="请输入备注" />
<el-input
type="textarea"
v-model="batchSettingObj.remark"
placeholder="请输入备注"
/>
</el-form-item>
</el-form>
<el-button @click="cancelBatchSetting()" style="margin-left: 370px">取消</el-button>
<el-button @click="cancelBatchSetting()" style="margin-left: 370px"
>取消</el-button
>
<el-button type="primary" @click="batchSettingConfirm()"> 确认 </el-button>
</el-dialog>
</template>
<style scoped>

Loading…
Cancel
Save