|
@@ -0,0 +1,161 @@
|
|
|
+<template>
|
|
|
+ <el-dialog :title="titleMap" v-model="visible" :width="700" destroy-on-close @closed="$emit('closed')">
|
|
|
+ <el-form :model="form" :rules="rules" :disabled="mode=='show'" ref="dialogForm" label-width="100px" label-position="left">
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="$t('user.userName')" prop="userName">
|
|
|
+ <el-input v-model="form.userName" disabled clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="$t('device.userQueryOptions2')" prop="nickName">
|
|
|
+ <el-input v-model="form.nickName" disabled clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="$t('user.fullName')" prop="fullName">
|
|
|
+ <el-input v-model="form.fullName" disabled clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="$t('user.phone')" prop="phone">
|
|
|
+ <el-input v-model="form.phone" disabled clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="$t('user.email')" prop="email">
|
|
|
+ <el-input v-model="form.email" disabled clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="$t('user.rank')" prop="rank">
|
|
|
+ <el-input v-model="form.rank" disabled clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="$t('user.hospitalName')" prop="organization">
|
|
|
+ <sc-select v-model="form.organization" :apiObj="$API.organization.organizationSelectList" style="width:100%" clearable filterable @change="orgChange(form.organization)"></sc-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item :label="$t('menu.roleList')" prop="role">
|
|
|
+ <el-select v-model="form.role" style="width:100%" clearable filterable>
|
|
|
+ <el-option v-for="item in platRules" :key="item.Key" :label="item.Value" :value="item.Key" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="15">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item :label="$t('user.userHeadImg')">
|
|
|
+ <sc-upload v-model="form.imgUrl" :title="$t('user.humanFaceImage')"></sc-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="visible=false" >{{$t('dialogBox.cancelButtonText')}}</el-button>
|
|
|
+ <el-button type="primary" :loading="isSaveing" @click="submit()">{{$t('dialogBox.saveButtonText')}}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ export default {
|
|
|
+ emits: ['success', 'closed'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ titleMap: this.$t('user.certificationAudit'),
|
|
|
+ visible: false,
|
|
|
+ isSaveing: false,
|
|
|
+ //表单数据
|
|
|
+ form: {
|
|
|
+ userName: '',
|
|
|
+ nickName: '',
|
|
|
+ fullName: '',
|
|
|
+ phone: '',
|
|
|
+ email: '',
|
|
|
+ rank: '',
|
|
|
+ organization: '-1',
|
|
|
+ rootOrganizationCode: '',
|
|
|
+ role: '',
|
|
|
+ imgUrl: ''
|
|
|
+ },
|
|
|
+ platRules: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //显示
|
|
|
+ open(userCode = ''){
|
|
|
+ this.queryUserInfo(userCode);
|
|
|
+ this.visible = true;
|
|
|
+ return this
|
|
|
+ },
|
|
|
+ //用户详情信息
|
|
|
+ async queryUserInfo(code){
|
|
|
+ this.isSaveing = true;
|
|
|
+ var res = await this.$API.user.userDetailInfo.post(code);
|
|
|
+ this.isSaveing = false;
|
|
|
+ if (res){
|
|
|
+ this.form.userCode = res.UserCode;
|
|
|
+ this.form.userName = res.UserName;
|
|
|
+ this.form.nickName = res.NickName;
|
|
|
+ this.form.fullName = res.FullName;
|
|
|
+ this.form.phone = res.Phone
|
|
|
+ this.form.email = res.Email
|
|
|
+ this.form.role = res.RoleCodes[0]
|
|
|
+ this.form.rank = res.RankName
|
|
|
+ this.form.organization = res.RootOrganizationCode
|
|
|
+ this.form.rootOrganizationCode = res.RootOrganizationCode
|
|
|
+ this.form.imgUrl = res.HeadImageUrl
|
|
|
+ if (res.RootOrganizationCode !== '' && res.RootOrganizationCode !== undefined) {
|
|
|
+ this.bindPlatRuleSelectList()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //根据机构code级联平台角色
|
|
|
+ orgChange(orgCode) {
|
|
|
+ if (orgCode === '') {
|
|
|
+ this.form.role = ''
|
|
|
+ this.platRules = []
|
|
|
+ } else {
|
|
|
+ this.bindPlatRuleSelectList()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //绑定角色
|
|
|
+ async bindPlatRuleSelectList()
|
|
|
+ {
|
|
|
+ var result = await this.$API.userRole.roleSelectList.post();
|
|
|
+ if (result)
|
|
|
+ {
|
|
|
+ this.platRules = result
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ this.platRules = []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //表单提交方法
|
|
|
+ async submit(){
|
|
|
+ this.isSaveing = true;
|
|
|
+ var res = false;
|
|
|
+ res = await this.$API.user.modifyUserInfo.post(this.form);
|
|
|
+ this.isSaveing = false;
|
|
|
+ if(res){
|
|
|
+ this.$emit('success');
|
|
|
+ this.visible = false;
|
|
|
+ this.$message.success(this.$t("response.operateSuccess"))
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.$alert(res.message, this.$t("dialogBox.confirmWarningTitle"), {type: 'error'})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|