Admin可以管理多个医院
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
836d2ffc22
commit
6d4705c0d4
|
@ -278,3 +278,35 @@ export function batchAddInternationalization(param) {
|
|||
data: param
|
||||
})
|
||||
}
|
||||
// 获取医院列表
|
||||
export function getHIRHospitalList(param) {
|
||||
return request({
|
||||
url: `/Patient/getHIRHospitalList`,
|
||||
method: 'post',
|
||||
data: param
|
||||
})
|
||||
}
|
||||
// 删除医院
|
||||
export function deleteHIRHospital(id) {
|
||||
return request({
|
||||
url: `/Patient/deleteHIRHospital/${id}`,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
// 新增或修改医院
|
||||
export function addOrUpdateHIRHospital(data) {
|
||||
return request({
|
||||
url: `/Patient/addOrUpdateHIRHospital`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 设置默认医院
|
||||
export function updateDefaultHospital(params) {
|
||||
return request({
|
||||
url: `/Patient/updateDefaultHospital`,
|
||||
method: 'put',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -6,12 +6,8 @@
|
|||
<div class="login-body">
|
||||
<div class="login-l">
|
||||
<div class="login-logo">
|
||||
<img
|
||||
v-if="language === 'zh' && hospital.HospitalLogoPath"
|
||||
:src="OSSclientConfig.basePath + hospital.HospitalLogoPath"
|
||||
crossOrigin="anonymous"
|
||||
alt=""
|
||||
/>
|
||||
<img v-if="language === 'zh' && hospital.HospitalLogoPath"
|
||||
:src="OSSclientConfig.basePath + hospital.HospitalLogoPath" crossOrigin="anonymous" alt="" />
|
||||
<!-- <img v-else src="@/assets/zzlogo3.png" alt="" /> -->
|
||||
</div>
|
||||
<div class="login-image">
|
||||
|
@ -25,87 +21,48 @@
|
|||
{{ $t('login:title:system') }}
|
||||
</div>
|
||||
</div>
|
||||
<el-form
|
||||
ref="loginForm"
|
||||
:model="loginForm"
|
||||
:rules="loginRules"
|
||||
class="login-form"
|
||||
auto-complete="on"
|
||||
label-position="left"
|
||||
>
|
||||
<el-form-item
|
||||
prop="username"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('login:formRule:userName'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
]"
|
||||
>
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on"
|
||||
label-position="left">
|
||||
<el-form-item prop="username" :rules="[
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('login:formRule:userName'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<span class="svg-container">
|
||||
<svg-icon icon-class="user" />
|
||||
</span>
|
||||
<!-- User Name -->
|
||||
<el-input
|
||||
ref="username"
|
||||
v-model="loginForm.username"
|
||||
size="small"
|
||||
:placeholder="$t('login:form:userName')"
|
||||
name="username"
|
||||
type="text"
|
||||
tabindex="1"
|
||||
/>
|
||||
<el-input ref="username" v-model="loginForm.username" size="small" :placeholder="$t('login:form:userName')"
|
||||
name="username" type="text" tabindex="1" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
prop="password"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('login:formRule:password'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
]"
|
||||
>
|
||||
<el-form-item prop="password" :rules="[
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('login:formRule:password'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<span class="svg-container">
|
||||
<svg-icon icon-class="password" />
|
||||
</span>
|
||||
<!-- password -->
|
||||
<el-input
|
||||
:key="passwordType"
|
||||
ref="password"
|
||||
v-model="loginForm.password"
|
||||
size="small"
|
||||
:type="passwordType"
|
||||
:placeholder="$t('login:form:password')"
|
||||
name="password"
|
||||
tabindex="2"
|
||||
@keyup.enter.native="handleLogin"
|
||||
/>
|
||||
<el-input :key="passwordType" ref="password" v-model="loginForm.password" size="small" :type="passwordType"
|
||||
:placeholder="$t('login:form:password')" name="password" tabindex="2" @keyup.enter.native="handleLogin" />
|
||||
<span class="show-pwd" @click="showPwd">
|
||||
<svg-icon
|
||||
:icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
|
||||
/>
|
||||
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
|
||||
</span>
|
||||
</el-form-item>
|
||||
<!-- Login -->
|
||||
<el-button
|
||||
:loading="loading"
|
||||
type="primary"
|
||||
style="width: 100%; margin-bottom: 10px"
|
||||
size="medium"
|
||||
@click.native.prevent="handleLogin"
|
||||
>
|
||||
<el-button :loading="loading" type="primary" style="width: 100%; margin-bottom: 10px" size="medium"
|
||||
@click.native.prevent="handleLogin">
|
||||
{{ $t('login:button:login') }}
|
||||
</el-button>
|
||||
<div style="text-align: right">
|
||||
<!-- Forget password? -->
|
||||
<el-button
|
||||
type="text"
|
||||
size="medium"
|
||||
@click.native.prevent="handleResetPwd"
|
||||
>
|
||||
<el-button type="text" size="medium" @click.native.prevent="handleResetPwd">
|
||||
{{ $t('login:button:forgetPassword') }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
@ -126,28 +83,33 @@
|
|||
<img src="@/assets/filing.png" />
|
||||
<span>沪公网安备 31011002005859号</span>
|
||||
</a> -->
|
||||
<span
|
||||
>{{ $t('login:copyright:title:construct') }}{{ config.hospital }}</span
|
||||
>
|
||||
<span><span @click.stop="openHospital">{{ $t('login:copyright:title:construct') }}</span>{{ hospital.HospitalName
|
||||
}}</span>
|
||||
<span> | </span>
|
||||
<span>{{ $t('login:copyright:title:support') }}{{ config.company }}</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<span
|
||||
>{{ $t('login:copyright:title:construct')
|
||||
}}{{ config.hospitalEN }}</span
|
||||
>
|
||||
<span>{{ $t('login:copyright:title:construct')
|
||||
}}{{ hospital.HospitalName }}</span>
|
||||
<span> | </span>
|
||||
<span
|
||||
>{{ $t('login:copyright:title:support') }}{{ config.companyEN }}</span
|
||||
>
|
||||
<span>{{ $t('login:copyright:title:support') }}{{ config.companyEN }}</span>
|
||||
</div>
|
||||
<Vcode
|
||||
:show="isShow"
|
||||
slider-text="拖到滑块完成验证"
|
||||
:imgs="[Img1]"
|
||||
@success="onSuccess"
|
||||
/>
|
||||
<Vcode :show="isShow" slider-text="拖到滑块完成验证" :imgs="[Img1]" @success="onSuccess" />
|
||||
<el-dialog :title="$t('login:hospital:title:changeHospital')" :visible.sync="visible" width="30%"
|
||||
:append-to-body="true">
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-form-item :label="$t('login:hospital:form:changeHospital')">
|
||||
<el-select v-model="form.Id" placeholder="" style="width:100%">
|
||||
<el-option v-for="item in hospitalList" :key="item.Id" :label="item.HospitalName" :value="item.Id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ $t("common:button:cancel") }}</el-button>
|
||||
<el-button type="primary" @click="saveHospital">{{ $t("system:hospital:save") }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -159,6 +121,7 @@ import Vcode from 'vue-puzzle-vcode'
|
|||
import Img1 from '@/assets/pic-1.png'
|
||||
import logoImg from '@/assets/zzlogo2.png'
|
||||
import { getHospital } from '@/api/hospital.js'
|
||||
import { getHIRHospitalList, updateDefaultHospital } from '@/api/admin'
|
||||
// import config from '/public/config.js'
|
||||
export default {
|
||||
name: 'Login',
|
||||
|
@ -166,6 +129,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
config: WINDOW_CONFIG,
|
||||
visible: false,
|
||||
logoImg,
|
||||
VUE_APP_OSS_CONFIG_REGION: process.env.VUE_APP_OSS_CONFIG_REGION,
|
||||
loginForm: {
|
||||
|
@ -204,7 +168,12 @@ export default {
|
|||
hospital: {
|
||||
HospitalLogoPath: null,
|
||||
HospitalName: null,
|
||||
Id: null
|
||||
},
|
||||
hospitalList: [],
|
||||
form: {
|
||||
Id: null
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
@ -212,7 +181,7 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getInfo()
|
||||
console.log(this.config)
|
||||
this.getList()
|
||||
},
|
||||
mounted() {
|
||||
this.loginType = this.$route.query.loginType
|
||||
|
@ -237,6 +206,41 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
...mapMutations({ setLanguage: 'lang/setLanguage' }),
|
||||
async saveHospital() {
|
||||
if (this.form.Id === this.hospital.Id) return this.visible = false
|
||||
let res = await updateDefaultHospital({
|
||||
HirHospitalId: this.form.Id
|
||||
})
|
||||
if (res.IsSuccess) {
|
||||
this.visible = false
|
||||
this.getInfo()
|
||||
this.getList()
|
||||
}
|
||||
},
|
||||
openHospital() {
|
||||
this.form.Id = this.hospital.Id
|
||||
this.visible = true
|
||||
},
|
||||
// 获取医院列表
|
||||
getList() {
|
||||
getHIRHospitalList({
|
||||
HospitalName: null,
|
||||
Country: null,
|
||||
City: null,
|
||||
Province: null,
|
||||
Address: null,
|
||||
Phone: null,
|
||||
Asc: false,
|
||||
SortField: 'CreateTime',
|
||||
PageIndex: 1,
|
||||
PageSize: 1000,
|
||||
})
|
||||
.then((res) => {
|
||||
this.hospitalList = res.Result.CurrentPageData
|
||||
})
|
||||
.catch(() => {
|
||||
})
|
||||
},
|
||||
// 获取医院信息
|
||||
async getInfo() {
|
||||
try {
|
||||
|
@ -379,20 +383,24 @@ $cursor: #fff;
|
|||
$bg: #2d3a4b;
|
||||
$dark_gray: #889aa4;
|
||||
$light_gray: #606266;
|
||||
|
||||
.login-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
background: rgb(249, 249, 249);
|
||||
|
||||
.login-header {
|
||||
margin: 10px 0px 20px 10px;
|
||||
height: 3rem;
|
||||
width: 720px;
|
||||
|
||||
.login-logo {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.login-body {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
|
@ -406,30 +414,36 @@ $light_gray: #606266;
|
|||
box-sizing: border-box;
|
||||
background: rgb(255, 255, 255);
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
|
||||
.login-l {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
|
||||
.login-logo {
|
||||
position: absolute;
|
||||
top: 35px;
|
||||
left: 50px;
|
||||
|
||||
img {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.login-image {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 0px;
|
||||
// transform: translateY(-50%);
|
||||
height: 100%;
|
||||
|
||||
img {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.login-r {
|
||||
position: relative;
|
||||
float: left;
|
||||
|
@ -447,9 +461,11 @@ $light_gray: #606266;
|
|||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.title-container {
|
||||
// margin-bottom: 50px;
|
||||
margin-top: 15%;
|
||||
|
||||
.title {
|
||||
font-size: 35px;
|
||||
color: $light_gray;
|
||||
|
@ -489,6 +505,7 @@ $light_gray: #606266;
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.login-footer {
|
||||
position: absolute;
|
||||
bottom: 50px;
|
||||
|
@ -502,6 +519,7 @@ $light_gray: #606266;
|
|||
align-items: center;
|
||||
// color: rgb(180, 190, 199);
|
||||
color: #909399;
|
||||
|
||||
a {
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
|
@ -510,13 +528,16 @@ $light_gray: #606266;
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
span {
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
img {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
// p{
|
||||
// display: inline-block;
|
||||
// height:20px;
|
||||
|
|
|
@ -0,0 +1,197 @@
|
|||
<template>
|
||||
<div class="hospital">
|
||||
<el-form ref="hospitalForm" size="small" :model="hospital" :rules="hospitalFormRules" label-width="150px"
|
||||
style="width: 800px">
|
||||
<el-card class="Basic" shadow="never" size="small">
|
||||
<el-form-item :label="$t('system:hospital:name')" prop="HospitalName">
|
||||
<el-input v-model.trim="hospital.HospitalName" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:code')" prop="HospitalCode">
|
||||
<el-input v-model.trim="hospital.HospitalCode" :disabled="disabled || hasPermi(['role:oa'])"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('system:hospital:aliasName')" prop="HospitalAliasName">
|
||||
<el-input v-model="hospital.HospitalAliasName" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('system:hospital:country')" prop="Country">
|
||||
<el-input v-model="hospital.Country" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:province')" prop="Province">
|
||||
<el-input v-model="hospital.Province" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:city')" prop="City">
|
||||
<el-input v-model="hospital.City" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:address')" prop="Address">
|
||||
<el-input v-model="hospital.Address" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:phone')" prop="Phone">
|
||||
<el-input v-model="hospital.Phone" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:trialKeepCount')" prop="TrialKeepCount">
|
||||
<el-input v-model="hospital.TrialKeepCount" :disabled="disabled || hasPermi(['role:oa'])"
|
||||
type="number" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:isCanConnectInternet')"
|
||||
v-hasPermi="['system:hospital:connectInternet']">
|
||||
<el-switch v-model="hospital.IsCanConnectInternet" active-color="#13ce66" inactive-color="#ff4949"
|
||||
active-text="是" inactive-text="否" :disabled="disabled">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:logo')" prop="HospitalLogoPath">
|
||||
<upload-logo :path.sync="hospital.HospitalLogoPath" :disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
<el-form-item v-if="status === 'default' && hasPermi(['system:hospital:edit'])">
|
||||
<el-button type="primary" size="small" style="margin: 10px 15px" :loading="btnLoading"
|
||||
:disabled="btnLoading" @click="handleSave">{{ $t("system:hospital:save") }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="btnBox" v-if="status !== 'default'">
|
||||
<el-button type="primary" size="small" style="margin: 10px 15px" :loading="btnLoading"
|
||||
:disabled="btnLoading" @click="handleSave">{{ $t("system:hospital:save") }}</el-button>
|
||||
<el-button type="primary" size="small" style="margin: 10px 15px" @click="handleCancel">{{
|
||||
$t("common:button:cancel") }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getHospital } from "@/api/hospital.js";
|
||||
import { addOrUpdateHIRHospital } from '@/api/admin'
|
||||
import uploadLogo from "./uploadLogo.vue";
|
||||
export default {
|
||||
name: "systemHospital",
|
||||
components: { "upload-logo": uploadLogo },
|
||||
props: {
|
||||
status: {
|
||||
type: String,
|
||||
default: "default" // add edit default
|
||||
},
|
||||
rowData: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
hospital: {
|
||||
HospitalName: null,
|
||||
HospitalAliasName: null,
|
||||
HospitalCode: null,
|
||||
Country: null,
|
||||
City: null,
|
||||
Province: null,
|
||||
Address: null,
|
||||
Phone: null,
|
||||
IsCanConnectInternet: true,
|
||||
Id: null,
|
||||
TrialKeepCount: null,
|
||||
HospitalLogoPath: null,
|
||||
},
|
||||
hospitalFormRules: {
|
||||
HospitalName: [
|
||||
{ required: true, message: "请输入医院名称", trigger: "blur" },
|
||||
],
|
||||
HospitalCode: [
|
||||
{ required: true, message: "请输入医院编码", trigger: "blur" },
|
||||
],
|
||||
// HospitalLogoPath: [
|
||||
// { required: true, message: "请上传医院logo", trigger: "blur" },
|
||||
// ],
|
||||
TrialKeepCount: [
|
||||
{ required: true, message: "请输入未激活项目数", trigger: "blur" },
|
||||
],
|
||||
// HospitalAliasName: [
|
||||
// { required: true, message: "请输入医院别称", trigger: "blur" },
|
||||
// ],
|
||||
// Country: [{ required: true, message: "请输入国家", trigger: "blur" }],
|
||||
// City: [{ required: true, message: "请输入所在城市", trigger: "blur" }],
|
||||
// Province: [
|
||||
// { required: true, message: "请输入所在省份", trigger: "blur" },
|
||||
// ],
|
||||
// Address: [
|
||||
// { required: true, message: "请输入医院地址", trigger: "blur" },
|
||||
// ],
|
||||
// Phone: [
|
||||
// { required: true, message: "请输入医院联系方式", trigger: "blur" },
|
||||
// ],
|
||||
},
|
||||
btnLoading: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
if (this.status === 'default') {
|
||||
this.getInfo();
|
||||
}
|
||||
if (this.status === 'edit') {
|
||||
Object.keys(this.hospital).forEach(key => {
|
||||
this.hospital[key] = this.rowData[key]
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
disabled() {
|
||||
return !this.hasPermi(["system:hospital:edit"]);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async handleSave() {
|
||||
if (this.btnLoading) return;
|
||||
try {
|
||||
let validate = await this.$refs.hospitalForm.validate();
|
||||
if (!validate) return;
|
||||
this.btnLoading = true;
|
||||
let res = await addOrUpdateHIRHospital(this.hospital);
|
||||
this.btnLoading = false;
|
||||
if (res.IsSuccess) {
|
||||
this.$message.success(this.$t("common:message:savedSuccessfully"));
|
||||
if (this.status !== 'default') {
|
||||
this.$emit("getList")
|
||||
this.$emit("close")
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
this.btnLoading = false;
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
// 获取医院信息
|
||||
async getInfo() {
|
||||
try {
|
||||
let res = await getHospital();
|
||||
if (res.IsSuccess) {
|
||||
Object.keys(this.hospital).forEach((key) => {
|
||||
this.hospital[key] = res.Result[key];
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
handleCancel() {
|
||||
this.$emit("close")
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep .is-error.my_new_pwd {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.hospital {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.btnBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,224 @@
|
|||
<template>
|
||||
<div class="log">
|
||||
<div ref="leftContainer" class="left">
|
||||
<el-form :inline="true">
|
||||
<el-form-item :label="$t('system:hospital:table:hospitalName')" prop="Version">
|
||||
<el-input v-model="searchData.HospitalName" size="small" clearable style="width:100px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:table:country')" prop="Version">
|
||||
<el-input v-model="searchData.Country" size="small" clearable style="width:100px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:table:city')" prop="UpdateContent">
|
||||
<el-input v-model="searchData.City" size="small" clearable style="width:100px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:table:province')" prop="UpdateContent">
|
||||
<el-input v-model="searchData.Province" size="small" clearable style="width:100px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:table:address')" prop="UpdateContent">
|
||||
<el-input v-model="searchData.Address" size="small" clearable style="width:100px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:table:phone')" prop="UpdateContent">
|
||||
<el-input v-model="searchData.Phone" size="small" clearable style="width:100px" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="getList">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">
|
||||
新增
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" v-adaptive="{ bottomOffset: 65 }" height="100" :data="list" class="table"
|
||||
@sort-change="handleSortByColumn" :default-sort="{ prop: 'PublishTime', order: 'descending' }">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column :label="$t('system:hospital:table:hospitalName')" prop="HospitalName" min-width="120"
|
||||
show-overflow-tooltip sortable="custom" />
|
||||
<el-table-column :label="$t('system:hospital:table:hospitalAliasName')" prop="HospitalAliasName"
|
||||
min-width="120" show-overflow-tooltip sortable="custom" />
|
||||
<el-table-column :label="$t('system:hospital:table:country')" prop="Country" show-overflow-tooltip />
|
||||
|
||||
<el-table-column :label="$t('system:hospital:table:city')" prop="City" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('system:hospital:table:province')" prop="Province" show-overflow-tooltip />
|
||||
<el-table-column :label="$t('system:hospital:table:address')" prop="Address" min-width="150"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column :label="$t('system:hospital:table:phone')" prop="Phone" min-width="150"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column :label="$t('system:hospital:table:isCanConnectInternet')" prop="IsCanConnectInternet"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ $fd("YesOrNo", scope.row.IsCanConnectInternet) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('system:hospital:table:hospitalCode')" prop="HospitalCode"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column :label="$t('system:hospital:table:isDefault')" prop="IsDefault" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ $fd("YesOrNo", scope.row.IsDefault) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column :label="$t('system:hospital:table:createTime')" prop="CreateTime" min-width="150"
|
||||
show-overflow-tooltip />
|
||||
<el-table-column :label="$t('system:hospital:table:updateTime')" prop="UpdateTime" min-width="150"
|
||||
show-overflow-tooltip />
|
||||
|
||||
<el-table-column :label="$t('common:action:action')" fixed="right" prop="" min-width="200"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" :disabled="scope.row.IsDefault" type="text" icon="el-icon-circle-check"
|
||||
@click="setDefault(scope.row)">
|
||||
{{ $t('system:hospital:button:setDefault') }}
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit-outline" @click="handleEdit(scope.row)">
|
||||
{{ $t('common:button:edit') }}
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">
|
||||
{{ $t('common:button:delete') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination" style="text-align: right; margin-top: 5px">
|
||||
<pagination :total="total" :page.sync="searchData.PageIndex" :limit.sync="searchData.PageSize"
|
||||
@pagination="getList" />
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog top="3vh" :title="status === 'edit' ? '编辑' : '新增'" :visible.sync="visible" width="850px">
|
||||
<system-hospital v-if="visible" :status="status" :rowData="rowData" @getList="getList" @close="close" />
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getHIRHospitalList, deleteHIRHospital, updateDefaultHospital } from '@/api/admin'
|
||||
import Pagination from '@/components/Pagination'
|
||||
import systemHospital from './form.vue'
|
||||
import moment from 'moment'
|
||||
const searchDataDefault = () => {
|
||||
return {
|
||||
HospitalName: null,
|
||||
Country: null,
|
||||
City: null,
|
||||
Province: null,
|
||||
Address: null,
|
||||
Phone: null,
|
||||
Asc: false,
|
||||
SortField: 'CreateTime',
|
||||
PageIndex: 1,
|
||||
PageSize: 20,
|
||||
}
|
||||
}
|
||||
export default {
|
||||
components: { Pagination, systemHospital },
|
||||
data() {
|
||||
return {
|
||||
moment,
|
||||
searchData: searchDataDefault(),
|
||||
list: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
|
||||
visible: false,
|
||||
status: 'default',
|
||||
rowData: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
async setDefault(row) {
|
||||
try {
|
||||
this.$confirm(this.$t('system:hospital:message:setDefault'), {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true,
|
||||
}).then(async () => {
|
||||
let res = await updateDefaultHospital({HirHospitalId:row.Id})
|
||||
if (res.IsSuccess) {
|
||||
this.getList()
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.loading = false
|
||||
})
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.visible = false
|
||||
this.rowData = {}
|
||||
this.status = "default"
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
getHIRHospitalList(this.searchData)
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
this.list = res.Result.CurrentPageData
|
||||
this.total = res.Result.TotalCount
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
handleAdd() {
|
||||
this.status = 'add'
|
||||
this.visible = true
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.status = 'edit'
|
||||
this.rowData = row
|
||||
this.visible = true
|
||||
},
|
||||
// 重置列表查询
|
||||
handleReset() {
|
||||
this.searchData = searchDataDefault()
|
||||
this.getList()
|
||||
},
|
||||
// 删除
|
||||
handleDelete(row) {
|
||||
this.$confirm('是否确认删除?', {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true,
|
||||
}).then(() => {
|
||||
this.loading = true
|
||||
deleteHIRHospital(row.Id)
|
||||
.then((res) => {
|
||||
this.loading = false
|
||||
if (res.IsSuccess) {
|
||||
this.getList()
|
||||
this.$message.success(
|
||||
this.$t('common:message:deletedSuccessfully')
|
||||
)
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
// 排序
|
||||
handleSortByColumn(column) {
|
||||
if (column.order === 'ascending') {
|
||||
this.searchData.Asc = true
|
||||
} else {
|
||||
this.searchData.Asc = false
|
||||
}
|
||||
this.searchData.SortField = column.prop
|
||||
this.searchData.PageIndex = 1
|
||||
this.getList()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.log {
|
||||
padding-top: 20px;
|
||||
|
||||
::v-deep .el-dialog__body {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -1,199 +1,27 @@
|
|||
<template>
|
||||
<div class="hospital">
|
||||
<el-form
|
||||
ref="hospitalForm"
|
||||
size="small"
|
||||
:model="hospital"
|
||||
:rules="hospitalFormRules"
|
||||
label-width="150px"
|
||||
style="width: 800px"
|
||||
>
|
||||
<el-card class="Basic" shadow="never" size="small">
|
||||
<el-form-item :label="$t('system:hospital:name')" prop="HospitalName">
|
||||
<el-input
|
||||
v-model.trim="hospital.HospitalName"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:code')" prop="HospitalCode">
|
||||
<el-input
|
||||
v-model.trim="hospital.HospitalCode"
|
||||
:disabled="disabled || hasPermi(['role:oa'])"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
:label="$t('system:hospital:aliasName')"
|
||||
prop="HospitalAliasName"
|
||||
>
|
||||
<el-input
|
||||
v-model="hospital.HospitalAliasName"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('system:hospital:country')" prop="Country">
|
||||
<el-input v-model="hospital.Country" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:province')" prop="Province">
|
||||
<el-input
|
||||
v-model="hospital.Province"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:city')" prop="City">
|
||||
<el-input v-model="hospital.City" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:address')" prop="Address">
|
||||
<el-input v-model="hospital.Address" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system:hospital:phone')" prop="Phone">
|
||||
<el-input v-model="hospital.Phone" :disabled="disabled" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('system:hospital:trialKeepCount')"
|
||||
prop="TrialKeepCount"
|
||||
>
|
||||
<el-input
|
||||
v-model="hospital.TrialKeepCount"
|
||||
:disabled="disabled || hasPermi(['role:oa'])"
|
||||
type="number"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('system:hospital:isCanConnectInternet')"
|
||||
v-hasPermi="['system:hospital:connectInternet']"
|
||||
>
|
||||
<el-switch
|
||||
v-model="hospital.IsCanConnectInternet"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
active-text="是"
|
||||
inactive-text="否"
|
||||
:disabled="disabled"
|
||||
>
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('system:hospital:logo')"
|
||||
prop="HospitalLogoPath"
|
||||
>
|
||||
<upload-logo
|
||||
:path.sync="hospital.HospitalLogoPath"
|
||||
:disabled="disabled"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-card>
|
||||
<el-form-item v-hasPermi="['system:hospital:edit']">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
style="margin: 10px 15px"
|
||||
:loading="btnLoading"
|
||||
:disabled="btnLoading"
|
||||
@click="handleSave"
|
||||
>{{ $t("system:hospital:save") }}</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<hospital-list v-if="isAdmin" />
|
||||
<hospital-form v-else />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { setHospital, getHospital } from "@/api/hospital.js";
|
||||
import uploadLogo from "./uploadLogo.vue";
|
||||
import hospitalList from "./components/list"
|
||||
import hospitalForm from "./components/form"
|
||||
export default {
|
||||
name: "systemHospital",
|
||||
components: { "upload-logo": uploadLogo },
|
||||
components: { hospitalList, hospitalForm },
|
||||
data() {
|
||||
return {
|
||||
hospital: {
|
||||
HospitalName: null,
|
||||
HospitalAliasName: null,
|
||||
HospitalCode: null,
|
||||
Country: null,
|
||||
City: null,
|
||||
Province: null,
|
||||
Address: null,
|
||||
Phone: null,
|
||||
IsCanConnectInternet: true,
|
||||
Id: null,
|
||||
TrialKeepCount: null,
|
||||
HospitalLogoPath: null,
|
||||
},
|
||||
hospitalFormRules: {
|
||||
HospitalName: [
|
||||
{ required: true, message: "请输入医院名称", trigger: "blur" },
|
||||
],
|
||||
HospitalCode: [
|
||||
{ required: true, message: "请输入医院编码", trigger: "blur" },
|
||||
],
|
||||
// HospitalLogoPath: [
|
||||
// { required: true, message: "请上传医院logo", trigger: "blur" },
|
||||
// ],
|
||||
TrialKeepCount: [
|
||||
{ required: true, message: "请输入未激活项目数", trigger: "blur" },
|
||||
],
|
||||
// HospitalAliasName: [
|
||||
// { required: true, message: "请输入医院别称", trigger: "blur" },
|
||||
// ],
|
||||
// Country: [{ required: true, message: "请输入国家", trigger: "blur" }],
|
||||
// City: [{ required: true, message: "请输入所在城市", trigger: "blur" }],
|
||||
// Province: [
|
||||
// { required: true, message: "请输入所在省份", trigger: "blur" },
|
||||
// ],
|
||||
// Address: [
|
||||
// { required: true, message: "请输入医院地址", trigger: "blur" },
|
||||
// ],
|
||||
// Phone: [
|
||||
// { required: true, message: "请输入医院联系方式", trigger: "blur" },
|
||||
// ],
|
||||
},
|
||||
btnLoading: false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getInfo();
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
disabled() {
|
||||
return !this.hasPermi(["system:hospital:edit"]);
|
||||
},
|
||||
isAdmin() {
|
||||
return this.hasPermi(['role:admin', 'role:dev'])
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async handleSave() {
|
||||
if (this.btnLoading) return;
|
||||
try {
|
||||
let validate = await this.$refs.hospitalForm.validate();
|
||||
if (!validate) return;
|
||||
this.btnLoading = true;
|
||||
let res = await setHospital(this.hospital);
|
||||
this.btnLoading = false;
|
||||
if (res.IsSuccess) {
|
||||
this.$message.success(this.$t("common:message:savedSuccessfully"));
|
||||
}
|
||||
} catch (err) {
|
||||
this.btnLoading = false;
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
// 获取医院信息
|
||||
async getInfo() {
|
||||
try {
|
||||
let res = await getHospital();
|
||||
if (res.IsSuccess) {
|
||||
Object.keys(this.hospital).forEach((key) => {
|
||||
this.hospital[key] = res.Result[key];
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -201,10 +29,10 @@ export default {
|
|||
::v-deep .is-error.my_new_pwd {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.hospital {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
Loading…
Reference in New Issue