Commit affbeb43 by 展昭

update

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