新增用户状态修改
This commit is contained in:
@@ -86,7 +86,7 @@
|
||||
|
||||
<el-table-column prop="inviteCount" label="下级人数">
|
||||
<template slot-scope="scope">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row,'yaoqing')">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row, 'yaoqing')">
|
||||
{{ scope.row.inviteCount ? scope.row.inviteCount : '0' }}
|
||||
</span>
|
||||
</template>
|
||||
@@ -99,7 +99,6 @@
|
||||
style="color: #4f9dec;background: #fff;border: none;"
|
||||
@click="xiugai2(scope.row, 'inviteAmount')">
|
||||
修改</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -138,7 +137,7 @@
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="platform" label="拉黑原因">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.platform| platformFilter}}</span>
|
||||
<span>{{ scope.row.platform | platformFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="zhifubaoName" label="支付宝名称">
|
||||
@@ -152,10 +151,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" width="160"></el-table-column>
|
||||
<el-table-column prop="balance" label="余额" ></el-table-column>
|
||||
<el-table-column prop="balance" label="余额"></el-table-column>
|
||||
<el-table-column prop="cashAmount" label="提现金额">
|
||||
<template slot-scope="scope">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row,'sixth')">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row, 'sixth')">
|
||||
{{ scope.row.cashAmount ? scope.row.cashAmount : '0' }}
|
||||
</span>
|
||||
</template>
|
||||
@@ -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>
|
||||
|
||||
@@ -465,7 +468,7 @@
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="platform" label="拉黑原因">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.platform| platformFilter}}</span>
|
||||
<span>{{ scope.row.platform | platformFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="zhifubaoName" label="支付宝名称">
|
||||
@@ -479,10 +482,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" width="160"></el-table-column>
|
||||
<el-table-column prop="balance" label="余额" ></el-table-column>
|
||||
<el-table-column prop="balance" label="余额"></el-table-column>
|
||||
<el-table-column prop="cashAmount" label="提现金额">
|
||||
<template slot-scope="scope">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row,'sixth')">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row, 'sixth')">
|
||||
{{ scope.row.cashAmount ? scope.row.cashAmount : '0' }}
|
||||
</span>
|
||||
</template>
|
||||
@@ -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>
|
||||
@@ -549,7 +551,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="inviteCount" label="下级人数">
|
||||
<template slot-scope="scope">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row,'yaoqing')">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row, 'yaoqing')">
|
||||
{{ scope.row.inviteCount ? scope.row.inviteCount : '0' }}
|
||||
</span>
|
||||
</template>
|
||||
@@ -562,7 +564,6 @@
|
||||
style="color: #4f9dec;background: #fff;border: none;"
|
||||
@click="xiugai2(scope.row, 'inviteAmount')">
|
||||
修改</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -601,7 +602,7 @@
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="platform" label="拉黑原因">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.platform| platformFilter}}</span>
|
||||
<span>{{ scope.row.platform | platformFilter }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="zhifubaoName" label="支付宝名称">
|
||||
@@ -615,10 +616,10 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="创建时间" width="160"></el-table-column>
|
||||
<el-table-column prop="balance" label="余额" ></el-table-column>
|
||||
<el-table-column prop="balance" label="余额"></el-table-column>
|
||||
<el-table-column prop="cashAmount" label="提现金额">
|
||||
<template slot-scope="scope">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row,'sixth')">
|
||||
<span style="color: #4f9dec;cursor: pointer;" @click="updates(scope.row, 'sixth')">
|
||||
{{ scope.row.cashAmount ? scope.row.cashAmount : '0' }}
|
||||
</span>
|
||||
</template>
|
||||
@@ -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,15 +798,56 @@ 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')
|
||||
console.log(d.status, 'debug')
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`user/removeUserBlack`),
|
||||
method: 'get',
|
||||
params: {
|
||||
'userId': d.userId,
|
||||
status: d.status == 0 ? "0": "1"
|
||||
status: d.status == 0 ? "0" : "1"
|
||||
}
|
||||
}).then(({
|
||||
data
|
||||
@@ -779,7 +862,7 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
// tabs切换
|
||||
handleClick(tab, event) {
|
||||
this.page = 1
|
||||
@@ -836,7 +919,7 @@ export default {
|
||||
})
|
||||
},
|
||||
// 详情跳转
|
||||
updates(row,active="first") {
|
||||
updates(row, active = "first") {
|
||||
console.log("`````", row.userId)
|
||||
this.$router.push({
|
||||
path: '/userDetail',
|
||||
@@ -971,10 +1054,10 @@ export default {
|
||||
this.tableDataLoading = false
|
||||
let returnData = data.data
|
||||
this.tableData = returnData
|
||||
this.tableData.list.forEach(ele=>{
|
||||
ele.status = ele.status == 1 ? 1 : 0
|
||||
})
|
||||
console.log(this.tableData,'shuiashd ')
|
||||
// this.tableData.list.forEach(ele => {
|
||||
// ele.status = ele.status == 1 ? 1 : 0
|
||||
// })
|
||||
console.log(this.tableData, 'shuiashd ')
|
||||
|
||||
})
|
||||
},
|
||||
@@ -1186,8 +1269,8 @@ export default {
|
||||
},
|
||||
filters: {
|
||||
platformFilter(item) {
|
||||
if(item == 'h5') return '-'
|
||||
else if(item == 'app') return '-'
|
||||
if (item == 'h5') return '-'
|
||||
else if (item == 'app') return '-'
|
||||
else return item
|
||||
},
|
||||
formatDate(time) {
|
||||
@@ -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