| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079 |
- <template>
- <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.usercode" placeholder="请输入用户名"></el-input>
- </el-col>
- <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)"
- class=""
- @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="Usercode"
- label="用户名"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="Name"
- label="会员名"
- width="90"
- >
- </el-table-column>
- <el-table-column
- prop="Phone"
- label="手机号"
- width="110"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="LastLoginTime"
- label="上次登陆时间"
- :formatter="filterFmtDate"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="GroupName"
- label="分组名称"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="SumNormalHour"
- label="剩余课时"
- width="105"
- sortable
- >
- </el-table-column>
- <el-table-column
- prop="SumGiftHour"
- label="剩余赠送"
- sortable
- >
- </el-table-column>
- </el-table>
- <br>
- <el-pagination
- background
- :total="pageination.total"
- :page-size="pageination.pageItem"
- @current-change="pageChange"
- ></el-pagination>
- </div>
- <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible"
- width="650px">
- <div class="dialogContent">
- <div>
- <el-form ref="form" :model="form" label-width="80px">
- <el-form-item label="会员账号" v-if="form.btnType == 0">
- <el-select v-model="form.userId " filterable placeholder="请选择会员账号">
- <el-option
- v-for="item in form.vipList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="商家分组" v-if="form.btnType == 0">
- <el-select v-model="form.groupId " filterable placeholder="请选择商家分组">
- <el-option
- v-for="item in form.groupList"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-form>
- </div>
- </div>
- <div class="dialogFooter">
- <el-button type="primary" size="small" v-if="form.btnType == 0" @click="confirmMember">确定</el-button>
- <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import Global from '../Global.js'
- import {
- AcrossVipUserQuery,
- VipUserSimpleQueryByAdmin,
- ShopGroupQuery,
- AcrossVipUserAdd,
- AcrossVipUserDel,
- VipUserStatusEdit,
- VipUserHourEdit,
- VipUserExpEdit,
- VipUserClassEdit,
- QueryTakeCustomerByName,
- BindTakeCustomer,
- } from "../api/getApiRes";
- let qs = require('qs');
- export default {
- data() {
- return {
- imageUrl: '',
- token: {}, // 七牛云的上传地址,根据自己所在地区选择,我这里是华南区
- domain: 'https://up-z1.qiniup.com', // 这是七牛云空间的外链默认域名
- qiniuaddr: 'qjzpcd34v.hb-bkt.clouddn.com',
- dialogVisible: false,//其他dialog
- TakeVisible: false,//take dialog
- dialogMemberVisible: false,//新增会员dialog
- dialogLesson: false,//课时调整
- dialogGift: false,//赠送课时调整
- dialogExpTime: false,//有效期调整
- dialogLessonTable: false,//会员课程
- dialogTitle: '新增会员',
- dialogValue: [],
- Takevalue: 0,
- Takeoptions: [],
- TakeHid: 0,
- sexOptions: [
- {value: 1, label: '男'},//性别 1:男, 2:女
- {value: 2, label: '女'},
- ],
- yearOptions: getyearOptions(15),
- // panel 配置项目
- 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,
- },
- form: {
- phone: '',
- name: '',
- userCode: '',
- shopId: '',
- Id: '',
- userId: '',
- height: '',
- weight: '',
- staticHr: '',
- head: '',
- birthday: '',
- sex: 1,
- vipType: 1,
- normalhour: 0,
- newnormalhour: 0,
- gifthour: 0,
- newgifthour: 0,
- btnType: 0,//0新建,1编辑编辑
- memo: '',
- expTime: '',
- vipList: [],
- groupList: [],
- classlist: [],
- dialogdata: [],//穿梭待选
- dialogValue: [],//穿梭已选
- },
- memberTypes: vipOptions(1),
- tableData: [],
- tableRadio: [],
- userLevel: localStorage.userLevel,
- serachBtnStatus: false
- }
- },
- mounted() {
- // 加载课程选项
- this.getClassVipuserQueryByAdmin();
- this.getShopGroupQuery();
- // 读取列表
- this.getTableQuery();
- },
- methods: {
- // 获取本课程下的会员列表
- getClassVipuserQueryByAdmin() {
- let that = this;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- VipUserSimpleQueryByAdmin(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.form.vipList = turnResToOptionBySimViper(json.Rs);
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- getShopGroupQuery() {
- let that = this;
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- ShopGroupQuery(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.form.groupList = turnResToOptionByGroup(json.Rs);
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 关联手机号跳转
- goRelevance(row) {
- this.$router.push({path: '/relevancePhone', query: {userId: row.UserInfo.Id}});
- },
- // 上传文件到七牛云
- upqiniu(req) {
- let that = this;
- const config = {
- headers: {'Content-Type': 'multipart/form-data'}
- };
- let filetype = '';
- if (req.file.type === 'image/png') {
- filetype = 'png'
- } else {
- filetype = 'jpg'
- }
- // 重命名要上传的文件
- const keyname = 'GoAllOut' + new Date().valueOf() + Math.floor(Math.random() * 100) + '.' + filetype;
- // 从后端获取上传凭证token
- let param = {
- token: localStorage.token,
- };
- let postdata = qs.stringify(param);
- this.axios.post(headapi + 'v1/QiNiu/GetSimpleQiNiuToken', postdata).then(res => {
- const formdata = new FormData();
- formdata.append('file', req.file);
- formdata.append('token', res.data.QiNinToken);
- formdata.append('key', keyname);
- // 获取到凭证之后再将文件上传到七牛云空间
- this.axios.post(this.domain, formdata, config).then(res => {
- this.imageUrl = 'http://' + this.qiniuaddr + '/' + res.data.key;
- this.form.head = 'http://' + this.qiniuaddr + '/' + keyname;
- })
- })
- },
- // 验证文件合法性
- beforeUpload(file) {
- const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
- const isLt2M = file.size / 1024 / 1024 < 2;
- if (!isJPG) {
- this.$message.error('上传头像图片只能是 JPG 格式!')
- }
- if (!isLt2M) {
- this.$message.error('上传头像图片大小不能超过 2MB!')
- }
- return isJPG && isLt2M
- },
- // 打开take绑定和拉取take数据
- addTake(row) {
- let that = this;
- let param = {
- token: localStorage.token,
- userId: row.UserInfo.Id,
- };
- this.TakeHid = row.UserInfo.HId;
- let postdata = qs.stringify(param);
- QueryTakeCustomerByName(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- if (json.Rs != '') {
- that.Takeoptions = json.Rs;
- that.Takevalue = json.Rs[0].Id;
- // 有值才能打开
- this.TakeVisible = true;
- } else {
- that.$message.error('当前用户没有可用的Take账号');
- this.TakeVisible = false;
- console.log('null');
- }
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 绑定take
- confirmTake() {
- let that = this;
- let param = {
- token: localStorage.token,
- hId: this.TakeHid,
- customerId: this.Takevalue,
- memo: '后台管理手动绑定',
- };
- let postdata = qs.stringify(param);
- BindTakeCustomer(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.$message({
- showClose: true,
- message: 'Take绑定成功!',
- type: 'success'
- });
- this.TakeVisible = false;
- // 读取列表
- this.getTableQuery();
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- clickChange(item) {
- this.tableRadio = item
- },
- // 编辑
- editMember(row) {
- let that = this;
- this.clearForm();
- this.form.phone = row.UserInfo.Phone;
- this.form.name = row.UserInfo.Name;
- this.form.memo = row.UserInfo.Memo;
- this.imageUrl = row.UserInfo.Head;
- this.form.height = row.UserInfo.Height;
- this.form.weight = parseInt(row.UserInfo.Weight) / 10;
- // this.form.staticHr = row.UserInfo.StaticHr;
- this.form.sex = row.UserInfo.Sex;
- this.form.birthday = row.UserInfo.Birthday;
- this.form.ubId = row.UserInfo.UbId;
- this.form.btnType = 1;
- this.form.shopId = row.UserInfo.ShopId;
- this.form.Id = row.UserInfo.Id;
- this.dialogMemberVisible = true;
- this.dialogTitle = '编辑会员'
- },
- // 禁用
- pauseRow(row) {
- let that = this;
- this.$confirm('是否禁用用户' + row.UserInfo.Name + '?', '禁用操作', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let param = {
- token: localStorage.token,
- userId: row.UserInfo.Id,
- status: 8,//状态 8:禁用 1:启用 9:删除
- };
- let postdata = qs.stringify(param);
- VipUserStatusEdit(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.$message({
- showClose: true,
- message: row.UserInfo.Name + '禁用成功!',
- type: 'success'
- });
- // table 重载
- that.getTableQuery();
- } else {
- that.$message.error(json.Memo);
- }
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消禁用'
- });
- });
- },
- // 启用
- runRow(row) {
- let that = this;
- this.$confirm('是否启用用户' + row.UserInfo.Name + '?', '启用操作', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let param = {
- token: localStorage.token,
- userId: row.UserInfo.Id,
- status: 1,//状态 8:禁用 1:启用 9:删除
- };
- let postdata = qs.stringify(param);
- VipUserStatusEdit(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.$message({
- showClose: true,
- message: row.UserInfo.Name + '启用成功!',
- type: 'success'
- });
- // table 重载
- that.getTableQuery();
- } else {
- that.$message.error(json.Memo);
- }
- })
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消启用'
- });
- });
- },
- // 关闭所有
- allDialogClose() {
- this.dialogVisible = false;
- this.dialogGift = false;
- this.dialogLesson = false;
- this.dialogExpTime = false;
- this.dialogLessonTable = false;
- },
- // 有效期调整
- ExpTimeChange() {
- // 仅针对年费用户,使用日期格式
- this.allDialogClose();
- if (this.tableRadio.length == 0) {
- this.$message.error("请先选中一条记录");
- return false
- }
- let row = this.tableRadio;
- if (parseInt(row.UserInfo.VipType) == 2) {
- this.$message({
- showClose: true,
- message: '错了哦,充值会员不能调整有效期',
- type: 'error'
- });
- return false
- }
- this.form.rowName = row.UserInfo.Name;
- this.form.userId = row.UserInfo.Id;
- this.form.expTime = row.UserInfo.ExpTime
- this.dialogVisible = true;
- this.dialogExpTime = true;
- },
- // 课时调整
- lessonChange() {
- this.allDialogClose();
- if (this.tableRadio.length == 0) {
- this.$message.error("请先选中一条记录");
- return false
- }
- let row = this.tableRadio;
- this.form.normalhour = row.UserInfo.RemainNormalhour;
- this.form.newnormalhour = 0;
- this.form.rowName = row.UserInfo.Name;
- this.form.userId = row.UserInfo.Id;
- this.dialogVisible = true;
- this.dialogLesson = true;
- },
- // 赠送调整
- giftChange() {
- this.allDialogClose();
- if (this.tableRadio.length == 0) {
- this.$message.error("请先选中一条记录");
- return false
- }
- let row = this.tableRadio;
- this.form.gifthour = row.UserInfo.RemainGifthour;
- this.form.newgifthour = 0;
- this.form.rowName = row.UserInfo.Name;
- this.form.userId = row.UserInfo.Id;
- this.dialogVisible = true;
- this.dialogGift = true;
- },
- // 增删会员课程
- lessonStudenChange() {
- let that = this;
- this.allDialogClose();
- // 重载课程列表选项
- if (this.tableRadio.length == 0) {
- that.$message.error("请先选中一条记录");
- return false
- }
- let row = this.tableRadio;
- this.form.rowName = row.UserInfo.Name;
- this.form.userId = row.UserInfo.Id;
- if (row.ClassInfo) {
- row.ClassInfo.map(function (item) {
- that.form.dialogValue.push(item.ClassId)
- })
- }
- this.dialogVisible = true;
- this.dialogLessonTable = true;
- },
- // 确认提交新增会员
- confirmMember() {
- let that = this;
- // checkNum
- if (!that.form.userId) {
- this.$message.error('错了哦,会员不能为空');
- return false
- }
- if (!that.form.groupId) {
- this.$message.error('错了哦,商家分组不能为空');
- return false
- }
- let param = {
- token: localStorage.token,
- shopId: localStorage.shopId,
- userId: that.form.userId,
- groupId: that.form.groupId,
- };
- let postdata = qs.stringify(param);
- AcrossVipUserAdd(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- // 关闭弹窗
- that.dialogMemberVisible = false;
- // 重载列表
- that.getTableQuery();
- that.$message({
- showClose: true,
- message: '跨店会员添加成功!',
- type: 'success'
- });
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 确认提交课时
- confirmLesson() {
- let that = this;
- // checkNum
- let param = {
- token: localStorage.token,
- userId: that.form.userId,
- chgHour: that.form.newnormalhour,
- chgType: 1,//课时类型 1:普通课时 2:赠送课时
- };
- let postdata = qs.stringify(param);
- VipUserHourEdit(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- // 关闭弹窗
- that.dialogVisible = false;
- // 重载列表
- that.getTableQuery();
- that.$message({
- showClose: true,
- message: '课时调整成功!',
- type: 'success'
- });
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 确认提交赠送
- confirmGift() {
- let that = this;
- let param = {
- token: localStorage.token,
- userId: that.form.userId,
- chgHour: that.form.newgifthour,
- chgType: 2,//课时类型 1:普通课时 2:赠送课时
- };
- let postdata = qs.stringify(param);
- VipUserHourEdit(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- // 关闭弹窗
- that.dialogVisible = false;
- // 重载列表
- that.getTableQuery();
- that.$message({
- showClose: true,
- message: '赠送课时调整成功!',
- type: 'success'
- });
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 确认提交有效期
- confirmExpTime() {
- let that = this;
- // checkNum
- let param = {
- token: localStorage.token,
- userId: that.form.userId,
- expTime: nonTfmtDate(that.form.expTime, 16),
- };
- let postdata = qs.stringify(param);
- VipUserExpEdit(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- // 关闭弹窗
- that.dialogVisible = false;
- // 重载列表
- that.getTableQuery();
- that.$message({
- showClose: true,
- message: '赠送课时调整成功!',
- type: 'success'
- });
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 确认提交会员课程
- confirmLessonTable() {
- let that = this;
- // checkNum
- let classList = that.form.dialogValue ? that.form.dialogValue.toString() : '';
- let param = {
- token: localStorage.token,
- userId: that.form.userId,
- classList: classList,
- };
- let postdata = qs.stringify(param);
- VipUserClassEdit(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- // 关闭弹窗
- that.dialogVisible = false;
- // 重载列表
- that.getTableQuery();
- that.$message({
- showClose: true,
- message: '会员课程调整成功!',
- type: 'success'
- });
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 新增会员
- addMember() {
- this.clearForm();
- this.dialogMemberVisible = true;
- this.btnType = 0;
- this.form.btnType = 0;
- this.dialogTitle = '新增会员'
- },
- // 删除
- delList() {
- let that = this;
- if (this.tableRadio.length == 0) {
- that.$message.error("请先选中一条记录");
- return false
- }
- let row = this.tableRadio;
- let param = {
- token: localStorage.token,
- userId: row.UserId,
- auId: row.AuId,
- };
- let postdata = qs.stringify(param);
- this.$confirm('此操作将永久删除该跨店会员, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- AcrossVipUserDel(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.$message({
- showClose: true,
- message: '选中的跨店会员已删除!',
- type: 'success'
- });
- // 重载列表
- that.getTableQuery();
- } else {
- that.$message.error(json.Memo);
- }
- });
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- // 查询按钮
- 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)
- },
- 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 = 0;
- this.form.sex = 1;
- this.form.birthday = '';
- this.form.userCode = '';
- this.form.shopId = '';
- this.form.classlist = [];
- },
- // 页面数据查询
- getTableQuery() {
- let that = this;
- that.loading = true;
- let param = {
- token: localStorage.token,
- vipType: that.panel.vipType,//
- phone: that.panel.phone,//
- usercode: that.panel.usercode,//
- name: that.panel.name,//
- expDay: that.panel.expDay,//
- start: 1,//
- tableMax: 9999,//
- };
- let postdata = qs.stringify(param);
- AcrossVipUserQuery(postdata).then(res => {
- let json = res;
- if (json.Code == 0) {
- that.loading = false;
- if (json.Rs) {
- that.allTableData = json.Rs;
- that.recordsTotal = json.Rs.length;
- } else {
- that.allTableData = [];
- that.recordsTotal = 0;
- }
- // 设置分页数据
- that.setPaginations();
- } else {
- that.$message.error(json.Memo);
- }
- })
- },
- // 设置分页数据
- 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;
- // that.getTableQuery();
- },
- // 过滤时间
- filterFmtDate(value, row, column) {
- let that = this;
- if (column == "0001-01-01T08:05:43+08:05" || column == "0001-01-01T00:00:00Z") {
- return '无有效期';
- } else {
- return nonTfmtDatetoLength(column, 16);
- }
- },
- }
- ,
- watch: {
- $route(to) {
- if (to.name == 'AcrossVip') {
- // 加载课程选项
- this.getClassVipuserQueryByAdmin();
- this.getShopGroupQuery();
- // 读取列表
- this.getTableQuery();
- }
- }
- ,
- }
- ,
- }
- </script>
- <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;
- }
- .dialogTitle {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- color: #000000;
- font-size: 18px;
- text-align: center;
- }
- .dialogTitle em {
- float: none;
- font-style: normal;
- color: #3799FF;
- margin: 0;
- }
- /deep/ .el-transfer-panel__item .el-checkbox__input {
- left: 40px;
- }
- .dialogFooter {
- width: 90%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- margin-top: 10px;
- }
- .dialogFooter button {
- float: right;
- margin-left: 10px;
- }
- .dialogContent {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- }
- .dialogContent .pull-left {
- width: 40%;
- float: left;
- }
- .dialogContent .pull-right {
- width: 60%;
- float: right;
- }
- .tabwild {
- width: 100% !important;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- }
- .lessonSpan {
- width: 78px;
- height: 22px;
- border-radius: 11px;
- margin-right: 5px;
- float: left;
- margin-bottom: 3px;
- text-align: center;
- color: #000;
- font-size: 12px;
- }
- .btn {
- float: left !important;
- margin-right: 5px;
- }
- /deep/ table .el-button + .el-button {
- margin-left: 0;
- margin-right: 3px;
- /*float: left;*/
- padding: 7px 6px;
- }
- table {
- width: 100%;
- display: block;
- margin: 0 auto;
- overflow: scroll;
- }
- .pull-left /deep/ .el-form .el-form-item {
- width: 50%;
- float: left;
- }
- .pull-left /deep/ .el-form-item__content {
- margin-left: 20px;
- }
- .pull-left .el-input-number {
- width: 130px;
- }
- .cell img {
- overflow: hidden;
- display: block;
- margin: 0 auto;
- }
- .el-date-editor.el-input__inner {
- width: 156px;
- }
- .avatar-uploader {
- border: 1px solid #ccc;
- cursor: pointer;
- border-radius: 5px;
- }
- /deep/ .el-upload {
- width: 100%;
- overflow: hidden;
- display: block;
- margin: 0 auto;
- }
- /deep/ .el-upload img {
- width: 70px;
- height: 70px;
- float: left;
- }
- .relevance {
- margin-top: 10px;
- }
- </style>
- �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
|