Commit 8a7f01ff authored by miaojiale's avatar miaojiale

1.医联体授权

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