提交 VIP办理

This commit is contained in:
2025-09-15 14:47:00 +08:00
parent c9b171d3af
commit e21ff23fa0
5 changed files with 1601 additions and 915 deletions

View File

@@ -1,7 +1,8 @@
<template>
<el-dialog
width="80%"
width="1200px"
title="开通VIP"
destroy-on-close
:close-on-click-modal="false"
:visible.sync="visible"
@close="handlereset"
@@ -40,7 +41,7 @@
</el-autocomplete>
</div>
</el-form-item>
<el-form-item
<!-- <el-form-item
label="账户余额"
v-if="dataForm.userKey"
style="width: 50%;float: left;"
@@ -53,7 +54,7 @@
style="font-style: normal; font-size: 16px; color: #17B3A3;"
>{{ dataForm.jf }}</em
>
</el-form-item>
</el-form-item> -->
</div>
<el-form-item label="VIP类型" prop="type" class="type_block">
@@ -69,7 +70,12 @@
</el-radio-group>
</el-form-item>
<el-form-item label="VIP年限" prop="year" class="year_block">
<el-radio-group v-model="dataForm.year" size="mini">
<div style="height: 40px;">
<el-radio-group
v-model="dataForm.year"
size="mini"
>
<el-radio
v-for="(option, index) in yearList"
:key="index"
@@ -78,46 +84,61 @@
{{ option.label }}
</el-radio>
</el-radio-group>
<span class="qita"
>其他<el-input v-model="dataForm.day"></el-input>&nbsp&nbsp天</span
>
</div >
<span class="qita"> </span>
<!-- 其他<el-input v-model="dataForm.day"></el-input>&nbsp&nbsp天 -->
</el-form-item>
<el-form-item label="预计费用" class="price_block">
<!-- <el-form-item label="预计费用" class="price_block">
<span style=" color: #f56c6c;">{{ dataForm.price }}</span>
</el-form-item> -->
<el-form-item label="支付方式" class="coin_block">
<div>
<el-radio-group v-model="dataForm.payType" @input="payTypeChange">
<el-radio label="微信">微信</el-radio>
<el-radio label="支付宝">支付宝</el-radio>
<el-radio label="天医币">天医币</el-radio>
<el-radio label="银行支付">银行支付</el-radio>
<el-radio label="海外支付">海外支付</el-radio>
<el-radio label="其他">其他</el-radio>
</el-radio-group>
</div>
</el-form-item>
<el-form-item label="抵扣天医币" class="coin_block">
<div> <el-input
style="width: 300px;"
v-model="dataForm.value"
placeholder="请输入需要抵扣的天医币"
>
</el-input></div>
<el-form-item label="金额" class="coin_block">
<div>
<el-input
clearable
v-model="dataForm.fee"
placeholder="请输入需要金额"
>
</el-input>
</div>
</el-form-item>
<el-form-item label="抵扣积分" class="coin_block">
<div> <el-input
style="width: 300px;"
v-model="dataForm.value"
placeholder="请输入需要抵扣的天医币"
>
</el-input></div>
<div>
<el-input
clearable
v-model="dataForm.jf"
placeholder="请输入需要抵扣的积分"
>
</el-input>
</div>
</el-form-item>
<el-form-item label="开通说明">
<el-form-item label="备注">
<el-input
type="textarea"
rows="5"
v-model="dataForm.remark"
placeholder="开通说明"
placeholder="备注"
>
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handlereset">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<el-button @click="handlereset" size="mini">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()" size="mini" >确定</el-button>
</span>
</el-dialog>
</template>
@@ -135,12 +156,14 @@ export default {
name: "",
tel: "",
email: "",
peanutCoin: "",
pageType: "", //vip类型
type: "", //vip类型
year: "",
day: "",
remark: "",
price: "0"
fee: 0, //金额
jf: 0 //积分
},
peanutCoin: 0, //天医币和积分总和判断是否为0
dataRule: {
@@ -160,12 +183,15 @@ export default {
]
},
typeList: [
{ value: "11", label: "超v" },
{ value: "12", label: "简易超v" },
{ value: "1", label: "医学超v" },
{ value: "2", label: "国学与心理学超v" },
{ value: "4", label: "中医学" },
{ value: "9", label: "中西汇通学" },
{ value: "5", label: "针灸学" },
{ value: "6", label: "肿瘤学" },
{ value: "2", label: "国学与心理学超v" },
{ value: "9", label: "中西汇通学" },
{ value: "7", label: "国学" },
{ value: "8", label: "心理学" }
],
@@ -178,14 +204,41 @@ export default {
},
methods: {
init(data) {
this.dataForm = {
id: 0,
name: "",
tel: "",
email: "",
pageType: "", //vip类型
type: "", //vip类型
year: "",
remark: "",
fee: 0, //金额
jf: 0 //积分
}
this.visible = true;
this.dataForm.userKey = data.tel || data.email;
this.dataForm.userId = data.id;
this.dataForm.name = data.name;
this.dataForm.tel = data.tel;
this.dataForm.email = data.email;
this.dataForm.peanutCoin = data.peanutCoin;
this.dataForm.jf = data.jf;
this.$http({
url: this.$http.adornUrl("/master/userVip/getUserVipInfoByUserId"),
method: "post",
data: this.$http.adornData({
userId: data.id
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.dataForm = data.userVipInfo;
} else {
cb([]);
}
});
// this.dataForm.userKey = data.tel || data.email;
// this.dataForm.userId = data.id;
// this.dataForm.name = data.name;
// this.dataForm.tel = data.tel;
// this.dataForm.email = data.email;
// this.dataForm.peanutCoin = data.peanutCoin;
// this.dataForm.jf = data.jf;
},
handleSelect(data) {
console.log("data at line 161:", data);
@@ -194,8 +247,6 @@ export default {
this.dataForm.name = data.name;
this.dataForm.tel = data.tel;
this.dataForm.email = data.email;
this.dataForm.peanutCoin = data.peanutCoin;
this.dataForm.jf = data.jf;
},
loadAll(queryString, cb) {
this.dataForm.userId = "";
@@ -222,9 +273,74 @@ export default {
}
});
},
payTypeChange(e){
console.log('e at line 261:', e)
if (this.dataForm.payType == "海外支付") {
this.dataForm.fee=0;
this.dataForm.jf=0;
}
},
//表单提交
dataFormSubmit() {},
dataFormSubmit() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
if (!this.dataForm.userId) {
this.$message.error("请选择用户");
return;
}
if (!this.dataForm.payType) {
this.$message.error("请输入支付方式");
return;
}
// if (this.dataForm.jf == 0 && this.dataForm.fee == 0) {
// this.$message.error("请重新填写金额或者积分,不能都为0");
// return;
// }
if (this.dataForm.payType == "海外支付") {
this.dataForm.fee=0;
this.dataForm.jf=0;
}
if (this.dataForm.payType == "其他") {
if (!this.dataForm.remark) {
this.$message.error("请输入备注");
return;
}
}
var data = {
...this.dataForm,
jf: this.dataForm.jf || 0,
fee: this.dataForm.fee || 0
};
data.adminId = 1;
console.log("...this.dataForm at line 273:", this.dataForm);
this.$http({
url: this.$http.adornUrl("/master/userVip/addUserVipByAdmin"),
method: "post",
data: this.$http.adornData({
...data
})
}).then(({ data }) => {
if (data && data.code === 0) {
this.$message({
message: "操作成功",
type: "success",
duration: 1500,
onClose: () => {
this.visible = false;
this.$emit("refreshDataList");
}
});
} else {
this.$message.error(data.msg);
}
});
}
});
},
//取消
handlereset() {
this.visible = false;
@@ -286,7 +402,7 @@ export default {
}
/deep/.el-radio__label {
padding-left: 3px;
padding-right: 25px;
padding-right: 10px;
}
}
</style>