Commit 8a7f01ff authored by miaojiale's avatar miaojiale

1.医联体授权

2.角色管理
3.用户管理还差接口
parent 19d67c11
......@@ -175,3 +175,11 @@ export function getLogPage(params = {}) {
params,
})
}
// 用户管理启用禁用
export function baseEnable(params = {}) {
return request({
url: "/cloud-upms/user/base/enable",
method: "get",
params,
})
}
......@@ -682,6 +682,14 @@
v-html="scope.row[column.value]"
></div>
</template>
<template v-if="column.type === 'switch'">
<el-switch
v-model="scope.row[column.value]"
:active-value="1"
:inactive-value="0"
@change="column.func(scope.row, scope.$index)"
></el-switch>
</template>
<!-- 展开列表 -->
<template v-if="column.tabType === 'expand'">
<el-form
......
......@@ -20,7 +20,7 @@
/>
</div>
<el-dialog :visible.sync="addVisible" width="520px" :show-close="true">
<div class="title">添加医联体</div>
<div class="title">{{ title }}</div>
<el-form
ref="form"
:model="form"
......@@ -63,13 +63,13 @@
</span>
</el-dialog>
<!-- 删除提示框 -->
<el-dialog title="提示" :visible.sync="deleteVisible" width="30%">
<!-- <el-dialog title="提示" :visible.sync="deleteVisible" width="30%">
<span>确定删除吗?</span>
<span slot="footer" class="dialog-footers">
<el-button @click="deleteVisible = false">取 消</el-button>
<el-button type="primary" @click="confirmDelete">确 定</el-button>
</span>
</el-dialog>
</el-dialog> -->
</div>
</template>
<script>
......@@ -171,6 +171,7 @@ export default {
],
form: {},
deleteId: "",
title: "添加医联体",
}
},
watch: {},
......@@ -195,6 +196,7 @@ export default {
},
// 添加医联体
addMedical() {
this.title = "添加医联体"
if (this.$refs["form"]) {
this.clearForm()
}
......@@ -203,6 +205,7 @@ export default {
},
// 编辑医联体
editMedical(data) {
this.title = "编辑医联体"
console.log(data)
this.form = { ...data }
this.addVisible = true
......@@ -236,8 +239,15 @@ export default {
// 删除
deleteFunc(data) {
console.log(data)
this.deleteVisible = true
// this.deleteVisible = true
this.deleteId = data.id
this.$confirm("确定要删除吗?", "警告", {
type: "warning",
})
.then(() => {
this.confirmDelete()
})
.catch(() => {})
},
clearForm() {
this.form = {}
......
......@@ -51,33 +51,33 @@ export default {
id: null,
// 查询列表
searchList: [
{
label: "角色名",
type: "input",
prop: "roleName",
placeholder: "请输入角色名",
},
// {
// label: "角色名",
// type: "input",
// prop: "roleName",
// placeholder: "请输入角色名",
// },
{
label: "状态",
type: "select",
prop: "status",
opts: [
{
label: "启用",
value: 1,
},
{
label: "禁用",
value: 0,
},
],
},
{
type: "button",
value: "查询",
icon: "el-icon-search",
},
// {
// label: "状态",
// type: "select",
// prop: "status",
// opts: [
// {
// label: "启用",
// value: 1,
// },
// {
// label: "禁用",
// value: 0,
// },
// ],
// },
// {
// type: "button",
// value: "查询",
// icon: "el-icon-search",
// },
{
type: "button",
color: "primary",
......
......@@ -11,6 +11,8 @@
ref="table"
:table-data="tableData"
:columns="columns"
tab-type="index"
tab-label="序号"
:list-loading="listLoading"
:current-page="pageIndex"
:total-count="total"
......@@ -57,6 +59,7 @@ import {
getUserInfo,
setUserRole,
resetPassword,
baseEnable,
} from "@/api/user"
import { getOrgList, getDepartPage } from "@/api/org"
import { medicalunionList, baseUnion } from "@/api/medicalunion-management"
......@@ -111,21 +114,27 @@ export default {
// 查询列表
searchList: [
{
label: "用户姓名",
label: "选择角色",
type: "select",
opts: roleList,
prop: "roleId",
placeholder: "请选择角色",
},
{
label: "登录名",
type: "input",
prop: "name",
placeholder: "请输入用户姓",
prop: "userName",
placeholder: "请输入登录",
},
{
type: "button",
value: "查询",
icon: "el-icon-search",
value: "搜索",
// icon: "el-icon-search",
},
{
type: "button",
color: "primary",
icon: "el-icon-plus",
// icon: "el-icon-plus",
value: "添加",
func: this.handleAdd,
},
......@@ -133,60 +142,68 @@ export default {
searchQuery: "",
columns: [
{
label: "用户姓",
minWidth: 120,
value: "name",
label: "登录",
width: 140,
value: "userName",
},
{
label: "性别",
value: "sex",
width: 80,
label: "角色",
value: "roles",
minWidth: 180,
formatter: (row) => {
return this.$handle.formatDicList(
this.dictMap["d-sex"],
String(row.sex)
)
if (row.roles.length > 0) {
let roleName = row.roles.map((e) => e.roleName)
return roleName.join("")
} else {
return "--"
}
},
},
{
label: "身份证号",
value: "idCard",
minWidth: 180,
},
{
label: "手机",
minWidth: 120,
value: "phone",
},
{
label: "机构",
label: "医联体名称",
value: "unions",
minWidth: 180,
value: "orgName",
formatter: (row) => {
if (row.unions.length > 0) {
let unionName = row.unions.map((e) => e.unionName)
return unionName.join("")
} else {
return "--"
}
},
},
{
label: "科室",
label: "医联体编号",
value: "unions",
minWidth: 180,
value: "deptName",
formatter: (row) => {
if (row.unions.length > 0) {
let unionNo = row.unions.map((e) => e.unionNo)
return unionNo.join("")
} else {
return "--"
}
},
},
{
label: "登录账户名",
minWidth: 150,
value: "userName",
label: "添加时间",
width: 140,
value: "createTime",
formatter: (row) => {
if (row.createTime) {
return row.createTime
} else {
return "--"
}
},
},
{
label: "邮箱",
minWidth: 180,
value: "email",
label: "状态",
width: 140,
type: "switch",
value: "status",
func: this.openChage,
},
// {
// label: "状态",
// value: "status",
// width: 100,
// formatter(row) {
// return row.status === 1 ? '启用' : '禁用'
// }
// },
{
label: "操作",
width: 220,
......@@ -250,6 +267,42 @@ export default {
},
],
},
// {
// label: "登录名",
// minWidth: 120,
// value: "name",
// },
// {
// label: "性别",
// value: "sex",
// width: 80,
// formatter: (row) => {
// return this.$handle.formatDicList(
// this.dictMap["d-sex"],
// String(row.sex)
// )
// },
// },
// {
// label: "身份证号",
// value: "idCard",
// minWidth: 180,
// },
// {
// label: "手机",
// minWidth: 120,
// value: "phone",
// },
// {
// label: "机构",
// minWidth: 180,
// value: "orgName",
// },
// {
// label: "科室",
// minWidth: 180,
// value: "deptName",
// },
],
tableData: [],
cacheForm: {},
......@@ -370,6 +423,7 @@ export default {
multiple: true,
},
],
roleList: roleList,
consortiaList: [],
consortiaDataRole: [
{
......@@ -403,6 +457,21 @@ export default {
this.loadMore()
},
methods: {
// 修改启用状态
// 启用状态
openChage(data, index) {
console.log(data, index)
let params = {
id: data.id,
status: data.status ? 1 : 0,
}
baseEnable(params).then((res) => {
if (res.code == 1) {
// this.$message.success("保存成功")
// this.handleSearch()
}
})
},
loadMore(current = 1) {
let params = {
current: current,
......@@ -473,15 +542,11 @@ export default {
})
},
handleReset(row) {
this.$confirm(
`【${row.name}】是否重置密码? 重置密码为123456!!`,
"提示",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
this.$confirm(`【${row.name}】是否重置密码? 重置密码为:123456`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
resetPassword(row.id).then((res) => {
if (res.code === 1) {
......@@ -530,6 +595,20 @@ export default {
handleConsortia({ id }) {
this.rowId = id
this.$refs.consortiaRole.open()
getUserInfo({ userId: id }).then((res) => {
if (res.code === 1) {
const consortiaList = []
res.data.unionList.map((item) => {
consortiaList.push(item.id)
})
this.consortiaList = [...consortiaList]
this.$refs.consortiaRole.initFields({
consortiaList: consortiaList,
})
}
})
},
handleRoleConfirm(form) {
const data = {
......@@ -545,6 +624,7 @@ export default {
setUserRole(data).then((res) => {
if (res.code === 1) {
this.$message.success(res.msg)
this.handleSearch()
this.$refs.role.close()
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment