新增用户状态修改
This commit is contained in:
@@ -99,7 +99,6 @@
|
||||
style="color: #4f9dec;background: #fff;border: none;"
|
||||
@click="xiugai2(scope.row, 'inviteAmount')">
|
||||
修改</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -168,12 +167,17 @@
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="state" label="是否拉黑">
|
||||
<el-table-column prop="state" label="账号状态">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.status" @change="releaseBlackout(scope.row)"
|
||||
:active-value="1" :inactive-value="0" active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
<div class="status-wrap" style="display: flex;flex-direction: column;">
|
||||
<div>{{ scope.row.status | filterStatus }}</div>
|
||||
<div style="color: #4f9dec;cursor: pointer;" @click="showUserStatusDialog(scope.row)">
|
||||
修改状态
|
||||
</div>
|
||||
</div>
|
||||
<!-- <el-switch v-model="scope.row.status" @change="releaseBlackout(scope.row)" :active-value="1"
|
||||
:inactive-value="0" active-color="#13ce66" inactive-color="#ff4949">
|
||||
</el-switch> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="120">
|
||||
@@ -426,7 +430,6 @@
|
||||
style="color: #4f9dec;background: #fff;border: none;"
|
||||
@click="xiugai2(scope.row, 'inviteAmount')">
|
||||
修改</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -497,9 +500,8 @@
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="state" label="是否拉黑">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.status" @change="releaseBlackout(scope.row)"
|
||||
:active-value="1" :inactive-value="0" active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
<el-switch v-model="scope.row.status" @change="releaseBlackout(scope.row)" :active-value="1"
|
||||
:inactive-value="0" active-color="#13ce66" inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -562,7 +564,6 @@
|
||||
style="color: #4f9dec;background: #fff;border: none;"
|
||||
@click="xiugai2(scope.row, 'inviteAmount')">
|
||||
修改</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -631,11 +632,10 @@
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="state" label="是否拉黑">
|
||||
<el-table-column prop="state" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.status" @change="releaseBlackout(scope.row)"
|
||||
:active-value="1" :inactive-value="0" active-color="#13ce66"
|
||||
inactive-color="#ff4949">
|
||||
<el-switch v-model="scope.row.status" @change="releaseBlackout(scope.row)" :active-value="1"
|
||||
:inactive-value="0" active-color="#13ce66" inactive-color="#ff4949">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -685,12 +685,54 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
</el-tabs>
|
||||
<el-dialog title="账号状态" :visible.sync="userStatusDialog">
|
||||
<el-form :model="userStatusForm" :rules="userStatusFormFules" label-width="80px">
|
||||
<el-form-item label="用户编号">
|
||||
<span>{{ userStatusRow.userId }}</span>
|
||||
<!-- <el-input v-model="userStatusRow.userId" disabled></el-input> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="用户昵称">
|
||||
<span>{{ userStatusRow.userName }}</span>
|
||||
<!-- <el-input v-model="userStatusRow.userName" disabled></el-input> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<span>{{ userStatusRow.phone }}</span>
|
||||
<!-- <el-input v-model="userStatusRow.phone" disabled></el-input> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="账号状态" prop="status">
|
||||
<el-radio-group v-model="userStatusForm.status" horizontal>
|
||||
<el-radio :label="0">拉黑</el-radio>
|
||||
<el-radio :label="1">正常</el-radio>
|
||||
<el-radio :label="2">禁用</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="userStatusDialog = false">取消</el-button>
|
||||
<el-button type="primary" :loading="userStatusFormLoading" @click="userStatusHandle">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userStatusDialog: false,
|
||||
userStatusRow: '',
|
||||
userStatusForm: {
|
||||
status: 1
|
||||
},
|
||||
userStatusFormFules: {
|
||||
status: [{
|
||||
required: true,
|
||||
message: '请选择账号状态',
|
||||
trigger: 'change'
|
||||
}]
|
||||
},
|
||||
userStatusFormLoading: false,
|
||||
openValue: 1,
|
||||
closeValue: 2,
|
||||
state: 'false',
|
||||
@@ -756,6 +798,47 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 改变用户状态
|
||||
userStatusHandle() {
|
||||
this.userStatusFormLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`user/updateUserStatusByUserId?userId=${this.userStatusRow.userId}&status=${this.userStatusForm.status}`),
|
||||
method: 'get'
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
this.userStatusFormLoading = false
|
||||
if (data.code == 0) {
|
||||
this.userStatusDialog = false
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
})
|
||||
this.dataSelect()
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
})
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.userStatusFormLoading = false
|
||||
this.$message({
|
||||
message: err.mes,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
})
|
||||
})
|
||||
},
|
||||
// 显示修改用户状态
|
||||
showUserStatusDialog(row) {
|
||||
this.userStatusDialog = true
|
||||
this.userStatusRow = { ...row }
|
||||
|
||||
this.userStatusForm.status = row.status
|
||||
},
|
||||
releaseBlackout(d) {
|
||||
// status 0 拉黑 1 解除拉黑
|
||||
console.log(d.status, 'debug')
|
||||
@@ -971,9 +1054,9 @@ export default {
|
||||
this.tableDataLoading = false
|
||||
let returnData = data.data
|
||||
this.tableData = returnData
|
||||
this.tableData.list.forEach(ele=>{
|
||||
ele.status = ele.status == 1 ? 1 : 0
|
||||
})
|
||||
// this.tableData.list.forEach(ele => {
|
||||
// ele.status = ele.status == 1 ? 1 : 0
|
||||
// })
|
||||
console.log(this.tableData, 'shuiashd ')
|
||||
|
||||
})
|
||||
@@ -1195,7 +1278,17 @@ export default {
|
||||
let date = new Date(time)
|
||||
return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds()
|
||||
},
|
||||
|
||||
filterStatus(t) {
|
||||
if (t == 0) {
|
||||
return '拉黑'
|
||||
} else if (t == 1) {
|
||||
return '正常'
|
||||
} else if (t == 2) {
|
||||
return '禁用'
|
||||
} else {
|
||||
return '-'
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.dataSelect()
|
||||
|
||||
Reference in New Issue
Block a user