|
|
@@ -179,8 +179,8 @@
|
|
|
<el-table-column label="参与营期数量" align="center" prop="partCourseCount" />
|
|
|
<el-table-column label="状态" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag :type="scope.row.status === 1 ? 'success' : 'danger'">
|
|
|
- {{ scope.row.status === 1 ? '正常' : '禁止' }}
|
|
|
+ <el-tag :type="getStatusType(scope.row.status)">
|
|
|
+ {{ getStatusText(scope.row.status) }}
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -294,8 +294,9 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="状态">
|
|
|
<el-radio-group v-model="form.status">
|
|
|
+ <el-radio :label="0">小黑屋</el-radio>
|
|
|
<el-radio :label="1">正常</el-radio>
|
|
|
- <el-radio :label="0">禁止</el-radio>
|
|
|
+ <el-radio :label="2">禁用</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -326,7 +327,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser } from "@/api/user/fsUser";
|
|
|
+import { listUser,getMemberUser,getUser,updateMemberUser, addUser, updateUser, delUser, exportUser, auditUser,myListUser } from "@/api/user/fsUser";
|
|
|
import {transferUser} from "@/api/users/user";
|
|
|
import {getUserList} from "@/api/company/companyUser";
|
|
|
import userDetails from '@/views/store/components/userDetails.vue';
|
|
|
@@ -341,6 +342,7 @@ export default {
|
|
|
title:"会员详情",
|
|
|
open:false,
|
|
|
},
|
|
|
+ rowInfo:null,
|
|
|
cusTransfer: {
|
|
|
targetUserId: [{required: true, message: '请选择转移至销售', trigger: 'change'}],
|
|
|
content: [{required: true, message: '请选择转移至销售', trigger: 'change'}]
|
|
|
@@ -431,6 +433,20 @@ export default {
|
|
|
this.getSalesOptions();
|
|
|
},
|
|
|
methods: {
|
|
|
+ /** 获取状态类型 */
|
|
|
+ getStatusType(status) {
|
|
|
+ if (status === 0) return 'warning'; // 小黑屋 - 黄色
|
|
|
+ if (status === 1) return 'success'; // 正常 - 绿色
|
|
|
+ if (status === 2) return 'danger'; // 禁用 - 红色
|
|
|
+ return '';
|
|
|
+ },
|
|
|
+ /** 获取状态文本 */
|
|
|
+ getStatusText(status) {
|
|
|
+ if (status === 0) return '小黑屋';
|
|
|
+ if (status === 1) return '正常';
|
|
|
+ if (status === 2) return '禁用';
|
|
|
+ return '未知状态';
|
|
|
+ },
|
|
|
handledetails(row){
|
|
|
this.show.open=true;
|
|
|
setTimeout(() => {
|
|
|
@@ -503,7 +519,7 @@ export default {
|
|
|
this.queryParams.registerEndTime = null;
|
|
|
}
|
|
|
|
|
|
- listUser(this.queryParams).then(response => {
|
|
|
+ myListUser(this.queryParams).then(response => {
|
|
|
this.userList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
|
@@ -603,9 +619,10 @@ export default {
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
+ this.rowInfo=row;
|
|
|
this.reset();
|
|
|
- const userId = row.userId || this.ids[0];
|
|
|
- getUser(userId).then(response => {
|
|
|
+ const id = row.id;
|
|
|
+ getMemberUser(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
|
|
|
// 处理标签数据,将字符串转为数组
|
|
|
@@ -622,28 +639,18 @@ export default {
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- // 处理标签数据,将数组转为字符串
|
|
|
- if (this.form.tagIds && Array.isArray(this.form.tagIds)) {
|
|
|
- this.form.tagIds = this.form.tagIds.join(',');
|
|
|
- }
|
|
|
-
|
|
|
- if (this.form.userId != null) {
|
|
|
- updateUser(this.form).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.$message.success("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- addUser(this.form).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.$message.success("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- });
|
|
|
+ const updateForm={
|
|
|
+ id: this.rowInfo.id,
|
|
|
+ status: this.form.status,
|
|
|
+ remark: this.form.remark
|
|
|
}
|
|
|
+ updateMemberUser(updateForm).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|