|
@@ -50,7 +50,15 @@
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
<div class="compName-row">
|
|
<div class="compName-row">
|
|
- <span class="compName">{{compName}}</span>
|
|
|
|
|
|
+ <!-- <span class="compName">{{compName}}</span> -->
|
|
|
|
+ <el-select @change='compNameChange' v-model="compName" placeholder="请选择">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in compNameoptions"
|
|
|
|
+ :key="item"
|
|
|
|
+ :label="item"
|
|
|
|
+ :value="item">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
</div>
|
|
</div>
|
|
<div v-if="getDay" class="right-menu-item hover-effect dayClass">
|
|
<div v-if="getDay" class="right-menu-item hover-effect dayClass">
|
|
{{ $t('common.trialDays') }}
|
|
{{ $t('common.trialDays') }}
|
|
@@ -165,8 +173,13 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import {
|
|
import {
|
|
- changePasswordByPwd
|
|
|
|
|
|
+ changePasswordByPwd,
|
|
|
|
+ getcomp
|
|
} from '@/model/indexRx'
|
|
} from '@/model/indexRx'
|
|
|
|
+ import { fastLogin, logout, login,complogin, getRoule, getCurrentUserInfo, companyInfo, isLandBased, getAccountLoginHistoryCount, updateShowInfo }
|
|
|
|
+ from '@/model/indexRx'
|
|
|
|
+ import Cookies from 'js-cookie'
|
|
|
|
+ import { setToken, getCompanyId, clearStorage } from '@/utils/auth'
|
|
import {
|
|
import {
|
|
mapActions,
|
|
mapActions,
|
|
mapGetters,
|
|
mapGetters,
|
|
@@ -176,6 +189,10 @@
|
|
fullscreenToggel,
|
|
fullscreenToggel,
|
|
listenfullscreen
|
|
listenfullscreen
|
|
} from '@/utils/util'
|
|
} from '@/utils/util'
|
|
|
|
+ import {
|
|
|
|
+ getTenantInfoByUser,
|
|
|
|
+} from '@/model/signIn/index'
|
|
|
|
+ import notification from '../../../notification'
|
|
import topMenu from './top-menu'
|
|
import topMenu from './top-menu'
|
|
import topSearch from './top-search'
|
|
import topSearch from './top-search'
|
|
import topTheme from './top-theme'
|
|
import topTheme from './top-theme'
|
|
@@ -243,6 +260,7 @@
|
|
toPageData: {},
|
|
toPageData: {},
|
|
userINfo: {},
|
|
userINfo: {},
|
|
barCode: '',
|
|
barCode: '',
|
|
|
|
+ compNameoptions:[],
|
|
isOpenCodeGun: false,
|
|
isOpenCodeGun: false,
|
|
smAlert: false,
|
|
smAlert: false,
|
|
showList: [
|
|
showList: [
|
|
@@ -288,6 +306,7 @@
|
|
newPassword: '', // 新密码
|
|
newPassword: '', // 新密码
|
|
password: '', // 二次输入密码
|
|
password: '', // 二次输入密码
|
|
},
|
|
},
|
|
|
|
+ loginForm:{},
|
|
// roleName: '',
|
|
// roleName: '',
|
|
// phone: '',
|
|
// phone: '',
|
|
// roleId: '',
|
|
// roleId: '',
|
|
@@ -298,6 +317,7 @@
|
|
compName: localStorage.getItem('ws-pf_compName'),
|
|
compName: localStorage.getItem('ws-pf_compName'),
|
|
companyId: localStorage.getItem('ws-pf_compId'),
|
|
companyId: localStorage.getItem('ws-pf_compId'),
|
|
cangid:'',
|
|
cangid:'',
|
|
|
|
+ UserInfo:JSON.parse(localStorage.getItem('ws_login_getTenantInfoByUser')),
|
|
tmp:{},
|
|
tmp:{},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -309,9 +329,20 @@
|
|
userCompany: localStorage.getItem('ws-pf_compId'),
|
|
userCompany: localStorage.getItem('ws-pf_compId'),
|
|
userName: localStorage.getItem('ws-pf_staffName'),
|
|
userName: localStorage.getItem('ws-pf_staffName'),
|
|
}
|
|
}
|
|
|
|
+
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
listenfullscreen(this.setScreen)
|
|
listenfullscreen(this.setScreen)
|
|
|
|
+ getcomp({userMobilePhone:this.UserInfo.loginInfo.userMobilePhone}).toPromise().then((res)=>{
|
|
|
|
+ this.compNameoptions=res
|
|
|
|
+ })
|
|
|
|
+ // this.complogin({username: Cookies.get('ws_login_account'),
|
|
|
|
+ // password: Cookies.get('ws_login_pwd'),
|
|
|
|
+ // companyName: this.compName})
|
|
|
|
+ // var res=this.complogin({username: Cookies.get('ws_login_account'),
|
|
|
|
+ // password: 111111,
|
|
|
|
+ // companyName: this.compName})
|
|
|
|
+ // console.log(res)
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
...mapState({
|
|
...mapState({
|
|
@@ -349,6 +380,7 @@
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapActions('common', ['setLocalVessels']),
|
|
...mapActions('common', ['setLocalVessels']),
|
|
|
|
+ ...mapActions('user', ['getUserInfo','toSetShow']),
|
|
payCode() {
|
|
payCode() {
|
|
console.log("input", this.barCode)
|
|
console.log("input", this.barCode)
|
|
this.btnStatus = {
|
|
this.btnStatus = {
|
|
@@ -384,6 +416,125 @@
|
|
this.getLook(this.cangid, this.userINfo.userName)
|
|
this.getLook(this.cangid, this.userINfo.userName)
|
|
|
|
|
|
},
|
|
},
|
|
|
|
+ compNameChange(){
|
|
|
|
+ // this.complogin({username:this.UserInfo.loginInfo.userMobilePhone,
|
|
|
|
+ // password: localStorage.getItem('ws-pf_pass'),
|
|
|
|
+ // companyName: this.compName})
|
|
|
|
+ var userInfo={
|
|
|
|
+ username:this.UserInfo.loginInfo.userMobilePhone,
|
|
|
|
+ password: localStorage.getItem('ws-pf_pass'),
|
|
|
|
+ companyName: this.compName
|
|
|
|
+ }
|
|
|
|
+ // var status=0
|
|
|
|
+ const redirect = this.$route.query.redirect
|
|
|
|
+ const { username, password, domainName, companyName } = userInfo
|
|
|
|
+ complogin({
|
|
|
|
+ username: username.trim(),
|
|
|
|
+ password: password,
|
|
|
|
+ domainName: domainName,
|
|
|
|
+ companyName: companyName
|
|
|
|
+ }).toPromise().then((res)=>{
|
|
|
|
+ if(res.data.code=='AUTH_001'){
|
|
|
|
+ Message({showClose: true,
|
|
|
|
+ message: '公司不可切换',
|
|
|
|
+ type: 'error'
|
|
|
|
+ });
|
|
|
|
+ this.compName=localStorage.getItem('ws-pf_compName')
|
|
|
|
+ localStorage.setItem('status', 1)
|
|
|
|
+ }else{
|
|
|
|
+ const { compId,
|
|
|
|
+ tenantId,
|
|
|
|
+ vesselId,
|
|
|
|
+ vesselBankFlag,
|
|
|
|
+ clientFag,
|
|
|
|
+ userId
|
|
|
|
+ } = res.data.data
|
|
|
|
+ // {TYPE='' MESSAGE} [第一次,失效].indexOf(type){type,msg,到期时间}
|
|
|
|
+ // EventBus.$emit('success', '登录成功')
|
|
|
|
+ localStorage.setItem('ws-pf_compId', compId)
|
|
|
|
+ localStorage.setItem('status', 2)
|
|
|
|
+ localStorage.setItem('ws-pf_userId', userId)
|
|
|
|
+ localStorage.setItem('ws-pf_tenantId', tenantId)
|
|
|
|
+ localStorage.setItem('ws-pf_vesselId', vesselId) // 仅适用于一条船
|
|
|
|
+ localStorage.setItem('ws-pf_vesselBankFlag', vesselBankFlag) // 当前登录人是船端还是岸端的人员
|
|
|
|
+ localStorage.setItem('ws-pf_clientFag', clientFag)
|
|
|
|
+ notification.setSessionId(userId) // 设置通知唯一标识
|
|
|
|
+ notification.start() // 开始监听通知
|
|
|
|
+ // 查询当前租户服务类型
|
|
|
|
+ isLandBased().toPromise().then(response => {
|
|
|
|
+ localStorage.setItem('ws-pf_serviceTypeFlag', response)
|
|
|
|
+ })
|
|
|
|
+ companyInfo({ compId: compId }).toPromise().then((res1)=>{
|
|
|
|
+ localStorage.setItem('ws-pf_organMonetaryKey', res1.organizationMonetaryKey)
|
|
|
|
+ localStorage.setItem('ws-pf_compName', res1.compName)
|
|
|
|
+ localStorage.setItem('ws-pf_compDomainName', res1.compDomainName)
|
|
|
|
+ localStorage.setItem('ws-pf_organMonetaryValue', res1.organizationMonetaryValue)
|
|
|
|
+ this.getUserInfo({ vesselBankFlag, compName:res1.compName })
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ this.toSetShow( userId)
|
|
|
|
+ setToken('Admin-Token')
|
|
|
|
+ localStorage.setItem('ws_login_type', 2)
|
|
|
|
+ Cookies.set('ws_login_companyShortName', companyName, {
|
|
|
|
+ expires: 365,
|
|
|
|
+ })
|
|
|
|
+ Cookies.set('ws_login_account', username, {
|
|
|
|
+ expires: 365,
|
|
|
|
+ })
|
|
|
|
+ console.log(username, password, domainName, companyName)
|
|
|
|
+ var rememberMe = Cookies.get('ws_login_rememberMe') === '1'
|
|
|
|
+ if (rememberMe) {
|
|
|
|
+ Cookies.set('ws_login_pwd', password, {
|
|
|
|
+ expires: 365,
|
|
|
|
+ })
|
|
|
|
+ Cookies.set('ws_login_rememberMe', 1, {
|
|
|
|
+ expires: 365
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ Cookies.remove('ws_login_companyShortName')
|
|
|
|
+ Cookies.remove('ws_login_account')
|
|
|
|
+ Cookies.remove('ws_login_pwd')
|
|
|
|
+ Cookies.set('ws_login_rememberMe', 0, {
|
|
|
|
+ expires: 365
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ console.log(redirect)
|
|
|
|
+
|
|
|
|
+ if (redirect) {
|
|
|
|
+ this.$router.replace(redirect)
|
|
|
|
+ } else {
|
|
|
|
+ this.$router.replace('/')
|
|
|
|
+ }
|
|
|
|
+ let newList = {
|
|
|
|
+ companyName: companyName,
|
|
|
|
+ username: username,
|
|
|
|
+ password: password,
|
|
|
|
+ }
|
|
|
|
+ getTenantInfoByUser(newList).toPromise().then((res2)=>{
|
|
|
|
+ console.log(res2)
|
|
|
|
+ localStorage.setItem(
|
|
|
|
+ 'ws_login_getTenantInfoByUser',
|
|
|
|
+ JSON.stringify({
|
|
|
|
+ ...res2,
|
|
|
|
+ loginInfo: res.data.data
|
|
|
|
+ }))
|
|
|
|
+ this.$router.go(0)
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ localStorage.setItem(
|
|
|
|
+ 'ws_login_accountId',
|
|
|
|
+ JSON.stringify(res.data.data.accountId)
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ console.log(localStorage.getItem('status'))
|
|
|
|
+ // } else {
|
|
|
|
+ // this.$message.error("您输入的用户名或密码错误!")
|
|
|
|
+ // return false
|
|
|
|
+ // }
|
|
|
|
+ },
|
|
cancel(){
|
|
cancel(){
|
|
this.barCode = ''
|
|
this.barCode = ''
|
|
this.smAlert = false
|
|
this.smAlert = false
|
|
@@ -742,7 +893,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
.input-Style {
|
|
.input-Style {
|
|
- opacity: 1;
|
|
|
|
|
|
+ opacity: 0;
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|
|
// visibility: hidden;
|
|
// visibility: hidden;
|
|
}
|
|
}
|