Commit 84c87798 by lishengfu

update

parent 120204bf
...@@ -3,30 +3,79 @@ ...@@ -3,30 +3,79 @@
<div class="header"> <div class="header">
<div class="tip"></div> <div class="tip"></div>
<div class="title">教育经历</div> <div class="title">教育经历</div>
<van-icon size="14px" color="#E1E4EB" name="arrow" />
</div> </div>
<div class="box"> <div class="box" v-show="true">
<div class="editItem"> <div class="editItem" v-for="(item,key) in obj" :key="key">
<van-cell title="北京大学" is-link value="2019-2019" /> <van-cell :title="item.graduateInstitutions" is-link @click="openEduItem(item)">
<van-cell title="北京大学" is-link value="2019-2019" /> <template>{{item.eduStartDate | subDate(0,7) }}{{item.eduEndDate | subDate(0,7) }}</template>
<div class="addEdu"><i><img src="@/assets/images/add.png" alt=""></i> 添加教育经历</div> </van-cell>
</div> </div>
<van-popup v-model="childShow" position="right" :style="{ height: '100%',width: '90%' }">
<edu-update-experience :childItem="childItem" />
</van-popup>
<div class="addEdu" @click="editInfo">
<i>
<img src="@/assets/images/add.png" alt />
</i> 添加教育经历
</div> </div>
<div class="box" v-show="false">
<div class="unEiteItem">
<div class="line">
<div class="lineTitle">
<i></i>
</div> </div>
<div class="lineBox"></div> <van-popup v-model="show" position="right" :style="{ height: '100%',width: '90%' }">
</div> <van-form>
<div class="unEiteItemBox"> <van-field v-model="graduateInstitutions" label="学校名称" placeholder="请填写学校名称" />
<div class="timeLine">2010-2008</div> <van-field v-model="major" label="专业名称" placeholder="请填写专业名称" />
<div class="schoolName">北京大学</div> <van-field
<div class="eduInfo">北京|计算机科学与技术</div> readonly
clickable
:value="education"
label="学历"
placeholder="请选择学历"
@click="showEdu = true"
/>
<van-popup v-model="showEdu" position="bottom">
<van-picker
show-toolbar
:columns="columns"
@confirm="onConfirmEdu"
@cancel="showEdu = false"
/>
</van-popup>
<van-field
v-model="eduStartDate"
label="开始时间"
placeholder="请选择开始时间"
@click="showStartDate=true"
/>
<van-popup v-model="showStartDate" position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
@confirm="onConfirmStartDate"
@cancel="showStartDate = false"
/>
</van-popup>
<van-field
v-model="eduEndDate"
label="结束时间"
placeholder="请选择结束时间"
@click="showEndDate=true"
/>
<van-popup v-model="showEndDate" position="bottom">
<van-datetime-picker
v-model="currentDate1"
type="date"
title="选择年月日"
@confirm="onConfirmEndDate"
@cancel="showEndDate = false"
/>
</van-popup>
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit" @click="addEduInfo">保存</van-button>
</div> </div>
</div> </van-form>
<div class="unEiteItem"> </van-popup>
<div class="box" v-show="false">
<div class="unEiteItem" v-for="(item,key) in obj" :key="key">
<div class="line"> <div class="line">
<div class="lineTitle"> <div class="lineTitle">
<i></i> <i></i>
...@@ -34,9 +83,11 @@ ...@@ -34,9 +83,11 @@
<div class="lineBox"></div> <div class="lineBox"></div>
</div> </div>
<div class="unEiteItemBox"> <div class="unEiteItemBox">
<div class="timeLine">2010-2008</div> <div
<div class="schoolName">北京大学</div> class="timeLine"
<div class="eduInfo">北京|计算机科学与技术</div> >{{item.eduStartDate | subDate(0,4)}}-{{item.eduEndDate | subDate(0,4)}}</div>
<div class="schoolName">{{item.graduateInstitutions}}</div>
<div class="eduInfo">{{item.major}} | {{item.education}}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -45,17 +96,71 @@ ...@@ -45,17 +96,71 @@
<script lang="ts"> <script lang="ts">
import Vue from "vue"; import Vue from "vue";
import { Icon, Cell } from "vant"; import {
import { Component } from "vue-property-decorator"; Button,
Cell,
Icon,
Popup,
Form,
Picker,
Field,
Toast,
DatetimePicker
} from "vant";
import { Component, Watch } from "vue-property-decorator";
import { formatDate } from "../../utils/public";
import eduUpdateExperience from "@/components/archives/eduUpdateExperience.vue";
@Component({ @Component({
components: { components: {
[Icon.name]: Icon, [Icon.name]: Icon,
[Cell.name]: Cell [Button.name]: Button,
[Cell.name]: Cell,
[Popup.name]: Popup,
[Form.name]: Form,
[Picker.name]: Picker,
[Field.name]: Field,
[DatetimePicker.name]: DatetimePicker,
eduUpdateExperience
},
filters: {
subDate(value: string, startNum: number, endNum: number) {
if (value == null) {
return null;
}
return value.substring(startNum, endNum);
}
} }
}) })
export default class eduExperience extends Vue { export default class eduExperience extends Vue {
obj: object = {}; obj: object = {};
private show: boolean = false;
private showEdu: boolean = false;
private showStartDate: boolean = false;
private showEndDate: boolean = false;
private childShow: boolean = false;
private major: string = "";
private eduEndDate: string = "";
private eduStartDate: string = "";
private graduateInstitutions: string = "";
private education: string = "";
private currentDate: Date = new Date();
private currentDate1: Date = new Date();
private childItem: any = "";
private columns: any = [
"小学",
"初中",
"高中",
"大专",
"本科",
"硕士研究生",
"博士研究生",
"职高",
"中专",
"技校",
"其他"
];
created() { created() {
let params = { let params = {
edId: this.$route.query.ed_id edId: this.$route.query.ed_id
...@@ -67,6 +172,47 @@ export default class eduExperience extends Vue { ...@@ -67,6 +172,47 @@ export default class eduExperience extends Vue {
}) })
.catch(error => {}); .catch(error => {});
} }
@Watch("obj")
getVisible(newVal: any, oldVal: any) {
this.obj = newVal;
console.log(111)
}
editInfo(): void {
this.show = true;
}
addEduInfo() {
let params = {
eduEndDate: this.eduEndDate,
eduStartDate: this.eduStartDate,
education: this.education,
graduateInstitutions: this.graduateInstitutions,
id: this.$route.query.ed_id,
major: this.major
};
this.$server.EmployeeService.addEduExperience(params)
.then(res => {
console.log(res);
})
.catch(error => {
// console.log(error)
});
}
onConfirmEdu(value: any) {
this.education = value;
this.showEdu = false;
}
onConfirmStartDate(time: any) {
this.eduStartDate = formatDate(time, "yyyy-MM-dd");
this.showStartDate = false;
}
onConfirmEndDate(time: any) {
this.eduEndDate = formatDate(time, "yyyy-MM-dd");
this.showEndDate = false;
}
openEduItem(item: any) {
this.childShow = true;
this.childItem = item;
}
} }
</script> </script>
...@@ -101,6 +247,7 @@ export default class eduExperience extends Vue { ...@@ -101,6 +247,7 @@ export default class eduExperience extends Vue {
.van-cell { .van-cell {
padding: 8px 0; padding: 8px 0;
} }
}
.addEdu { .addEdu {
height: 15px; height: 15px;
font-size: 15px; font-size: 15px;
...@@ -111,15 +258,14 @@ export default class eduExperience extends Vue { ...@@ -111,15 +258,14 @@ export default class eduExperience extends Vue {
margin: 25px auto 12px; margin: 25px auto 12px;
display: flex; display: flex;
justify-content: center; justify-content: center;
i{ i {
margin-right: 10px; margin-right: 10px;
img{ img {
width: 16px; width: 16px;
height: 17px; height: 17px;
} }
} }
} }
}
.unEiteItem { .unEiteItem {
display: flex; display: flex;
.line { .line {
......
<template>
<div>
<van-form>
<van-field v-model="childItem.graduateInstitutions" label="学校名称" placeholder="请填写学校名称" />
<van-field v-model="childItem.major" label="专业名称" placeholder="请填写专业名称" />
<van-field
readonly
clickable
:value="childItem.education"
label="学历"
placeholder="请选择学历"
@click="showEdu = true"
/>
<van-popup v-model="showEdu" position="bottom">
<van-picker
show-toolbar
:columns="columns"
@confirm="onConfirmEdu"
@cancel="showEdu = false"
/>
</van-popup>
<van-field
v-model="childItem.eduStartDate"
label="开始时间"
placeholder="请选择开始时间"
@click="showStartDate=true"
/>
<van-popup v-model="showStartDate" position="bottom">
<van-datetime-picker
v-model="currentDate"
type="date"
title="选择年月日"
@confirm="onConfirmStartDate"
@cancel="showStartDate = false"
/>
</van-popup>
<van-field
v-model="childItem.eduEndDate"
label="结束时间"
placeholder="请选择结束时间"
@click="showEndDate=true"
/>
<van-popup v-model="showEndDate" position="bottom">
<van-datetime-picker
v-model="currentDate1"
type="date"
title="选择年月日"
@confirm="onConfirmEndDate"
@cancel="showEndDate = false"
/>
</van-popup>
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit" @click="updateEduInfo">修改</van-button>
</div>
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit" @click="deleteEduInfo">删除</van-button>
</div>
</van-form>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import {
Dialog,
Button,
Popup,
Form,
Picker,
Field,
Toast,
DatetimePicker
} from "vant";
import { Component, Prop, Watch } from "vue-property-decorator";
import { formatDate } from "../../utils/public";
@Component({
components: {
[Button.name]: Button,
[Popup.name]: Popup,
[Form.name]: Form,
[Picker.name]: Picker,
[Field.name]: Field,
[DatetimePicker.name]: DatetimePicker
}
})
export default class eduExperience extends Vue {
private showEdu: boolean = false;
private showStartDate: boolean = false;
private showEndDate: boolean = false;
private currentDate: Date = new Date();
private currentDate1: Date = new Date();
private columns: any = [
"小学",
"初中",
"高中",
"大专",
"本科",
"硕士研究生",
"博士研究生",
"职高",
"中专",
"技校",
"其他"
];
//获取父组件中的值
@Prop({
required: true,
default: ""
})
childItem!: any;
@Watch("childItem")
getVisible(newVal: any, oldVal: any) {
this.childItem = newVal;
}
onConfirmEdu(value: any) {
this.childItem.education = value;
this.showEdu = false;
}
onConfirmStartDate(time: any) {
this.childItem.eduStartDate = formatDate(time, "yyyy-MM-dd");
this.showStartDate = false;
}
onConfirmEndDate(time: any) {
this.childItem.eduEndDate = formatDate(time, "yyyy-MM-dd");
this.showEndDate = false;
}
//修改
updateEduInfo() {
let params = {
eduEndDate: this.childItem.eduEndDate,
eduStartDate: this.childItem.eduStartDate,
education: this.childItem.education,
graduateInstitutions: this.childItem.graduateInstitutions,
id: this.childItem.id,
major: this.childItem.major
};
this.$server.EmployeeService.updateEduExperience(params)
.then(res => {
console.log(res);
})
.catch(error => {
console.log(error);
});
}
//删除
deleteEduInfo() {
let params = {
eduId: this.childItem.id
};
Dialog.confirm({
message: "确认删除?"
})
.then(() => {
this.$server.EmployeeService.deleteEduExperience(params)
.then(res => {
Toast.success("删除成功!");
})
.catch(error => {
console.log(error);
});
})
.catch(() => {
// on cancel
});
}
}
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
...@@ -58,6 +58,17 @@ import { Component } from "vue-property-decorator"; ...@@ -58,6 +58,17 @@ import { Component } from "vue-property-decorator";
}) })
export default class workExperience extends Vue { export default class workExperience extends Vue {
obj: object = {}; obj: object = {};
created() {
let params = {
edId: this.$route.query.ed_id //工作信息里返回的id
};
this.$server.EmployeeService.getWorkInfoList(params)
.then(res => {
console.log("work-res=" + res);
this.obj = res;
})
.catch(error => {});
}
} }
</script> </script>
......
...@@ -41,12 +41,13 @@ import { Component } from "vue-property-decorator"; ...@@ -41,12 +41,13 @@ import { Component } from "vue-property-decorator";
}) })
export default class workInfo extends Vue { export default class workInfo extends Vue {
obj:object={} obj:object={}
// @Emit('bindSend') send(msg: string){};
created() { created() {
let params = { let params = {
edId: this.$route.query.ed_id edId: this.$route.query.ed_id
}; };
this.$server.EmployeeService.getWorkInfoDetail(params).then(res => { this.$server.EmployeeService.getWorkInfoDetail(params).then(res => {
console.log("res="+JSON.stringify(res)) console.log("workinfo_res="+JSON.stringify(res))
this.obj=res this.obj=res
}).catch(error=>{ }).catch(error=>{
......
...@@ -21,6 +21,7 @@ export interface EmployeeInterface { ...@@ -21,6 +21,7 @@ export interface EmployeeInterface {
getEduExperienceDetial(params: any): Promise<any>; //获取教育信息详情 getEduExperienceDetial(params: any): Promise<any>; //获取教育信息详情
addEduExperience(params: any): Promise<any>; //新增教育信息 addEduExperience(params: any): Promise<any>; //新增教育信息
updateEduExperience(params: any): Promise<any>; //修改教育信息 updateEduExperience(params: any): Promise<any>; //修改教育信息
deleteEduExperience(params: any): Promise<any>; //删除教育信息
getTechnologyExperience(params: any): Promise<any>; //获取技术特长 getTechnologyExperience(params: any): Promise<any>; //获取技术特长
updateTechnologyExperience(params: any): Promise<any>; //修改技术特长 updateTechnologyExperience(params: any): Promise<any>; //修改技术特长
......
...@@ -214,6 +214,15 @@ class EmployeeService implements EmployeeInterface { ...@@ -214,6 +214,15 @@ class EmployeeService implements EmployeeInterface {
} }
/** /**
* 删除教育信息
* @param params
*/
public deleteEduExperience(params: any): Promise<any> {
let url = urls.employeeUrl + `/api/user/employee/edu/${params.eduId}/info`;
return request.delete(url, params, this.header)
}
/**
* 获取技术特长 * 获取技术特长
* @param params * @param params
*/ */
......
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