Commit 0e09e2e4 by lishengfu

update

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