Commit affbeb43 by 展昭

update

parent 3e8ed6ae
......@@ -27,3 +27,7 @@ yarn run lint
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
必要参数
authcode
\ No newline at end of file
<template>
<div class="main main-company" id="main_company">
<div class="company-item-box">
<p class="company-name" coId="id"></p>
<div class="company-item-box" v-for="(item,index) in dispatch_list" :key="index" >
<p class="company-name" @click="toCompany_click(item.id)">{{item.fullName}}</p>
<img src="../assets/images/right_arrow.png" alt="进入派遣公司" title="进入派遣公司" />
</div>
</div>
</template>
......@@ -21,25 +25,35 @@ import { Component } from "vue-property-decorator";
})
export default class workInfo extends Vue {
private dispatch_list: any[] = [];
private id_no_encrytion: string = this.$route.query.id_no as string;
// get id_no():string{
// return window.atob(decodeURI(this.id_no_encrytion));
// }
// private async getDispatchList() {
// await this.$server.EmployeeService.getDispatchList({ idNo: this.id_no })
// .then(res => {
// this.dispatch_list = res;
// })
// .catch(err => {
// console.log("err=", err);
// });
// }
// created() {
// //this.getDispatchList();
// }
private id_no_encrytion: any = "";
get id_no(): string {
return window.atob(decodeURI(this.id_no_encrytion));
}
private async getDispatchList() {
await this.$server.EmployeeService.getDispatchList({ idNo: this.id_no })
.then(res => {
console.log("res=", res);
this.dispatch_list = res;
})
.catch(err => {
console.log("err=", err);
});
}
private async toCompany_click(id: string) {
this.$router.push({
name: "Index",
query: { id_no: this.id_no_encrytion, sp_id: id }
});
}
created() {
this.id_no_encrytion = this.$route.query.id_no;
console.log(this.id_no_encrytion);
this.getDispatchList();
}
}
</script>
......
......@@ -7,7 +7,7 @@
<p>可查看专项订单服务,使用职场小工具</p>
</div>
</a>-->
<a class="si-child" id="dispatch-employee" @click="toIndex_click">
<a v-if="company_num>0" class="si-child" id="dispatch-employee" @click="toIndex_click">
<img src="../assets/images/agent/dispatch-employee.png" alt />
<div class="si-child-desc">
<h4>我是派遣员工</h4>
......@@ -38,6 +38,10 @@ export default class SelectIdentity extends Vue {
return encodeURI(window.btoa(this.id_no));
}
get company_num(): number {
return this.dispatch_list.length;
}
private toFlex(): void {
this.$router.push({
name: "FlexEmployee",
......@@ -50,7 +54,6 @@ export default class SelectIdentity extends Vue {
name: "Index",
query: { id_no: this.id_no_encrytion, sp_id: sp_id }
});
// this.$router.push({ name: "ChooseCompany", query: { id_no: this.id_no } });
}
private ChooseCompany() {
......@@ -61,13 +64,11 @@ export default class SelectIdentity extends Vue {
}
private toIndex_click(): void {
console.log(this.dispatch_list);
if (this.dispatch_list && this.dispatch_list.length > 1) {
if (this.company_num > 1) {
this.ChooseCompany();
}
if (this.dispatch_list && this.dispatch_list.length == 1) {
if (this.company_num == 1) {
const sp_id: string = this.dispatch_list[0].id as string;
this.toIndex(sp_id);
}
......@@ -77,7 +78,6 @@ export default class SelectIdentity extends Vue {
await this.$server.EmployeeService.getUserInfo({})
.then(res => {
if (res.data && res.data.uthStatus && res.data.uthStatus > 0) {
console.log("2", res.data.personalIdCardNo);
this.id_no = res.data.personalIdCardNo;
} else {
//TODO: 跳转到实名认证
......@@ -88,6 +88,7 @@ export default class SelectIdentity extends Vue {
console.log("err=", err);
});
}
private async getDispatchList() {
await this.$server.EmployeeService.getDispatchList({ idNo: this.id_no })
.then(res => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment