用户账号提交一部分

This commit is contained in:
aixianling
2022-02-22 15:04:03 +08:00
parent 4922c3cb2b
commit 01c843cde1

View File

@@ -0,0 +1,88 @@
<template>
<section class="AppPortalAccount">
<ai-list>
<ai-title slot="title" title="用户账号" isShowBottomBorder/>
<template #content>
<ai-search-bar>
<template #left>
<ai-select v-model="search.status" :selectList="dict.getDict('status')" placeholder="认证状态"/>
<ai-select v-model="search.status" :selectList="dict.getDict('status')" placeholder="账号状态"/>
</template>
<template #right>
<el-input size="small" placeholder="搜索姓名、手机号" v-model="search.name" clearable
@change="page.current=1,getTableData()"/>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="options" label="操作" fixed="right" align="center">
<template slot-scope="{row}">
<el-button v-if="row.status==0" type="text" @click="handleEnable(row)">启用</el-button>
<el-button v-else-if="row.status==1" type="text" @click="handleEnable(row)">禁用</el-button>
<el-button type="text">详情</el-button>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</section>
</template>
<script>
export default {
name: "AppPortalAccount",
label: "用户账号(经营主体)",
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
search: {name: "",},
page: {current: 1, size: 10, total: 0},
tableData: [],
colConfigs: [
{label: "用户账号", prop: "phone"},
{label: "企业注册数量", prop: ""},
{label: "认证状态", prop: ""},
{label: "注册时间", prop: ""},
{label: "账号状态", prop: ""},
{slot: "options"}
]
}
},
methods: {
getTableData() {
this.instance.post("/appportaluser/list", null, {
params: {...this.page, ...this.search}
}).then(res => {
if (res?.data) {
this.tableData = res.data?.records
this.page.total = res.data.total
}
})
},
handleEnable(row) {
let status = (++row.status) % 2
this.$confirm(`是否要${this.dict.getLabel('status', status)}账号?`).then(() => {
this.instance.post("/appportaluser/addOrUpdate", {...row, status}).then(res => {
if (res?.code == 0) {
this.$message.success(this.dict.getLabel('status', status) + "成功!")
this.getTableData()
}
})
}).catch(() => 0)
}
},
created() {
this.dict.load("status")
this.getTableData()
}
}
</script>
<style lang="scss" scoped>
.AppPortalAccount {
}
</style>