Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f34a7b9430 | ||
![]() |
fbd4fdcbd1 | ||
![]() |
7ea73622cd | ||
![]() |
6e66ca4864 |
34
src/api/VipGive/VipGive.js
Normal file
34
src/api/VipGive/VipGive.js
Normal file
@@ -0,0 +1,34 @@
|
||||
import request from '@/utils/request';
|
||||
import { genQueryParam } from '@/utils/maintainer';
|
||||
// 查询用户接口
|
||||
export const getByErbanNo = query => {
|
||||
return request({
|
||||
url: '/admin/user/getByErbanNo',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 获取VIP列表接口
|
||||
export const listAll = query => {
|
||||
return request({
|
||||
url: '/admin/vip/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 获取列表接口
|
||||
export const pageRecord = query => {
|
||||
return request({
|
||||
url: '/vipSend/pageRecord',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 赠送VIP接口
|
||||
export const vipSendSend = query => {
|
||||
return request({
|
||||
url: '/vipSend/send',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
58
src/api/medal/medal.js
Normal file
58
src/api/medal/medal.js
Normal file
@@ -0,0 +1,58 @@
|
||||
import request from '@/utils/request';
|
||||
import { genQueryParam } from '@/utils/maintainer';
|
||||
// 地区接口
|
||||
export const listPartitionInfo = query => {
|
||||
return request({
|
||||
url: '/partition/listPartitionInfo',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章信息-列表
|
||||
export const medalPage = query => {
|
||||
return request({
|
||||
url: '/admin/medal/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章信息-新增&保存
|
||||
export const medalSave = query => {
|
||||
return request({
|
||||
url: '/admin/medal/save',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章信息-发放
|
||||
export const medalSend = query => {
|
||||
return request({
|
||||
url: '/admin/medal/send',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章记录-撤销
|
||||
export const rollback = query => {
|
||||
return request({
|
||||
url: '/admin/medalRecord/rollback',
|
||||
method: 'post',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章记录-列表
|
||||
export const medalRecordPage = query => {
|
||||
return request({
|
||||
url: '/admin/medalRecord/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
// 勋章记录-勋章列表
|
||||
export const listAll = query => {
|
||||
return request({
|
||||
url: '/admin/medal/listAll',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
@@ -115,3 +115,8 @@ export const exportFamilyMember = query => {
|
||||
window.location.href = `/admin/family/manage/exportFamilyMember?${genQueryParam(query)}`;
|
||||
return;
|
||||
};
|
||||
// 导出-公会信息
|
||||
export const exportInfo = query => {
|
||||
window.location.href = `/admin/family/manage/exportFamily?${genQueryParam(query)}`;
|
||||
return;
|
||||
};
|
||||
|
624
src/views/medal/MedalInfo.vue
Normal file
624
src/views/medal/MedalInfo.vue
Normal file
@@ -0,0 +1,624 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>勋章ID</span>
|
||||
<el-input v-model="inquire.id" placeholder="" class="input"></el-input>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>勋章昵称</span>
|
||||
<el-input v-model="inquire.nick" placeholder="" class="input"></el-input>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span class="demonstration">地区</span>
|
||||
<el-select filterable v-model="inquire.partitionId" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in inquire.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button class="primary" type="primary" @click="add()"> 新增 </el-button>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="id" align="center" label="勋章ID" />
|
||||
<el-table-column prop="partitionFlag" align="center" label="地区">
|
||||
<template v-slot="scope">{{
|
||||
partitionFlagFun(scope.row.partitionFlag, 1)
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="勋章名称-华语区">
|
||||
<template v-slot="scope">{{ JSON.parse(scope.row.name).zh }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="勋章名称-英语区">
|
||||
<template v-slot="scope">{{ JSON.parse(scope.row.name).en }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" align="center" label="勋章名称-阿语区">
|
||||
<template v-slot="scope">{{ JSON.parse(scope.row.name).ar }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
prop="picUrl"
|
||||
label="勋章图片"
|
||||
width="120"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.picUrl"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.picUrl"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="enable" align="center" label="状态">
|
||||
<template v-slot="scope">{{
|
||||
scope.row.enable ? "生效" : "不生效"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" align="center" label="添加时间" />
|
||||
<el-table-column align="center" label="操作" width="220">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="eidFun(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="grantFun(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
:disabled="!scope.row.enable"
|
||||
>
|
||||
发放
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 新增&编辑弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
class="pub"
|
||||
v-model="controlsDialog"
|
||||
:title="controlsTitle"
|
||||
width="32%"
|
||||
center
|
||||
>
|
||||
<!-- 地区 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>地区</span
|
||||
>
|
||||
<el-select
|
||||
multiple
|
||||
filterable
|
||||
v-model="controlsObj.value"
|
||||
placeholder="请选择"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in controlsObj.options"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 勋章名称-华语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章名称-华语</span
|
||||
>
|
||||
<el-input
|
||||
v-model="controlsObj.nickZh"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 勋章名称-英语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章名称-英语</span
|
||||
>
|
||||
<el-input
|
||||
v-model="controlsObj.nickEn"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 勋章名称-阿语 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章名称-阿语</span
|
||||
>
|
||||
<el-input
|
||||
v-model="controlsObj.nickAr"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 勋章图片 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章图片</span
|
||||
>
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
action="/admin/tencent/cos/upload/file"
|
||||
:show-file-list="false"
|
||||
:on-success="handleAvatarSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:on-error="handleAvatarError"
|
||||
>
|
||||
<img
|
||||
:src="controlsObj.imageUrl1"
|
||||
class="avatar"
|
||||
/>
|
||||
</el-upload>
|
||||
</div>
|
||||
|
||||
<!-- 状态 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>状态</span
|
||||
>
|
||||
<el-select filterable v-model="controlsObj.value2" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in controlsObj.options2"
|
||||
:key="item.id"
|
||||
:label="item.desc"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 弹窗按钮 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="controlsDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="controlsDialogOut()">
|
||||
确认
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 发放勋章弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
class="pub"
|
||||
v-model="grantDialog"
|
||||
title="发放勋章"
|
||||
width="32%"
|
||||
center
|
||||
>
|
||||
<!-- 勋章名称 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章名称</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.nick"
|
||||
placeholder="默认展示的是中文勋章名称"
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 发放对象平台号 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>发放对象平台号</span
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="grantObj.userId"
|
||||
placeholder="多个平台号用英文“,”号分开分隔"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 发放天数 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>发放天数</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.days"
|
||||
placeholder="输入天数,不输入则视为无限制"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 备注 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>备注</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.desc"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 弹窗按钮 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="grantDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="grantOut()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
listPartitionInfo,
|
||||
medalPage,
|
||||
medalSave,
|
||||
medalSend,
|
||||
} from "@/api/medal/medal";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "MedalInfo",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
id: "",
|
||||
nick: "",
|
||||
partitionId: "",
|
||||
},
|
||||
// 表格
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
// 操作弹窗
|
||||
controlsDialog: false,
|
||||
controlsTitle: "新增&编辑",
|
||||
controlsType: 1,
|
||||
controlsObj: {
|
||||
value: [],
|
||||
options: [],
|
||||
nickZh: "",
|
||||
nickEn: "",
|
||||
nickAr: "",
|
||||
imageUrl1: "",
|
||||
value2: "",
|
||||
options2: [
|
||||
{
|
||||
desc: "生效",
|
||||
id: true,
|
||||
},
|
||||
{
|
||||
desc: "不生效",
|
||||
id: false,
|
||||
},
|
||||
],
|
||||
id: "",
|
||||
},
|
||||
// 发放弹窗
|
||||
grantDialog: false,
|
||||
grantObj: {
|
||||
nick: "",
|
||||
userId: "",
|
||||
days: "",
|
||||
desc: "",
|
||||
},
|
||||
grantObjNew: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listPartitionInfo().then((res) => {
|
||||
this.inquire.options = res.data;
|
||||
this.inquire.options.push({
|
||||
desc: "全部",
|
||||
id: "",
|
||||
});
|
||||
listPartitionInfo().then((res) => {
|
||||
this.controlsObj.options = res.data;
|
||||
this.getData();
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
this.loading = true;
|
||||
medalPage({
|
||||
id: this.inquire.id,
|
||||
name: this.inquire.nick,
|
||||
partitionId: this.inquire.partitionId,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.data.total;
|
||||
this.tableData = res.data.records;
|
||||
this.loading = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 添加
|
||||
add() {
|
||||
this.controlsTitle = "新增";
|
||||
this.controlsType = 1;
|
||||
this.controlsObj.value = [];
|
||||
this.controlsObj.nickZh = "";
|
||||
this.controlsObj.nickEn = "";
|
||||
this.controlsObj.nickAr = "";
|
||||
this.controlsObj.imageUrl1 = "";
|
||||
this.controlsObj.value2 = "";
|
||||
this.controlsDialog = true;
|
||||
},
|
||||
// 编辑
|
||||
eidFun(val) {
|
||||
this.controlsTitle = "编辑";
|
||||
this.controlsType = 2;
|
||||
this.controlsObj.value = this.partitionFlagFun(val.partitionFlag, 2);
|
||||
this.controlsObj.nickZh = JSON.parse(val.name).zh;
|
||||
this.controlsObj.nickEn = JSON.parse(val.name).en;
|
||||
this.controlsObj.nickAr = JSON.parse(val.name).ar;
|
||||
this.controlsObj.imageUrl1 = val.picUrl;
|
||||
this.controlsObj.value2 = val.enable;
|
||||
this.controlsObj.id = val.id;
|
||||
this.controlsDialog = true;
|
||||
},
|
||||
// 确认保存按钮
|
||||
controlsDialogOut() {
|
||||
if (this.controlsType == 1) {
|
||||
// 新增
|
||||
var obj = {};
|
||||
var partitionFlagVal = 0;
|
||||
console.log(this.controlsObj.value);
|
||||
console.log(this.controlsObj.options);
|
||||
this.controlsObj.value.forEach((res, i) => {
|
||||
partitionFlagVal |= this.controlsObj.options[i].id;
|
||||
});
|
||||
obj.partitionFlag = partitionFlagVal;
|
||||
obj.name = JSON.stringify({
|
||||
zh: this.controlsObj.nickZh,
|
||||
en: this.controlsObj.nickEn,
|
||||
ar: this.controlsObj.nickAr,
|
||||
});
|
||||
obj.picUrl = this.controlsObj.imageUrl1;
|
||||
obj.enable = this.controlsObj.value2;
|
||||
console.log(obj);
|
||||
medalSave(obj).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getData();
|
||||
this.controlsDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 编辑
|
||||
var obj1 = {};
|
||||
var partitionFlagVal1 = 0;
|
||||
this.controlsObj.value.forEach((res, i) => {
|
||||
partitionFlagVal1 += res;
|
||||
});
|
||||
obj1.partitionFlag = partitionFlagVal1;
|
||||
obj1.name = JSON.stringify({
|
||||
zh: this.controlsObj.nickZh,
|
||||
en: this.controlsObj.nickEn,
|
||||
ar: this.controlsObj.nickAr,
|
||||
});
|
||||
obj1.picUrl = this.controlsObj.imageUrl1;
|
||||
obj1.enable = this.controlsObj.value2;
|
||||
obj1.id = this.controlsObj.id;
|
||||
console.log(1111111111, this.controlsObj.value);
|
||||
console.log(this.controlsObj.options);
|
||||
console.log(obj1);
|
||||
medalSave(obj1).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getData();
|
||||
this.controlsDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
//发放按钮
|
||||
grantFun(val) {
|
||||
this.grantObjNew = val;
|
||||
this.grantObj.nick = JSON.parse(val.name).zh;
|
||||
this.grantDialog = true;
|
||||
},
|
||||
// 确认发放
|
||||
grantOut() {
|
||||
medalSend({
|
||||
days: this.grantObj.days,
|
||||
erbanNoStr: this.grantObj.userId,
|
||||
medalId: this.grantObjNew.id,
|
||||
remark: this.grantObj.desc,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "发放成功",
|
||||
type: "success",
|
||||
});
|
||||
this.grantDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
partitionFlagFun(num, type) {
|
||||
//1 2 4
|
||||
var val = 0;
|
||||
if (type == 2) {
|
||||
if (num == 0 || num == 7) {
|
||||
val = [4, 1, 2];
|
||||
} else if (num == 1) {
|
||||
val = [1];
|
||||
} else if (num == 3) {
|
||||
val = [1, 2];
|
||||
} else if (num == 2) {
|
||||
val = [2];
|
||||
} else if (num == 6) {
|
||||
val = [2, 4];
|
||||
} else if (num == 4) {
|
||||
val = [4];
|
||||
}
|
||||
} else {
|
||||
if (num == 0 || num == 7) {
|
||||
val = "华语区、英语区、阿语区";
|
||||
} else if (num == 1) {
|
||||
val = "英语区";
|
||||
} else if (num == 3) {
|
||||
val = "英语区、阿语区";
|
||||
} else if (num == 2) {
|
||||
val = "阿语区";
|
||||
} else if (num == 6) {
|
||||
val = "阿语区、华语区";
|
||||
} else if (num == 4) {
|
||||
val = "华语区";
|
||||
}
|
||||
}
|
||||
return val;
|
||||
},
|
||||
beforeAvatarUpload() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传中~",
|
||||
type: "warning",
|
||||
});
|
||||
},
|
||||
handleAvatarError() {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传失败!",
|
||||
type: "error",
|
||||
});
|
||||
},
|
||||
handleAvatarSuccess(res, file) {
|
||||
console.log(file);
|
||||
this.controlsObj.imageUrl1 = file.response.data;
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "上传成功!",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
363
src/views/medal/MedalRecord.vue
Normal file
363
src/views/medal/MedalRecord.vue
Normal file
@@ -0,0 +1,363 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>勋章ID</span>
|
||||
<el-input v-model="inquire.id" placeholder="" class="input"></el-input>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>用户平台ID</span>
|
||||
<el-input
|
||||
v-model="inquire.userId"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button class="primary" type="primary" @click="grantDialog = true">
|
||||
发放勋章
|
||||
</el-button>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="createTime" align="center" label="发放时间" />
|
||||
<el-table-column prop="source" align="center" label="发放渠道">
|
||||
<template v-slot="scope">{{
|
||||
scope.row.source == 1 ? "管理后台" : scope.row.source
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="id" align="center" label="发放勋章ID" />
|
||||
<el-table-column prop="medalName" align="center" label="勋章名称" />
|
||||
<el-table-column align="center" prop="x" label="勋章图片" width="120">
|
||||
<template v-slot="scope">
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.picUrl"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="scope.row.picUrl"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="生效天数">
|
||||
<template v-slot="scope">{{ scope.row.days }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="备注">
|
||||
<template v-slot="scope">{{
|
||||
scope.row.remark == "" ? "-" : scope.row.remark
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="x" align="center" label="状态">
|
||||
<template v-slot="scope">{{
|
||||
scope.row.status == 1
|
||||
? "生效中"
|
||||
: scope.row.status == 0
|
||||
? "已失效"
|
||||
: "撤销"
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="erbanNo" align="center" label="发放对象平台号" />
|
||||
<el-table-column prop="nick" align="center" label="发放对象昵称" />
|
||||
<el-table-column
|
||||
prop="partitionName"
|
||||
align="center"
|
||||
label="发放对象分区"
|
||||
/>
|
||||
<el-table-column align="center" label="操作" width="220">
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
@click="eidFun(scope.row)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
:disabled="scope.row.status <= 0 ? true : false"
|
||||
>
|
||||
撤销
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 发放勋章弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
class="pub"
|
||||
v-model="grantDialog"
|
||||
title="发放勋章"
|
||||
width="32%"
|
||||
center
|
||||
>
|
||||
<!-- 勋章昵称 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>勋章昵称</span
|
||||
>
|
||||
<el-select filterable v-model="grantObj.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in grantObj.options"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 发放对象平台号 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>发放对象平台号</span
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
v-model="grantObj.userId"
|
||||
placeholder="多个平台号用英文“,”号分开分隔"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 发放天数 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>发放天数</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.days"
|
||||
placeholder="输入天数,不输入则视为无限制"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 备注 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px; display: flex">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>备注</span
|
||||
>
|
||||
<el-input
|
||||
v-model="grantObj.desc"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 弹窗按钮 -->
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="grantDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="grantOut()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 二次确认弹窗 -->
|
||||
<el-dialog
|
||||
destroy-on-close
|
||||
v-model="delDialog"
|
||||
title="提示"
|
||||
width="30%"
|
||||
center
|
||||
>
|
||||
<span> 确定要撤销吗?</span>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="delDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="delClick()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
medalRecordPage,
|
||||
listAll,
|
||||
medalSend,
|
||||
rollback,
|
||||
} from "@/api/medal/medal";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "MedalRecord",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
id: "",
|
||||
userId: "",
|
||||
},
|
||||
// 表格
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
// 发放弹窗
|
||||
grantDialog: false,
|
||||
grantObj: {
|
||||
value: "",
|
||||
options: [],
|
||||
userId: "",
|
||||
days: "",
|
||||
desc: "",
|
||||
},
|
||||
// 撤销
|
||||
delDialog: false,
|
||||
delObj: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
listAll().then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.grantObj.options = res.data;
|
||||
this.getData();
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
this.loading = true;
|
||||
medalRecordPage({
|
||||
medalId: this.inquire.id,
|
||||
erbanNo: this.inquire.userId,
|
||||
page: this.currentPage,
|
||||
pageSize: this.pageSize,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.total = res.data.total;
|
||||
this.tableData = res.data.records;
|
||||
this.loading = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 确认发放
|
||||
grantOut() {
|
||||
medalSend({
|
||||
days: this.grantObj.days,
|
||||
erbanNoStr: this.grantObj.userId,
|
||||
medalId: this.grantObj.value,
|
||||
remark: this.grantObj.desc,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "发放成功",
|
||||
type: "success",
|
||||
});
|
||||
this.grantDialog = false;
|
||||
this.getData();
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 撤销按钮
|
||||
eidFun(val) {
|
||||
this.delObj = val;
|
||||
this.delDialog = true;
|
||||
},
|
||||
// 确认撤销按钮
|
||||
delClick() {
|
||||
console.log(this.delObj);
|
||||
rollback({ recordId: this.delObj.id }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message || "撤销成功",
|
||||
type: "success",
|
||||
});
|
||||
this.getData();
|
||||
this.delDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -3,120 +3,133 @@
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>ID</span>
|
||||
<el-input v-model="inquire.userId"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
<el-input
|
||||
v-model="inquire.userId"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<div class="inquire">
|
||||
<span>推荐人</span>
|
||||
<el-input v-model="inquire.referrer"
|
||||
placeholder=""
|
||||
class="input"></el-input>
|
||||
<el-input
|
||||
v-model="inquire.referrer"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 时间选择器 -->
|
||||
<div class="inquire">
|
||||
<div class="block">
|
||||
<span class="demonstration">日期</span>
|
||||
<el-date-picker v-model="inquire.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
<el-date-picker
|
||||
v-model="inquire.time"
|
||||
type="datetimerange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
>
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="getData()">查询</el-button>
|
||||
<el-button class="primary"
|
||||
type="primary"
|
||||
@click="addDialog = true">添加</el-button>
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询</el-button
|
||||
>
|
||||
<el-button class="primary" type="primary" @click="addDialog = true"
|
||||
>添加</el-button
|
||||
>
|
||||
<el-button class="primary" type="primary" @click="exportInfoFun()"
|
||||
>导出</el-button
|
||||
>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px">
|
||||
<el-table-column prop="referrer"
|
||||
align="center"
|
||||
label="推荐人" />
|
||||
<el-table-column prop="ownerErbanNo"
|
||||
align="center"
|
||||
label="会长ID" />
|
||||
<el-table-column prop="ownerNick"
|
||||
align="center"
|
||||
label="会长昵称" />
|
||||
<el-table-column prop="ownerPartitionName"
|
||||
align="center"
|
||||
label="会长分区" />
|
||||
<el-table-column prop="name"
|
||||
align="center"
|
||||
label="公会昵称" />
|
||||
<el-table-column align="center"
|
||||
prop="giftInfo"
|
||||
label="公会背景图">
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="referrer" align="center" label="推荐人" />
|
||||
<el-table-column prop="ownerErbanNo" align="center" label="会长ID" />
|
||||
<el-table-column prop="ownerNick" align="center" label="会长昵称" />
|
||||
<el-table-column
|
||||
prop="ownerPartitionName"
|
||||
align="center"
|
||||
label="会长分区"
|
||||
/>
|
||||
<el-table-column prop="name" align="center" label="公会昵称" />
|
||||
<el-table-column align="center" prop="giftInfo" label="公会背景图">
|
||||
<template v-slot="scope">
|
||||
<el-image style="width: 100px; height: 100px"
|
||||
:src="scope.row.backgroundUrl"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="[scope.row.backgroundUrl]"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true" />
|
||||
<el-image
|
||||
style="width: 100px; height: 100px"
|
||||
:src="scope.row.backgroundUrl"
|
||||
:zoom-rate="1.1"
|
||||
:preview-src-list="[scope.row.backgroundUrl]"
|
||||
fit="cover"
|
||||
preview-teleported="true"
|
||||
hide-on-click-modal="true"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime"
|
||||
align="center"
|
||||
label="创建日期" />
|
||||
<el-table-column prop="createTime" align="center" label="创建日期" />
|
||||
<!-- <el-table-column prop="memberNum" align="center" label="成员数量" /> -->
|
||||
<el-table-column align="center"
|
||||
label="成员数量/上限"><template v-slot="scope">{{ scope.row.memberNum }}/{{ scope.row.memberNumLimit }}</template></el-table-column>
|
||||
<el-table-column prop="goldIncome"
|
||||
align="center"
|
||||
label="金币总收入" />
|
||||
<el-table-column prop="diamondRemain"
|
||||
align="center"
|
||||
label="钻石总收入" />
|
||||
<el-table-column align="center" label="成员数量/上限"
|
||||
><template v-slot="scope"
|
||||
>{{ scope.row.memberNum }}/{{ scope.row.memberNumLimit }}</template
|
||||
></el-table-column
|
||||
>
|
||||
<el-table-column prop="goldIncome" align="center" label="金币总收入" />
|
||||
<el-table-column prop="diamondRemain" align="center" label="钻石总收入" />
|
||||
|
||||
<el-table-column align="center"
|
||||
label="操作"
|
||||
width="300">
|
||||
<el-table-column align="center" label="操作" width="300">
|
||||
<template v-slot="scope">
|
||||
<el-button @click="ediClick(scope)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
:disabled="!scope.row.enable">编辑</el-button>
|
||||
<el-button @click="
|
||||
<el-button
|
||||
@click="ediClick(scope)"
|
||||
class="primary"
|
||||
type="primary"
|
||||
size="default"
|
||||
:disabled="!scope.row.enable"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
@click="
|
||||
delDialog = true;
|
||||
delDialogData = scope.row;
|
||||
"
|
||||
:class="scope.row.enable ? 'danger' : 'info'"
|
||||
:type="scope.row.enable ? 'danger' : 'info'"
|
||||
size="default"
|
||||
:disabled="!scope.row.enable">{{ scope.row.enable ? "移除" : "已解散" }}</el-button>
|
||||
:class="scope.row.enable ? 'danger' : 'info'"
|
||||
:type="scope.row.enable ? 'danger' : 'info'"
|
||||
size="default"
|
||||
:disabled="!scope.row.enable"
|
||||
>{{ scope.row.enable ? "移除" : "已解散" }}</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 新增弹窗 -->
|
||||
<el-dialog v-model="addDialog"
|
||||
title="新增"
|
||||
width="28%"
|
||||
center>
|
||||
<el-dialog v-model="addDialog" title="新增" width="28%" center>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label">会长ID</span>
|
||||
<el-input v-model="resource.id"
|
||||
style="width: 75%"
|
||||
class="input"></el-input>
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label"
|
||||
>会长ID</span
|
||||
>
|
||||
<el-input
|
||||
v-model="resource.id"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<div style="margin-bottom: 25px">
|
||||
<span style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label">推荐人</span>
|
||||
<el-input v-model="resource.referrer"
|
||||
style="width: 75%"
|
||||
class="input"></el-input>
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px; width: 100px"
|
||||
class="col-sm-2 control-label"
|
||||
>推荐人</span
|
||||
>
|
||||
<el-input
|
||||
v-model="resource.referrer"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- <div style="margin-bottom: 25px">
|
||||
<span
|
||||
@@ -133,96 +146,115 @@
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="addDialog = false">取消</el-button>
|
||||
<el-button type="primary"
|
||||
@click="add()"> 确认 </el-button>
|
||||
<el-button type="primary" @click="add()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 分页 -->
|
||||
<el-pagination style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange" />
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
<!-- 编辑弹窗 -->
|
||||
<el-dialog v-model="editDialog"
|
||||
title="编辑"
|
||||
width="28%"
|
||||
center>
|
||||
<el-dialog v-model="editDialog" title="编辑" width="28%" center>
|
||||
<!-- 会长ID -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">会长ID</span>
|
||||
<el-input v-model="ediObj.leaderId"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>会长ID</span
|
||||
>
|
||||
<el-input
|
||||
v-model="ediObj.leaderId"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 会长昵称 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">会长昵称</span>
|
||||
<el-input v-model="ediObj.leaderNick"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>会长昵称</span
|
||||
>
|
||||
<el-input
|
||||
v-model="ediObj.leaderNick"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 公会昵称 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">公会昵称</span>
|
||||
<el-input v-model="ediObj.guildNick"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled></el-input>
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>公会昵称</span
|
||||
>
|
||||
<el-input
|
||||
v-model="ediObj.guildNick"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 成员数量上限 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label">成员数量上限</span>
|
||||
<el-input v-model="ediObj.guildNumber"
|
||||
style="width: 75%"
|
||||
class="input"></el-input>
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>成员数量上限</span
|
||||
>
|
||||
<el-input
|
||||
v-model="ediObj.guildNumber"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="editDialog = false">取消</el-button>
|
||||
<el-button type="primary"
|
||||
@click="editDialogClick()">
|
||||
<el-button type="primary" @click="editDialogClick()">
|
||||
确认
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 二次确认删除弹窗 -->
|
||||
<el-dialog v-model="delDialog"
|
||||
title="提示"
|
||||
width="30%"
|
||||
center>
|
||||
<el-dialog v-model="delDialog" title="提示" width="30%" center>
|
||||
<span> 确定要解散该公会吗?</span>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="delDialog = false">取消</el-button>
|
||||
<el-button type="primary"
|
||||
@click="delClick()"> 确认 </el-button>
|
||||
<el-button type="primary" @click="delClick()"> 确认 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { pageFamily, create, update, dismiss } from "@/api/nobleman/nobleman";
|
||||
import {
|
||||
pageFamily,
|
||||
exportInfo,
|
||||
create,
|
||||
update,
|
||||
dismiss,
|
||||
} from "@/api/nobleman/nobleman";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "GuildInfo",
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
delDialog: false,
|
||||
@@ -258,12 +290,12 @@ export default {
|
||||
},
|
||||
};
|
||||
},
|
||||
created () {
|
||||
created() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData () {
|
||||
getData() {
|
||||
this.loading = true;
|
||||
let time = this.inquire.time;
|
||||
let startTime = "";
|
||||
@@ -286,8 +318,25 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 导出
|
||||
exportInfoFun() {
|
||||
let time = this.inquire.time;
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
if (time && time.length > 0) {
|
||||
startTime = dateFormat(this.inquire.time[0], "yyyy-MM-dd hh:mm:ss");
|
||||
endTime = dateFormat(this.inquire.time[1], "yyyy-MM-dd hh:mm:ss");
|
||||
}
|
||||
exportInfo({
|
||||
erbanNo: this.inquire.userId,
|
||||
referrer: this.inquire.referrer,
|
||||
familyName: this.inquire.nick,
|
||||
startDate: startTime,
|
||||
endDate: endTime,
|
||||
}).then((res) => {});
|
||||
},
|
||||
// 添加
|
||||
add () {
|
||||
add() {
|
||||
this.addDialog = false;
|
||||
create({
|
||||
erbanNo: this.resource.id,
|
||||
@@ -297,7 +346,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 编辑按钮
|
||||
ediClick (res) {
|
||||
ediClick(res) {
|
||||
var obj = res.row;
|
||||
this.ediObj.leaderId = obj.ownerErbanNo;
|
||||
this.ediObj.leaderNick = obj.ownerNick;
|
||||
@@ -307,7 +356,7 @@ export default {
|
||||
this.editDialog = true;
|
||||
},
|
||||
// 二次确认弹窗
|
||||
editDialogClick () {
|
||||
editDialogClick() {
|
||||
console.log(this.ediObj);
|
||||
update({
|
||||
id: this.ediObj.id,
|
||||
@@ -332,7 +381,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 解散按钮
|
||||
delClick () {
|
||||
delClick() {
|
||||
console.log(this.delDialogData.id);
|
||||
var familyId = this.delDialogData.id;
|
||||
dismiss({ familyId }).then((res) => {
|
||||
@@ -355,10 +404,10 @@ export default {
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange () {
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange () {
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
|
302
src/views/vip/VipGive.vue
Normal file
302
src/views/vip/VipGive.vue
Normal file
@@ -0,0 +1,302 @@
|
||||
<template>
|
||||
<div class="box">
|
||||
<!-- 查询 -->
|
||||
<div class="inquire">
|
||||
<span>ID</span>
|
||||
<el-input
|
||||
v-model="inquire.userId"
|
||||
placeholder=""
|
||||
class="input"
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 查询按钮 -->
|
||||
<el-button class="primary" type="primary" @click="getData()"
|
||||
>查询
|
||||
</el-button>
|
||||
<el-button class="primary" type="primary" @click="editDialog = true"
|
||||
>赠送VIP
|
||||
</el-button>
|
||||
|
||||
<!-- 表格 -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%; margin-top: 25px"
|
||||
>
|
||||
<el-table-column prop="erbanNo" align="center" label="平台号" />
|
||||
<el-table-column prop="nick" align="center" label="昵称" />
|
||||
<el-table-column
|
||||
prop="registerTime"
|
||||
align="center"
|
||||
label="用户注册时间"
|
||||
/>
|
||||
<el-table-column prop="createTime" align="center" label="赠送贵族时间" />
|
||||
<el-table-column prop="vipLevel" align="center" label="赠送贵族等级">
|
||||
<template v-slot="scope">VIP{{ scope.row.vipLevel }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="adminName" align="center" label="操作人" />
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<el-pagination
|
||||
style="margin-top: 10px"
|
||||
class="paginationClass"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:page-sizes="[10, 20, 30, 40, 50, 100, 200, 300, 400, 500, 999999999]"
|
||||
layout="sizes, prev, pager, next"
|
||||
:total="total"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
|
||||
<!-- 赠送VIP弹窗 -->
|
||||
<el-dialog
|
||||
v-model="editDialog"
|
||||
title="赠送VIP(点击确认直接赠送,请认真核对谨慎操作!!)"
|
||||
width="36%"
|
||||
center
|
||||
>
|
||||
<!-- 赠送用户平台ID -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>赠送用户平台ID</span
|
||||
>
|
||||
<el-input
|
||||
v-model="editObj.userId"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请输入赠送用户平台ID"
|
||||
@input="inputFun()"
|
||||
></el-input>
|
||||
</div>
|
||||
|
||||
<!-- 赠送等级 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>赠送VIP等级</span
|
||||
>
|
||||
<el-select v-model="editObj.value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in editObj.options"
|
||||
:key="item.vipLevel"
|
||||
:label="item.vipName"
|
||||
:value="item.vipLevel"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<!-- 用户昵称 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>用户昵称</span
|
||||
>
|
||||
<el-input
|
||||
v-model="editObj.nick"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请先输入用户平台id"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 用户地区 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>用户地区</span
|
||||
>
|
||||
<el-input
|
||||
v-model="editObj.region"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请先输入用户平台id"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
<!-- 用户注册时间 -->
|
||||
<div style="margin-bottom: 25px; margin-top: 10px">
|
||||
<span
|
||||
style="display: inline-block; margin-right: 20px"
|
||||
class="col-sm-2 control-label"
|
||||
>用户注册时间</span
|
||||
>
|
||||
<el-input
|
||||
v-model="editObj.time"
|
||||
style="width: 75%"
|
||||
class="input"
|
||||
placeholder="请先输入用户平台id"
|
||||
disabled
|
||||
></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="editDialog = false">取消</el-button>
|
||||
<el-button type="primary" @click="editDialogClick()">
|
||||
确认
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getByErbanNo,
|
||||
listAll,
|
||||
pageRecord,
|
||||
vipSendSend,
|
||||
} from "@/api/VipGive/VipGive";
|
||||
// @ts-ignore
|
||||
import { dateFormat } from "@/utils/system-helper";
|
||||
// @ts-ignore
|
||||
import { ElMessage } from "element-plus";
|
||||
export default {
|
||||
name: "VipGive",
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
//查询所需条件对象
|
||||
inquire: {
|
||||
userId: "",
|
||||
},
|
||||
// 表格
|
||||
tableData: [],
|
||||
// 分页
|
||||
total: 10, //总页数
|
||||
currentPage: 1, //页码
|
||||
pageSize: 10, //条数
|
||||
// 赠送VIP
|
||||
editDialog: false,
|
||||
timeout: "",
|
||||
editObj: {
|
||||
userId: "",
|
||||
value: "",
|
||||
options: [],
|
||||
nick: "",
|
||||
time: "",
|
||||
region: "",
|
||||
uid: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
listAll().then((res) => {
|
||||
this.editObj.options = res.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 查询接口
|
||||
getData() {
|
||||
this.loading = true;
|
||||
pageRecord({
|
||||
erbanNo: this.inquire.userId,
|
||||
current: this.currentPage,
|
||||
size: this.pageSize,
|
||||
}).then((res) => {
|
||||
this.total = res.data.total;
|
||||
this.tableData = res.data.rows;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 监听弹窗用户id输入
|
||||
inputFun() {
|
||||
var than = this;
|
||||
clearTimeout(than.timeout);
|
||||
than.timeout = setTimeout(function () {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "查询中~",
|
||||
type: "warning",
|
||||
});
|
||||
getByErbanNo({
|
||||
erbanNo: than.editObj.userId,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
than.editObj.nick = res.data.nick;
|
||||
than.editObj.region = res.data.partitionName;
|
||||
than.editObj.time = res.data.createTime;
|
||||
than.editObj.uid = res.data.uid;
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "查询成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
},
|
||||
// 赠送按钮
|
||||
editDialogClick() {
|
||||
vipSendSend({
|
||||
uid: this.editObj.uid,
|
||||
vipLevel: this.editObj.value,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.getData();
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: "赠送成功",
|
||||
type: "success",
|
||||
});
|
||||
this.editDialog = false;
|
||||
} else {
|
||||
ElMessage({
|
||||
showClose: true,
|
||||
message: res.message,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 分页导航
|
||||
handleSizeChange() {
|
||||
this.getData();
|
||||
},
|
||||
handleCurrentChange() {
|
||||
this.getData();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.box {
|
||||
padding-top: 20px;
|
||||
background: #ecf0f5;
|
||||
.inquire {
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
span {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.input {
|
||||
width: 180px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
.dialogTableVisibleBut {
|
||||
display: block;
|
||||
margin: 30px 0 0 830px;
|
||||
}
|
||||
.paginationClass {
|
||||
margin: 15px 0 5px 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user