提交
This commit is contained in:
@@ -87,6 +87,8 @@ const mainRoutes = {
|
||||
|
||||
{ path: '/medicalrecords-medicalList', component: _import('modules/medicalrecords/medicalList'), name: 'medicalrecords-medicalList', meta: { title: '医案列表', isTab: true } },
|
||||
{ path: '/medicalrecords-userList', component: _import('modules/medicalrecords/userList'), name: 'medicalrecords-userList', meta: { title: '审核人员列表', isTab: true } },
|
||||
{ path: '/vipList-userList', component: _import('modules/vipList/userList'), name: 'vipList-userList', meta: { title: 'VIP用户列表', isTab: true } },
|
||||
{ path: '/vipList-vipDetail', component: _import('modules/vipList/vipDetail'), name: 'vipList-vipDetail', meta: { title: 'VIP详情', isTab: true } },
|
||||
|
||||
],
|
||||
beforeEnter (to, from, next) {
|
||||
|
||||
@@ -646,7 +646,11 @@ export default {
|
||||
addJF,
|
||||
OpenVip
|
||||
},
|
||||
|
||||
activated() {
|
||||
if(this.$route.params.key){
|
||||
this.dataForm.key = this.$route.params.key
|
||||
}
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
|
||||
292
src/views/modules/vipList/user-open-vip.vue
Normal file
292
src/views/modules/vipList/user-open-vip.vue
Normal file
@@ -0,0 +1,292 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
width="80%"
|
||||
title="开通VIP"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible"
|
||||
@close="handlereset"
|
||||
>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="120px"
|
||||
>
|
||||
<div style="overflow: hidden;">
|
||||
<el-form-item
|
||||
style="width: 50%;float: left;"
|
||||
label="手机号/邮箱:"
|
||||
prop="userKey"
|
||||
class="form_item"
|
||||
>
|
||||
<div style="display: flex;align-items: center;">
|
||||
<el-autocomplete
|
||||
size="small"
|
||||
style="width: 100%;"
|
||||
v-model="dataForm.userKey"
|
||||
:fetch-suggestions="loadAll"
|
||||
placeholder="请输入手机号/邮箱"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<template #default="{ item }">
|
||||
<div class="custom-item">
|
||||
<span>{{ item.tel ? item.tel : item.email }}</span>
|
||||
<span style="color: gray; margin-left: 10px;" v-if="item.name"
|
||||
>({{ item.name }})</span
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
label="账户余额"
|
||||
v-if="dataForm.userKey"
|
||||
style="width: 50%;float: left;"
|
||||
>
|
||||
天医币 <em
|
||||
style="font-style: normal; font-size: 16px; color: #17B3A3;"
|
||||
>{{ dataForm.peanutCoin }}</em
|
||||
>
|
||||
   积分 <em
|
||||
style="font-style: normal; font-size: 16px; color: #17B3A3;"
|
||||
>{{ dataForm.jf }}</em
|
||||
>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item label="VIP类型" prop="type" class="type_block">
|
||||
<el-radio-group v-model="dataForm.type" size="mini">
|
||||
<el-radio
|
||||
style="margin-right: 10px;"
|
||||
v-for="(option, index) in typeList"
|
||||
:key="index"
|
||||
:label="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</el-radio>
|
||||
</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">
|
||||
<el-radio
|
||||
v-for="(option, index) in yearList"
|
||||
:key="index"
|
||||
:label="option.value"
|
||||
>
|
||||
{{ option.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
<span class="qita"
|
||||
>其他:<el-input v-model="dataForm.day"></el-input>  天</span
|
||||
>
|
||||
</el-form-item>
|
||||
<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-input
|
||||
style="width: 300px;"
|
||||
|
||||
v-model="dataForm.value"
|
||||
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>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="开通说明">
|
||||
<el-input
|
||||
type="textarea"
|
||||
rows="5"
|
||||
v-model="dataForm.remark"
|
||||
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>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import global from "../../common/common.vue"; //引入共用组间
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
baseUrl: global.baseUrl,
|
||||
visible: false,
|
||||
|
||||
dataForm: {
|
||||
id: 0,
|
||||
name: "",
|
||||
tel: "",
|
||||
email: "",
|
||||
peanutCoin: "",
|
||||
type: "", //vip类型
|
||||
year: "",
|
||||
day: "",
|
||||
remark: "",
|
||||
price: "0"
|
||||
},
|
||||
peanutCoin: 0, //天医币和积分总和判断是否为0
|
||||
dataRule: {
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: "类型不能为空",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
year: [
|
||||
{
|
||||
required: true,
|
||||
message: "年限不能为空",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
typeList: [
|
||||
{ value: "1", label: "医学超v" },
|
||||
{ value: "4", label: "中医学" },
|
||||
{ value: "9", label: "中西汇通学" },
|
||||
{ value: "5", label: "针灸学" },
|
||||
{ value: "6", label: "肿瘤学" },
|
||||
{ value: "2", label: "国学与心理学超v" },
|
||||
{ value: "7", label: "国学" },
|
||||
{ value: "8", label: "心理学" }
|
||||
],
|
||||
yearList: [
|
||||
{ value: "1", label: "1年" },
|
||||
{ value: "3", label: "3年" },
|
||||
{ value: "4", label: "4年" }
|
||||
]
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init(data) {
|
||||
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;
|
||||
},
|
||||
handleSelect(data) {
|
||||
console.log("data at line 161:", data);
|
||||
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;
|
||||
},
|
||||
loadAll(queryString, cb) {
|
||||
this.dataForm.userId = "";
|
||||
this.dataForm.userName = "";
|
||||
if (queryString == "") {
|
||||
return false;
|
||||
}
|
||||
this.$http({
|
||||
// url: this.$http.adornUrl('/book/user/list'),
|
||||
url: this.$http.adornUrl("/book/user/getUserList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
page: 1,
|
||||
limit: 9999,
|
||||
key: queryString
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
var arr = data.user.records;
|
||||
console.log("arr at line 467:", arr);
|
||||
cb(arr);
|
||||
} else {
|
||||
cb([]);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
//表单提交
|
||||
dataFormSubmit() {},
|
||||
//取消
|
||||
handlereset() {
|
||||
this.visible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.year_block {
|
||||
/deep/.el-form-item__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
/deep/.el-radio {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
/deep/.el-radio__label {
|
||||
padding-left: 3px;
|
||||
padding-right: 30px;
|
||||
}
|
||||
|
||||
.qita {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 12px;
|
||||
|
||||
/deep/.el-input {
|
||||
width: 60px;
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.price_block {
|
||||
/deep/.el-form-item__content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
/deep/.el-checkbox-group {
|
||||
margin-left: 30px;
|
||||
}
|
||||
/deep/.el-checkbox {
|
||||
padding-top: 5px;
|
||||
margin-left: 20px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
/deep/.el-input {
|
||||
width: 130px;
|
||||
}
|
||||
}
|
||||
.type_block {
|
||||
/deep/.el-radio {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
/deep/.el-radio__label {
|
||||
padding-left: 3px;
|
||||
padding-right: 25px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
830
src/views/modules/vipList/userList.vue
Normal file
830
src/views/modules/vipList/userList.vue
Normal file
@@ -0,0 +1,830 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<el-form
|
||||
:inline="true"
|
||||
:model="dataForm"
|
||||
@keyup.enter.native="getDataList()"
|
||||
>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="dataForm.key"
|
||||
placeholder="参数名"
|
||||
clearable
|
||||
size="small"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
size="small"
|
||||
v-model="dataForm.vipType"
|
||||
placeholder="请选择VIP类型"
|
||||
clearable
|
||||
>
|
||||
<!-- <el-option label="医学SVIP" value="1"></el-option> -->
|
||||
<!-- <el-option label="国学与心理学SVIP" value="2"></el-option> -->
|
||||
<el-option label="中医VIP" value="4"></el-option>
|
||||
<el-option label="针灸VIP" value="5"></el-option>
|
||||
<el-option label="肿瘤VIP" value="6"></el-option>
|
||||
<el-option label="国学VIP" value="7"></el-option>
|
||||
<el-option label="心理学VIP" value="8"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
size="small"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
size="small"
|
||||
@click="
|
||||
pageIndex = 1;
|
||||
getDataList();
|
||||
"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button
|
||||
size="small"
|
||||
v-if="isAuth('book:user:save')"
|
||||
type="primary"
|
||||
@click="openVip()"
|
||||
>开通VIP</el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
size="small"
|
||||
plain
|
||||
v-if="isAuth('book:user:save')"
|
||||
type="danger"
|
||||
@click="addOrUpdateHandle()"
|
||||
>补录人工开通 VIP 记录</el-button
|
||||
> -->
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
style="width: 100%;"
|
||||
>
|
||||
<!-- <el-table-column type="selection" header-align="center" align="center" width="50">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column label="序号" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ (pageIndex - 1) * pageSize + scope.$index + 1 }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
width="120"
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="用户ID"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
@click="detailHandle(scope.row)"
|
||||
style="cursor: pointer;color: #006699;position: absolute;top: 0;left: 6px;font-size: 12px;"
|
||||
>详情</span
|
||||
>
|
||||
|
||||
<div>
|
||||
<el-image
|
||||
v-if="scope.row.avatar && scope.row.avatar != ''"
|
||||
style="width: 30px; height: 30px;cursor: pointer;"
|
||||
:src="scope.row.avatar"
|
||||
:preview-src-list="[scope.row.avatar]"
|
||||
>
|
||||
</el-image>
|
||||
|
||||
<img
|
||||
v-else
|
||||
src="/static/img/morenAvavter.png"
|
||||
width="30"
|
||||
height="30"
|
||||
class="tableImg"
|
||||
/>
|
||||
</div>
|
||||
<div style="line-height: 20px;">
|
||||
<span>ID:{{ scope.row.id }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="260"
|
||||
prop="nickname"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="用户信息"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div style="display: flex;align-items: center;padding-left: 10px;">
|
||||
<span style="margin-right: 10px;color: #888;">昵称 ( 姓名 ):</span>
|
||||
<div
|
||||
style="font-size: 13px;"
|
||||
v-if="!scope.row.nickname && !scope.row.name"
|
||||
>
|
||||
<span style="color: #999;">
|
||||
未设置
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
style="font-size: 13px;"
|
||||
v-else-if="scope.row.nickname == scope.row.name"
|
||||
>
|
||||
<span style="color: #999;">
|
||||
未设置
|
||||
</span>
|
||||
</div>
|
||||
<div style="font-size: 13px;" v-else>
|
||||
<span v-if="scope.row.nickname">{{ scope.row.nickname }}</span>
|
||||
<span v-else style="color: #999;">
|
||||
未设置
|
||||
</span>
|
||||
|
||||
<span style="color: #999;">(</span>
|
||||
<span v-if="scope.row.name">{{ scope.row.name }}</span>
|
||||
<span v-else style="color: #999;">
|
||||
未设置
|
||||
</span>
|
||||
<span style="color: #999;">)</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display: flex;align-items: flex-start;padding-left: 10px;margin-top: 4px;">
|
||||
<span style="margin-right: 10px;display: inline-block;color: #888;">联系方式:</span>
|
||||
<div style="font-size: 14px;padding-left: 4px;font-weight: bold;text-align: left;">
|
||||
<div v-if="scope.row.tel">
|
||||
<img
|
||||
src="../../../assets/img/tel.png"
|
||||
width="15"
|
||||
height="15"
|
||||
/>{{ scope.row.tel ? scope.row.tel : "-" }}
|
||||
</div>
|
||||
<div v-if="scope.row.email">
|
||||
<img
|
||||
src="../../../assets/img/email.png"
|
||||
width="15"
|
||||
height="15"
|
||||
/>
|
||||
{{ scope.row.email ? scope.row.email : "-" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
min-width="120"
|
||||
prop="nickname"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="VIP信息 ( 时间 )"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.userVips || scope.row.userVips.length == 0"
|
||||
>-</span
|
||||
>
|
||||
|
||||
<span v-else v-html="computedVipType(scope.row.userVips)"> </span>
|
||||
<span>{{ scope.row.createTime?scope.row.createTime.split(' ')[0]:'' }}</span>
|
||||
<span >{{ scope.row.endTime?scope.row.endTime.split(' ')[0]:'' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
width="190"
|
||||
prop="nickname"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="摊销金额"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
width="190"
|
||||
prop="nickname"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="金额 ( 支付方式 ) "
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<div>金额:</div>
|
||||
<div>订单:</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
|
||||
|
||||
<!-- <el-table-column prop="age" header-align="center" align="center" label="年龄">
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column prop="sex" header-align="center" align="center" label="性别">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.sex == 0">女</span><span v-if="scope.row.sex == 1">男</span><span v-if="scope.row.sex == 2">保密</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="110"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleDetail(scope.row.id)"
|
||||
>管理</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="addOrUpdateHandle(scope.row.id)"
|
||||
>操作VIP</el-button
|
||||
>
|
||||
|
||||
<!-- <el-dropdown>
|
||||
<span
|
||||
class="el-dropdown-link"
|
||||
style="font-size:12px; color:#17B3A3; cursor: pointer;"
|
||||
>
|
||||
更多操作<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item
|
||||
><el-button type="text" size="small" @click="ck(scope.row)"
|
||||
>充/扣天医币</el-button
|
||||
></el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item>
|
||||
<router-link
|
||||
:to="{
|
||||
path: 'user-point-memery',
|
||||
query: {
|
||||
tel: scope.row.tel,
|
||||
id: scope.row.id,
|
||||
userName: scope.row.nickname
|
||||
}
|
||||
}"
|
||||
>
|
||||
<el-button type="text" size="small"
|
||||
>充/扣天医币记录</el-button
|
||||
>
|
||||
</router-link>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
><el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="
|
||||
thisUserID = scope.row.id;
|
||||
youVisible = true;
|
||||
"
|
||||
>优惠券管理</el-button
|
||||
></el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item
|
||||
><el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="resetPassword(scope.row)"
|
||||
>修改密码</el-button
|
||||
></el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item>
|
||||
<router-link
|
||||
:to="{ path: '/userCourse', query: { id: scope.row.id } }"
|
||||
>
|
||||
<el-button type="text" size="small">
|
||||
用户课程管理
|
||||
</el-button>
|
||||
</router-link>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<router-link
|
||||
:to="{ path: '/userPoints', query: { id: scope.row.id } }"
|
||||
>
|
||||
<el-button type="text" size="small">
|
||||
湖分管理
|
||||
</el-button>
|
||||
</router-link>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<router-link
|
||||
:to="{
|
||||
path: '/userCertificate',
|
||||
query: { id: scope.row.id }
|
||||
}"
|
||||
>
|
||||
<el-button type="text" size="small">
|
||||
证书管理
|
||||
</el-button>
|
||||
</router-link>
|
||||
</el-dropdown-item>
|
||||
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-dropdown-item>
|
||||
<el-button type="text" size="small" @click="openVip(scope.row)">
|
||||
开通VIP
|
||||
</el-button>
|
||||
</el-dropdown-item> -->
|
||||
</el-table>
|
||||
<el-pagination
|
||||
@size-change="sizeChangeHandle"
|
||||
@current-change="currentChangeHandle"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getDataList"
|
||||
></add-or-update>
|
||||
<!-- 开通VIP -->
|
||||
<open-vip v-if="openVipVisible" ref="openVip"> </open-vip>
|
||||
|
||||
<el-dialog
|
||||
title="充/扣天医币"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="adc"
|
||||
append-to-body
|
||||
width="30%"
|
||||
:before-close="closeDia"
|
||||
>
|
||||
<el-form
|
||||
:model="pointForm"
|
||||
label-width="100px"
|
||||
:rules="pointFormRules"
|
||||
ref="pointForm"
|
||||
>
|
||||
<el-form-item label="用户">
|
||||
{{ pointForm.tel }}
|
||||
<span v-if="pointForm.name != ''">({{ pointForm.name }})</span>
|
||||
<span
|
||||
>账户余额:<em
|
||||
style="font-style: normal; font-size: 16px; color: #17B3A3;"
|
||||
>{{ pointForm.peanutCoin }}</em
|
||||
></span
|
||||
>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="充/扣主题">
|
||||
<el-input v-model="pointForm.title"></el-input>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="充值类型" prop="pointType">
|
||||
<!-- <el-input v-model="pointForm.pointType" placeholder="0-普通 1-vip"></el-input>
|
||||
-->
|
||||
<el-select v-model="pointForm.pointType" placeholder="请选择">
|
||||
<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 label="金额" prop="pointAmount">
|
||||
<el-input-number
|
||||
v-model="pointForm.pointAmount"
|
||||
:placeholder="pointForm.peanutCoin + '可用'"
|
||||
>
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="充扣明细">
|
||||
<el-input
|
||||
type="textarea"
|
||||
rows="5"
|
||||
v-model="pointForm.remark"
|
||||
placeholder="操作说明"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDia">取消</el-button>
|
||||
<el-button type="primary" @click="huaSheng(pointForm.peanutCoin)"
|
||||
>确定</el-button
|
||||
>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import OpenVip from "./user-open-vip";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ""
|
||||
},
|
||||
pointFormRules: {
|
||||
pointAmount: [
|
||||
{ required: true, message: "请输入金额", trigger: "blur" }
|
||||
],
|
||||
pointType: {
|
||||
required: true,
|
||||
message: "请选择操作类型",
|
||||
trigger: "blur"
|
||||
}
|
||||
},
|
||||
vipList: [],
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: "充天医币"
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "扣天医币"
|
||||
}
|
||||
],
|
||||
adc: false,
|
||||
pointForm: {
|
||||
pointType: 0,
|
||||
remark: "",
|
||||
// title:'',
|
||||
pointAmount: 0
|
||||
},
|
||||
dataList: [],
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
totalPage: 0,
|
||||
total: 0,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
addOrUpdateVisible: false,
|
||||
youVisible: false,
|
||||
youForm: {},
|
||||
currentuserInfo: {},
|
||||
courperList: [],
|
||||
courperHistList: [],
|
||||
//开通vip
|
||||
openVipVisible: false
|
||||
};
|
||||
},
|
||||
components: {OpenVip},
|
||||
activated() {
|
||||
this.getDataList();
|
||||
},
|
||||
methods: {
|
||||
handleDetail(id){
|
||||
|
||||
this.$router.push({
|
||||
name: "vipList-vipDetail",
|
||||
query: {
|
||||
id: id
|
||||
}
|
||||
})
|
||||
},
|
||||
detailHandle(row) {
|
||||
console.log("row at line 447:", row);
|
||||
this.$router.push({
|
||||
name: "user-user",
|
||||
params: {
|
||||
key: row.tel || row.email
|
||||
}
|
||||
});
|
||||
},
|
||||
//批量开通课程
|
||||
addOpenCourse() {
|
||||
this.$router.push("/user-add-course");
|
||||
},
|
||||
//开通vip
|
||||
openVip() {
|
||||
this.openVipVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.openVip.init();
|
||||
});
|
||||
},
|
||||
|
||||
computedVipType(userVips) {
|
||||
if (!userVips || userVips.length === 0) return "";
|
||||
|
||||
const vipMap = {
|
||||
4: "中医VIP",
|
||||
5: "针灸VIP",
|
||||
6: "肿瘤VIP",
|
||||
7: "国学VIP",
|
||||
8: "心理学VIP"
|
||||
};
|
||||
|
||||
// 将 userVips 转为数组形式,以便处理(如果是数字则转为数字数组)
|
||||
let vipTypes = [];
|
||||
if (typeof userVips === "number") {
|
||||
vipTypes = String(userVips)
|
||||
.split("")
|
||||
.map(Number); // 数字转为数组
|
||||
} else {
|
||||
vipTypes = userVips.map(vip => vip.type); // 如果是对象数组,获取每个对象的 type
|
||||
}
|
||||
|
||||
// 判断是否同时包含 4、5、6(医学SVIP)
|
||||
const hasMedicalSVip = [4, 5, 6].every(type => vipTypes.includes(type));
|
||||
// 判断是否同时包含 7、8(心理学SVIP)
|
||||
const hasPsychologySVip = [7, 8].every(type => vipTypes.includes(type));
|
||||
|
||||
const tags = [];
|
||||
vipTypes.forEach(type => {
|
||||
if (type == 4 || type == 5 || type == 6) {
|
||||
tags.push(
|
||||
`<el-tag size="mini" type="info" style="font-weight: bold; color: #fff;display:inline-block;margin-bottom: 6px; padding:0 6px; border-radius: 2px; font-size: 11px; background: #409EFF;" effect="dark">${vipMap[type]}</el-tag>`
|
||||
);
|
||||
} else if (type == 7 ) {
|
||||
tags.push(
|
||||
`<el-tag size="mini" type="info" style="font-weight: bold; color: #fff;display:inline-block;margin-bottom: 6px; padding:0 6px; border-radius: 2px; font-size: 11px; background:#67c23a" effect="dark">${vipMap[type]}</el-tag>`
|
||||
);
|
||||
} else if (type == 8 ) {
|
||||
tags.push(
|
||||
`<el-tag size="mini" type="info" style="font-weight: bold; color: #fff;display:inline-block;margin-bottom: 6px; background: #00bcd4; padding:0 6px; border-radius: 2px; font-size: 11px; " effect="dark">${vipMap[type]}</el-tag>`
|
||||
);
|
||||
}
|
||||
});
|
||||
// 1. 医学SVIP(只显示一次)
|
||||
// if (hasMedicalSVip) {
|
||||
// tags.push(
|
||||
// `<el-tag size="mini" type="warning" style="font-weight: bold; background-image: linear-gradient(90deg, #ff1f00 0%, #fa9f93 100%); color: #fff; padding: 2px; border-radius: 2px; font-size: 11px;" effect="dark">医学SVIP</el-tag>`
|
||||
// );
|
||||
// }
|
||||
|
||||
// // 2. 心理学SVIP(只显示一次)
|
||||
// if (hasPsychologySVip) {
|
||||
// tags.push(
|
||||
// `<el-tag size="mini" type="warning" style="font-weight: bold; background-image: linear-gradient(90deg, #67c23a 0%, #e1f3d8 100%); color: #fff; padding: 2px; border-radius: 2px; font-size: 11px;" effect="dark">心理学SVIP</el-tag>`
|
||||
// );
|
||||
// }
|
||||
|
||||
// // 3. 普通VIP标签(确保不重复显示SVIP相关的类型)
|
||||
// vipTypes
|
||||
// .filter(
|
||||
// type =>
|
||||
// vipMap[type] &&
|
||||
// !(
|
||||
// (
|
||||
// (hasMedicalSVip && [4, 5, 6].includes(type)) || // 医学SVIP已显示,排除 4、5、6
|
||||
// (hasPsychologySVip && [7, 8].includes(type))
|
||||
// ) // 心理学SVIP已显示,排除 7、8
|
||||
// )
|
||||
// )
|
||||
// .forEach(type => {
|
||||
// tags.push(
|
||||
// `<el-tag size="mini" type="info" style="font-weight: bold; color: #fff; padding: 2px; border-radius: 2px; font-size: 11px; background: #409EFF;" effect="dark">${vipMap[type]}</el-tag>`
|
||||
// );
|
||||
// });
|
||||
|
||||
return tags.join("<br/>");
|
||||
},
|
||||
|
||||
getVipMoney(data) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/master/userVip/getVipProductForUser"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
uid: data.id
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
var list = [];
|
||||
console.log("data at line 436:", data.list);
|
||||
for (let i in data.list) {
|
||||
if (data.list[i].length > 0) {
|
||||
list.push([...data.list[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
this.vipList = list.flat(Infinity);
|
||||
|
||||
console.log("this.vipList at line 440:", this.vipList);
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
this.vipList = [];
|
||||
}
|
||||
});
|
||||
},
|
||||
closeCoupon(val) {
|
||||
this.youVisible = false;
|
||||
},
|
||||
// 用户课程
|
||||
userCourse(val) {},
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
// url: this.$http.adornUrl('/book/user/list'),
|
||||
url: this.$http.adornUrl("/book/user/getUserList"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
key: this.dataForm.key,
|
||||
vipType: this.dataForm.vipType
|
||||
})
|
||||
// params: this.$http.adornParams({
|
||||
// 'page': 1,
|
||||
// 'limit': this.pageSize,
|
||||
// 'key': this.dataForm.key
|
||||
// })
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.user.records;
|
||||
this.totalPage = data.user.pages;
|
||||
this.total = data.user.total;
|
||||
this.dataListLoading = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 重置密码
|
||||
resetPassword(row) {
|
||||
console.log(row, "row");
|
||||
this.$prompt("请输入新密码", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消"
|
||||
// inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
|
||||
// inputErrorMessage: '邮箱格式不正确'
|
||||
})
|
||||
.then(({ value }) => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/user/updateUserPassword"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
id: row.id,
|
||||
password: value
|
||||
})
|
||||
})
|
||||
.then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success("修改密码成功");
|
||||
}
|
||||
})
|
||||
.catch(({ e }) => {
|
||||
console.log(e, "e");
|
||||
});
|
||||
// this.$message({
|
||||
// type: 'success',
|
||||
// message: '你的邮箱是: ' + value
|
||||
// });
|
||||
})
|
||||
.catch(() => {
|
||||
// this.$message({
|
||||
// type: 'info',
|
||||
// message: '取消输入'
|
||||
// });
|
||||
});
|
||||
},
|
||||
|
||||
// 每页数
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val;
|
||||
this.getDataList();
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
closeDia() {
|
||||
this.adc = false;
|
||||
this.$refs.pointForm.resetFields();
|
||||
// this.pointForm.pointType == 0
|
||||
},
|
||||
// 删除
|
||||
deleteHandle(id) {
|
||||
var ids = id
|
||||
? [id]
|
||||
: this.dataListSelections.map(item => {
|
||||
return item.id;
|
||||
});
|
||||
this.$confirm(
|
||||
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
|
||||
"提示",
|
||||
{
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}
|
||||
).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/user/delete"),
|
||||
method: "post",
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
// 充值扣款天医币
|
||||
ck(e) {
|
||||
this.pointForm = e;
|
||||
this.adc = true;
|
||||
},
|
||||
handleRecharge(val) {
|
||||
this.currentuserInfo = val;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addCertificate.init("add", {});
|
||||
});
|
||||
},
|
||||
handleJF(val) {
|
||||
this.currentuserInfo = val;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addJF.init("add", {});
|
||||
});
|
||||
},
|
||||
huaSheng(point) {
|
||||
// console.log(this.pointForm.pointAmount, point)
|
||||
if (this.pointForm.pointAmount <= 0) {
|
||||
this.$message.error("金额不能小于0");
|
||||
return false;
|
||||
}
|
||||
if (this.pointForm.pointAmount > point && this.pointForm.pointType == 1) {
|
||||
return this.$message.error("扣除金额不能大于总金额");
|
||||
}
|
||||
|
||||
this.$refs["pointForm"].validate(valid => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(
|
||||
`/book/user/pointChange?pointType=${this.pointForm.pointType}¬e=${this.pointForm.remark}&pointAmount=${this.pointForm.pointAmount}&id=${this.pointForm.id}`
|
||||
),
|
||||
method: "get",
|
||||
params: this.$http.adornParams()
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message.success("操作成功");
|
||||
this.getDataList();
|
||||
this.adc = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
courDelete(e) {
|
||||
let arrList = [];
|
||||
arrList.push(e.id);
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/couponhistory/delete"),
|
||||
method: "post",
|
||||
data: this.$http.adornData(arrList, false)
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
duration: 1500
|
||||
});
|
||||
this.youhui(this.youForm);
|
||||
this.youVisible = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
/deep/ .mod-config .el-table .el-table__cell {
|
||||
padding: 4px 0 !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
/deep/ .mod-config .el-table .cell,
|
||||
.el-table th div {
|
||||
padding: 0 !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
</style>
|
||||
823
src/views/modules/vipList/vipDetail.vue
Normal file
823
src/views/modules/vipList/vipDetail.vue
Normal file
@@ -0,0 +1,823 @@
|
||||
<template>
|
||||
<div class="mod-config">
|
||||
<!-- 订单详细更新 -->
|
||||
<!-- <div class="orderType">
|
||||
<span v-if="orderDetails.orderStatus == 0" class="item hightLight0"
|
||||
>待付款</span
|
||||
>
|
||||
<span v-if="orderDetails.orderStatus == 1" class="item hightLight1"
|
||||
>待发货</span
|
||||
>
|
||||
<span v-if="orderDetails.orderStatus == 2" class="item hightLight2"
|
||||
>已发货</span
|
||||
>
|
||||
<span v-if="orderDetails.orderStatus == 3" class="item hightLight3"
|
||||
>已完成</span
|
||||
>
|
||||
</div> -->
|
||||
<div>
|
||||
<ul class="list">
|
||||
<div v-if="orderDetails.userInfo">
|
||||
<div class="liName">用户信息</div>
|
||||
<li>
|
||||
<span class="infoTitle">用户名:</span
|
||||
><span>{{
|
||||
orderDetails.userInfo.userName !== null
|
||||
? orderDetails.userInfo.userName
|
||||
: "暂无"
|
||||
}}</span>
|
||||
</li>
|
||||
<!-- <li><span class="infoTitle">用户ID:</span><span>{{orderDetails.userId}}</span></li> -->
|
||||
<li>
|
||||
<span class="infoTitle">联系电话:</span
|
||||
><span>{{ orderDetails.userInfo.userPhone }}</span>
|
||||
</li>
|
||||
<li style="clear:both"></li>
|
||||
<!-- <li><span class="infoTitle">电 话:</span><span>187898544875</span></li> -->
|
||||
<!-- <li><span class="infoTitle">地 址:</span><span>天津市天津市天津市天津市天津市天津市</span></li> -->
|
||||
<li class="line"></li>
|
||||
</div>
|
||||
<div style="display: none;">
|
||||
|
||||
|
||||
<div class="liName">订单信息</div>
|
||||
<li>
|
||||
<span class="infoTitle">订单ID:</span
|
||||
><span>{{ orderDetails.orderSn }}</span>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<span class="infoTitle">创建时间:</span
|
||||
><span>{{ orderDetails.createTime }}</span>
|
||||
</li>
|
||||
<li v-if="orderDetails.orderStatus > 0">
|
||||
<span class="infoTitle">支付时间:</span
|
||||
><span>{{ orderDetails.paymentDate }}</span>
|
||||
</li>
|
||||
<li style="width: 100%;" v-if="orderDetails.orderStatus > 0">
|
||||
<span class="infoTitle">支付方式:</span>
|
||||
<span v-if="orderDetails.paymentMethod == 2"
|
||||
><icon-svg name="zhifubao"></icon-svg> <span>支付宝支付</span></span
|
||||
>
|
||||
<span v-if="orderDetails.paymentMethod == 1"
|
||||
><icon-svg name="weixin"></icon-svg> <span>微信支付</span></span
|
||||
>
|
||||
<span v-if="orderDetails.paymentMethod == 4"
|
||||
><img
|
||||
src="../../../../static/img/oder_chong.png"
|
||||
width="22px"
|
||||
height="22px"
|
||||
/>
|
||||
<span>天医币支付</span></span
|
||||
>
|
||||
<span v-if="orderDetails.paymentMethod == 3">
|
||||
|
||||
<span>IOS内购</span>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li
|
||||
style="width: 100%;"
|
||||
v-if="orderDetails.paymentMethod == 2 && orderDetails.orderStatus > 0"
|
||||
>
|
||||
<span class="infoTitle">订单号:</span>
|
||||
<span>{{ orderDetails.outTradeNo }}</span>
|
||||
</li>
|
||||
<li
|
||||
style="width: 100%;"
|
||||
v-if="orderDetails.paymentMethod == 2 && orderDetails.orderStatus > 0"
|
||||
>
|
||||
<span class="infoTitle">支付宝订单号:</span>
|
||||
<span>{{ orderDetails.tradeNo }}</span>
|
||||
</li>
|
||||
<li class="line"></li>
|
||||
<div style="clear:both"></div>
|
||||
<div>
|
||||
<div class="liName">支付信息</div>
|
||||
<li>
|
||||
<span class="infoTitle">订单金额:</span
|
||||
><span>¥{{ orderDetails.orderPrice }}</span>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
<li>
|
||||
<span class="infoTitle">积分抵扣:</span
|
||||
><span
|
||||
|
||||
v-if="orderDetails.jfDeduction > 0"
|
||||
>-</span
|
||||
>
|
||||
<span
|
||||
|
||||
>{{ orderDetails.jfDeduction }}</span
|
||||
>
|
||||
<span
|
||||
|
||||
v-if="orderDetails.jfDeduction > 0"
|
||||
>积分</span
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<span class="infoTitle">天医币抵扣:</span
|
||||
><span
|
||||
v-if="
|
||||
orderDetails.paymentMethod == 4 && orderDetails.realPrice > 0
|
||||
"
|
||||
|
||||
>- {{ orderDetails.realPrice }}
|
||||
</span>
|
||||
<span
|
||||
v-if="
|
||||
orderDetails.paymentMethod == 4 && orderDetails.realPrice == 0
|
||||
"
|
||||
>0
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li v-if="orderDetails.orderStatus > 0" style="width: 100%;">
|
||||
<span class="infoTitle">实际支付:</span>
|
||||
<span v-if="orderDetails.orderType == 'point'"
|
||||
>¥{{ orderDetails.realPrice }}</span
|
||||
>
|
||||
|
||||
<span class="DiscountColor" v-else>
|
||||
<span v-if="orderDetails.realPrice > 0">
|
||||
¥{{ orderDetails.realPrice }}
|
||||
|
||||
<span style="" v-if="orderDetails.paymentMethod == 1"
|
||||
>微信支付</span
|
||||
>
|
||||
<span style="" v-if="orderDetails.paymentMethod == 2"
|
||||
>支付宝支付</span
|
||||
>
|
||||
<span style="" v-if="orderDetails.paymentMethod == 3"
|
||||
>苹果支付</span
|
||||
>
|
||||
<span style="" v-if="orderDetails.paymentMethod == 4">
|
||||
天医币支付
|
||||
</span>
|
||||
</span>
|
||||
|
||||
|
||||
<span
|
||||
style="margin: 0 4rpx"
|
||||
v-if="
|
||||
orderDetails.realPrice > 0 && orderDetails.jfDeduction > 0
|
||||
"
|
||||
>
|
||||
+
|
||||
</span>
|
||||
|
||||
<span v-if="orderDetails.jfDeduction > 0"
|
||||
>{{ orderDetails.jfDeduction }} 积分</span
|
||||
>
|
||||
</span>
|
||||
</li>
|
||||
<li class="line"></li>
|
||||
<div style="clear:both"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- 订单商品 -->
|
||||
<div v-for="(item, index) in vipData">
|
||||
<div class="liName">VIP 信息</div>
|
||||
|
||||
<p>办理明细</p>
|
||||
<el-table
|
||||
:data="orderDetails.trainingClassData"
|
||||
style="width: 100%"
|
||||
v-if="orderDetails.orderType == 'trainingClass'"
|
||||
>
|
||||
<el-table-column label="商品名" min-width="280">
|
||||
<template slot-scope="scope">
|
||||
<div class="flexbox">
|
||||
<!-- <img
|
||||
style="padding: 2px; border:1px solid #f1f1f1; margin-right: 5px;"
|
||||
:src="scope.row.productImage"
|
||||
width="30px"
|
||||
height="30px"
|
||||
/> -->
|
||||
<div class="proname">
|
||||
{{ scope.row.productName }}
|
||||
<i
|
||||
v-if="scope.row.books && scope.row.books.length > 0"
|
||||
@click.stop="seeBooks(scope.row.books)"
|
||||
class="el-icon-view"
|
||||
style="color:#409eff; cursor: pointer;"
|
||||
></i>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="productPrice" label="价格" width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="quantity" label="数量" width="80">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 抽屉 -->
|
||||
<el-dialog
|
||||
title="物流详情"
|
||||
:visible.sync="tracesShow"
|
||||
@close="drawerHandleClose"
|
||||
append-to-body
|
||||
>
|
||||
<div class="deliver_info">
|
||||
<div>
|
||||
运单信息:{{ currentSheet.expressCompanyName }} -
|
||||
{{ currentSheet.expressOrderSn }}
|
||||
</div>
|
||||
<div
|
||||
class="scroll"
|
||||
style="padding: 10px;"
|
||||
v-if="traces && traces.length > 0"
|
||||
>
|
||||
<el-timeline :reverse="reverse">
|
||||
<el-timeline-item
|
||||
v-for="(activity, index2) in traces"
|
||||
:key="index2"
|
||||
:icon="activity.icon"
|
||||
:timestamp="activity.acceptTime"
|
||||
>
|
||||
{{ activity.acceptStation }}
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
<div v-else class="noinfo">-暂无物流信息-</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import AddOrUpdate from "./buyorderdetail-add-or-update";
|
||||
// import setDeliverDialog from "./set-deliver-dialog";
|
||||
export default {
|
||||
props: ["orderSn", "pageType"],
|
||||
data() {
|
||||
return {
|
||||
orderList: [],
|
||||
dataForm: {
|
||||
key: ""
|
||||
},
|
||||
traces: [], // 物流轨迹
|
||||
tracesShow: false,
|
||||
currentSheet: {},
|
||||
|
||||
reverse: true,
|
||||
activities: [],
|
||||
deliverData: [], // 物流信息
|
||||
|
||||
setDeliverVisible: false,
|
||||
dataListLoading: false,
|
||||
dataListSelections: [],
|
||||
// addOrUpdateVisible: false,
|
||||
query: {
|
||||
orderSn: 0,
|
||||
ordertype: null
|
||||
},
|
||||
changeAddVisible: false,
|
||||
orderDetails: {},
|
||||
addressForm: {
|
||||
provinceCode: null, //省份串码
|
||||
provinceName: null,
|
||||
cityCode: null, //市区串码
|
||||
cityName: null,
|
||||
countyCode: null, //省份串码
|
||||
countyName: null,
|
||||
name: "",
|
||||
tel: "",
|
||||
addressXX: ""
|
||||
},
|
||||
provinceEntity: [], // 城市列表
|
||||
cityEntity: [], // 市
|
||||
countyEntity: [], // 区
|
||||
optionProps: {
|
||||
checkStrictly: true,
|
||||
value: "regionCode",
|
||||
label: "provName",
|
||||
children: "children"
|
||||
},
|
||||
addressFormRule: {
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入收货人信息",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
tel: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入收货联系电话信息",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
county: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择收货地址",
|
||||
trigger: "blur"
|
||||
}
|
||||
],
|
||||
addressXX: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入详细地址信息",
|
||||
trigger: "blur"
|
||||
}
|
||||
]
|
||||
},
|
||||
sheetList: [], // 面单列表
|
||||
currBookLIst: [],
|
||||
booksShow: false,
|
||||
showChange: true
|
||||
};
|
||||
},
|
||||
components: {
|
||||
// AddOrUpdate
|
||||
},
|
||||
activated() {
|
||||
this.query.orderSn = this.$route.query.orderSn;
|
||||
this.query.ordertype = this.$route.query.ordertype;
|
||||
// console.log(this.$route.query.orderSn)
|
||||
this.getData();
|
||||
// this.getOrderSheetList()
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.query.orderSn = this.orderSn;
|
||||
this.query.ordertype = this.$route.query.ordertype;
|
||||
// console.log(this.$route.query.orderSn)
|
||||
this.getData();
|
||||
},
|
||||
showProducts(item, index) {
|
||||
this.showChange = false;
|
||||
this.sheetList[index].showProduct = !item.showProduct;
|
||||
this.showChange = true;
|
||||
// console.log(this.sheetList,'this.sheetList[index].showProduct')
|
||||
},
|
||||
seeBooks(arr) {
|
||||
this.currBookLIst = arr;
|
||||
this.booksShow = true;
|
||||
},
|
||||
booksHandleClose() {
|
||||
this.currBookLIst = [];
|
||||
this.booksShow = false;
|
||||
},
|
||||
drawerHandleClose() {
|
||||
// console.log('关闭')
|
||||
this.traces = [];
|
||||
this.tracesShow = false;
|
||||
this.currentSheet = {};
|
||||
},
|
||||
// 获取某一快递的物流进度
|
||||
seeSheetDetails(item) {
|
||||
// console.log('正在查询快递进度',item)
|
||||
this.currentSheet = item;
|
||||
let loading = this.$loading({
|
||||
lock: true,
|
||||
text: "正在获取物流信息...",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)"
|
||||
});
|
||||
// var mobileLeng = this.orderDetails.consignee.consigneeMobile.length
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/buyOrder/searchExpress"),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
expressOrderSn: item.expressOrderSn
|
||||
// 'expressCompanyCode': item.expressCompanyCode,
|
||||
// 'customerName': this.orderDetails.consignee.consigneeMobile.substring(mobileLeng-4, mobileLeng)
|
||||
})
|
||||
})
|
||||
.then(({ data }) => {
|
||||
if (data.code == 0) {
|
||||
if (data.express.traces.length > 0) {
|
||||
this.traces = data.express.traces;
|
||||
this.tracesShow = true;
|
||||
// console.log(data,'data')
|
||||
loading.close();
|
||||
} else {
|
||||
this.$message("暂无物流信息哦~");
|
||||
loading.close();
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(({ e }) => {
|
||||
console.log(e, "e");
|
||||
loading.close();
|
||||
});
|
||||
},
|
||||
countyChange(e) {
|
||||
// console.log(e,'countyName')
|
||||
this.countyEntity.countyList.find((val, index, arr) => {
|
||||
this.addressForm.countyName = val.countyName;
|
||||
return val.regionCode == e;
|
||||
});
|
||||
// console.log('this.addressForm.countyName', this.addressForm)
|
||||
},
|
||||
cityChange(e) {
|
||||
// console.log('修改了市',e)
|
||||
this.addressForm.countyCode = null;
|
||||
this.countyEntity = this.cityEntity.cityList.find((val, index, arr) => {
|
||||
this.addressForm.cityName = val.cityName;
|
||||
return val.regionCode == e;
|
||||
});
|
||||
// console.log(' this.addressForm.cityName', this.addressForm.cityName)
|
||||
},
|
||||
provinceChange(e) {
|
||||
// console.log('修改了省份',e)
|
||||
this.addressForm.cityCode = null;
|
||||
this.addressForm.countyCode = null;
|
||||
this.cityEntity = this.provinceEntity.find((val, index, arr) => {
|
||||
this.addressForm.provinceName = val.provName;
|
||||
return val.regionCode == e;
|
||||
});
|
||||
// console.log('this.addressForm.provinceName',this.addressForm.provinceName)
|
||||
},
|
||||
changeAddHandleClose() {
|
||||
this.changeAddVisible = false;
|
||||
this.addressForm.provinceCode = null;
|
||||
this.addressForm.cityCode = null;
|
||||
this.addressForm.countyCode = null;
|
||||
this.addressForm.provinceName = null;
|
||||
this.addressForm.cityName = null;
|
||||
this.addressForm.countyName = null;
|
||||
this.provinceEntity = [];
|
||||
this.cityEntity = [];
|
||||
this.countyEntity = [];
|
||||
this.$refs["addressFormRef"].clearValidate();
|
||||
this.$nextTick(() => {
|
||||
this.addressForm.name = "";
|
||||
this.addressForm.tel = "";
|
||||
this.addressForm.addressXX = "";
|
||||
// this.$refs['addressFormRef'].resetFields();
|
||||
});
|
||||
// $refs[formName].resetFields()
|
||||
// console.log('关闭了', this.addressForm)
|
||||
},
|
||||
changeAddressShow() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/api/province/getProvince"),
|
||||
method: "post"
|
||||
// params: this.$http.adornParams({
|
||||
// 'orderId': this.query.orderId
|
||||
// })
|
||||
})
|
||||
.then(({ data }) => {
|
||||
// console.log('获取地址三级列表', data)
|
||||
if (data.code == 0) {
|
||||
this.provinceEntity = data.provinceEntity;
|
||||
this.addressForm.addressXX = this.orderDetails.consignee.address;
|
||||
this.addressForm.provinceCode = this.orderDetails.consignee.provinceCode;
|
||||
this.addressForm.cityCode = this.orderDetails.consignee.cityCode;
|
||||
this.addressForm.countyCode = this.orderDetails.consignee.countyCode;
|
||||
this.addressForm.provinceName = this.orderDetails.consignee.provinceCode;
|
||||
this.addressForm.cityName = this.orderDetails.consignee.cityCode;
|
||||
this.addressForm.countyName = this.orderDetails.consignee.countyCode;
|
||||
this.addressForm.name = this.orderDetails.consignee.consigneeName;
|
||||
this.addressForm.tel = this.orderDetails.consignee.consigneeMobile;
|
||||
// console.log(this.provinceEntity,'this.provinceEntity')
|
||||
this.cityEntity = this.provinceEntity.find((val, index, arr) => {
|
||||
return val.regionCode == this.addressForm.provinceCode;
|
||||
});
|
||||
this.countyEntity = this.cityEntity.cityList.find(
|
||||
(val, index, arr) => {
|
||||
return val.regionCode == this.addressForm.cityCode;
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e, "e");
|
||||
});
|
||||
this.changeAddVisible = true;
|
||||
// console.log('显示修改收货地址')
|
||||
},
|
||||
// 修改收货信息
|
||||
changeAddress() {
|
||||
this.$refs["addressFormRef"].validate(valid => {
|
||||
if (valid) {
|
||||
// console.log('修改收货地址')
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/buyOrder/modifyConsigneeAddress"),
|
||||
method: "post",
|
||||
data: this.$http.adornData({
|
||||
orderSn: this.query.orderSn,
|
||||
// 'province': this.addressForm.provinceName,
|
||||
// 'city': this.addressForm.cityName,
|
||||
// 'county': this.addressForm.countyName,
|
||||
address: this.addressForm.addressXX,
|
||||
consigneeName: this.addressForm.name,
|
||||
consigneeMobile: this.addressForm.tel,
|
||||
provinceCode: this.addressForm.provinceCode,
|
||||
cityCode: this.addressForm.cityCode,
|
||||
countyCode: this.addressForm.countyCode
|
||||
//'orderId': this.addressForm.orderId
|
||||
})
|
||||
})
|
||||
.then(({ data }) => {
|
||||
// console.log('修改地址返回值', data)
|
||||
this.$message.success("修改地址成功!");
|
||||
this.changeAddHandleClose();
|
||||
this.getData();
|
||||
})
|
||||
.catch(e => {
|
||||
console.log(e, "e");
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 获取数据列表
|
||||
getData() {
|
||||
this.dataListLoading = true;
|
||||
this.$http({
|
||||
|
||||
url: this.$http.adornUrl(`/book/buyOrder/orderDetail`),
|
||||
method: "get",
|
||||
params: this.$http.adornParams({
|
||||
orderSn: this.query.orderSn
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
// console.log(data.result,'data.result')
|
||||
this.vipData = data.result;
|
||||
} else {
|
||||
this.orderDetails = {};
|
||||
return this.$message.error("VIP详情获取失败,请重试");
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
closeDeliverDialog(val) {
|
||||
this.setDeliverVisible = false;
|
||||
this.getData();
|
||||
},
|
||||
// 去发货
|
||||
godeliver() {
|
||||
this.orderList[0] = this.query.orderSn;
|
||||
this.setDeliverVisible = true;
|
||||
},
|
||||
|
||||
// 删除订单
|
||||
deleteOrder() {
|
||||
this.$confirm(`确定对订单进行删除操作?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl("/book/buyOrder/orderDel"),
|
||||
method: "post",
|
||||
params: this.$http.adornParams({
|
||||
orderSn: this.orderDetails.orderSn
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.$router.push({
|
||||
path: "/order-buyorder"
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.myicon {
|
||||
border: 1px solid #409eff;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.booksUl {
|
||||
overflow: hidden;
|
||||
margin-top: 15px;
|
||||
padding-left: 0;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
width: 50%;
|
||||
float: left;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.sheetOrdersUl {
|
||||
padding-left: 0;
|
||||
|
||||
li {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.orderType {
|
||||
overflow: hidden;
|
||||
margin-bottom: 20px;
|
||||
|
||||
.item {
|
||||
color: #fff;
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
border-radius: 0 20px 20px 0;
|
||||
}
|
||||
|
||||
.hightLight0 {
|
||||
background-color: #e6a23c;
|
||||
}
|
||||
|
||||
.hightLight1 {
|
||||
background-color: #409eff;
|
||||
}
|
||||
|
||||
.hightLight2 {
|
||||
background-color: #f56c6c;
|
||||
}
|
||||
|
||||
.hightLight3 {
|
||||
background-color: #67c23a;
|
||||
}
|
||||
}
|
||||
|
||||
.noinfo {
|
||||
color: #ddd;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.scroll {
|
||||
margin-top: 15px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.deliverBox {
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.item {
|
||||
padding-right: 15px;
|
||||
min-width: 300px;
|
||||
|
||||
.deliver_heade {
|
||||
margin-top: 15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-timeline {
|
||||
li {
|
||||
float: none;
|
||||
}
|
||||
}
|
||||
|
||||
.flexbox {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.deliver_info {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.infoTitle {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
ul.list {
|
||||
overflow: hidden;
|
||||
color: #515a6e;
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
width: 50%;
|
||||
line-height: 26px;
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.hightLight {
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
border-bottom: 1px solid #eee;
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
.liName {
|
||||
font-size: 12px;
|
||||
margin-bottom: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.text_button {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-icon-truck:before {
|
||||
content: "\e740";
|
||||
}
|
||||
|
||||
.el-timeline-item:first-child {
|
||||
.el-timeline-item__node {
|
||||
background-color: rgb(11, 189, 135);
|
||||
}
|
||||
|
||||
color: rgb(11, 189, 135) !important;
|
||||
}
|
||||
|
||||
.el-timeline-item {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
|
||||
.el-timeline-item__node--large {
|
||||
left: -2px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.el-timeline-item__node {
|
||||
position: absolute;
|
||||
background-color: #e4e7ed;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-timeline-item__node--normal {
|
||||
left: -1px;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
.el-timeline-item__wrapper {
|
||||
position: relative;
|
||||
padding-left: 28px;
|
||||
top: -3px;
|
||||
}
|
||||
|
||||
.el-timeline li {
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.el-timeline-item__tail {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
height: 100%;
|
||||
border-left: 2px solid #e4e7ed;
|
||||
}
|
||||
|
||||
.el-timeline .el-timeline-item:last-child .el-timeline-item__tail {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-timeline-item__timestamp {
|
||||
color: #c3c3c3;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/deep/ .el-select-dropdown {
|
||||
width: 200px !important;
|
||||
}
|
||||
|
||||
:deep(.el-select-dropdown__list) {
|
||||
width: 200px !important;
|
||||
}
|
||||
|
||||
/deep/ .el-select-dropdown__list {
|
||||
width: 200px !important;
|
||||
}
|
||||
.DiscountColor {
|
||||
color: #f94f04;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
window.SITE_CONFIG = {};
|
||||
|
||||
// api接口请求地址
|
||||
window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||
// window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; //川
|
||||
// window.SITE_CONFIG['baseUrl'] = 'https://api.nuttyreading.com'; // 线上正式环境
|
||||
window.SITE_CONFIG['baseUrl'] = 'http://192.168.110.100:9200/pb'; //川
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||
|
||||
Reference in New Issue
Block a user