192 lines
4.7 KiB
Vue
192 lines
4.7 KiB
Vue
<template>
|
|
<div class="container-wrapper">
|
|
<div class="title">
|
|
<div class="title-search">
|
|
<el-form
|
|
:model="search"
|
|
label-width="auto"
|
|
:inline="true"
|
|
class="demo-form-inline"
|
|
>
|
|
<el-form-item>
|
|
<el-input v-model="search.name" placeholder="请输入姓名" style="width: 200px"></el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-select v-model="search.sectionId" placeholder="请选择" style="width: 200px">
|
|
<el-option
|
|
v-for="item in roleList"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value"
|
|
>
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form>
|
|
</div>
|
|
<div class="title-btn">
|
|
<el-button type="primary" @click="init()">查询</el-button>
|
|
<el-button type="primary" @click="resetSearch">重置</el-button>
|
|
<el-button type="primary" :icon="Plus" @click="openDialog(null)">新增</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table">
|
|
<el-table :data="tableData" style="width: 100%" @row-click="rowClick">
|
|
<el-table-column prop="date" label="日期" width="180">
|
|
<template #default="scope">
|
|
{{ formatDate(scope.row.memberInfo.createDatetime) }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="name" label="姓名" width="180">
|
|
<template #default="scope">
|
|
{{ scope.row.memberInfo.name }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="role" label="角色" width="180">
|
|
<template #default="scope">
|
|
{{ roleList.find((item: any) => item.value === scope.row.memberInfo.role)?.label || '-' }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="sectionId" label="科室">
|
|
<template #default="scope">
|
|
{{ sectionList.find((item: any) => item.id === scope.row.memberInfo.sectionId)?.name || '-' }}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="memo" label="备注">
|
|
<template #default="scope">
|
|
{{ scope.row.memberInfo.memo }}
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<div class="bottom">
|
|
<div class="page_btn_list">
|
|
<el-pagination
|
|
background
|
|
layout="prev, pager, next"
|
|
:page-size="pageSize"
|
|
:current-page="page"
|
|
:total="total"
|
|
@current-change="changePage"
|
|
/>
|
|
</div>
|
|
</div>
|
|
<MemberEdit ref="memberEditRef" @close="init()"></MemberEdit>
|
|
</div>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import {onMounted, ref, nextTick} from "vue"
|
|
import MemberEdit from "@/components/settings/MemberEdit.vue";
|
|
import {post} from "@/utils/request.ts";
|
|
import {formatDate} from "@/utils/dateUtils.ts";
|
|
import {Plus} from "@element-plus/icons-vue";
|
|
import {apiConfig} from "@/assets/config/apiConfig.ts";
|
|
|
|
const isShow = ref(false)
|
|
const tableData = ref<any>([]);
|
|
const memberEditRef = ref<any>(null)
|
|
const rowClick = (row: any) => {
|
|
openDialog(row.memberInfo.id)
|
|
}
|
|
const openDialog= (id:any) => {
|
|
nextTick(() => {
|
|
memberEditRef.value?.init(id)
|
|
})
|
|
}
|
|
const roleList = [
|
|
{
|
|
value: 1,
|
|
label: '医生',
|
|
},
|
|
{
|
|
value: 2,
|
|
label: '护士',
|
|
},
|
|
{
|
|
value: 3,
|
|
label: '检验技师',
|
|
},
|
|
{
|
|
value: 4,
|
|
label: '理疗师',
|
|
},
|
|
{
|
|
value: 5,
|
|
label: '医生助手',
|
|
},
|
|
{
|
|
value: 6,
|
|
label: '检查技师',
|
|
},
|
|
{
|
|
value: 7,
|
|
label: '管理员',
|
|
},
|
|
{
|
|
value: 8,
|
|
label: '其他',
|
|
},
|
|
]
|
|
const init = (() => {
|
|
isShow.value = false
|
|
post('organization/member/list ', {page: page.value, size: pageSize.value, ...search.value}).then((res: any) => {
|
|
tableData.value = res.list
|
|
list()
|
|
})
|
|
})
|
|
const sectionList = ref<any>([]);
|
|
const list = () => {
|
|
post(apiConfig.OrganizationSectionAllList).then((res: any) => {
|
|
sectionList.value = res
|
|
})
|
|
}
|
|
onMounted(() => {
|
|
init()
|
|
})
|
|
const changePage = (val: any) => {
|
|
page.value = val
|
|
};
|
|
const pageSize = ref(20);
|
|
const page = ref(1);
|
|
const total = ref(0);
|
|
|
|
const search = ref<any>({})
|
|
const resetSearch = () => {
|
|
search.value = {}
|
|
init()
|
|
}
|
|
</script>
|
|
<style scoped lang="scss">
|
|
@use "@/assets/scss/base.scss";
|
|
|
|
.container-wrapper {
|
|
background: #fff;
|
|
padding: 24px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
|
|
.title {
|
|
height: 60px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
|
|
.table {
|
|
flex: 1;
|
|
}
|
|
|
|
.bottom {
|
|
height: 60px;
|
|
background-color: #FFF;
|
|
box-sizing: border-box;
|
|
padding: 10px;
|
|
border-top: 1px solid #EEE;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
}
|
|
}
|
|
|
|
</style> |