Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/hir-web into main
commit
ccf91449bf
|
@ -27,3 +27,9 @@ export function setNewUserName(newPhone) {
|
||||||
method: 'put'
|
method: 'put'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function SetNewCheckCode(newCheckCode) {
|
||||||
|
return request({
|
||||||
|
url: `/User/SetNewCheckCode/${newCheckCode}`,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
@ -14,13 +14,13 @@
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
<div class="navbar-flex-wrapper">
|
<div class="navbar-flex-wrapper">
|
||||||
<template v-if="device!=='mobile'">
|
<template v-if="device !== 'mobile'">
|
||||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||||
</template>
|
</template>
|
||||||
<!-- <div class="avatar-container">
|
<!-- <div class="avatar-container">
|
||||||
<img src="@/assets/avatar.png" class="user-avatar">
|
<img src="@/assets/avatar.png" class="user-avatar">
|
||||||
</div> -->
|
</div> -->
|
||||||
<div style="margin-left:20px;">
|
<div style="margin-left: 20px">
|
||||||
<el-dropdown class="dropdown-container" trigger="click">
|
<el-dropdown class="dropdown-container" trigger="click">
|
||||||
<span class="el-dropdown-link">
|
<span class="el-dropdown-link">
|
||||||
{{ name }}
|
{{ name }}
|
||||||
|
@ -29,13 +29,17 @@
|
||||||
</span>
|
</span>
|
||||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||||
<el-dropdown-item v-if="!isReviewer">
|
<el-dropdown-item v-if="!isReviewer">
|
||||||
<span style="display:block;" @click="editInfo">Edit Info</span>
|
<span style="display: block" @click="editInfo">{{
|
||||||
|
$t("trials:trials-myinfo:title:accountInfo")
|
||||||
|
}}</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item>
|
<!-- <el-dropdown-item>
|
||||||
<span style="display:block;" @click="account">Account</span>
|
<span style="display:block;" @click="account">Account</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item> -->
|
||||||
<el-dropdown-item divided>
|
<el-dropdown-item divided>
|
||||||
<span style="display:block;" @click="logout">Log Out</span>
|
<span style="display: block" @click="logout">{{
|
||||||
|
$t("trials:trials-myinfo:button:loginout")
|
||||||
|
}}</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
@ -46,62 +50,62 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {mapGetters, mapMutations} from 'vuex'
|
import { mapGetters, mapMutations } from "vuex";
|
||||||
import Breadcrumb from '@/components/Breadcrumb'
|
import Breadcrumb from "@/components/Breadcrumb";
|
||||||
import Hamburger from '@/components/Hamburger'
|
import Hamburger from "@/components/Hamburger";
|
||||||
import Screenfull from '@/components/Screenfull'
|
import Screenfull from "@/components/Screenfull";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
Breadcrumb,
|
Breadcrumb,
|
||||||
Hamburger,
|
Hamburger,
|
||||||
Screenfull
|
Screenfull,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isReviewer: false,
|
isReviewer: false,
|
||||||
userTypeShortName: zzSessionStorage.getItem('userTypeShortName')
|
userTypeShortName: zzSessionStorage.getItem("userTypeShortName"),
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['sidebar', 'name', 'device'])
|
...mapGetters(["sidebar", "name", "device"]),
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.isReviewer = JSON.parse(zzSessionStorage.getItem('IsReviewer'))
|
this.isReviewer = JSON.parse(zzSessionStorage.getItem("IsReviewer"));
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations({ setLanguage: 'lang/setLanguage' }),
|
...mapMutations({ setLanguage: "lang/setLanguage" }),
|
||||||
toggleSideBar() {
|
toggleSideBar() {
|
||||||
this.$store.dispatch('app/toggleSideBar')
|
this.$store.dispatch("app/toggleSideBar");
|
||||||
},
|
},
|
||||||
async logout() {
|
async logout() {
|
||||||
var loginType = zzSessionStorage.getItem('loginType')
|
var loginType = zzSessionStorage.getItem("loginType");
|
||||||
await this.$store.dispatch('user/logout')
|
await this.$store.dispatch("user/logout");
|
||||||
if (loginType) {
|
if (loginType) {
|
||||||
this.$router.push(`/login?loginType=${loginType}`)
|
this.$router.push(`/login?loginType=${loginType}`);
|
||||||
} else {
|
} else {
|
||||||
this.$router.push(`/login`)
|
this.$router.push(`/login`);
|
||||||
}
|
}
|
||||||
this.$i18n.locale = 'zh'
|
this.$i18n.locale = "zh";
|
||||||
this.setLanguage('zh')
|
this.setLanguage("zh");
|
||||||
this.$updateDictionary()
|
this.$updateDictionary();
|
||||||
},
|
},
|
||||||
editInfo() {
|
editInfo() {
|
||||||
this.$router.push({ name: 'BaiscInfo' })
|
this.$router.push({ name: "BaiscInfo" });
|
||||||
},
|
},
|
||||||
account() {
|
account() {
|
||||||
this.$router.push({ name: 'Account' })
|
this.$router.push({ name: "Account" });
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.navbar-flex-wrapper{
|
.navbar-flex-wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
.navbar {
|
.navbar {
|
||||||
height: 50px;
|
height: 50px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -0,0 +1,255 @@
|
||||||
|
<template>
|
||||||
|
<div class="trial-myinfo-right">
|
||||||
|
<div class="trial-myinfo-right-box">
|
||||||
|
<div class="trial-myinfo-head">
|
||||||
|
<!-- 账号信息 -->
|
||||||
|
{{ $t("trials:trials-myinfo:title:accountInfo") }}
|
||||||
|
</div>
|
||||||
|
<el-form label-position="right" label-width="100px">
|
||||||
|
<!-- 用户名 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:trials-myinfo:form:userName')"
|
||||||
|
style="margin-bottom: 5px"
|
||||||
|
prop="UserName"
|
||||||
|
>
|
||||||
|
<span>{{ user.UserName }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="" style="position: relative" prop="UserName">
|
||||||
|
<el-input
|
||||||
|
v-model="userForm.UserName"
|
||||||
|
:placeholder="$t('trials:trials-myinfo:form:userName')"
|
||||||
|
/>
|
||||||
|
<!-- 修改 -->
|
||||||
|
<el-button
|
||||||
|
:disabled="!userForm.UserName"
|
||||||
|
class="saveBtn"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="setNewUserName"
|
||||||
|
>
|
||||||
|
{{ $t("trials:trials-myinfo:button:update") }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 校验码 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:researchForm:form:checkCode')"
|
||||||
|
style="margin-bottom: 5px"
|
||||||
|
prop="CheckCode"
|
||||||
|
>
|
||||||
|
<!-- <span>{{ user.UserName }}</span> -->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="" style="position: relative" prop="CheckCode">
|
||||||
|
<el-input
|
||||||
|
v-model="userForm.CheckCode"
|
||||||
|
:placeholder="$t('trials:researchForm:form:checkCode')"
|
||||||
|
:maxlength="10"
|
||||||
|
type="number"
|
||||||
|
/>
|
||||||
|
<!-- 修改 -->
|
||||||
|
<el-button
|
||||||
|
:disabled="!userForm.CheckCode"
|
||||||
|
class="saveBtn"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click.stop="setNewUserCheckCode"
|
||||||
|
>
|
||||||
|
{{ $t("trials:trials-myinfo:button:update") }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 电话 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:trials-myinfo:form:phone')"
|
||||||
|
style="margin-bottom: 5px"
|
||||||
|
prop="UserName"
|
||||||
|
>
|
||||||
|
<span>{{ user.Phone }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="" style="position: relative" prop="UserName">
|
||||||
|
<el-input
|
||||||
|
v-model="userForm.Phone"
|
||||||
|
:placeholder="$t('trials:trials-myinfo:form:phone')"
|
||||||
|
/>
|
||||||
|
<!-- 修改 -->
|
||||||
|
<el-button
|
||||||
|
:disabled="!userForm.Phone"
|
||||||
|
class="saveBtn"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="setNewPhone"
|
||||||
|
>
|
||||||
|
{{ $t("trials:trials-myinfo:button:update") }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 邮箱 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:trials-myinfo:form:email')"
|
||||||
|
style="margin-bottom: 5px"
|
||||||
|
prop="UserName"
|
||||||
|
>
|
||||||
|
<span>{{ user.EMail }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label=""
|
||||||
|
style="margin-bottom: 10px; position: relative"
|
||||||
|
prop="EMail"
|
||||||
|
v-if="IsCanConnectInternet"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="userForm.EMail"
|
||||||
|
@input="handleEmailChange"
|
||||||
|
:placeholder="$t('trials:trials-myinfo:form:email')"
|
||||||
|
/>
|
||||||
|
<el-button
|
||||||
|
class="sendCode"
|
||||||
|
:disabled="sendDisabled"
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
@click="sendVerificationCode"
|
||||||
|
>{{ sendTitle }}</el-button
|
||||||
|
>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
label=""
|
||||||
|
style="position: relative"
|
||||||
|
prop="VerificationCode"
|
||||||
|
v-if="IsCanConnectInternet"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="userForm.VerificationCode"
|
||||||
|
:placeholder="$t('trials:researchForm:form:verifyCode')"
|
||||||
|
/>
|
||||||
|
<!-- 修改 -->
|
||||||
|
<el-button
|
||||||
|
:disabled="
|
||||||
|
!userForm.EMail || !userForm.VerificationCode || sendDisabled
|
||||||
|
"
|
||||||
|
class="saveBtn"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="setNewEmail"
|
||||||
|
>
|
||||||
|
{{ $t("trials:trials-myinfo:button:update") }}
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import {
|
||||||
|
sendVerificationCode,
|
||||||
|
setNewEmail,
|
||||||
|
setNewPhone,
|
||||||
|
setNewUserName,
|
||||||
|
SetNewCheckCode,
|
||||||
|
} from "@/api/system/user.js";
|
||||||
|
var timer = "";
|
||||||
|
var countdown = 60;
|
||||||
|
export default {
|
||||||
|
name: "account",
|
||||||
|
props: {
|
||||||
|
user: {
|
||||||
|
required: true,
|
||||||
|
default: () => {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
IsCanConnectInternet: {
|
||||||
|
required: true,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
userForm: {},
|
||||||
|
sendDisabled: true,
|
||||||
|
sendTitle: this.$t("trials:trials-myinfo:button:getVCode"),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 修改校验码
|
||||||
|
async setNewUserCheckCode() {
|
||||||
|
try {
|
||||||
|
let res = await SetNewCheckCode(this.userForm.CheckCode);
|
||||||
|
if (res.IsSuccess) {
|
||||||
|
this.userForm.CheckCode = "";
|
||||||
|
this.$message.success(
|
||||||
|
this.$t("trials:trials-myinfo:message:updateSuccessfully")
|
||||||
|
);
|
||||||
|
this.$emit("getUserInfo");
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setNewEmail() {
|
||||||
|
setNewEmail(this.userForm.EMail, this.userForm.VerificationCode).then(
|
||||||
|
() => {
|
||||||
|
this.userForm.EMail = "";
|
||||||
|
this.userForm.VerificationCode = "";
|
||||||
|
this.$message.success(
|
||||||
|
this.$t("trials:trials-myinfo:message:updateSuccessfully")
|
||||||
|
);
|
||||||
|
this.$emit("getUserInfo");
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
setNewUserName() {
|
||||||
|
setNewUserName(this.userForm.UserName).then(() => {
|
||||||
|
this.userForm.UserName = "";
|
||||||
|
this.$message.success(
|
||||||
|
this.$t("trials:trials-myinfo:message:updateSuccessfully")
|
||||||
|
);
|
||||||
|
this.$emit("getUserInfo");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setNewPhone() {
|
||||||
|
setNewPhone(this.userForm.Phone).then(() => {
|
||||||
|
this.userForm.Phone = "";
|
||||||
|
this.$message.success(
|
||||||
|
this.$t("trials:trials-myinfo:message:updateSuccessfully")
|
||||||
|
);
|
||||||
|
this.$emit("getUserInfo");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleEmailChange() {
|
||||||
|
var reg =
|
||||||
|
/^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/;
|
||||||
|
if (this.userForm.EMail && reg.test(this.userForm.EMail)) {
|
||||||
|
this.sendDisabled = false;
|
||||||
|
} else {
|
||||||
|
this.sendDisabled = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sendVerificationCode() {
|
||||||
|
sendVerificationCode(this.userForm.EMail).then(() => {
|
||||||
|
this.settime(this);
|
||||||
|
// 发送成功
|
||||||
|
this.$message.success(
|
||||||
|
this.$t("trials:trials-myinfo:message:sendSuccessfully")
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
settime(obj) {
|
||||||
|
if (countdown === 0) {
|
||||||
|
obj.sendDisabled = false;
|
||||||
|
obj.sendTitle = this.$t("trials:trials-myinfo:button:getVCode"); // '获取验证码'
|
||||||
|
countdown = 60;
|
||||||
|
clearTimeout(timer);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
obj.sendDisabled = true;
|
||||||
|
obj.sendTitle = `${this.$t(
|
||||||
|
"trials:trials-myinfo:button:wait"
|
||||||
|
)}(${countdown}s)`;
|
||||||
|
countdown--;
|
||||||
|
// eslint-disable-next-line no-self-assign
|
||||||
|
countdown = countdown;
|
||||||
|
timer = setTimeout(function () {
|
||||||
|
obj.settime(obj);
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -1,385 +1,202 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="trial-myinfo">
|
<div class="trial-myinfo">
|
||||||
<div class="trial-myinfo-left">
|
<el-menu
|
||||||
<div class="trial-myinfo-left-top">
|
:default-active="activeIndex"
|
||||||
<div class="trial-myinfo-head">
|
@select="handleSelect"
|
||||||
<!-- 个人头像 -->
|
class="el-menu-demo"
|
||||||
{{ $t('trials:trials-myinfo:title:avater') }}
|
style="width: 200px"
|
||||||
</div>
|
>
|
||||||
<div class="trial-myinfo-body">
|
<el-menu-item index="1">{{
|
||||||
<div>
|
$t("trials:trials-myinfo:menuTitle:mine")
|
||||||
{{ user.LastName }}
|
}}</el-menu-item>
|
||||||
</div>
|
<el-menu-item index="2">{{
|
||||||
</div>
|
$t("trials:trials-myinfo:menuTitle:account")
|
||||||
</div>
|
}}</el-menu-item>
|
||||||
<div class="trial-myinfo-left-bottom">
|
<el-menu-item index="3">{{
|
||||||
<div class="trial-myinfo-head">
|
$t("trials:trials-myinfo:menuTitle:password")
|
||||||
<!-- 用户基本信息 -->
|
}}</el-menu-item>
|
||||||
{{ $t('trials:trials-myinfo:title:basicInfo') }}
|
<el-menu-item index="4">{{
|
||||||
</div>
|
$t("trials:trials-myinfo:menuTitle:loginLog")
|
||||||
<el-form ref="userForm" label-position="right" :model="user" :rules="userFormRules" label-width="120px">
|
}}</el-menu-item>
|
||||||
<el-form-item v-if="user.Code" label="ID: " prop="Code">
|
</el-menu>
|
||||||
<el-input v-model="user.Code" disabled />
|
<div class="contentBox">
|
||||||
</el-form-item>
|
<mine
|
||||||
<!-- 姓 -->
|
:user="user"
|
||||||
<el-form-item :disabled="user.UserTypeEnum === 8" :label="$t('trials:trials-myinfo:form:surname')" prop="LastName">
|
:userTypeOptions="userTypeOptions"
|
||||||
<el-input v-model="user.LastName" :placeholder="$t('trials:trials-myinfo:form:surname')"/>
|
v-if="activeIndex === '1'"
|
||||||
</el-form-item>
|
/>
|
||||||
<!-- 名 -->
|
<account
|
||||||
<el-form-item :disabled="user.UserTypeEnum === 8" :label="$t('trials:trials-myinfo:form:givenname')" prop="FirstName">
|
:user="user"
|
||||||
<el-input v-model="user.FirstName" :placeholder="$t('trials:trials-myinfo:form:givenname')"/>
|
@getUserInfo="getUserInfo"
|
||||||
</el-form-item>
|
:IsCanConnectInternet="IsCanConnectInternet"
|
||||||
<!-- 性别 -->
|
v-if="activeIndex === '2'"
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:gender')" prop="Sex" style="margin-right:40px;">
|
/>
|
||||||
<el-radio-group v-model="user.Sex">
|
<password v-if="activeIndex === '3'" />
|
||||||
<el-radio :label="1">Male</el-radio>
|
<login-log v-if="activeIndex === '4'" :name="userName" :isMine="true" />
|
||||||
<el-radio :label="0">Female</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 单位 -->
|
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:organization')" prop="OrganizationName">
|
|
||||||
<el-input v-model="user.OrganizationName" :placeholder="$t('trials:trials-myinfo:form:organization')"/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 部门 -->
|
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:department')" prop="DepartmentName">
|
|
||||||
<el-input v-model="user.DepartmentName" :placeholder="$t('trials:trials-myinfo:form:organization')"/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 职位 -->
|
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:position')" prop="PositionName">
|
|
||||||
<el-input v-model="user.PositionName" :placeholder="$t('trials:trials-myinfo:form:position')"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<!-- 保存 -->
|
|
||||||
<el-button
|
|
||||||
class="trial-info-btn"
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
@click="handleSave"
|
|
||||||
>
|
|
||||||
{{ $t('trials:trials-myinfo:button:save') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="trial-myinfo-right">
|
|
||||||
<div class="trial-myinfo-right-box">
|
|
||||||
<div class="trial-myinfo-head">
|
|
||||||
<!-- 账号信息 -->
|
|
||||||
{{ $t('trials:trials-myinfo:title:accountInfo') }}
|
|
||||||
</div>
|
|
||||||
<el-form label-position="right" label-width="150px">
|
|
||||||
<!-- 用户名 -->
|
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:userName')" style="margin-bottom: 5px;" prop="UserName">
|
|
||||||
<span>{{ user.UserName }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" style="position: relative" prop="UserName">
|
|
||||||
<el-input v-model="userForm.UserName" :placeholder="$t('trials:trials-myinfo:form:userName')"/>
|
|
||||||
<!-- 修改 -->
|
|
||||||
<el-button :disabled="!userForm.UserName" class="saveBtn" type="primary" size="small" @click="setNewUserName">
|
|
||||||
{{ $t('trials:trials-myinfo:button:update') }}
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 电话 -->
|
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:phone')" style="margin-bottom: 5px;" prop="UserName">
|
|
||||||
<span>{{ user.Phone }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" style="position: relative" prop="UserName">
|
|
||||||
<el-input v-model="userForm.Phone" :placeholder="$t('trials:trials-myinfo:form:phone')"/>
|
|
||||||
<!-- 修改 -->
|
|
||||||
<el-button :disabled="!userForm.Phone" class="saveBtn" type="primary" size="small" @click="setNewPhone">
|
|
||||||
{{ $t('trials:trials-myinfo:button:update') }}
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 邮箱 -->
|
|
||||||
<el-form-item :label="$t('trials:trials-myinfo:form:email')" style="margin-bottom: 5px;" prop="UserName">
|
|
||||||
<span>{{ user.EMail }}</span>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" style="margin-bottom: 10px;position: relative" prop="EMail">
|
|
||||||
<el-input v-model="userForm.EMail" @input="handleEmailChange" :placeholder="$t('trials:trials-myinfo:form:email')"/>
|
|
||||||
<el-button class="sendCode" :disabled="sendDisabled" type="primary" size="mini" @click="sendVerificationCode">{{ sendTitle }}</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="" style="position: relative" prop="VerificationCode">
|
|
||||||
<el-input v-model="userForm.VerificationCode" :placeholder="$t('trials:researchForm:form:verifyCode')"/>
|
|
||||||
<!-- 修改 -->
|
|
||||||
<el-button :disabled="!userForm.EMail || !userForm.VerificationCode || sendDisabled" class="saveBtn" type="primary" size="small" @click="setNewEmail">
|
|
||||||
{{ $t('trials:trials-myinfo:button:update') }}
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
<div class="trial-myinfo-right-box">
|
|
||||||
<div class="trial-myinfo-head">
|
|
||||||
<!-- 修改密码 -->
|
|
||||||
{{ $t('trials:trials-myinfo:title:updatePaasord') }}
|
|
||||||
</div>
|
|
||||||
<el-form ref="passwordForm" label-position="right" :model="password" :rules="passwordFormRules" label-width="150px">
|
|
||||||
<!-- 旧密码 -->
|
|
||||||
<el-form-item :label="$t('recompose:form:oldPassword')" prop="OldPassWord">
|
|
||||||
<el-input v-model="password.OldPassWord" type="password" show-password auto-complete="new-password" :placeholder="$t('recompose:form:oldPassword')"/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 新密码 -->
|
|
||||||
<el-form-item :label="$t('recompose:form:newPassword')" prop="NewPassWord">
|
|
||||||
<el-input v-model="password.NewPassWord" type="password" show-password auto-complete="new-password" :placeholder="$t('recompose:form:newPassword')"/>
|
|
||||||
</el-form-item>
|
|
||||||
<!-- 确认密码 -->
|
|
||||||
<el-form-item :label="$t('recompose:form:confirmPassword')" prop="ConfirmPassWord">
|
|
||||||
<el-input v-model="password.ConfirmPassWord" type="password" show-password auto-complete="new-password" :placeholder="$t('recompose:form:confirmPassword')"/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
class="trial-info-btn"
|
|
||||||
@click="save"
|
|
||||||
>
|
|
||||||
{{ $t('trials:trials-myinfo:button:save') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getUserTypeList, getUser, updateUser, modifyPassword } from '@/api/admin.js'
|
import mine from "./mine.vue";
|
||||||
import { sendVerificationCode, setNewEmail, setNewPhone, setNewUserName } from '@/api/system/user.js'
|
import account from "./account.vue";
|
||||||
import md5 from 'js-md5'
|
import password from "./password.vue";
|
||||||
var timer = ''
|
import loginLog from "@/views/trials/trials-panel/trial-summary/login-log";
|
||||||
var countdown = 60
|
import { getUserTypeList, getUser } from "@/api/admin.js";
|
||||||
import store from '@/store'
|
import { getHospital } from "@/api/hospital.js";
|
||||||
import {mapGetters, mapMutations} from 'vuex'
|
import store from "@/store";
|
||||||
|
import { mapGetters } from "vuex";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: "TrialsMyinfo",
|
||||||
name: 'TrialsMyinfo',
|
components: { mine, account, password, "login-log": loginLog },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
activeIndex: "1",
|
||||||
|
|
||||||
userTypeOptions: [],
|
userTypeOptions: [],
|
||||||
user: {},
|
user: {},
|
||||||
password: {},
|
IsCanConnectInternet: true, // 是否可以链接互联网
|
||||||
userForm: {},
|
};
|
||||||
sendDisabled: true,
|
|
||||||
sendTitle: this.$t('trials:trials-myinfo:button:getVCode'),
|
|
||||||
userFormRules: {
|
|
||||||
UserName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
|
|
||||||
UserTypeId: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }],
|
|
||||||
IsZhiZhun: [{ required: true, message: this.$t('common:ruleMessage:select'), trigger: ['blur', 'change'] }],
|
|
||||||
OrganizationName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
|
|
||||||
LastName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }, { max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` }],
|
|
||||||
FirstName: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }, { max: 50, message: `${this.$t('common:ruleMessage:maxLength')} 50` }],
|
|
||||||
Sex: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
|
|
||||||
Status: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }]
|
|
||||||
},
|
|
||||||
passwordFormRules: {
|
|
||||||
OldPassWord: [{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' }],
|
|
||||||
NewPassWord: [
|
|
||||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
trigger: 'blur',
|
|
||||||
validator: this.$validatePassword
|
|
||||||
},
|
|
||||||
],
|
|
||||||
ConfirmPassWord: [
|
|
||||||
{ required: true, message: this.$t('common:ruleMessage:specify'), trigger: 'blur' },
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
trigger: 'blur',
|
|
||||||
validator: this.$validatePassword
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userId', 'name'])
|
...mapGetters(["userId", "name"]),
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getUserInfo()
|
this.getUserInfo();
|
||||||
this.getUserTypeList()
|
this.getUserTypeList();
|
||||||
|
this.getInfo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations({ setLanguage: 'lang/setLanguage' }),
|
// 获取医院信息
|
||||||
handleSave() {
|
async getInfo() {
|
||||||
this.$refs.userForm.validate(valid => {
|
try {
|
||||||
console.log(valid)
|
let res = await getHospital();
|
||||||
if (valid) {
|
if (res.IsSuccess) {
|
||||||
this.isDisabled = true
|
this.IsCanConnectInternet = res.Result.IsCanConnectInternet;
|
||||||
const selectedUserType = this.userTypeOptions.filter((item) => {
|
|
||||||
return item.Id === this.user.UserTypeId
|
|
||||||
})
|
|
||||||
if (selectedUserType.length > 0) {
|
|
||||||
this.user.userTypeEnum = selectedUserType[0].UserTypeEnum
|
|
||||||
}
|
|
||||||
// if (this.user.IsZhiZhun === true) {
|
|
||||||
// this.user.OrganizationName = 'ZhiZhun'
|
|
||||||
// }
|
|
||||||
if (this.user.Id) {
|
|
||||||
updateUser(this.user).then(res => {
|
|
||||||
this.isDisabled = false
|
|
||||||
this.$message.success(this.$t('trials:trials-myinfo:message:updateSuccessfully'))
|
|
||||||
this.getUserInfo()
|
|
||||||
}).catch(() => { this.isDisabled = false })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
} catch (err) {
|
||||||
},
|
console.log(err);
|
||||||
handleEmailChange() {
|
|
||||||
var reg = /^[A-Za-z0-9]+([_\.][A-Za-z0-9]+)*@([A-Za-z0-9\-]+\.)+[A-Za-z]{2,6}$/
|
|
||||||
if (this.userForm.EMail && reg.test(this.userForm.EMail)) {
|
|
||||||
this.sendDisabled = false
|
|
||||||
} else {
|
|
||||||
this.sendDisabled = true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
sendVerificationCode() {
|
handleSelect(index) {
|
||||||
sendVerificationCode(this.userForm.EMail).then(() => {
|
this.activeIndex = index;
|
||||||
this.settime(this)
|
|
||||||
// 发送成功
|
|
||||||
this.$message.success(this.$t('trials:trials-myinfo:message:sendSuccessfully'))
|
|
||||||
})
|
|
||||||
},
|
|
||||||
save() {
|
|
||||||
this.$refs.passwordForm.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.password.NewPassWord !== this.password.ConfirmPassWord) {
|
|
||||||
this.$alert(this.$t('passwordReset:formRule:passwordsDiffer'))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const param = {
|
|
||||||
UserId: this.userId,
|
|
||||||
NewPassWord: md5(this.password.NewPassWord),
|
|
||||||
OldPassWord: md5(this.password.OldPassWord)
|
|
||||||
}
|
|
||||||
modifyPassword(param).then(res => {
|
|
||||||
if (res.IsSuccess) {
|
|
||||||
// 修改成功,请重新登录账号
|
|
||||||
this.$message.success(this.$t('trials:trials-myinfo:message:modifyPWSuccessfully'))
|
|
||||||
setTimeout(() => {
|
|
||||||
this.logout()
|
|
||||||
}, 1000)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setNewEmail() {
|
|
||||||
setNewEmail(this.userForm.EMail, this.userForm.VerificationCode).then(() => {
|
|
||||||
this.userForm.EMail = ''
|
|
||||||
this.userForm.VerificationCode = ''
|
|
||||||
this.$message.success(this.$t('trials:trials-myinfo:message:updateSuccessfully'))
|
|
||||||
this.getUserInfo()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setNewUserName() {
|
|
||||||
setNewUserName(this.userForm.UserName).then(() => {
|
|
||||||
this.userForm.UserName = ''
|
|
||||||
this.$message.success(this.$t('trials:trials-myinfo:message:updateSuccessfully'))
|
|
||||||
this.getUserInfo()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setNewPhone() {
|
|
||||||
setNewPhone(this.userForm.Phone).then(() => {
|
|
||||||
this.userForm.Phone = ''
|
|
||||||
this.$message.success(this.$t('trials:trials-myinfo:message:updateSuccessfully'))
|
|
||||||
this.getUserInfo()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
getUserInfo() {
|
getUserInfo() {
|
||||||
const loading = this.$loading({
|
const loading = this.$loading({
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
lock: true,
|
lock: true,
|
||||||
text: 'Loading',
|
text: "Loading",
|
||||||
spinner: 'el-icon-loading',
|
spinner: "el-icon-loading",
|
||||||
background: 'rgba(0, 0, 0, 0.07)'
|
background: "rgba(0, 0, 0, 0.07)",
|
||||||
})
|
});
|
||||||
getUser(this.userId).then(async res => {
|
getUser(this.userId)
|
||||||
this.user = res.Result
|
.then(async (res) => {
|
||||||
/* eslint-disable */
|
this.user = res.Result;
|
||||||
zzSessionStorage.setItem('realName', this.user.RealName)
|
/* eslint-disable */
|
||||||
await store.dispatch('user/updateInfo')
|
zzSessionStorage.setItem("realName", this.user.RealName);
|
||||||
loading.close()
|
await store.dispatch("user/updateInfo");
|
||||||
}).catch(() => { loading.close() })
|
loading.close();
|
||||||
},
|
})
|
||||||
settime(obj) {
|
.catch(() => {
|
||||||
if (countdown === 0) {
|
loading.close();
|
||||||
obj.sendDisabled = false
|
});
|
||||||
obj.sendTitle = this.$t('trials:trials-myinfo:button:getVCode')// '获取验证码'
|
|
||||||
countdown = 60
|
|
||||||
clearTimeout(timer)
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
obj.sendDisabled = true
|
|
||||||
obj.sendTitle = `${this.$t('trials:trials-myinfo:button:wait')}(${countdown}s)`
|
|
||||||
countdown--
|
|
||||||
// eslint-disable-next-line no-self-assign
|
|
||||||
countdown = countdown
|
|
||||||
timer = setTimeout(function() {
|
|
||||||
obj.settime(obj)
|
|
||||||
}, 1000)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getUserTypeList() {
|
getUserTypeList() {
|
||||||
getUserTypeList().then(res => {
|
getUserTypeList().then((res) => {
|
||||||
if (res.IsSuccess) {
|
if (res.IsSuccess) {
|
||||||
this.userTypeOptions = res.Result
|
this.userTypeOptions = res.Result;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
async logout() {
|
},
|
||||||
/* eslint-disable */
|
};
|
||||||
var loginType = zzSessionStorage.getItem('loginType')
|
|
||||||
await this.$store.dispatch('user/logout')
|
|
||||||
if (loginType) {
|
|
||||||
this.$router.push(`/login?loginType=${loginType}`)
|
|
||||||
} else {
|
|
||||||
this.$router.push(`/login`)
|
|
||||||
}
|
|
||||||
this.$i18n.locale = 'zh'
|
|
||||||
this.setLanguage('zh')
|
|
||||||
this.$updateDictionary()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.trial-myinfo{
|
.trial-myinfo {
|
||||||
flex: 1;overflow: auto;display: flex;flex-direction: row;justify-content: space-around;
|
flex: 1;
|
||||||
.trial-myinfo-head{
|
overflow: auto;
|
||||||
position: absolute;top: 40px;left: -10%;font-size: 14px;
|
display: flex;
|
||||||
}
|
flex-direction: row;
|
||||||
.trial-myinfo-left{
|
justify-content: space-around;
|
||||||
overflow: auto;
|
.contentBox {
|
||||||
background: #fff;width: calc(50% - 9px);margin: 6px 0;
|
width: calc(100% - 220px);
|
||||||
padding-bottom: 50px;
|
background-color: #fff;
|
||||||
.trial-myinfo-left-top{
|
padding: 20px;
|
||||||
width: 70%;padding-top: 100px;position: relative;margin: 0 auto;margin-bottom: 10px;
|
// padding-bottom: 50px;
|
||||||
.trial-myinfo-body{
|
}
|
||||||
width:160px;height:160px;border-radius: 50%;background: #428bca;display: flex;justify-content: center;align-items: center;
|
.trial-myinfo-head {
|
||||||
div{
|
position: absolute;
|
||||||
color:#fff;font-size: 30px;
|
top: 40px;
|
||||||
}
|
left: 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.trial-myinfo-left {
|
||||||
|
overflow: auto;
|
||||||
|
background: #fff;
|
||||||
|
// width: calc(50% - 9px);
|
||||||
|
margin: 6px 0;
|
||||||
|
height: 100%;
|
||||||
|
// padding-bottom: 50px;
|
||||||
|
.trial-myinfo-left-top {
|
||||||
|
width: 70%;
|
||||||
|
padding-top: 100px;
|
||||||
|
position: relative;
|
||||||
|
// margin: 0 auto;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
.trial-myinfo-body {
|
||||||
|
width: 160px;
|
||||||
|
height: 160px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #428bca;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 30px;
|
||||||
|
div {
|
||||||
|
color: #fff;
|
||||||
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.saveBtn{
|
}
|
||||||
position: absolute;right: -10px;top:2px;transform: translateX(100%)
|
.saveBtn {
|
||||||
|
position: absolute;
|
||||||
|
right: -10px;
|
||||||
|
top: 2px;
|
||||||
|
transform: translateX(100%);
|
||||||
|
}
|
||||||
|
.trial-info-btn {
|
||||||
|
position: absolute;
|
||||||
|
bottom: -60px;
|
||||||
|
left: calc(100% + 10px);
|
||||||
|
min-width: 97px;
|
||||||
|
}
|
||||||
|
.trial-myinfo-left-bottom {
|
||||||
|
width: 40%;
|
||||||
|
padding-top: 100px;
|
||||||
|
position: relative;
|
||||||
|
// margin: 0 auto;
|
||||||
|
}
|
||||||
|
.trial-myinfo-right {
|
||||||
|
overflow: auto;
|
||||||
|
background: #fff;
|
||||||
|
// width: calc(50% - 9px);
|
||||||
|
margin: 6px 0;
|
||||||
|
padding-bottom: 50px;
|
||||||
|
.sendCode {
|
||||||
|
position: absolute;
|
||||||
|
right: -10px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(100%, -50%);
|
||||||
}
|
}
|
||||||
.trial-info-btn{
|
.trial-myinfo-right-box {
|
||||||
position: absolute;bottom: -60px;left: calc(100% + 10px);min-width: 97px;
|
width: 40%;
|
||||||
}
|
padding-top: 100px;
|
||||||
.trial-myinfo-left-bottom{
|
position: relative;
|
||||||
width: 70%;padding-top: 100px;position: relative;margin: 0 auto;
|
// margin: 0 auto;
|
||||||
}
|
|
||||||
.trial-myinfo-right{
|
|
||||||
overflow: auto;
|
|
||||||
background: #fff;width: calc(50% - 9px);margin: 6px 0;
|
|
||||||
padding-bottom: 50px;
|
|
||||||
.sendCode {
|
|
||||||
position: absolute;right: -10px;top: 50%;transform: translate(100%, -50%);
|
|
||||||
}
|
|
||||||
.trial-myinfo-right-box{
|
|
||||||
width: 70%;padding-top: 100px;position: relative;margin: 0 auto;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -0,0 +1,209 @@
|
||||||
|
<template>
|
||||||
|
<div class="trial-myinfo-left">
|
||||||
|
<div class="trial-myinfo-left-top">
|
||||||
|
<div class="trial-myinfo-head">
|
||||||
|
<!-- 个人头像 -->
|
||||||
|
{{ $t("trials:trials-myinfo:title:avater") }}
|
||||||
|
</div>
|
||||||
|
<div class="trial-myinfo-body">
|
||||||
|
<div>
|
||||||
|
{{ user.LastName }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="trial-myinfo-left-bottom">
|
||||||
|
<div class="trial-myinfo-head">
|
||||||
|
<!-- 用户基本信息 -->
|
||||||
|
{{ $t("trials:trials-myinfo:title:basicInfo") }}
|
||||||
|
</div>
|
||||||
|
<el-form
|
||||||
|
ref="userForm"
|
||||||
|
label-position="right"
|
||||||
|
:model="user"
|
||||||
|
:rules="userFormRules"
|
||||||
|
label-width="120px"
|
||||||
|
>
|
||||||
|
<el-form-item v-if="user.Code" label="ID: " prop="Code">
|
||||||
|
<el-input v-model="user.Code" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 姓 -->
|
||||||
|
<el-form-item
|
||||||
|
:disabled="user.UserTypeEnum === 8"
|
||||||
|
:label="$t('trials:trials-myinfo:form:surname')"
|
||||||
|
prop="LastName"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="user.LastName"
|
||||||
|
:placeholder="$t('trials:trials-myinfo:form:surname')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 名 -->
|
||||||
|
<el-form-item
|
||||||
|
:disabled="user.UserTypeEnum === 8"
|
||||||
|
:label="$t('trials:trials-myinfo:form:givenname')"
|
||||||
|
prop="FirstName"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="user.FirstName"
|
||||||
|
:placeholder="$t('trials:trials-myinfo:form:givenname')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 单位 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:trials-myinfo:form:organization')"
|
||||||
|
prop="OrganizationName"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="user.OrganizationName"
|
||||||
|
:placeholder="$t('trials:trials-myinfo:form:organization')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 部门 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:trials-myinfo:form:department')"
|
||||||
|
prop="DepartmentName"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="user.DepartmentName"
|
||||||
|
:placeholder="$t('trials:trials-myinfo:form:organization')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 职位 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('trials:trials-myinfo:form:position')"
|
||||||
|
prop="PositionName"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="user.PositionName"
|
||||||
|
:placeholder="$t('trials:trials-myinfo:form:position')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<!-- 保存 -->
|
||||||
|
<el-button
|
||||||
|
class="trial-info-btn"
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="handleSave"
|
||||||
|
>
|
||||||
|
{{ $t("trials:trials-myinfo:button:save") }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { updateUser } from "@/api/admin.js";
|
||||||
|
export default {
|
||||||
|
name: "mine",
|
||||||
|
props: {
|
||||||
|
user: {
|
||||||
|
required: true,
|
||||||
|
default: () => {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
userTypeOptions: {
|
||||||
|
required: true,
|
||||||
|
default: () => {
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
userFormRules: {
|
||||||
|
UserName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:specify"),
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
UserTypeId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:select"),
|
||||||
|
trigger: ["blur", "change"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
IsZhiZhun: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:select"),
|
||||||
|
trigger: ["blur", "change"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
OrganizationName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:specify"),
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
LastName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:specify"),
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{ max: 50, message: `${this.$t("common:ruleMessage:maxLength")} 50` },
|
||||||
|
],
|
||||||
|
FirstName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:specify"),
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{ max: 50, message: `${this.$t("common:ruleMessage:maxLength")} 50` },
|
||||||
|
],
|
||||||
|
Sex: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:specify"),
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
Status: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:specify"),
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSave() {
|
||||||
|
this.$refs.userForm.validate((valid) => {
|
||||||
|
console.log(valid);
|
||||||
|
if (valid) {
|
||||||
|
this.isDisabled = true;
|
||||||
|
const selectedUserType = this.userTypeOptions.filter((item) => {
|
||||||
|
return item.Id === this.user.UserTypeId;
|
||||||
|
});
|
||||||
|
if (selectedUserType.length > 0) {
|
||||||
|
this.user.userTypeEnum = selectedUserType[0].UserTypeEnum;
|
||||||
|
}
|
||||||
|
// if (this.user.IsZhiZhun === true) {
|
||||||
|
// this.user.OrganizationName = 'ZhiZhun'
|
||||||
|
// }
|
||||||
|
if (this.user.Id) {
|
||||||
|
updateUser(this.user)
|
||||||
|
.then((res) => {
|
||||||
|
this.isDisabled = false;
|
||||||
|
this.$message.success(
|
||||||
|
this.$t("trials:trials-myinfo:message:updateSuccessfully")
|
||||||
|
);
|
||||||
|
this.getUserInfo();
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.isDisabled = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -0,0 +1,156 @@
|
||||||
|
<template>
|
||||||
|
<div class="trial-myinfo-right">
|
||||||
|
<div class="trial-myinfo-right-box">
|
||||||
|
<div class="trial-myinfo-head">
|
||||||
|
<!-- 修改密码 -->
|
||||||
|
{{ $t("trials:trials-myinfo:title:updatePaasord") }}
|
||||||
|
</div>
|
||||||
|
<el-form
|
||||||
|
ref="passwordForm"
|
||||||
|
label-position="right"
|
||||||
|
:model="password"
|
||||||
|
:rules="passwordFormRules"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<!-- 旧密码 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('recompose:form:oldPassword')"
|
||||||
|
prop="OldPassWord"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="password.OldPassWord"
|
||||||
|
type="password"
|
||||||
|
show-password
|
||||||
|
auto-complete="new-password"
|
||||||
|
:placeholder="$t('recompose:form:oldPassword')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 新密码 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('recompose:form:newPassword')"
|
||||||
|
prop="NewPassWord"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="password.NewPassWord"
|
||||||
|
type="password"
|
||||||
|
show-password
|
||||||
|
auto-complete="new-password"
|
||||||
|
:placeholder="$t('recompose:form:newPassword')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- 确认密码 -->
|
||||||
|
<el-form-item
|
||||||
|
:label="$t('recompose:form:confirmPassword')"
|
||||||
|
prop="ConfirmPassWord"
|
||||||
|
>
|
||||||
|
<el-input
|
||||||
|
v-model="password.ConfirmPassWord"
|
||||||
|
type="password"
|
||||||
|
show-password
|
||||||
|
auto-complete="new-password"
|
||||||
|
:placeholder="$t('recompose:form:confirmPassword')"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
class="trial-info-btn"
|
||||||
|
@click="save"
|
||||||
|
>
|
||||||
|
{{ $t("trials:trials-myinfo:button:save") }}
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import md5 from "js-md5";
|
||||||
|
import { mapGetters, mapMutations } from "vuex";
|
||||||
|
import { modifyPassword } from "@/api/admin.js";
|
||||||
|
export default {
|
||||||
|
name: "password",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
password: {},
|
||||||
|
passwordFormRules: {
|
||||||
|
OldPassWord: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:specify"),
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
NewPassWord: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:specify"),
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
trigger: "blur",
|
||||||
|
validator: this.$validatePassword,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
ConfirmPassWord: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t("common:ruleMessage:specify"),
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
trigger: "blur",
|
||||||
|
validator: this.$validatePassword,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(["userId"]),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapMutations({ setLanguage: "lang/setLanguage" }),
|
||||||
|
save() {
|
||||||
|
this.$refs.passwordForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.password.NewPassWord !== this.password.ConfirmPassWord) {
|
||||||
|
this.$alert(this.$t("passwordReset:formRule:passwordsDiffer"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const param = {
|
||||||
|
UserId: this.userId,
|
||||||
|
NewPassWord: md5(this.password.NewPassWord),
|
||||||
|
OldPassWord: md5(this.password.OldPassWord),
|
||||||
|
};
|
||||||
|
modifyPassword(param).then((res) => {
|
||||||
|
if (res.IsSuccess) {
|
||||||
|
// 修改成功,请重新登录账号
|
||||||
|
this.$message.success(
|
||||||
|
this.$t("trials:trials-myinfo:message:modifyPWSuccessfully")
|
||||||
|
);
|
||||||
|
setTimeout(() => {
|
||||||
|
this.logout();
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async logout() {
|
||||||
|
/* eslint-disable */
|
||||||
|
var loginType = zzSessionStorage.getItem("loginType");
|
||||||
|
await this.$store.dispatch("user/logout");
|
||||||
|
if (loginType) {
|
||||||
|
this.$router.push(`/login?loginType=${loginType}`);
|
||||||
|
} else {
|
||||||
|
this.$router.push(`/login`);
|
||||||
|
}
|
||||||
|
this.$i18n.locale = "zh";
|
||||||
|
this.setLanguage("zh");
|
||||||
|
this.$updateDictionary();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<BaseContainer>
|
<BaseContainer>
|
||||||
<template slot="search-container">
|
<template slot="search-container" v-if="!isMine">
|
||||||
<el-form :inline="true">
|
<el-form :inline="true">
|
||||||
<el-form-item
|
<el-form-item
|
||||||
:label="$t('trials:loginLog:table:optType')"
|
:label="$t('trials:loginLog:table:optType')"
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
<template slot="main-container">
|
<template slot="main-container">
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
v-adaptive="{ bottomOffset: 60 }"
|
v-adaptive="{ bottomOffset: isMine ? 80 : 60 }"
|
||||||
height="100"
|
height="100"
|
||||||
:data="list"
|
:data="list"
|
||||||
class="table"
|
class="table"
|
||||||
|
@ -199,12 +199,23 @@ const searchDataDefault = () => {
|
||||||
EndDate: "",
|
EndDate: "",
|
||||||
Asc: false,
|
Asc: false,
|
||||||
SortField: "CreateTime",
|
SortField: "CreateTime",
|
||||||
|
LoginUserName: null,
|
||||||
PageIndex: 1,
|
PageIndex: 1,
|
||||||
PageSize: 20,
|
PageSize: 20,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
export default {
|
export default {
|
||||||
components: { BaseContainer, Pagination },
|
components: { BaseContainer, Pagination },
|
||||||
|
props: {
|
||||||
|
isMine: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
moment,
|
moment,
|
||||||
|
@ -222,6 +233,9 @@ export default {
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.searchData.TrialId = this.$route.query.trialId;
|
this.searchData.TrialId = this.$route.query.trialId;
|
||||||
|
if (this.isMine) {
|
||||||
|
this.searchData.LoginUserName = this.name;
|
||||||
|
}
|
||||||
getUserLogList(this.searchData)
|
getUserLogList(this.searchData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
|
@ -1,247 +1,11 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<trials-info />
|
||||||
<el-form
|
|
||||||
ref="userForm"
|
|
||||||
size="small"
|
|
||||||
:model="user"
|
|
||||||
:rules="userFormRules"
|
|
||||||
label-width="150px"
|
|
||||||
style="width:800px;"
|
|
||||||
>
|
|
||||||
<el-card class="Basic" shadow="never" size="small">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span>Basic Information</span>
|
|
||||||
</div>
|
|
||||||
<el-form-item v-if="user.Code" label="ID: " prop="Code">
|
|
||||||
<el-input v-model="user.Code" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="User Name: " prop="UserName">
|
|
||||||
<el-input v-model="user.UserName" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<!-- <el-form-item label="Real Name: " prop="RealName">
|
|
||||||
<el-input v-model="user.RealName" />
|
|
||||||
</el-form-item> -->
|
|
||||||
<el-form-item v-if="user.UserTypeEnum !== 8" label="Surname: " prop="LastName">
|
|
||||||
<el-input v-model="user.LastName" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="user.UserTypeEnum !== 8" label="Given Name: " prop="FirstName">
|
|
||||||
<el-input v-model="user.FirstName" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="Gender: " prop="Sex" style="margin-right:40px;">
|
|
||||||
<el-radio-group v-model="user.Sex">
|
|
||||||
<el-radio :label="1">Male</el-radio>
|
|
||||||
<el-radio :label="0">Female</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="Email: " prop="EMail">
|
|
||||||
<el-input v-model="user.EMail" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="Phone: ">
|
|
||||||
<el-input v-model="user.Phone" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="user.UserTypeEnum !== 8" label="Disable">
|
|
||||||
<el-switch v-model="user.Status" :active-value="0" :inactive-value="1" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="User Type: " prop="UserTypeId">
|
|
||||||
<el-select v-model="user.UserTypeId" size="small" placeholder="Please select" disabled>
|
|
||||||
<el-option
|
|
||||||
v-for="(value,key) of dictionaryList.UserType"
|
|
||||||
:key="key"
|
|
||||||
:label="value"
|
|
||||||
:value="key"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item> -->
|
|
||||||
<!-- <el-form-item label="User Type: " prop="UserTypeId">
|
|
||||||
<el-select ref="userType" v-model="user.UserTypeId" size="small" placeholder="Please select" style="width:100%;">
|
|
||||||
<el-option
|
|
||||||
v-for="(userType,key) of userTypeOptions"
|
|
||||||
:key="key"
|
|
||||||
:label="userType.UserType"
|
|
||||||
:value="userType.Id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item> -->
|
|
||||||
|
|
||||||
<el-form-item label="User Type: " prop="UserType">
|
|
||||||
<el-input v-model="user.UserType" disabled />
|
|
||||||
</el-form-item>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
<el-card v-if="user.UserTypeEnum !== 8" class="Affiliation" shadow="never" style="margin-top:10px;" size="small">
|
|
||||||
<div slot="header" class="clearfix">
|
|
||||||
<span>Affiliation</span>
|
|
||||||
</div>
|
|
||||||
<el-form-item prop="IsZhiZhun">
|
|
||||||
<el-radio-group v-model="user.IsZhiZhun">
|
|
||||||
<el-radio :label="true">Internal</el-radio>
|
|
||||||
<el-radio :label="false">External</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-show="user.IsZhiZhun === false" label="Organization Name: " prop="OrganizationName">
|
|
||||||
<el-input v-model="user.OrganizationName" />
|
|
||||||
</el-form-item>
|
|
||||||
<!-- <el-form-item label="Orgnization Type: " prop="OrganizationTypeId">
|
|
||||||
<el-select
|
|
||||||
v-model="user.OrganizationTypeId"
|
|
||||||
placeholder="Please select"
|
|
||||||
@change="handelOrgnizationTypeChange"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="(value,key) of dictionaryList.InstitutionalType"
|
|
||||||
:key="key"
|
|
||||||
:label="value"
|
|
||||||
:value="key"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item v-show="user.OrganizationTypeId" label="Orgnization: " prop="OrganizationId">
|
|
||||||
<el-select v-model="user.OrganizationId" placeholder="Please select">
|
|
||||||
<el-option
|
|
||||||
v-for="(item) of OrganizationOptions"
|
|
||||||
:key="item.Id"
|
|
||||||
:label="item.InstitutionName"
|
|
||||||
:value="item.Id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item> -->
|
|
||||||
|
|
||||||
<el-form-item label="Department: " prop="DepartmentName">
|
|
||||||
<el-input v-model="user.DepartmentName" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="Position: " prop="PositionName">
|
|
||||||
<el-input v-model="user.PositionName" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-card>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
:disabled="isDisabled"
|
|
||||||
style="margin:10px 15px"
|
|
||||||
@click="handleSave"
|
|
||||||
>Save</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getUserTypeList, getInstitutionList, getUser, addUser, updateUser } from '@/api/admin.js'
|
import TrialsMyinfo from "@/views/trials/trials-myinfo";
|
||||||
import store from '@/store'
|
|
||||||
import { mapGetters } from 'vuex'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
components: {
|
||||||
return {
|
"trials-info": TrialsMyinfo,
|
||||||
user: {},
|
|
||||||
userFormRules: {
|
|
||||||
UserName: [{ required: true, message: 'Please specify', trigger: 'blur' }],
|
|
||||||
UserTypeId: [{ required: true, message: 'Please Select', trigger: ['blur', 'change'] }],
|
|
||||||
// OrganizationId: [{ required: true, message: 'Please specify', trigger: 'blur' }],
|
|
||||||
// OrganizationTypeId: [{ required: true, message: 'Please specify', trigger: 'blur' }],
|
|
||||||
// RealName: [{ required: true, message: 'Please specify', trigger: 'blur' }],
|
|
||||||
IsZhiZhun: [{ required: true, message: 'Please Select', trigger: ['blur', 'change'] }],
|
|
||||||
OrganizationName: [{ required: true, message: 'Please specify', trigger: 'blur' }],
|
|
||||||
LastName: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }],
|
|
||||||
FirstName: [{ required: true, message: 'Please specify', trigger: 'blur' }, { max: 50, message: 'The maximum length is 50' }],
|
|
||||||
|
|
||||||
// Phone: [
|
|
||||||
// { max: 20, min: 7, message: 'The length is 7 to 20' }
|
|
||||||
// ],
|
|
||||||
EMail: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: 'Please input the email address',
|
|
||||||
trigger: 'blur'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'email',
|
|
||||||
message: 'Please input the correct email address',
|
|
||||||
trigger: ['blur', 'change']
|
|
||||||
},
|
|
||||||
{ max: 50, message: 'The maximum length is 50' }
|
|
||||||
],
|
|
||||||
Sex: [{ required: true, message: 'Please specify', trigger: 'blur' }],
|
|
||||||
Status: [{ required: true, message: 'Please specify', trigger: 'blur' }]
|
|
||||||
},
|
|
||||||
// OrganizationOptions: [],
|
|
||||||
userTypeOptions: [],
|
|
||||||
isDisabled: false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
};
|
||||||
...mapGetters(['userId'])
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// this.getUserTypeList()
|
|
||||||
this.initPage()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleSave() {
|
|
||||||
this.$refs.userForm.validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
this.isDisabled = true
|
|
||||||
const selectedUserType = this.userTypeOptions.filter((item) => {
|
|
||||||
return item.Id === this.user.UserTypeId
|
|
||||||
})
|
|
||||||
if (selectedUserType.length > 0) {
|
|
||||||
this.user.userTypeEnum = selectedUserType[0].UserTypeEnum
|
|
||||||
}
|
|
||||||
if (this.user.IsZhiZhun === true) {
|
|
||||||
this.user.OrganizationName = 'ZhiZhun'
|
|
||||||
}
|
|
||||||
if (this.user.Id) {
|
|
||||||
updateUser(this.user).then(res => {
|
|
||||||
this.isDisabled = false
|
|
||||||
this.$message.success('Updated successfully')
|
|
||||||
}).catch(() => { this.isDisabled = false })
|
|
||||||
} else {
|
|
||||||
addUser(this.user).then(res => {
|
|
||||||
this.isDisabled = false
|
|
||||||
this.$emit('getUserId', res.Result.Id)
|
|
||||||
this.$message.success('Added successfully')
|
|
||||||
}).catch(() => { this.isDisabled = false })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getUserInfo() {
|
|
||||||
getUser(this.userId).then(res => {
|
|
||||||
this.user = res.Result
|
|
||||||
// res.Result.OrganizationTypeId !== '00000000-0000-0000-0000-000000000000' ? this.getOrgnizationList(res.Result.OrganizationTypeId) : this.user.OrganizationTypeId = ''
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getUserTypeList() {
|
|
||||||
getUserTypeList().then(res => {
|
|
||||||
if (res.IsSuccess) {
|
|
||||||
this.userTypeOptions = res.Result
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handelOrgnizationTypeChange(val) {
|
|
||||||
if (val) {
|
|
||||||
this.user.OrganizationId = ''
|
|
||||||
this.getOrgnizationList(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getOrgnizationList(OrganizationTypeId) {
|
|
||||||
getInstitutionList(OrganizationTypeId).then(res => {
|
|
||||||
if (res.IsSuccess) {
|
|
||||||
this.OrganizationOptions = res.Result
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async initPage() {
|
|
||||||
this.userId === '' ? await store.dispatch('user/getInfo') : ''
|
|
||||||
|
|
||||||
if (this.userId === '') {
|
|
||||||
await store.dispatch('user/getInfo')
|
|
||||||
}
|
|
||||||
this.getUserInfo()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue