Commit 0e09e2e4 by lishengfu

update

parent c6cadf95
...@@ -112,6 +112,7 @@ export default class eduExperience extends Vue { ...@@ -112,6 +112,7 @@ export default class eduExperience extends Vue {
this.$server.EmployeeService.addWorkInfo(params).then(res=>{ this.$server.EmployeeService.addWorkInfo(params).then(res=>{
Toast.success("保存成功") Toast.success("保存成功")
this.$emit('showPopup') this.$emit('showPopup')
this.$emit('addChildItem',params)
}).catch(error=>{ }).catch(error=>{
console.log(error) console.log(error)
}) })
......
...@@ -266,12 +266,12 @@ export default class socialInfo extends Vue { ...@@ -266,12 +266,12 @@ export default class socialInfo extends Vue {
//没有父节点的数据 //没有父节点的数据
// console.log(this.parents); // console.log(this.parents);
//有父节点的数据 //有父节点的数据
console.log(this.childrens); // console.log(this.childrens);
this.parents.forEach((parent:any) => { this.parents.forEach((parent:any) => {
this.childrens.forEach((children:any) =>{ this.childrens.forEach((children:any) =>{
if(parent.id==children.parentId){ if(parent.id==children.parentId){
console.log(parent.name+parent.id+"++"+children.name+children.parentId) // console.log(parent.name+parent.id+"++"+children.name+children.parentId)
} }
}) })
...@@ -329,7 +329,7 @@ export default class socialInfo extends Vue { ...@@ -329,7 +329,7 @@ export default class socialInfo extends Vue {
this.$server.EmployeeService.getSalaryInfo(params) this.$server.EmployeeService.getSalaryInfo(params)
.then(res => { .then(res => {
console.log("res=" + JSON.stringify(res)+'工资条'); // console.log("res=" + JSON.stringify(res)+'工资条');
this.obj = res; this.obj = res;
}) })
......
...@@ -96,14 +96,15 @@ export default class eduExperience extends Vue { ...@@ -96,14 +96,15 @@ export default class eduExperience extends Vue {
message: "确认删除?" message: "确认删除?"
}) })
.then(() => { .then(() => {
// this.$emit("removeEduItem", this.childItem.id); this.$server.EmployeeService.deleteWorkInfo(params)
// this.$server.EmployeeService.deleteWorkInfo(params) .then(res => {
// .then(res => { this.$emit("removeChileItem", this.childItem.id);
// console.log(res); this.$emit('showPopup')
// }) Toast.success("删除成功")
// .catch(error => { })
// console.log(error); .catch(error => {
// }); console.log(error);
});
}) })
.catch(() => { .catch(() => {
// on cancel // on cancel
......
...@@ -11,16 +11,20 @@ ...@@ -11,16 +11,20 @@
</van-cell> </van-cell>
</div> </div>
<van-popup v-model="childShow" position="right" :style="{ height: '100%',width: '90%' }"> <van-popup v-model="childShow" position="right" :style="{ height: '100%',width: '90%' }">
<update-work-experience :childItem="childItem" @showPopup="showPopup" /> <update-work-experience
:childItem="childItem"
@showPopup="showPopup"
@removeChileItem="removeChileItem"
/>
</van-popup> </van-popup>
<div class="addEdu" @click="addWork"> <div class="addEdu" @click="addWork">
<i> <i>
<img src="@/assets/images/add.png" alt /> <img src="@/assets/images/add.png" alt />
</i>添加工作经历 </i>添加工作经历
</div> </div>
<!-- 添加工作经历 --> <!-- 添加工作经历 -->
<van-popup v-model="addShow" position="right" :style="{ height: '100%',width: '90%' }"> <van-popup v-model="addShow" position="right" :style="{ height: '100%',width: '90%' }">
<add-work-experience @showPopup="showPopup" /> <add-work-experience @showPopup="showPopup" @addChildItem="addChildItem" />
</van-popup> </van-popup>
</div> </div>
<div class="box" v-show="false"> <div class="box" v-show="false">
...@@ -32,7 +36,9 @@ ...@@ -32,7 +36,9 @@
<div class="lineBox"></div> <div class="lineBox"></div>
</div> </div>
<div class="unEiteItemBox"> <div class="unEiteItemBox">
<div class="timeLine">{{item.workStartDate | subDate(0,7)}} 至 {{item.workEndDate | subDate(0,7)}}</div> <div
class="timeLine"
>{{item.workStartDate | subDate(0,7)}} 至 {{item.workEndDate | subDate(0,7)}}</div>
<div class="schoolName">{{item.workUnit}}</div> <div class="schoolName">{{item.workUnit}}</div>
<div class="eduInfo">{{item.position}} | 缺少城市字段</div> <div class="eduInfo">{{item.position}} | 缺少城市字段</div>
<div class="ditale">{{item.description}}</div> <div class="ditale">{{item.description}}</div>
...@@ -44,10 +50,10 @@ ...@@ -44,10 +50,10 @@
<script lang="ts"> <script lang="ts">
import Vue from "vue"; import Vue from "vue";
import { Icon, Cell,Popup } from "vant"; import { Icon, Cell, Popup } from "vant";
import { Component } from "vue-property-decorator"; import { Component } from "vue-property-decorator";
import addWorkExperience from "./addWorkExperience.vue" import addWorkExperience from "./addWorkExperience.vue";
import updateWorkExperience from "./updateWorkExperience.vue" import updateWorkExperience from "./updateWorkExperience.vue";
@Component({ @Component({
components: { components: {
...@@ -59,9 +65,9 @@ import updateWorkExperience from "./updateWorkExperience.vue" ...@@ -59,9 +65,9 @@ import updateWorkExperience from "./updateWorkExperience.vue"
} }
}) })
export default class workExperience extends Vue { export default class workExperience extends Vue {
obj: object = {}; obj: any = "";
private addShow:boolean=false private addShow: boolean = false;
private childShow:boolean=false private childShow: boolean = false;
private childItem: any = ""; private childItem: any = "";
created() { created() {
let params = { let params = {
...@@ -69,23 +75,45 @@ export default class workExperience extends Vue { ...@@ -69,23 +75,45 @@ export default class workExperience extends Vue {
}; };
this.$server.EmployeeService.getWorkInfoList(params) this.$server.EmployeeService.getWorkInfoList(params)
.then(res => { .then(res => {
console.log("work-res=" + JSON.stringify(res));
this.obj = res; this.obj = res;
}) })
.catch(error => {}); .catch(error => {});
} }
addWork(){ addWork() {
this.addShow=true this.addShow = true;
}
//通过子组件来添加父组件中的列表
addChildItem(item: any) {
let addItem = [];
for (let i in this.obj) {
addItem.push(this.obj[i]);
}
addItem.push(item);
this.obj = addItem;
} }
// //
openWorkItem(item:any){ openWorkItem(item: any) {
this.childShow = true; this.childShow = true;
this.childItem = item; this.childItem = item;
} }
//子组件调用父组件方法 //子组件调用父组件方法
showPopup(){ showPopup() {
this.addShow=false this.addShow = false;
this.childShow=false this.childShow = false;
}
//通过子组件删除父组件对应的列表
removeChileItem(item: any) {
let removeCliedArr = [];
for (let i in this.obj) {
removeCliedArr.push(this.obj[i]);
}
let removeList = removeCliedArr;
removeCliedArr.forEach((i, index) => {
if (i.id === item) {
removeList.splice(index, 1);
}
});
this.obj = removeList;
} }
} }
</script> </script>
...@@ -123,23 +151,23 @@ export default class workExperience extends Vue { ...@@ -123,23 +151,23 @@ export default class workExperience extends Vue {
} }
} }
.addEdu { .addEdu {
height: 15px; height: 15px;
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
color: rgba(34, 189, 122, 1); color: rgba(34, 189, 122, 1);
line-height: 15px; line-height: 15px;
text-align: center; text-align: center;
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 {
......
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