|
@@ -1,13 +1,342 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <h5>临时会员</h5>
|
|
|
|
|
|
|
+ <div class="context">
|
|
|
|
|
+ <div class="panel">
|
|
|
|
|
+ <h5>临时会员</h5>
|
|
|
|
|
+ <div class="panel-body">
|
|
|
|
|
+ <div class="panel_control">
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="4">
|
|
|
|
|
+ <em>姓名:</em>
|
|
|
|
|
+ <el-input v-model="panel.name" placeholder="请输入姓名"></el-input>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="4">
|
|
|
|
|
+ <em>手机号:</em>
|
|
|
|
|
+ <el-input v-model="panel.phone" placeholder="请输入手机号" type="number"></el-input>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="4">
|
|
|
|
|
+ <el-button size="" type="primary" @click="query" plain :disabled="serachBtnStatus">查询
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="change">
|
|
|
|
|
+ <el-button @click="addMember" v-if="userLevel != 4" type="primary">新增临时会员</el-button>
|
|
|
|
|
+ <el-button @click="delList" v-if="userLevel != 4">删除临时会员</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="table">
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ :data="tableData"
|
|
|
|
|
+ border
|
|
|
|
|
+ is-horizontal-resize
|
|
|
|
|
+ :default-sort="{prop: 'date', order: 'descending'}"
|
|
|
|
|
+ element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
|
|
+ @selection-change="handleSelectionChange" @current-change="clickChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column label="选择" width="55">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-radio v-model="tableRadio" :label="scope.row"><i></i></el-radio>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ type="index"
|
|
|
|
|
+ label="序号"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ width="50"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="UserInfo.head"
|
|
|
|
|
+ label="头像"
|
|
|
|
|
+ width="50"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <div class="demo-image__preview" v-if="scope.row.UserInfo.Head">
|
|
|
|
|
+ <el-image
|
|
|
|
|
+ style="width: 25px; height: 25px"
|
|
|
|
|
+ :src="scope.row.UserInfo.Head"
|
|
|
|
|
+ :preview-src-list="[scope.row.UserInfo.Head]"
|
|
|
|
|
+
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-image>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <img src="../assets/img/nav/head.png" alt="" v-else width="25px" height="25px">
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="UserInfo.Name"
|
|
|
|
|
+ label="会员名"
|
|
|
|
|
+ width="90"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="UserInfo.Phone"
|
|
|
|
|
+ label="手机号"
|
|
|
|
|
+ width="110"
|
|
|
|
|
+ sortable
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="ClassInfo"
|
|
|
|
|
+ label="会员课程"
|
|
|
|
|
+ width="220px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span class="lessonSpan" :style="{background:lesson.ClassColor}"
|
|
|
|
|
+ v-for="lesson in scope.row.ClassInfo">{{ lesson.ClassName }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="UserInfo.IsAcross"
|
|
|
|
|
+ label="跨店会员"
|
|
|
|
|
+ width="105"
|
|
|
|
|
+ sortable
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="scope.row.UserInfo.IsAcross == 0" class="green">本店用户</span>
|
|
|
|
|
+ <span v-else class="red">跨店用户</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="UserInfo.Memo"
|
|
|
|
|
+ label="备注">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <el-popover
|
|
|
|
|
+ placement="top"
|
|
|
|
|
+ title=""
|
|
|
|
|
+ width="200"
|
|
|
|
|
+ trigger="hover"
|
|
|
|
|
+ :content="scope.row.UserInfo.Memo">
|
|
|
|
|
+ <span slot="reference"
|
|
|
|
|
+ v-if="scope.row.UserInfo.Memo.length > 6">{{ scope.row.UserInfo.Memo.substr(0, 6) }} ....</span>
|
|
|
|
|
+ </el-popover>
|
|
|
|
|
+ <span v-if="scope.row.UserInfo.Memo.length <= 6">{{ scope.row.UserInfo.Memo }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <br>
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ background
|
|
|
|
|
+ :total="pageination.total"
|
|
|
|
|
+ :page-size="pageination.pageItem"
|
|
|
|
|
+ @current-change="pageChange"
|
|
|
|
|
+ ></el-pagination>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import Global from '../Global.js'
|
|
|
|
|
+ import ImgCutter from 'vue-img-cutter'
|
|
|
|
|
+ import {
|
|
|
|
|
+ testTable,
|
|
|
|
|
+ testSelect
|
|
|
|
|
+ } from "../api/getApiRes";
|
|
|
|
|
+
|
|
|
|
|
+ let qs = require('qs');
|
|
|
export default {
|
|
export default {
|
|
|
- name: "tempUser"
|
|
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ imageUrl: '',
|
|
|
|
|
+ token: {}, // 七牛云的上传地址,根据自己所在地区选择,我这里是华南区
|
|
|
|
|
+ domain: 'https://up-z1.qiniup.com', // 这是七牛云空间的外链默认域名
|
|
|
|
|
+ qiniuaddr: 'xhead.beswell.com',//xhead.beswell.com 旧的 qjzpcd34v.hb-bkt.clouddn.com
|
|
|
|
|
+ tableData: [],
|
|
|
|
|
+ tableRadio: [],
|
|
|
|
|
+ userLevel: localStorage.userLevel,
|
|
|
|
|
+ serachBtnStatus: false,
|
|
|
|
|
+ panel: {
|
|
|
|
|
+ usercode: '',
|
|
|
|
|
+ username: '',
|
|
|
|
|
+ compname: '',
|
|
|
|
|
+ keyword: '',
|
|
|
|
|
+ USERCODE: '',
|
|
|
|
|
+ endType: '',
|
|
|
|
|
+ taskstatus: 99,
|
|
|
|
|
+ draw: 1,
|
|
|
|
|
+ start: 0,
|
|
|
|
|
+ recordsTotal: 0,
|
|
|
|
|
+ tableData: [],
|
|
|
|
|
+ allTableData: [],
|
|
|
|
|
+ limit: '10',
|
|
|
|
|
+ multipleSort: false,
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ fileList: [],
|
|
|
|
|
+ multipleSelection: [],
|
|
|
|
|
+ detectedmac: '',
|
|
|
|
|
+ vipType: '',
|
|
|
|
|
+ expDay: '',
|
|
|
|
|
+ vipOptions: vipOptions(0),
|
|
|
|
|
+ endTypeOptions: endTypeOptions(),
|
|
|
|
|
+ time1: globalBt(),
|
|
|
|
|
+ },
|
|
|
|
|
+ multipleSelection: [],
|
|
|
|
|
+ pageination: {
|
|
|
|
|
+ pageItem: 20,
|
|
|
|
|
+ pageoptions: pageOptions(),
|
|
|
|
|
+ total: 100,
|
|
|
|
|
+ pageIndex: 1,
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ addMember(){
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ delList(){
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ clickChange(item) {
|
|
|
|
|
+ this.tableRadio = item
|
|
|
|
|
+ },
|
|
|
|
|
+ // 查询按钮
|
|
|
|
|
+ query() {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ that.serachBtnStatus = true;
|
|
|
|
|
+ that.getTableQuery();
|
|
|
|
|
+ that.$message.success('查询完毕');
|
|
|
|
|
+ let totalTime = 2
|
|
|
|
|
+ let clock = window.setInterval(() => {
|
|
|
|
|
+ totalTime--
|
|
|
|
|
+ if (totalTime < 0) {
|
|
|
|
|
+ totalTime = 2;
|
|
|
|
|
+ that.serachBtnStatus = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ },
|
|
|
|
|
+ // 页面数据查询
|
|
|
|
|
+ getTableQuery() {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ that.loading = true;
|
|
|
|
|
+ let param = {
|
|
|
|
|
+ token: localStorage.token,
|
|
|
|
|
+ vipType: that.panel.vipType,//
|
|
|
|
|
+ phone: that.panel.phone,//
|
|
|
|
|
+ name: that.panel.name,//
|
|
|
|
|
+ expDay: that.panel.expDay,//
|
|
|
|
|
+ start: that.start,//
|
|
|
|
|
+ tableMax: 20,//
|
|
|
|
|
+ };
|
|
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
|
|
+ VipUserListQuery(postdata).then(res => {
|
|
|
|
|
+ let json = res;
|
|
|
|
|
+ if (json.Code == 0) {
|
|
|
|
|
+ that.loading = false;
|
|
|
|
|
+ if (json.Rs) {
|
|
|
|
|
+ that.allTableData = json.Rs;
|
|
|
|
|
+ that.recordsTotal = json.PageCount * that.pageination.pageItem;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.allTableData = [];
|
|
|
|
|
+ that.recordsTotal = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 设置分页数据
|
|
|
|
|
+ that.setPaginations();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.$message.error(json.Memo + '错误码:' + json.Code);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ clearForm() {
|
|
|
|
|
+ // clear
|
|
|
|
|
+ this.form.name = '';
|
|
|
|
|
+ this.form.head = '';
|
|
|
|
|
+ this.imageUrl = '';
|
|
|
|
|
+ this.form.phone = '';
|
|
|
|
|
+ this.form.memo = '';
|
|
|
|
|
+ this.form.normalhour = 0;
|
|
|
|
|
+ this.form.gifthour = 0;
|
|
|
|
|
+ this.form.height = '';
|
|
|
|
|
+ this.form.weight = '';
|
|
|
|
|
+ this.form.staticHr = '';
|
|
|
|
|
+ this.form.sex = 1;
|
|
|
|
|
+ this.form.birthday = '';
|
|
|
|
|
+ this.form.userCode = '';
|
|
|
|
|
+ this.form.shopId = '';
|
|
|
|
|
+ this.form.classlist = [];
|
|
|
|
|
+ },
|
|
|
|
|
+ handleSelectionChange(val) {
|
|
|
|
|
+ this.multipleSelection = val;
|
|
|
|
|
+ },
|
|
|
|
|
+ // 设置分页数据
|
|
|
|
|
+ setPaginations() {
|
|
|
|
|
+ // 分页属性
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ that.pageination.total = that.recordsTotal;
|
|
|
|
|
+
|
|
|
|
|
+ // 默认分页
|
|
|
|
|
+ that.tableData = that.allTableData.filter((item, index) => {
|
|
|
|
|
+ return index < that.pageination.pageItem;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 每页显示数量
|
|
|
|
|
+ handleSizeChange() {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ that.tableData = that.allTableData.filter((item, index) => {
|
|
|
|
|
+ return index < that.pageination.pageItem;
|
|
|
|
|
+ });
|
|
|
|
|
+ that.draw = that.pageination.pageItem;
|
|
|
|
|
+ // that.getTableQuery();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 翻页
|
|
|
|
|
+ pageChange(pageIndex) {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ // 获取当前页
|
|
|
|
|
+ let index = that.pageination.pageItem * (pageIndex - 1);
|
|
|
|
|
+ // 数据总数
|
|
|
|
|
+ let nums = that.pageination.pageItem * pageIndex;
|
|
|
|
|
+ // 容器
|
|
|
|
|
+ let tables = [];
|
|
|
|
|
+ for (var i = index; i < nums; i++) {
|
|
|
|
|
+ if (that.allTableData[i]) {
|
|
|
|
|
+ tables.push(that.allTableData[i])
|
|
|
|
|
+ }
|
|
|
|
|
+ this.tableData = tables;
|
|
|
|
|
+ }
|
|
|
|
|
+ that.start = index * that.draw;
|
|
|
|
|
+ console.log(index);
|
|
|
|
|
+ console.log(that.draw);
|
|
|
|
|
+ that.getTableQuery();
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
|
|
+ @import "../assets/css/panel.css";
|
|
|
|
|
+
|
|
|
|
|
+ .context {
|
|
|
|
|
+ border-radius: 12px;
|
|
|
|
|
+ height: 770px;
|
|
|
|
|
+ overflow-y: scroll;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+ background-color: #fff !important;
|
|
|
|
|
+ padding: 30px;
|
|
|
|
|
+ padding-bottom: 30px;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ .panel-body {
|
|
|
|
|
+ padding: 20px;
|
|
|
|
|
+ background: #F0F2F5;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .change {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+ padding-top: 10px;
|
|
|
|
|
+ padding-bottom: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .change button {
|
|
|
|
|
+ float: left;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .change button.pull-right {
|
|
|
|
|
+ float: right;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|