2023-10-09 11:06:01 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<el-card >
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
2024-01-04 18:44:52 +08:00
|
|
|
|
<!-- <el-form-item label="来源油站" prop="storeIds">-->
|
|
|
|
|
<!-- <el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">-->
|
|
|
|
|
<!-- <el-option v-for="item in storeList" :key="item.id" :label="item.name" :value="item.id"/>-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
2023-11-11 18:04:49 +08:00
|
|
|
|
<el-form-item label="会员号" prop="userNo">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.userNo"
|
|
|
|
|
placeholder="请输入会员号"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 240px;"
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="手机号" prop="mobile">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.mobile"
|
|
|
|
|
placeholder="请输入会员手机号"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 240px;"
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
2023-10-18 18:31:46 +08:00
|
|
|
|
/>
|
2023-11-11 18:04:49 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="名称" prop="name">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.name"
|
|
|
|
|
placeholder="请输入会员名称"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 240px;"
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="会员等级" prop="gradeId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.gradeId"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="全部"
|
|
|
|
|
>
|
|
|
|
|
<el-option v-for="grade in userGradeList" :key="grade.id+''" :label="grade.name" :value="grade.id+''"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="" prop="balance">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="ifBalance"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="全部"
|
|
|
|
|
>
|
|
|
|
|
<el-option label="有储值余额" value="haveBalance"/>
|
|
|
|
|
<el-option label="无储值余额" value="noHaveBalance"/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="" prop="status">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="queryParams.official"
|
|
|
|
|
placeholder="全部"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.official"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="注册时间">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="dateRange"
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
size="medium"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
type="daterange"
|
|
|
|
|
range-separator="-"
|
|
|
|
|
start-placeholder="开始日期"
|
|
|
|
|
end-placeholder="结束日期"
|
|
|
|
|
></el-date-picker>
|
|
|
|
|
</el-form-item>
|
2023-10-18 18:31:46 +08:00
|
|
|
|
|
2023-11-11 18:04:49 +08:00
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
|
|
|
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
2023-10-16 18:04:58 +08:00
|
|
|
|
</el-card>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<el-card style="margin-top: 20px">
|
2023-10-17 19:01:29 +08:00
|
|
|
|
<div>统计</div>
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<div class="sta">
|
|
|
|
|
<el-statistic
|
|
|
|
|
group-separator=","
|
|
|
|
|
:value="total"
|
|
|
|
|
title="会员总数"
|
|
|
|
|
></el-statistic>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<div class="sta">
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<el-statistic title="今日新增/昨日新增">
|
|
|
|
|
<template slot="formatter">
|
|
|
|
|
{{ addNum }}/{{ yesterdayAddNum }}
|
|
|
|
|
</template>
|
|
|
|
|
</el-statistic>
|
2023-10-17 19:01:29 +08:00
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<div class="sta">
|
|
|
|
|
<el-statistic
|
|
|
|
|
group-separator=","
|
|
|
|
|
:precision="2"
|
|
|
|
|
:value="balance"
|
|
|
|
|
title="储值总余额"
|
|
|
|
|
></el-statistic>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<!-- <el-col :span="4">-->
|
|
|
|
|
<!-- <div class="sta">-->
|
|
|
|
|
<!-- <el-statistic-->
|
|
|
|
|
<!-- group-separator=","-->
|
|
|
|
|
<!-- :precision="2"-->
|
|
|
|
|
<!-- :value="literCard"-->
|
|
|
|
|
<!-- title="升数卡总余额"-->
|
|
|
|
|
<!-- ></el-statistic>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- </el-col>-->
|
2023-10-17 19:01:29 +08:00
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<div class="sta">
|
|
|
|
|
<el-statistic
|
|
|
|
|
group-separator=","
|
|
|
|
|
:value="point"
|
|
|
|
|
title="积分总余额"
|
|
|
|
|
></el-statistic>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<!-- <el-col :span="4">-->
|
|
|
|
|
<!-- <div class="sta">-->
|
|
|
|
|
<!-- <el-statistic-->
|
|
|
|
|
<!-- group-separator=","-->
|
|
|
|
|
<!-- :precision="2"-->
|
|
|
|
|
<!-- :value="refuelMoney"-->
|
|
|
|
|
<!-- title="加油金余额"-->
|
|
|
|
|
<!-- ></el-statistic>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- </el-col>-->
|
2023-10-17 19:01:29 +08:00
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<el-card style="margin-top: 20px">
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
@click="handleAdd"
|
2023-10-19 18:47:09 +08:00
|
|
|
|
>新增会员</el-button>
|
2023-10-24 18:51:29 +08:00
|
|
|
|
<el-table ref="tables" v-loading="loading" :data="list"
|
|
|
|
|
@selection-change="handleSelectionChange" :default-sort="defaultSort"
|
|
|
|
|
@sort-change="handleSortChange">
|
2024-01-31 17:05:12 +08:00
|
|
|
|
<el-table-column type="index" width="60" align="center" label="序号"/>
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<el-table-column label="头像" align="center" width="70">
|
|
|
|
|
<template slot-scope="scope">
|
2024-01-03 18:40:21 +08:00
|
|
|
|
<img v-if="scope.row.avatar" class="list-avatar" :src="baseUrl + scope.row.avatar">
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<img v-else class="list-avatar" src="@/assets/images/avatar.png">
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="会员号" align="center" prop="userNo" width="150"/>
|
2023-10-17 19:01:29 +08:00
|
|
|
|
<el-table-column label="名称" align="center" prop="name" >
|
|
|
|
|
<template slot-scope="scope">
|
2024-01-10 13:45:02 +08:00
|
|
|
|
<span style="color: #409EFF;cursor: pointer " @click="goDedi(scope.row.id)">{{ scope.row.name ? scope.row.name : "--" }}</span>
|
2023-10-17 19:01:29 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<el-table-column label="手机号" align="center" prop="mobile" width="110">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ scope.row.mobile ? scope.row.mobile : '-' }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="会员等级" align="center" prop="gradeId" width="80">
|
|
|
|
|
<template slot-scope="scope">
|
2023-11-29 16:26:19 +08:00
|
|
|
|
<span>{{ scope.row.gradeId ? getName(allUserGrade, scope.row.gradeId) : '-' }}</span>
|
2023-10-16 18:04:58 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<el-table-column label="储值卡" align="center" prop="cardBalance">
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<template slot-scope="scope">
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<div>{{ scope.row.cardBalance ? scope.row.cardBalance.toFixed(2) : '0.00' }}</div>
|
2023-10-16 18:04:58 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<el-table-column label="积分" align="center" prop="points">
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<template slot-scope="scope">
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<div><span>{{ scope.row.points ? scope.row.points : '0.00' }}</span></div>
|
2023-10-16 18:04:58 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<el-table-column label="加油次数" align="center" prop="consumeNum">
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<template slot-scope="scope">
|
2023-11-29 16:26:19 +08:00
|
|
|
|
<div>{{ scope.row.consumeNum ? scope.row.consumeNum : '0' }}</div>
|
2023-10-16 18:04:58 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-01-29 18:18:30 +08:00
|
|
|
|
<el-table-column label="注册时间" align="center" width="160" prop="balCreateTime">
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<template slot-scope="scope">
|
2024-01-29 18:18:30 +08:00
|
|
|
|
<span>{{ parseTime(scope.row.balCreateTime) }}</span>
|
2023-10-16 18:04:58 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
|
|
|
<template slot-scope="scope">
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<dict-tag :options="dict.type.zhzt" :value="scope.row.status"/>
|
2023-10-16 18:04:58 +08:00
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
2024-01-30 18:36:40 +08:00
|
|
|
|
<!-- <el-table-column label="公众号" align="center" prop="official">-->
|
|
|
|
|
<!-- <template slot-scope="scope">-->
|
|
|
|
|
<!-- <dict-tag :options="dict.type.official" :value="scope.row.official"/>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<el-table-column label="操作" align="center" width="120" fixed='right'>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="queryParams.page"
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
</el-card>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
|
2023-10-19 18:47:09 +08:00
|
|
|
|
<!-- 添加会员信息,选择是否批量录入-->
|
2023-11-29 18:33:09 +08:00
|
|
|
|
<el-dialog :title="title" width="55%" :visible.sync="openUser" append-to-body>
|
2023-10-19 18:47:09 +08:00
|
|
|
|
<el-alert
|
|
|
|
|
type="info"
|
|
|
|
|
:closable="false">
|
|
|
|
|
<p v-for="(item,index) in addMember" :id="index">
|
|
|
|
|
{{item}}
|
|
|
|
|
</p>
|
|
|
|
|
</el-alert>
|
2023-10-31 18:18:30 +08:00
|
|
|
|
<div style="margin: 10px 0">
|
2023-10-19 18:47:09 +08:00
|
|
|
|
<el-button type="primary"
|
|
|
|
|
icon="el-icon-edit-outline" @click="addOne" round>录入单个会员</el-button>
|
|
|
|
|
<el-button type="primary"
|
|
|
|
|
icon="el-icon-connection" @click="addMult" round>批量导入会员</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-table ref="tables" v-loading="loading" :data="userList">
|
2023-10-31 18:18:30 +08:00
|
|
|
|
<el-table-column prop="batchNumber" align="center" label="批次号" width="200"/>
|
|
|
|
|
<el-table-column prop="type" align="center" label="类型"/>
|
|
|
|
|
<el-table-column prop="memberNumber" align="center" label="会员数"/>
|
|
|
|
|
<el-table-column label="执行结果" align="center" >
|
|
|
|
|
<el-table-column prop="successNumber" align="center" label="成功人数"/>
|
|
|
|
|
<el-table-column prop="errorNumber" align="center" label="失败人数"/>
|
|
|
|
|
<el-table-column prop="repeatNumber" align="center" label="重复人数"/>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="createTime" align="center" label="处理时间" width="160">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
|
|
</template>
|
2023-10-19 18:47:09 +08:00
|
|
|
|
</el-table-column>
|
2023-10-31 18:18:30 +08:00
|
|
|
|
<!-- <el-table-column prop="date" align="center" label="处理结果详情"/>-->
|
2023-10-19 18:47:09 +08:00
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<pagination
|
2023-10-31 18:18:30 +08:00
|
|
|
|
:total="total1"
|
2023-10-19 18:47:09 +08:00
|
|
|
|
:page.sync="queryParams.page"
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
2023-10-09 11:06:01 +08:00
|
|
|
|
<!-- 添加或修改对话框 -->
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="800px" append-to-body>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="会员名称" prop="name" style="width: 420px">
|
|
|
|
|
<el-input v-model="form.name" placeholder="请输入会员名称" maxlength="30" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="手机号" prop="mobile">
|
|
|
|
|
<el-input v-model="form.mobile" placeholder="请输入手机号" maxlength="30"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="会员等级" prop="gradeId">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="form.gradeId"
|
|
|
|
|
placeholder="会员等级"
|
|
|
|
|
style="width: 300px"
|
|
|
|
|
>
|
2023-11-30 11:48:14 +08:00
|
|
|
|
<el-option v-for="grade in userGradeList" :key="grade.id+''" :label="grade.name" :value="grade.id"/>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2023-10-18 18:31:46 +08:00
|
|
|
|
|
2023-10-09 11:06:01 +08:00
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="会员号" prop="userNo">
|
|
|
|
|
<el-input v-model="form.userNo" placeholder="请输入会员号,为空系统将自动分配" maxlength="30" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<el-form-item label="身份证号" prop="idcard">
|
|
|
|
|
<el-input v-model="form.idcard" placeholder="请输入身份证号" maxlength="30"/>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<el-form-item label="会员初始积分" prop="points">
|
2023-11-30 11:48:14 +08:00
|
|
|
|
<el-input :disabled="title == '编辑会员'" v-model="form.points" placeholder="请输入会员初始积分" maxlength="30"/>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<!-- <el-row>-->
|
|
|
|
|
<!-- <el-col :span="24">-->
|
|
|
|
|
<!-- <el-form-item label="初始加油金" prop="refuelMoney">-->
|
|
|
|
|
<!-- <el-input v-model="form.refuelMoney" placeholder="0" maxlength="30"/>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- </el-row>-->
|
2023-10-09 11:06:01 +08:00
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<el-form-item label="储值通用余额" prop="cardBalance">
|
2023-11-30 11:48:14 +08:00
|
|
|
|
<el-input :disabled="title == '编辑会员'" v-model="form.cardBalance" placeholder="请输入储值卡初始余额" maxlength="30"/>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2023-11-02 18:38:22 +08:00
|
|
|
|
<!-- <el-row>-->
|
|
|
|
|
<!-- <el-col :span="24">-->
|
|
|
|
|
<!-- <el-form-item label="升数卡余额" prop="literCard">-->
|
|
|
|
|
<!-- <el-input v-model="form.literCard" placeholder="0" maxlength="30"/>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- </el-col>-->
|
|
|
|
|
<!-- </el-row>-->
|
2023-10-09 11:06:01 +08:00
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<el-form-item label="是否关注公众号">
|
|
|
|
|
<el-radio-group v-model="form.official">
|
|
|
|
|
<el-radio label="ygz" value="ygz">已关注</el-radio>
|
|
|
|
|
<el-radio label="wgz" value="wgz">未关注</el-radio>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
2023-11-29 16:26:19 +08:00
|
|
|
|
<el-form-item label="会员状态" prop="status">
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<el-radio-group v-model="form.status">
|
|
|
|
|
<el-radio label="qy" value="qy">启用</el-radio>
|
|
|
|
|
<el-radio label="jy" value="jy">禁用</el-radio>
|
|
|
|
|
</el-radio-group>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
2023-10-18 18:31:46 +08:00
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
|
|
|
|
</el-form-item>
|
2023-10-09 11:06:01 +08:00
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
2023-10-19 18:47:09 +08:00
|
|
|
|
<!-- 批量录入会员信息-->
|
2023-11-30 11:48:14 +08:00
|
|
|
|
<el-dialog :title="title" :visible.sync="openUpload" append-to-body>
|
2023-10-19 18:47:09 +08:00
|
|
|
|
<div style="height: 60px;line-height: 30px">
|
|
|
|
|
<div> 第一步: 下载示例模板,按照模板填写会员数据,手机号为必填项 </div>
|
|
|
|
|
<a style="margin-left: 50px;color: #00afff"
|
|
|
|
|
href="/dev-api/excel/export"> 会员示例模板.xlsx </a>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="margin: 20px 0">
|
|
|
|
|
<div>第二步: 选择用户数据上传并导入会员</div>
|
|
|
|
|
<el-upload
|
|
|
|
|
class="upload-demo"
|
2023-10-20 18:42:38 +08:00
|
|
|
|
v-loading="uploading"
|
2023-10-19 18:47:09 +08:00
|
|
|
|
action="/dev-api/excel/import"
|
|
|
|
|
:headers="headers"
|
2023-10-20 18:42:38 +08:00
|
|
|
|
:limit="1"
|
2023-10-19 18:47:09 +08:00
|
|
|
|
:on-change="handleChange"
|
2023-10-20 18:42:38 +08:00
|
|
|
|
style="margin-left: 50px"
|
2023-10-19 18:47:09 +08:00
|
|
|
|
:file-list="fileList">
|
|
|
|
|
<el-button size="small" type="success" icon="el-icon-upload">点击上传</el-button>
|
|
|
|
|
<div slot="tip">只能上传xls/xlsx文件,单次最大5000行会员数据且不超过1M 超出请分文件处理</div>
|
|
|
|
|
</el-upload>
|
2023-10-20 18:42:38 +08:00
|
|
|
|
<!-- <el-button type="primary" round @click="importUser">主要按钮</el-button>-->
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
2023-10-19 18:47:09 +08:00
|
|
|
|
|
2023-10-20 18:42:38 +08:00
|
|
|
|
<!-- 批量导入结果-->
|
|
|
|
|
<el-dialog width="400px" style="margin-top: 150px" :title="title" :visible.sync="openResult" append-to-body>
|
|
|
|
|
<div class="huiyuan">
|
|
|
|
|
会员总数:<span class="num">{{result.total}}</span> 人
|
|
|
|
|
</div>
|
|
|
|
|
<div class="huiyuan">
|
|
|
|
|
成功人数:<span class="num">{{result.success}}</span> 人
|
|
|
|
|
</div>
|
|
|
|
|
<div class="huiyuan">
|
|
|
|
|
失败人数:<span class="num">{{result.error}}</span> 人
|
|
|
|
|
<span v-if="result.error!=0" style="color: red;font-size: 12px">手机号不可为空</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="huiyuan">
|
|
|
|
|
重复人数:<span class="num">{{result.repeat}}</span> 人
|
2023-10-19 18:47:09 +08:00
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
2023-10-09 11:06:01 +08:00
|
|
|
|
<!-- 余额充值对话框 -->
|
|
|
|
|
<balanceRecharge :showDialog="openBalance" :userId="userId" @closeDialog="closeDialog" @close="closeDialog"/>
|
|
|
|
|
|
|
|
|
|
<!-- 积分充值对话框 -->
|
|
|
|
|
<pointRecharge :showDialog="openPoint" :userId="userId" @closeDialog="closeDialog" @close="closeDialog"/>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { getMemberList, updateMemberStatus, getMemberInfo, saveMember, deleteMember } from "@/api/member";
|
|
|
|
|
import balanceRecharge from "./balanceRecharge";
|
|
|
|
|
import pointRecharge from "./pointRecharge";
|
2023-10-31 18:18:30 +08:00
|
|
|
|
import {
|
|
|
|
|
addUser,
|
|
|
|
|
delUser,
|
|
|
|
|
exportUsers,
|
|
|
|
|
getUser,
|
2024-01-04 18:44:52 +08:00
|
|
|
|
getUserMobile, getUserPhone,
|
2023-10-31 18:18:30 +08:00
|
|
|
|
listStatistic,
|
|
|
|
|
listUser, listUserStatistic,
|
|
|
|
|
updateUser
|
|
|
|
|
} from "@/api/staff/user/user";
|
2023-11-29 16:26:19 +08:00
|
|
|
|
import {allUserGrade, listUserGrade} from "@/api/staff/user/usergrade";
|
2023-11-30 11:48:14 +08:00
|
|
|
|
import {ljStoreList, storesList} from "@/api/staff/store";
|
2023-10-19 18:47:09 +08:00
|
|
|
|
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
|
|
|
|
import { getToken } from "@/utils/auth";
|
2023-11-02 18:38:22 +08:00
|
|
|
|
import {paymentApi} from "@/api/payment/fypay";
|
2023-10-09 11:06:01 +08:00
|
|
|
|
export default {
|
|
|
|
|
name: "MemberIndex",
|
|
|
|
|
components: { balanceRecharge, pointRecharge },
|
2023-10-18 18:31:46 +08:00
|
|
|
|
dicts: ['official','zhzt'],
|
2023-10-09 11:06:01 +08:00
|
|
|
|
data() {
|
|
|
|
|
return {
|
2024-01-03 18:40:21 +08:00
|
|
|
|
baseUrl:process.env.VUE_APP_BASE_API,
|
2023-10-20 18:42:38 +08:00
|
|
|
|
result:{},
|
|
|
|
|
// 是否自动上传
|
|
|
|
|
isUpload:false,
|
2023-10-19 18:47:09 +08:00
|
|
|
|
headers: {
|
|
|
|
|
'Access-Token': getToken(),
|
|
|
|
|
},
|
|
|
|
|
// 文件上传信息
|
|
|
|
|
fileList: [],
|
|
|
|
|
|
|
|
|
|
addMember:[],
|
2023-10-17 19:01:29 +08:00
|
|
|
|
// 余额
|
|
|
|
|
balance:'',
|
|
|
|
|
// 积分
|
|
|
|
|
point:'',
|
|
|
|
|
// 升数卡
|
|
|
|
|
literCard:'',
|
|
|
|
|
// 加油金
|
|
|
|
|
refuelMoney:'',
|
|
|
|
|
// 今日新增
|
|
|
|
|
addNum:'',
|
2023-10-18 18:31:46 +08:00
|
|
|
|
// 昨日新增
|
|
|
|
|
yesterdayAddNum:'',
|
2023-10-09 11:06:01 +08:00
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
2023-10-20 18:42:38 +08:00
|
|
|
|
uploading: false,
|
|
|
|
|
uploadingFile: 0,
|
2023-10-09 11:06:01 +08:00
|
|
|
|
// 标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
2023-10-31 18:18:30 +08:00
|
|
|
|
total1: 0,
|
2023-10-09 11:06:01 +08:00
|
|
|
|
// 表格数据
|
|
|
|
|
list: [],
|
2023-10-19 18:47:09 +08:00
|
|
|
|
// 会员表格数据
|
|
|
|
|
userList: [],
|
2023-11-29 16:26:19 +08:00
|
|
|
|
// 当前店铺会员等级列表
|
2023-10-09 11:06:01 +08:00
|
|
|
|
userGradeList: [],
|
2023-11-29 16:26:19 +08:00
|
|
|
|
// 所有等级信息
|
|
|
|
|
allUserGrade:[],
|
2023-10-09 11:06:01 +08:00
|
|
|
|
// 店铺列表
|
|
|
|
|
storeList: [],
|
|
|
|
|
storeIds: [],
|
|
|
|
|
// 是否显示修改对话框
|
|
|
|
|
open: false,
|
2023-10-19 18:47:09 +08:00
|
|
|
|
openUser: false,
|
|
|
|
|
openUpload: false,
|
2023-10-20 18:42:38 +08:00
|
|
|
|
openResult: false,
|
2023-10-09 11:06:01 +08:00
|
|
|
|
// 当前操作用户
|
|
|
|
|
userId: '',
|
|
|
|
|
// 是否弹层充值
|
|
|
|
|
openBalance: false,
|
|
|
|
|
// 是否弹层积分
|
|
|
|
|
openPoint: false,
|
|
|
|
|
// 日期范围
|
|
|
|
|
dateRange: [],
|
|
|
|
|
// 默认排序
|
|
|
|
|
defaultSort: {prop: 'updateTime', order: 'descending'},
|
|
|
|
|
// 表单参数
|
2023-11-29 18:33:09 +08:00
|
|
|
|
form: { id: '', name: '', gradeId: '', mobile: '', userNo: '',points:0, startTime: '',
|
|
|
|
|
endTime: '', refuelMoney:'0',official:'wgz',
|
|
|
|
|
cardBalance:0, literCard:'0', sex: 1, idcard: '', birthday: '', address: '', status: "qy", description: '' },
|
2023-10-09 11:06:01 +08:00
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
page: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
mobile: '',
|
|
|
|
|
id: '',
|
|
|
|
|
userNo: '',
|
|
|
|
|
name: '',
|
|
|
|
|
gradeId: '',
|
|
|
|
|
status: '',
|
2023-11-27 18:28:41 +08:00
|
|
|
|
storeId: '',
|
2023-10-18 18:31:46 +08:00
|
|
|
|
official:'',
|
2023-11-02 18:38:22 +08:00
|
|
|
|
cardBalance:'',
|
2023-10-09 11:06:01 +08:00
|
|
|
|
},
|
2023-10-18 18:31:46 +08:00
|
|
|
|
ifBalance:'',
|
2023-10-09 11:06:01 +08:00
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
name: [
|
|
|
|
|
{ required: true, message: "会员名称不能为空", trigger: "blur" },
|
2024-01-11 13:55:20 +08:00
|
|
|
|
// { min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' }
|
2023-10-09 11:06:01 +08:00
|
|
|
|
],
|
2023-11-29 16:26:19 +08:00
|
|
|
|
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }],
|
|
|
|
|
status: [{ required: true, message: "请选择会员状态", trigger: "blur" }],
|
2023-10-31 18:18:30 +08:00
|
|
|
|
mobile: [
|
|
|
|
|
{ required: true, message: "请输入手机号", trigger: "blur" },
|
2023-11-29 18:33:09 +08:00
|
|
|
|
{ min: 8, max: 11, message: '请输入正确的手机号', trigger: 'blur' }
|
2023-10-31 18:18:30 +08:00
|
|
|
|
],
|
2023-10-09 11:06:01 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
2023-10-17 19:01:29 +08:00
|
|
|
|
this.getStatistic();
|
2023-10-19 18:47:09 +08:00
|
|
|
|
this.getConfig();
|
2023-10-31 18:18:30 +08:00
|
|
|
|
this.getUserList();
|
2024-02-21 17:02:13 +08:00
|
|
|
|
// this.queryUserList();
|
2023-10-09 11:06:01 +08:00
|
|
|
|
},
|
|
|
|
|
methods: {
|
2024-01-30 16:04:49 +08:00
|
|
|
|
// 定时器
|
|
|
|
|
queryUserList(){
|
2024-02-21 17:02:13 +08:00
|
|
|
|
// let _this = this;
|
|
|
|
|
// setInterval(function (){
|
|
|
|
|
// _this.getList();
|
|
|
|
|
// _this.getStatistic();
|
|
|
|
|
// },5000)
|
2024-01-30 16:04:49 +08:00
|
|
|
|
},
|
2023-10-17 19:01:29 +08:00
|
|
|
|
// 跳转详情页
|
|
|
|
|
goDedi(id){
|
|
|
|
|
this.$router.push({
|
|
|
|
|
path:"/member/userInfo",
|
2023-10-18 18:31:46 +08:00
|
|
|
|
query:{
|
|
|
|
|
id:id
|
|
|
|
|
}
|
2023-10-17 19:01:29 +08:00
|
|
|
|
})
|
|
|
|
|
},
|
2023-10-31 18:18:30 +08:00
|
|
|
|
getUserList(){
|
|
|
|
|
this.loading = true;
|
|
|
|
|
listUserStatistic().then( response => {
|
|
|
|
|
this.userList = response.data.records;
|
|
|
|
|
this.total1 = response.data.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
2023-10-09 11:06:01 +08:00
|
|
|
|
// 查询列表
|
|
|
|
|
getList() {
|
|
|
|
|
this.loading = true;
|
2023-10-18 18:31:46 +08:00
|
|
|
|
listUser(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
2023-10-16 18:04:58 +08:00
|
|
|
|
this.list = response.data.records;
|
|
|
|
|
this.total = response.data.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
2023-10-09 11:06:01 +08:00
|
|
|
|
},
|
2023-10-18 18:31:46 +08:00
|
|
|
|
// 获得统计信息
|
2023-10-17 19:01:29 +08:00
|
|
|
|
getStatistic(){
|
2023-10-18 18:31:46 +08:00
|
|
|
|
listStatistic(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
2023-10-17 19:01:29 +08:00
|
|
|
|
this.addNum = response.data.addNum;
|
2023-10-18 18:31:46 +08:00
|
|
|
|
this.yesterdayAddNum = response.data.yesterdayAddNum;
|
2024-02-21 17:02:13 +08:00
|
|
|
|
if (!response.data.balance) {
|
|
|
|
|
this.balance = 0
|
|
|
|
|
}else {
|
|
|
|
|
this.balance = response.data.balance;
|
|
|
|
|
}
|
|
|
|
|
if (!response.data.point) {
|
|
|
|
|
this.point = 0
|
|
|
|
|
}else {
|
|
|
|
|
this.point = response.data.point;
|
|
|
|
|
}
|
2023-10-17 19:01:29 +08:00
|
|
|
|
});
|
2023-11-29 16:26:19 +08:00
|
|
|
|
allUserGrade().then( response => {
|
|
|
|
|
this.allUserGrade = response.data
|
|
|
|
|
});
|
|
|
|
|
listUserGrade({page:1,pageSize:20}).then( response => {
|
|
|
|
|
this.userGradeList = response.data.records;
|
2023-10-18 18:31:46 +08:00
|
|
|
|
});
|
2023-11-30 11:48:14 +08:00
|
|
|
|
storesList().then( response => {
|
2023-10-18 18:31:46 +08:00
|
|
|
|
this.storeList = response.data
|
|
|
|
|
});
|
2023-10-17 19:01:29 +08:00
|
|
|
|
},
|
2023-10-09 11:06:01 +08:00
|
|
|
|
// 搜索按钮操作
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.page = 1;
|
2023-10-18 18:31:46 +08:00
|
|
|
|
if (this.ifBalance=='haveBalance'){
|
2023-11-02 18:38:22 +08:00
|
|
|
|
this.queryParams.cardBalance = 1;
|
2023-10-18 18:31:46 +08:00
|
|
|
|
}else {
|
2023-11-02 18:38:22 +08:00
|
|
|
|
this.queryParams.cardBalance = 2;
|
2023-10-18 18:31:46 +08:00
|
|
|
|
}
|
|
|
|
|
if (this.ifBalance==''){
|
2023-11-02 18:38:22 +08:00
|
|
|
|
this.queryParams.cardBalance = ''
|
2023-10-18 18:31:46 +08:00
|
|
|
|
}
|
2023-10-09 11:06:01 +08:00
|
|
|
|
this.getList();
|
2024-01-30 16:04:49 +08:00
|
|
|
|
this.getStatistic();
|
2023-10-09 11:06:01 +08:00
|
|
|
|
},
|
|
|
|
|
// 重置按钮操作
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.dateRange = [];
|
|
|
|
|
this.resetForm("queryForm");
|
2023-11-24 18:13:11 +08:00
|
|
|
|
this.queryParams.storeId = '';
|
|
|
|
|
this.queryParams.official = "";
|
|
|
|
|
this.ifBalance = ""
|
2023-10-09 11:06:01 +08:00
|
|
|
|
this.storeIds = [];
|
|
|
|
|
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 状态修改
|
|
|
|
|
handleStatusChange(row) {
|
|
|
|
|
let text = row.status == "A" ? "启用" : "禁用";
|
|
|
|
|
this.$modal.confirm('确认要' + text + '"' + row.name + '"吗?').then(function() {
|
|
|
|
|
return updateMemberStatus(row.id, row.status);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$modal.msgSuccess(text + "成功");
|
|
|
|
|
}).catch(function() {
|
|
|
|
|
row.status = row.status === "N" ? "A" : "N";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
// 排序触发事件
|
|
|
|
|
handleSortChange(column, prop, order) {
|
|
|
|
|
this.queryParams.orderByColumn = column.prop;
|
|
|
|
|
this.queryParams.isAsc = column.order;
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
// 余额充值操作
|
|
|
|
|
handleBalance(userId) {
|
|
|
|
|
this.openBalance = true;
|
|
|
|
|
this.userId = userId.toString();
|
2023-10-19 18:47:09 +08:00
|
|
|
|
},
|
|
|
|
|
// 导入会员信息
|
|
|
|
|
importUser(){
|
2023-10-20 18:42:38 +08:00
|
|
|
|
this.openResult = true;
|
|
|
|
|
this.title = "会员创建结果";
|
|
|
|
|
this.getList();
|
2023-10-31 18:18:30 +08:00
|
|
|
|
this.getUserList();
|
2023-10-09 11:06:01 +08:00
|
|
|
|
},
|
|
|
|
|
// 积分变更操作
|
|
|
|
|
handlePoint(userId) {
|
|
|
|
|
this.openPoint = true
|
|
|
|
|
this.userId = userId.toString();
|
|
|
|
|
},
|
|
|
|
|
// 关闭对话框
|
|
|
|
|
closeDialog(dialog) {
|
|
|
|
|
if (dialog == 'balance') {
|
|
|
|
|
this.openBalance = false;
|
|
|
|
|
}
|
|
|
|
|
if (dialog == 'point') {
|
|
|
|
|
this.openPoint = false;
|
|
|
|
|
}
|
|
|
|
|
this.userId = "";
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
// 新增按钮操作
|
|
|
|
|
handleAdd() {
|
2023-10-19 18:47:09 +08:00
|
|
|
|
this.openUser = true;
|
|
|
|
|
this.title = "新增会员";
|
|
|
|
|
},
|
|
|
|
|
// 新增按钮操作
|
|
|
|
|
addOne() {
|
2023-10-09 11:06:01 +08:00
|
|
|
|
this.reset();
|
|
|
|
|
this.open = true;
|
2023-10-19 18:47:09 +08:00
|
|
|
|
this.title = "录入会员";
|
|
|
|
|
},
|
|
|
|
|
addMult(){
|
|
|
|
|
this.openUpload = true;
|
|
|
|
|
this.title = "批量导入会员";
|
|
|
|
|
},
|
|
|
|
|
// 获取配置信息
|
|
|
|
|
getConfig(){
|
|
|
|
|
getSysConfig('addMember').then(response => {
|
|
|
|
|
this.addMember = response.data.split(";")
|
|
|
|
|
});
|
2023-10-09 11:06:01 +08:00
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.resetForm("form");
|
2023-11-29 18:33:09 +08:00
|
|
|
|
this.form= { id: '', name: '', gradeId: '', mobile: '', userNo: '',points:0, startTime: '', endTime: '',
|
|
|
|
|
refuelMoney:'0',official:'wgz',cardBalance:0, literCard:'0', sex: 1, idcard: '', birthday: '', address: '',
|
2023-10-18 18:31:46 +08:00
|
|
|
|
status: "qy", description: ''
|
|
|
|
|
}
|
2023-10-09 11:06:01 +08:00
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 提交按钮
|
|
|
|
|
submitForm: function() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id) {
|
2024-01-06 10:02:09 +08:00
|
|
|
|
updateUser(this.form).then(response => {
|
|
|
|
|
if (response.data==1){
|
|
|
|
|
this.$modal.msgSuccess("修改会员成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
}else {
|
2024-01-05 18:27:59 +08:00
|
|
|
|
this.$modal.msgError("手机号已存在");
|
|
|
|
|
}
|
2024-01-06 10:02:09 +08:00
|
|
|
|
});
|
2023-10-09 11:06:01 +08:00
|
|
|
|
} else {
|
2024-01-04 18:44:52 +08:00
|
|
|
|
getUserPhone({mobile:this.form.mobile}).then( response => {
|
|
|
|
|
if(response.data){
|
2023-10-31 18:18:30 +08:00
|
|
|
|
this.$modal.msgError("手机号已存在");
|
|
|
|
|
}else {
|
2024-01-06 15:47:07 +08:00
|
|
|
|
addUser(this.form).then(res => {
|
|
|
|
|
this.$modal.msgSuccess("新增会员成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.openUser = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
this.getUserList();
|
2023-10-31 18:18:30 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
2023-10-09 11:06:01 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 修改按钮操作
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
const id = row.id || this.ids;
|
2023-10-18 18:31:46 +08:00
|
|
|
|
getUser(id).then(response => {
|
|
|
|
|
this.form = response.data;
|
2023-10-09 11:06:01 +08:00
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "编辑会员";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 删除按钮操作
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const name = row.name
|
|
|
|
|
this.$modal.confirm('确定删除"' + name + '"的会员信息?').then(function() {
|
2023-10-18 18:31:46 +08:00
|
|
|
|
// return deleteMember(row.id);
|
|
|
|
|
return delUser(row.id);
|
2023-10-09 11:06:01 +08:00
|
|
|
|
}).then(() => {
|
2023-10-28 13:33:42 +08:00
|
|
|
|
this.queryParams.page = 1
|
2023-10-09 11:06:01 +08:00
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).catch(() => {});
|
2023-10-19 18:47:09 +08:00
|
|
|
|
},
|
|
|
|
|
handleChange(file, fileList) {
|
2023-10-20 18:42:38 +08:00
|
|
|
|
this.uploading = true;
|
|
|
|
|
if(file.status === 'success'){
|
|
|
|
|
this.uploading = false;
|
|
|
|
|
this.openUpload = false;
|
|
|
|
|
this.openUser = false;
|
|
|
|
|
this.importUser();
|
|
|
|
|
this.fileList.splice(0,1)
|
|
|
|
|
this.result = file.response.data
|
|
|
|
|
}
|
|
|
|
|
},
|
2023-10-09 11:06:01 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
2023-10-16 18:04:58 +08:00
|
|
|
|
<style scoped>
|
2023-11-29 18:33:09 +08:00
|
|
|
|
|
2023-10-16 18:04:58 +08:00
|
|
|
|
.app-container{
|
|
|
|
|
width: 100%;
|
2023-10-18 18:31:46 +08:00
|
|
|
|
height: 100%;
|
2023-10-16 18:04:58 +08:00
|
|
|
|
background: #f6f8f9;
|
|
|
|
|
}
|
2023-10-17 19:01:29 +08:00
|
|
|
|
.sta{
|
|
|
|
|
height: 100px;
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
background: #f6f8f9;
|
|
|
|
|
padding-top: 30px;
|
|
|
|
|
}
|
2023-10-20 18:42:38 +08:00
|
|
|
|
.huiyuan{
|
|
|
|
|
height: 30px;
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
font-size: 16px;
|
|
|
|
|
}
|
|
|
|
|
.num{
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
color: red;
|
|
|
|
|
font-size: 18px;
|
2023-10-19 18:47:09 +08:00
|
|
|
|
}
|
2023-10-16 18:04:58 +08:00
|
|
|
|
</style>
|