|
|
@ -62,38 +62,6 @@ |
|
|
|
<span> password: any</span> |
|
|
|
<span> password: any</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
|
|
|
:visible.sync="companySelectDialog" |
|
|
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
:close-on-press-escape="false" |
|
|
|
|
|
|
|
width="500px" |
|
|
|
|
|
|
|
title="请选择登录企业" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-table :data="companyList"> |
|
|
|
|
|
|
|
<el-table-column property="companyName" label="公司名称" width="200" /> |
|
|
|
|
|
|
|
<el-table-column property="parentMark" label="公司性质"> |
|
|
|
|
|
|
|
<template slot-scope="{ row }"> |
|
|
|
|
|
|
|
<el-tag v-if="row.parentMark === 0" effect="dark" size="normal" |
|
|
|
|
|
|
|
>主体公司</el-tag |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<el-tag v-else effect="dark" type="info" size="normal" |
|
|
|
|
|
|
|
>分公司</el-tag |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column property="name" label="操作"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
|
|
<el-button |
|
|
|
|
|
|
|
type="text" |
|
|
|
|
|
|
|
size="small" |
|
|
|
|
|
|
|
@click="loginAgain(scope.row.companyId)" |
|
|
|
|
|
|
|
>登录</el-button |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -113,8 +81,6 @@ export default { |
|
|
|
loading: false, |
|
|
|
loading: false, |
|
|
|
passwordType: "", |
|
|
|
passwordType: "", |
|
|
|
companyList: [], |
|
|
|
companyList: [], |
|
|
|
companySelectDialog: false, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
loginForm: { |
|
|
|
loginForm: { |
|
|
|
username: "", |
|
|
|
username: "", |
|
|
|
password: "", |
|
|
|
password: "", |
|
|
@ -140,6 +106,8 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleLogin() { |
|
|
|
handleLogin() { |
|
|
|
|
|
|
|
this.$refs["loginForm"].validate((valid) => { |
|
|
|
|
|
|
|
if (valid) { |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
let { username, password, networkId } = this.loginForm; |
|
|
|
let { username, password, networkId } = this.loginForm; |
|
|
|
serve |
|
|
|
serve |
|
|
@ -149,21 +117,16 @@ export default { |
|
|
|
networkId, |
|
|
|
networkId, |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
.then((res) => { |
|
|
|
if (res && res.code === 42014) { |
|
|
|
if (res.data.accessToken) { |
|
|
|
serve |
|
|
|
|
|
|
|
.getRefineryByCustomerId(this.loginForm.username) |
|
|
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
|
|
this.companyList = res.data; |
|
|
|
|
|
|
|
this.companySelectDialog = true; |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
localStorage.setItem("token", res.data.accessToken); |
|
|
|
localStorage.setItem("token", res.data.accessToken); |
|
|
|
this.$router.replace("/"); |
|
|
|
this.$router.replace("/"); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch(() => { |
|
|
|
.catch(() => { |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|