|
|
@@ -69,11 +69,12 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="channel" label="渠道" min-width="50">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" align="center" fixed="right" width="220">
|
|
|
+ <el-table-column label="操作" align="center" fixed="right" width="290">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button @click="$router.push({path:'/userTeam',query:{column:scope.row.id+',recommender'}})" type="primary" size="small" plain>团队
|
|
|
</el-button>
|
|
|
<el-button @click="weiren(scope.row)" type="primary" size="mini" plain>委任</el-button>
|
|
|
+ <el-button @click="changePasswordRow(scope.row)" type="primary" size="mini" plain>密码</el-button>
|
|
|
<el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -117,40 +118,45 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { mapState } from 'vuex'
|
|
|
+import { mapState } from 'vuex';
|
|
|
|
|
|
export default {
|
|
|
created() {
|
|
|
-
|
|
|
- this.$http.get({
|
|
|
- url: '/userLevel/all'
|
|
|
- }).then(res => {
|
|
|
- if (res.success) {
|
|
|
-
|
|
|
- if (res.data.length > 0) {
|
|
|
- res.data.forEach(item => {
|
|
|
- this.userLevelOptions.push({ label: item.name, value: item.id });
|
|
|
- })
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
+ url: '/userLevel/all',
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ res.data.forEach(item => {
|
|
|
+ this.userLevelOptions.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- this.$http.get({
|
|
|
- url: '/channelInfo/all'
|
|
|
- }).then(res => {
|
|
|
- if (res.success) {
|
|
|
+ });
|
|
|
|
|
|
- if (res.data.length > 0) {
|
|
|
- res.data.forEach(item => {
|
|
|
- this.channelOptions.push({ label: item.name, value: item.id });
|
|
|
- })
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
+ url: '/channelInfo/all',
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ if (res.data.length > 0) {
|
|
|
+ res.data.forEach(item => {
|
|
|
+ this.channelOptions.push({
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
this.getData();
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -164,39 +170,45 @@ export default {
|
|
|
filter3: '',
|
|
|
filter4: '',
|
|
|
filter5: '',
|
|
|
- tableColumns: [{
|
|
|
- label: '用户名',
|
|
|
- value: 'username',
|
|
|
- show: true
|
|
|
- }, {
|
|
|
- label: '昵称',
|
|
|
- value: 'nickname',
|
|
|
- show: true
|
|
|
- }, {
|
|
|
- label: '头像',
|
|
|
- value: 'icon',
|
|
|
- show: true
|
|
|
- }, {
|
|
|
- label: '性别',
|
|
|
- value: 'sex',
|
|
|
- show: true
|
|
|
- }, {
|
|
|
- label: 'phone',
|
|
|
- value: 'phone',
|
|
|
- show: true
|
|
|
- }],
|
|
|
+ tableColumns: [
|
|
|
+ {
|
|
|
+ label: '用户名',
|
|
|
+ value: 'username',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '昵称',
|
|
|
+ value: 'nickname',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '头像',
|
|
|
+ value: 'icon',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '性别',
|
|
|
+ value: 'sex',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'phone',
|
|
|
+ value: 'phone',
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ ],
|
|
|
multipleMode: false,
|
|
|
userLevelOptions: [],
|
|
|
channelOptions: [],
|
|
|
weirenRow: {},
|
|
|
weirenShowDialog: false,
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['tableHeight']),
|
|
|
selection() {
|
|
|
return this.$refs.table.selection.map(i => i.id);
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
pageSizeChange(size) {
|
|
|
@@ -208,23 +220,25 @@ export default {
|
|
|
this.getData();
|
|
|
},
|
|
|
getData() {
|
|
|
- this.$http.get({
|
|
|
- url: '/userInfo/page',
|
|
|
- data: {
|
|
|
- currentPage: this.currentPage,
|
|
|
- pageNumber: this.pageSize,
|
|
|
- adminFlag: this.filter2,
|
|
|
- searchKey: this.filter1,
|
|
|
- createFlag: this.filter3,
|
|
|
- levelId: this.filter4,
|
|
|
- channel: this.filter5,
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.totalNumber = res.data.page.totalNumber;
|
|
|
- this.tableData = res.data.pp;
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
+ url: '/userInfo/page',
|
|
|
+ data: {
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ pageNumber: this.pageSize,
|
|
|
+ adminFlag: this.filter2,
|
|
|
+ searchKey: this.filter1,
|
|
|
+ createFlag: this.filter3,
|
|
|
+ levelId: this.filter4,
|
|
|
+ channel: this.filter5,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.totalNumber = res.data.page.totalNumber;
|
|
|
+ this.tableData = res.data.pp;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
isColumnShow(column) {
|
|
|
var row = this.tableColumns.find(i => i.value === column);
|
|
|
@@ -240,9 +254,17 @@ export default {
|
|
|
this.$router.push({
|
|
|
path: '/user',
|
|
|
query: {
|
|
|
- id: row.id
|
|
|
- }
|
|
|
- })
|
|
|
+ id: row.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changePasswordRow(row) {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/changePassword',
|
|
|
+ query: {
|
|
|
+ id: row.id,
|
|
|
+ },
|
|
|
+ });
|
|
|
},
|
|
|
weiren(row) {
|
|
|
this.weirenRow = row;
|
|
|
@@ -250,35 +272,33 @@ export default {
|
|
|
},
|
|
|
weirenSubmit() {
|
|
|
if (!this.weirenRow.levelId) {
|
|
|
- this.$message.warning('请选择级别')
|
|
|
-
|
|
|
+ this.$message.warning('请选择级别');
|
|
|
} else {
|
|
|
- this.$http.post({
|
|
|
- url: '/userInfo/weiren',
|
|
|
- data: {
|
|
|
- id: this.weirenRow.id,
|
|
|
- levelId: this.weirenRow.levelId
|
|
|
- }
|
|
|
- }).then(res => {
|
|
|
- if (res.success) {
|
|
|
-
|
|
|
- this.$message.success('保存成功');
|
|
|
- this.getData();
|
|
|
-
|
|
|
- } else {
|
|
|
- this.$message.error('保存失败');
|
|
|
- }
|
|
|
+ this.$http
|
|
|
+ .post({
|
|
|
+ url: '/userInfo/weiren',
|
|
|
+ data: {
|
|
|
+ id: this.weirenRow.id,
|
|
|
+ levelId: this.weirenRow.levelId,
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ this.getData();
|
|
|
+ } else {
|
|
|
+ this.$message.error('保存失败');
|
|
|
+ }
|
|
|
|
|
|
- this.weirenRow = {};
|
|
|
- this.weirenShowDialog = false;
|
|
|
- })
|
|
|
+ this.weirenRow = {};
|
|
|
+ this.weirenShowDialog = false;
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
operation1() {
|
|
|
this.$notify({
|
|
|
title: '提示',
|
|
|
- message: this.selection
|
|
|
+ message: this.selection,
|
|
|
});
|
|
|
},
|
|
|
operation2() {
|
|
|
@@ -288,8 +308,8 @@ export default {
|
|
|
this.currentPage = 1;
|
|
|
this.getData();
|
|
|
},
|
|
|
- }
|
|
|
-}
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
</style>
|