|
|
@ -77,9 +77,9 @@ const recharge = ref({ |
|
|
|
const add = async function () { |
|
|
|
try { |
|
|
|
|
|
|
|
const formattedRecharge = { ...recharge.value} |
|
|
|
const formattedRecharge = { ...recharge.value } |
|
|
|
|
|
|
|
// 将永久金币数、免费金币数和充值金额数乘以 100 |
|
|
|
// 将永久金币数、免费金币数和充值金额数乘以 100 |
|
|
|
if (formattedRecharge.permanentGold) { |
|
|
|
formattedRecharge.permanentGold = Number(formattedRecharge.permanentGold) * 100; |
|
|
|
} |
|
|
@ -154,7 +154,7 @@ const addBefore = () => { |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
if(recharge.value.money == null || recharge.value.money == '' || recharge.value.money == undefined){ |
|
|
|
if (recharge.value.money == null || recharge.value.money == '' || recharge.value.money == undefined) { |
|
|
|
ElMessage({ |
|
|
|
type: 'error', |
|
|
|
message: '请输入充值金额' |
|
|
@ -187,21 +187,20 @@ const addBefore = () => { |
|
|
|
// 表单验证 |
|
|
|
// 开始时间改变时,重新验证结束时间 |
|
|
|
const Ref = ref(null) |
|
|
|
|
|
|
|
const validateJwCode = (rule, value, callback) => { |
|
|
|
if (!value) { |
|
|
|
callback(new Error('精网号不能为空')); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (/[^0-9]/.test(value)) { |
|
|
|
callback(new Error('精网号只能包含数字')); |
|
|
|
return; |
|
|
|
} |
|
|
|
callback(); |
|
|
|
}; |
|
|
|
|
|
|
|
const rules = reactive({ |
|
|
|
jwcode: [{ required: true, validator: validateJwCode, trigger: 'blur' }], |
|
|
|
jwcode: [{ |
|
|
|
required: true, validator: (rule, value, callback) => { |
|
|
|
if (!value) { |
|
|
|
callback(new Error('精网号不能为空')); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (/[^0-9]/.test(value)) { |
|
|
|
callback(new Error('精网号只能包含数字')); |
|
|
|
return; |
|
|
|
} |
|
|
|
callback(); |
|
|
|
}, trigger: 'blur' |
|
|
|
}], |
|
|
|
activity: [{ required: true, message: '请选择活动名称', trigger: 'blur' }], |
|
|
|
permanentGold: [ |
|
|
|
{ required: true, message: '请输入永久金币数', trigger: 'blur' }, |
|
|
@ -539,25 +538,12 @@ onMounted(() => { |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
|
|
|
|
<el-form |
|
|
|
:model="recharge" |
|
|
|
ref="Ref" |
|
|
|
:rules="rules" |
|
|
|
label-width="auto" |
|
|
|
style="max-width: 600px" |
|
|
|
class="add-form" |
|
|
|
> |
|
|
|
<el-form-item prop="jwcode" label="精网号"> |
|
|
|
<el-input v-model="recharge.jwcode" style="width: 220px" /> |
|
|
|
<el-button |
|
|
|
type="primary" |
|
|
|
@click="getUser(recharge.jwcode)" |
|
|
|
style="margin-left: 20px" |
|
|
|
|
|
|
|
>查询</el-button |
|
|
|
> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item prop="activity" label="活动名称"> |
|
|
|
<el-form :model="recharge" ref="Ref" :rules="rules" label-width="auto" style="max-width: 600px" class="add-form"> |
|
|
|
<el-form-item prop="jwcode" label="精网号"> |
|
|
|
<el-input v-model="recharge.jwcode" style="width: 220px" /> |
|
|
|
<el-button type="primary" @click="getUser(recharge.jwcode)" style="margin-left: 20px">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item prop="activity" label="活动名称"> |
|
|
|
<el-select |
|
|
|
v-model="recharge.activity" |
|
|
|
placeholder="请选择" |
|
|
@ -572,24 +558,20 @@ onMounted(() => { |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> --> |
|
|
|
<el-form-item prop="activity" label="活动名称"> |
|
|
|
<el-input |
|
|
|
v-model="recharge.activity" |
|
|
|
placeholder="请输入活动名称" |
|
|
|
style="width: 300px" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="permanentGold" label="永久金币"> |
|
|
|
<el-input v-model="recharge.permanentGold" style="width: 100px" /> |
|
|
|
<p>个</p> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="freeGold" label="免费金币"> |
|
|
|
|
|
|
|
<el-input v-model="recharge.freeGold" style="width: 100px" /> |
|
|
|
<p>个</p> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item label="充值金额"> |
|
|
|
<el-form-item prop="activity" label="活动名称"> |
|
|
|
<el-input v-model="recharge.activity" placeholder="请输入活动名称" style="width: 300px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="permanentGold" label="永久金币"> |
|
|
|
<el-input v-model="recharge.permanentGold" style="width: 100px" /> |
|
|
|
<p>个</p> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="freeGold" label="免费金币"> |
|
|
|
|
|
|
|
<el-input v-model="recharge.freeGold" style="width: 100px" /> |
|
|
|
<p>个</p> |
|
|
|
</el-form-item> |
|
|
|
<!-- <el-form-item label="充值金额"> |
|
|
|
<el-select |
|
|
|
prop="moneys" |
|
|
|
v-model="rateName" |
|
|
@ -607,203 +589,139 @@ onMounted(() => { |
|
|
|
<el-input prop="money" v-model="recharge.money" style="width: 200px" aria-required="true"/> |
|
|
|
</el-form-item> --> |
|
|
|
|
|
|
|
<el-form-item label="充值金额" required> |
|
|
|
<!-- 货币名称 --> |
|
|
|
<el-form-item prop="rateName" style="display: inline-block; margin-left:0;"> |
|
|
|
<el-select |
|
|
|
v-model="recharge.rateName" |
|
|
|
placeholder="货币名称" |
|
|
|
style="width: 100px" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in rateName" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<!-- 充值金额 --> |
|
|
|
<el-form-item prop="money" style="display: inline-block; margin-left:10px;"> |
|
|
|
<el-input v-model="recharge.money" style="width: 190px"/> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="payModel" label="收款方式"> |
|
|
|
<el-select |
|
|
|
v-model="recharge.payModel" |
|
|
|
placeholder="请选择" |
|
|
|
style="width: 300px" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in payModel" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="payTime" label="交款时间"> |
|
|
|
<!-- 修改 type 属性为 datetime 以支持时分秒选择 --> |
|
|
|
<el-date-picker |
|
|
|
v-model="recharge.payTime" |
|
|
|
type="datetime" |
|
|
|
style="width: 300px" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item |
|
|
|
prop="voucher" |
|
|
|
label="交款凭证" |
|
|
|
style="margin-bottom: 5px" |
|
|
|
> |
|
|
|
<el-upload |
|
|
|
:http-request="customUpload" |
|
|
|
class="avatar-uploader" |
|
|
|
:show-file-list="false" |
|
|
|
: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> |
|
|
|
<p style="margin-left: 10px; color: rgb(177, 176, 176)"> |
|
|
|
仅支持.jpg .png格式,文件≤1MB |
|
|
|
</p> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="remark" label="备注"> |
|
|
|
<el-input |
|
|
|
v-model="recharge.remark" |
|
|
|
style="width: 300px" |
|
|
|
:rows="2" |
|
|
|
maxlength="100" |
|
|
|
show-word-limit |
|
|
|
type="textarea" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="adminName" label="提交人"> |
|
|
|
<el-input |
|
|
|
style="width: 300px" |
|
|
|
:value="adminData.adminName" |
|
|
|
disabled |
|
|
|
placeholder="提交人姓名" |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-button @click="deleteRecharge" style="margin-left: 280px" type="success" |
|
|
|
>重置</el-button |
|
|
|
> |
|
|
|
<el-button type="primary" @click="addBefore"> 提交 </el-button> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<!-- 客户信息栏 --> |
|
|
|
<el-card v-if="user.jwcode" style="width: 800px; float: right" class="customer-info"> |
|
|
|
<el-form |
|
|
|
:model="user" |
|
|
|
label-width="auto" |
|
|
|
style="max-width: 1000px" |
|
|
|
label-position="left" |
|
|
|
> |
|
|
|
<el-text size="large" style="margin-left: 20px">客户信息</el-text> |
|
|
|
|
|
|
|
<!-- 第一行:姓名 + 历史金币 --> |
|
|
|
<el-row style="margin-top: 20px"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="姓名:"> |
|
|
|
<p>{{ user.name }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="历史金币总数"> |
|
|
|
<!-- 检查 user.historySumGold 是否为有效的数字 --> |
|
|
|
<p style="color: #2fa1ff; margin-right: 5px" v-if="!isNaN(Number(user.historySumGold))"> |
|
|
|
{{ Number(user.historySumGold ) /100 }} |
|
|
|
</p> |
|
|
|
|
|
|
|
<!-- 如果不是有效的数字,显示默认值 --> |
|
|
|
<p v-else></p> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item style="margin-top: -23px"> |
|
|
|
<span |
|
|
|
style="display: inline; white-space: nowrap; color: #b1b1b1" |
|
|
|
v-if="user.historyPermanentGold !== undefined" |
|
|
|
>(永久金币:{{ user.historyPermanentGold /100 }};免费金币:{{ |
|
|
|
(user.historyFreeGold) /100 |
|
|
|
}};任务金币:{{ user.historyTaskGold /100}})</span> |
|
|
|
<el-form-item label="充值金额" required> |
|
|
|
<!-- 货币名称 --> |
|
|
|
<el-form-item prop="rateName" style="display: inline-block; margin-left:0;"> |
|
|
|
<el-select v-model="recharge.rateName" placeholder="货币名称" style="width: 100px"> |
|
|
|
<el-option v-for="item in rateName" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第二行:精网号 + 当前金币(独立行) --> |
|
|
|
<el-row style="margin-top:-23px"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="精网号"> |
|
|
|
<p>{{ user.jwcode }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="当前金币总数" style="width: 500px"> |
|
|
|
<span |
|
|
|
style="color: #2fa1ff; margin-right: 5px" |
|
|
|
v-if="user.nowSumGold !== undefined" |
|
|
|
>{{ user.nowSumGold /100}}</span> |
|
|
|
</el-form-item> |
|
|
|
<!-- 金币详情独立显示 --> |
|
|
|
<el-form-item style="margin-top: -23px"> <!-- 负边距减少间距 --> |
|
|
|
<span |
|
|
|
style="color: #b1b1b1; margin-left: 0px" |
|
|
|
v-if="user.nowPermanentGold !== undefined" |
|
|
|
>(永久金币:{{ user.nowPermanentGold /100}}; |
|
|
|
免费金币:{{ user.nowFreeGold /100}}; |
|
|
|
任务金币:{{ user.nowTaskGold /100}})</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第三行:首次充值日期 + 充值次数 --> |
|
|
|
<el-row style="margin-top:-23px"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="首次充值日期"> |
|
|
|
<p v-if="user.firstRecharge"> |
|
|
|
{{ moment(user.firstRecharge).format('YYYY-MM-DD HH:mm:ss') }} |
|
|
|
</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="充值次数"> |
|
|
|
<p style="color: #2fa1ff">{{ user.rechargeNum }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第四行:消费次数 + 所属门店 --> |
|
|
|
<el-row> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="消费次数"> |
|
|
|
<p style="color: #2fa1ff">{{ user.consumeNum }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="所属门店"> |
|
|
|
<p>{{ user.market }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
<!-- 充值金额 --> |
|
|
|
<el-form-item prop="money" style="display: inline-block; margin-left:10px;"> |
|
|
|
<el-input v-model="recharge.money" style="width: 190px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item prop="payModel" label="收款方式"> |
|
|
|
<el-select v-model="recharge.payModel" placeholder="请选择" style="width: 300px"> |
|
|
|
<el-option v-for="item in payModel" :key="item.value" :label="item.label" :value="item.value" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="payTime" label="交款时间"> |
|
|
|
<!-- 修改 type 属性为 datetime 以支持时分秒选择 --> |
|
|
|
<el-date-picker v-model="recharge.payTime" type="datetime" style="width: 300px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="voucher" label="交款凭证" style="margin-bottom: 5px"> |
|
|
|
<el-upload :http-request="customUpload" class="avatar-uploader" :show-file-list="false" |
|
|
|
: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> |
|
|
|
<p style="margin-left: 10px; color: rgb(177, 176, 176)"> |
|
|
|
仅支持.jpg .png格式,文件≤1MB |
|
|
|
</p> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="remark" label="备注"> |
|
|
|
<el-input v-model="recharge.remark" style="width: 300px" :rows="2" maxlength="100" show-word-limit |
|
|
|
type="textarea" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="adminName" label="提交人"> |
|
|
|
<el-input style="width: 300px" :value="adminData.adminName" disabled placeholder="提交人姓名" /> |
|
|
|
</el-form-item> |
|
|
|
<el-button @click="deleteRecharge" style="margin-left: 280px" type="success">重置</el-button> |
|
|
|
<el-button type="primary" @click="addBefore"> 提交 </el-button> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<!-- 客户信息栏 --> |
|
|
|
<el-card v-if="user.jwcode" style="width: 800px; float: right" class="customer-info"> |
|
|
|
<el-form :model="user" label-width="auto" style="max-width: 1000px" label-position="left"> |
|
|
|
<el-text size="large" style="margin-left: 20px">客户信息</el-text> |
|
|
|
|
|
|
|
<!-- 第一行:姓名 + 历史金币 --> |
|
|
|
<el-row style="margin-top: 20px"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="姓名:"> |
|
|
|
<p>{{ user.name }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="历史金币总数"> |
|
|
|
<!-- 检查 user.historySumGold 是否为有效的数字 --> |
|
|
|
<p style="color: #2fa1ff; margin-right: 5px" v-if="!isNaN(Number(user.historySumGold))"> |
|
|
|
{{ Number(user.historySumGold) / 100 }} |
|
|
|
</p> |
|
|
|
|
|
|
|
<!-- 如果不是有效的数字,显示默认值 --> |
|
|
|
<p v-else></p> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item style="margin-top: -23px"> |
|
|
|
<span style="display: inline; white-space: nowrap; color: #b1b1b1" |
|
|
|
v-if="user.historyPermanentGold !== undefined">(永久金币:{{ user.historyPermanentGold / 100 }};免费金币:{{ |
|
|
|
(user.historyFreeGold) / 100 |
|
|
|
}};任务金币:{{ user.historyTaskGold / 100 }})</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第二行:精网号 + 当前金币(独立行) --> |
|
|
|
<el-row style="margin-top:-23px"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="精网号"> |
|
|
|
<p>{{ user.jwcode }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="当前金币总数" style="width: 500px"> |
|
|
|
<span style="color: #2fa1ff; margin-right: 5px" v-if="user.nowSumGold !== undefined">{{ user.nowSumGold |
|
|
|
/100}}</span> |
|
|
|
</el-form-item> |
|
|
|
<!-- 金币详情独立显示 --> |
|
|
|
<el-form-item style="margin-top: -23px"> <!-- 负边距减少间距 --> |
|
|
|
<span style="color: #b1b1b1; margin-left: 0px" v-if="user.nowPermanentGold !== undefined">(永久金币:{{ |
|
|
|
user.nowPermanentGold /100}}; |
|
|
|
免费金币:{{ user.nowFreeGold / 100 }}; |
|
|
|
任务金币:{{ user.nowTaskGold / 100 }})</span> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第三行:首次充值日期 + 充值次数 --> |
|
|
|
<el-row style="margin-top:-23px"> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="首次充值日期"> |
|
|
|
<p v-if="user.firstRecharge"> |
|
|
|
{{ moment(user.firstRecharge).format('YYYY-MM-DD HH:mm:ss') }} |
|
|
|
</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="14"> |
|
|
|
<el-form-item label="充值次数"> |
|
|
|
<p style="color: #2fa1ff">{{ user.rechargeNum }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<!-- 第四行:消费次数 + 所属门店 --> |
|
|
|
<el-row> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="消费次数"> |
|
|
|
<p style="color: #2fa1ff">{{ user.consumeNum }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="9"> |
|
|
|
<el-form-item label="所属门店"> |
|
|
|
<p>{{ user.market }}</p> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
</el-card> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<style scoped> |
|
|
|