|
|
@ -569,6 +569,53 @@ const cancelBatch = function () { |
|
|
|
}); |
|
|
|
}; |
|
|
|
// |
|
|
|
const changeActivity = function (row) { |
|
|
|
console.log("row===", row); |
|
|
|
let ratio = 0; |
|
|
|
for (let i = 0; i < activity.value.length; i++) { |
|
|
|
if (activity.value[i].activityId == row.activityId) { |
|
|
|
ratio = activity.value[i].rechargeRatio; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
console.log("ratio===", ratio); |
|
|
|
if (row.paidGold == null || row.paidGold == "") { |
|
|
|
row.freeGold = 0; |
|
|
|
} else { |
|
|
|
if (ratio == 0) { |
|
|
|
row.freeGold = 0; |
|
|
|
} else { |
|
|
|
row.freeGold = Math.ceil(row.paidGold / ratio); |
|
|
|
// for (let i = 0; i < batchData.value.length; i++) { |
|
|
|
// if (batchData.value[i].line == row.line) { |
|
|
|
// batchData.value[i].freeGold = Math.ceil(row.paidGold / ratio); |
|
|
|
// break; |
|
|
|
// } |
|
|
|
// }; |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
// |
|
|
|
const changePaidGold = function (row) { |
|
|
|
console.log("row===", row); |
|
|
|
let ratio = 0; |
|
|
|
if (row.activityId == null || row.activityId == "") { |
|
|
|
row.freeGold = 0; |
|
|
|
} else { |
|
|
|
for (let i = 0; i < activity.value.length; i++) { |
|
|
|
if (activity.value[i].activityId == row.activityId) { |
|
|
|
ratio = activity.value[i].rechargeRatio; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (ratio == 0) { |
|
|
|
row.freeGold = 0; |
|
|
|
} else { |
|
|
|
row.freeGold = Math.ceil(Number(row.paidGold) / ratio); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
// |
|
|
|
const calculatedRowFreeGold = function (row) { |
|
|
|
console.log("row===", row); |
|
|
|
let ratio = 0; |
|
|
@ -593,7 +640,7 @@ const calculatedRowFreeGold = function (row) { |
|
|
|
}; |
|
|
|
|
|
|
|
const calculatedRowRechargeGold = computed(() => { |
|
|
|
if (!Rate.value == 0) { |
|
|
|
if (Rate.value != 0) { |
|
|
|
const paidGold = Number(addRecharge.value.paidGold) || 0; |
|
|
|
const rate = Number(Rate.value) || 1; // 避免乘以0 |
|
|
|
return Number(Math.ceil(paidGold * rate)); |
|
|
@ -656,7 +703,7 @@ const batchAdd = function () { |
|
|
|
<template> |
|
|
|
<div style="display: flex"> |
|
|
|
<div style="margin-right: 20px">新增充值</div> |
|
|
|
<!-- <el-button type="primary" plain @click="batchInit()">批量充值</el-button> --> |
|
|
|
<el-button type="primary" plain @click="batchInit()">批量充值</el-button> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-form |
|
|
@ -871,11 +918,12 @@ const batchAdd = function () { |
|
|
|
</el-form> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
<!-- <el-dialog |
|
|
|
<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: auto" |
|
|
@ -905,8 +953,7 @@ const batchAdd = function () { |
|
|
|
</el-table-column> |
|
|
|
<el-table-column property="jwcode" label="精网号" width="150px"> |
|
|
|
<template #default="scope"> |
|
|
|
<input |
|
|
|
type="number" |
|
|
|
<el-input |
|
|
|
v-if="scope.row.showInput" |
|
|
|
v-model="scope.row.jwcode" |
|
|
|
style="width: 110px" |
|
|
@ -922,12 +969,11 @@ const batchAdd = function () { |
|
|
|
clearable |
|
|
|
v-model="scope.row.activityId" |
|
|
|
placeholder="请选择活动名称" |
|
|
|
@change="handleSelectionChange" |
|
|
|
@change="changeActivity(scope.row)" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in activity" |
|
|
|
:key="item.value" |
|
|
|
:key="item.activityId" |
|
|
|
:label="item.activityName" |
|
|
|
:value="item.activityId" |
|
|
|
> |
|
|
@ -938,20 +984,26 @@ const batchAdd = function () { |
|
|
|
</el-table-column> |
|
|
|
<el-table-column property="paidGold" label="充值金币" width="110px"> |
|
|
|
<template #default="scope"> |
|
|
|
<input |
|
|
|
<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 disabled v-model="scope.row.freeGold"></el-input> |
|
|
|
<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="rechargeGold" label="充值金额"> |
|
|
|
<el-table-column property="rate" label="货币名称"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-select |
|
|
|
v-if="scope.row.showInput" |
|
|
@ -962,7 +1014,7 @@ const batchAdd = function () { |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in currency" |
|
|
|
:key="item.value" |
|
|
|
:key="item.exchangeRate" |
|
|
|
:label="item.currency" |
|
|
|
:value="item.exchangeRate" |
|
|
|
> |
|
|
@ -973,7 +1025,7 @@ const batchAdd = function () { |
|
|
|
</el-table-column> |
|
|
|
<el-table-column property="rechargeGold" label="充值金额" width="110px"> |
|
|
|
<template #default="scope"> |
|
|
|
<el-input disabled v-model="scope.row.rechargeGold"></el-input> |
|
|
|
<el-input v-model="scope.row.rechargeGold"></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column property="payWay" label="收款方式" width="130px"> |
|
|
@ -1012,25 +1064,34 @@ const batchAdd = function () { |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column property="rechargeVoucher" label="充值凭证"> |
|
|
|
<span> X </span> |
|
|
|
<template #default="scope"> |
|
|
|
<el-upload class="avatar-uploader" :show-file-list="true" :on-success="handleAvatarSuccess" |
|
|
|
:before-upload="beforeAvatarUpload" v-if="scope.row.showInput"> |
|
|
|
<img v-if="scope.row.imageUrl" :src="scope.row.imageUrl" class="avatar" /> |
|
|
|
<template #default="scope"> |
|
|
|
<el-upload |
|
|
|
class="avatar-uploader" |
|
|
|
:show-file-list="true" |
|
|
|
:on-success="handleAvatarSuccess" |
|
|
|
:before-upload="beforeAvatarUpload" |
|
|
|
v-if="scope.row.showInput" |
|
|
|
> |
|
|
|
<img |
|
|
|
v-if="scope.row.imageUrl" |
|
|
|
:src="scope.row.imageUrl" |
|
|
|
class="avatar" |
|
|
|
/> |
|
|
|
<el-icon v-else class="avatar-uploader-icon"></el-icon> |
|
|
|
</el-upload> |
|
|
|
</el-upload> |
|
|
|
<span v-else>{{ scope.row.rechargeVoucher }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column property="remark" label="备注" width="130px"> |
|
|
|
<template #default="scope"> |
|
|
|
<textarea |
|
|
|
<el-input |
|
|
|
type="textarea" |
|
|
|
v-if="scope.row.showInput" |
|
|
|
v-model="scope.row.remark" |
|
|
|
style="max-width: 90px" |
|
|
|
rows="1" |
|
|
|
cols="12" |
|
|
|
></textarea> |
|
|
|
></el-input> |
|
|
|
<span v-else>{{ scope.row.remark }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -1088,7 +1149,7 @@ const batchAdd = function () { |
|
|
|
<el-button type="primary" @click="batchAdd()"> 提交 </el-button> |
|
|
|
</div> |
|
|
|
</el-row> |
|
|
|
</el-dialog> --> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|