Compare commits

...

2 Commits

2 changed files with 68 additions and 30 deletions

View File

@ -1,6 +1,6 @@
<template>
<el-dialog v-if="visible" :visible.sync="visible" v-dialogDrag width="540px" :close-on-click-modal="false"
:close-on-press-escape="false" append-to-body :title="$t('system:userlist:roleList:title')"
:close-on-press-escape="false" append-to-body :title="$t('system:userlist:button:groups')"
:before-close="cancel">
<el-button size="mini" type="primary" @click.stop="openAdd" style="float: right">
{{ $t('common:button:new') }}

View File

@ -21,6 +21,14 @@
<template slot="genderSlot" slot-scope="{ scope }">
{{ scope.row.Sex ? 'Male' : 'Female' }}
</template>
<template slot="HospitalGroupListSlot" slot-scope="{ scope }">
{{
Array.isArray(scope.row.HospitalGroupList) &&
scope.row.HospitalGroupList.length > 0
? scope.row.HospitalGroupList.map((item) => item.Name).join(', ')
: ''
}}
</template>
<template slot="UserTypeSlot" slot-scope="{ scope }">
{{
Array.isArray(scope.row.UserRoleList) &&
@ -59,7 +67,7 @@
</box-content>
</template>
<script>
import { getUserList, getUserTypeList, deleteSysUser } from "@/api/admin";
import { getUserList, getUserTypeList, deleteSysUser, getHospitalGroupList } from "@/api/admin";
// import { searchForm, searchHandle, columns } from './list'
import BoxContent from "@/components/BoxContent";
import SearchForm from "@/components/BaseForm/search-form";
@ -146,6 +154,14 @@ export default {
minWidth: 130,
showOverflowTooltip: true,
},
{
prop: 'HospitalGroupId',
label: this.$t('system:userlist:table:HospitalGroupList'),
minWidth: 100,
slot: 'HospitalGroupListSlot',
// sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: 'UserType',
label: this.$t('system:userlist:table:UserType'),
@ -163,15 +179,15 @@ export default {
sortable: 'custom',
showOverflowTooltip: true,
},
{
prop: 'IsTestUser',
label: this.$t('system:userlist:table:IsTestUser'),
hidden: true,
slot: 'isTestUserSlot',
minWidth: 120,
sortable: 'custom',
showOverflowTooltip: true,
},
// {
// prop: 'IsTestUser',
// label: this.$t('system:userlist:table:IsTestUser'),
// hidden: true,
// slot: 'isTestUserSlot',
// minWidth: 120,
// sortable: 'custom',
// showOverflowTooltip: true,
// },
{
prop: 'Status',
label: this.$t('system:userlist:table:Status'),
@ -280,25 +296,25 @@ export default {
change: (scope) => '',
placeholder: '',
},
{
type: 'Select',
label: this.$t('system:userlist:label:IsTestUser'),
prop: 'IsTestUser',
width: '100px',
options: [
{
label: this.$t('system:userlist:label:IsTestUser:Yes'),
value: true,
},
{
label: this.$t('system:userlist:label:IsTestUser:No'),
value: false,
},
],
props: { label: 'label', value: 'value' },
change: (scope) => '',
placeholder: '',
},
// {
// type: 'Select',
// label: this.$t('system:userlist:label:IsTestUser'),
// prop: 'IsTestUser',
// width: '100px',
// options: [
// {
// label: this.$t('system:userlist:label:IsTestUser:Yes'),
// value: true,
// },
// {
// label: this.$t('system:userlist:label:IsTestUser:No'),
// value: false,
// },
// ],
// props: { label: 'label', value: 'value' },
// change: (scope) => '',
// placeholder: '',
// },
{
type: 'Select',
label: this.$t('system:userlist:label:Status'),
@ -315,6 +331,15 @@ export default {
change: (scope) => '',
placeholder: '',
},
{
type: 'Select',
label: this.$t('system:userlist:label:HospitalGroupList'),
prop: 'HospitalGroupId',
width: '100px',
options: [], //
props: { label: 'Name', value: 'Id' }, //
placeholder: '',
},
{
type: 'Select',
label: this.$t('system:userlist:label:UserType'),
@ -374,11 +399,24 @@ export default {
created() {
this.getList();
this.getInfo();
this.getHospitalGroupList()
},
methods: {
diffTime(time) {
return moment(new Date()).diff(time, 'days')
},
async getHospitalGroupList() {
try {
let res = await getHospitalGroupList({})
if (res.IsSuccess) {
let hospitalGroupList = res.Result
const index = this.findItemIndex("HospitalGroupId");
this.$set(this.searchForm[index], "options", hospitalGroupList);
}
} catch (err) {
console.log(err)
}
},
//
getList() {
this.loading = true;