Commit e3a1f5b8 by lishengfu

update

parent b94db16f
......@@ -7166,8 +7166,7 @@
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
"dev": true,
"optional": true
"dev": true
},
"pify": {
"version": "4.0.1",
......
<template>
<div>
<van-picker show-toolbar title="标题" :columns="columns" @change="updateCity" />
</div>
</template>
<script lang="ts">
import Vue from "vue";
import { Picker } from "vant";
import { Component } from "vue-property-decorator";
@Component({
components: {
[Picker.name]: Picker
}
})
export default class cityList extends Vue {
private data: any = "";
private province: any = ""; //省份
private city: any = []; //市份
private area: any = ""; //区,县
private columns: any = [
{
text: "",
children: []
}
];
created() {
this.$server.EmployeeService.getCityList({}).then(res => {
this.data = res;
//展示省份数据
Object.values(this.data).map((item: any) => {
if (item.parentId == 0) {
this.province = {
text: item.name,
id: item.id
};
this.columns.push(this.province);
}
});
//展示市级数据
this.columns.map((i: any) => {
Object.values(this.data).map((item: any) => {
let obj = {};
if (item.parentId != 0) {
obj = {
text: item.name,
id: item.id,
parentId: item.parentId
};
// console.log(this.city)
this.city.push(obj);
// this.columns.children[0].push(this.city);
}
});
});
// console.log(this.city)
});
}
updateCity(picker: any, values: any, index: any) {
console.log(values);
picker.setColumnValues(1, this.cityData(this.city, values[0]));
}
cityData(data: any, provinceId: any) {
data.map((item: any) => {
if (item.text == provinceId) {
console.log(provinceId);
this.city = item;
}
});
return this.city.map((res: any) => {
console.log(res)
// return { text: res.name, code: res.code };
});
}
}
</script>
<style lang="less" scoped>
</style>
\ No newline at end of file
......@@ -15,12 +15,7 @@
@cancel="showStartDate = false"
/>
</van-popup>
<van-field
v-model="endDate"
label="结束时间"
placeholder="请选择结束时间(非必填)"
@click="showEndDate=true"
/>
<van-field v-model="endDate" label="结束时间" placeholder="请选择结束时间(非必填)" @click="showEndDate=true" />
<van-popup v-model="showEndDate" position="bottom">
<van-datetime-picker
v-model="currentDate1"
......@@ -47,6 +42,8 @@ import { formatDate } from "../../utils/public";
}
})
export default class eduExperience extends Vue {
startTime: any = "";
endTime: any = "";
private showStartDate: boolean = false;
private showEndDate: boolean = false;
private currentDate: Date = new Date();
......@@ -63,17 +60,15 @@ export default class eduExperience extends Vue {
default: ""
})
endDate!: any;
@Watch("dateItem")
getVisible(newVal: any, oldVal: any) {
// this.dateItem = newVal;
}
onConfirmStartDate(time: any) {
this.startDate = formatDate(time, "yyyy-MM-dd");
this.startTime = formatDate(time, "yyyy-MM-dd");
this.$emit("childStartDate", this.startTime); //把值传回给父元素
this.showStartDate = false;
}
onConfirmEndDate(time: any) {
this.endDate = formatDate(time, "yyyy-MM-dd");
this.endTime = formatDate(time, "yyyy-MM-dd");
this.$emit("childEndDate", this.endTime); //把值传回给父元素
this.showEndDate = false;
}
}
......
......@@ -4,38 +4,13 @@
<van-field v-model="workUnit" label="就职公司" placeholder="请填写公司名称" />
<van-field v-model="position" label="从事职位" placeholder="请填写职位名称" />
<van-field v-model="place" label="工作地点" placeholder="请填写工作地点(非必填)" />
<van-field
v-model="workStartDate"
label="开始时间"
placeholder="请选择开始时间(非必填)"
@click="showStartDate=true"
<date-select
:startDate="workStartDate"
:endDate="workEndDate"
@childStartDate="childStartDate"
@childEndDate="childEndDate"
/>
<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="workEndDate"
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>
<van-field v-model="description" label="工作内容" placeholder="请填写工作内容(非必填)" />
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit" @click="saveWorkInfo">保存</van-button>
</div>
......@@ -56,6 +31,7 @@ import {
} from "vant";
import { Component, Prop, Watch } from "vue-property-decorator";
import { formatDate } from "@/utils/public";
import dateSelect from "@/components/common/dateSelect.vue";
@Component({
components: {
......@@ -64,13 +40,14 @@ import { formatDate } from "@/utils/public";
[Form.name]: Form,
[Picker.name]: Picker,
[Field.name]: Field,
[DatetimePicker.name]: DatetimePicker
[DatetimePicker.name]: DatetimePicker,
dateSelect
}
})
export default class eduExperience extends Vue {
private description: any = "";
private position: any = "";
private place:any=""//缺少工作地点字段
private place: any = ""; //缺少工作地点字段
private workEndDate: any = "";
private workStartDate: any = "";
private workUnit: any = "";
......@@ -78,26 +55,14 @@ 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();
//获取父组件中的值
// @Prop({
// required: true,
// default: ""
// })
// childItem!: any;
// @Watch("childItem")
// getVisible(newVal: any, oldVal: any) {
// this.childItem = newVal;
// }
onConfirmStartDate(time: any) {
this.workStartDate = formatDate(time, "yyyy-MM-dd");
this.showStartDate = false;
//获取日期组件中的值
childStartDate(item: any) {
this.workStartDate = item;
}
onConfirmEndDate(time: any) {
this.workEndDate = formatDate(time, "yyyy-MM-dd");
this.showEndDate = false;
childEndDate(item: any) {
this.workEndDate = item;
}
//TODO 新增工作经历
saveWorkInfo() {
......@@ -109,13 +74,11 @@ export default class eduExperience extends Vue {
workStartDate: this.workStartDate,
workUnit: this.workUnit
};
this.$server.EmployeeService.addWorkInfo(params).then(res=>{
Toast.success("保存成功")
this.$emit('showPopup')
this.$emit('addChildItem',params)
}).catch(error=>{
console.log(error)
})
this.$server.EmployeeService.addWorkInfo(params).then(res => {
Toast.success("保存成功");
this.$emit("showPopup");
this.$emit("addChildItem", params);
});
}
}
</script>
......
<template>
<div>
<van-form>
<van-field v-model="graduateInstitutions" label="学校名称" placeholder="请填写学校名称" />
<van-field v-model="major" label="专业名称" placeholder="请填写专业名称" />
<van-field
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>
<date-select
:startDate="eduStartDate"
:endDate="eduEndDate"
@childStartDate="childStartDate"
@childEndDate="childEndDate"
/>
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit" @click="addEduInfo">保存</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, Emit } from "vue-property-decorator";
import { formatDate } from "@/utils/public";
import dateSelect from "@/components/common/dateSelect.vue";
@Component({
components: {
[Button.name]: Button,
[Popup.name]: Popup,
[Form.name]: Form,
[Picker.name]: Picker,
[Field.name]: Field,
[DatetimePicker.name]: DatetimePicker,
dateSelect
}
})
export default class eduExperience extends Vue {
private graduateInstitutions: any = "";
private major: any = "";
private education: any = "";
private eduEndDate: string = "";
private eduStartDate: string = "";
private showEdu: boolean = false;
private showStartDate: boolean = false;
private showEndDate: boolean = false;
private columns: any = [
"小学",
"初中",
"高中",
"大专",
"本科",
"硕士研究生",
"博士研究生",
"职高",
"中专",
"技校",
"其他"
];
//获取日期组件中的值
childStartDate(item: any) {
this.eduStartDate = item;
}
childEndDate(item: any) {
this.eduEndDate = item;
}
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 => {
Toast.success("保存成功")
this.$emit('popupShow')
this.$emit('addChildItem',params)
});
}
onConfirmEdu(value: any) {
this.education = value;
this.showEdu = false;
}
//TODO 新增工作经历
saveWorkInfo() {}
// startDate(item: any) {
// this.eduStartDate = item;
// }
// ednDate(item: any) {
// this.eduEndDate = item;
// }
}
</script>
\ No newline at end of file
......@@ -19,60 +19,8 @@
</i> 添加教育经历
</div>
</div>
<van-popup v-model="show" position="right" :style="{ height: '100%',width: '90%' }">
<van-form>
<van-field v-model="graduateInstitutions" label="学校名称" placeholder="请填写学校名称" />
<van-field v-model="major" label="专业名称" placeholder="请填写专业名称" />
<van-field
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>
</van-form>
<van-popup v-model="addShow" position="right" :style="{ height: '100%',width: '90%' }">
<edu-add-experience @popupShow="popupShow" @addChildItem="addChildItem" />
</van-popup>
<div class="box" v-show="false">
<div class="unEiteItem" v-for="(item,key) in obj" :key="key">
......@@ -104,12 +52,12 @@ import {
Form,
Picker,
Field,
Toast,
DatetimePicker
Toast
} from "vant";
import { Component, Watch } from "vue-property-decorator";
import { formatDate } from "@/utils/public";
import eduUpdateExperience from "./eduUpdateExperience.vue";
import eduAddExperience from "./eduAddExperience.vue"
@Component({
components: {
......@@ -120,38 +68,15 @@ import eduUpdateExperience from "./eduUpdateExperience.vue";
[Form.name]: Form,
[Picker.name]: Picker,
[Field.name]: Field,
[DatetimePicker.name]: DatetimePicker,
eduUpdateExperience
eduUpdateExperience,
eduAddExperience
}
})
export default class eduExperience extends Vue {
obj: object = {};
private show: boolean = false;
private showEdu: boolean = false;
private showStartDate: boolean = false;
private showEndDate: boolean = false;
obj: any = "";
private addShow: 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() {
let params = {
......@@ -169,54 +94,37 @@ export default class eduExperience extends Vue {
this.obj = newVal;
}
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;
this.addShow = true;
}
openEduItem(item: any) {
this.childShow = true;
this.childItem = item;
}
//通过子组件来添加父组件中的列表
addChildItem(item: any) {
let addItem = [];
for (let i in this.obj) {
addItem.push(this.obj[i]);
}
addItem.push(item);
this.obj = addItem;
}
//删除对应的列表
removeEduItem(itemId:any){
console.log(itemId)
var arr=Object.entries(this.obj)
arr=arr.filter(item=>item!==itemId)
console.log(arr)
// arr.forEach(item=>{
// item.forEach(i=>{
// console.log(i.id)
// })
// })
removeEduItem(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;
}
popupShow(){
this.addShow=false
this.childShow=false
}
}
......
......@@ -19,7 +19,12 @@
@cancel="showEdu = false"
/>
</van-popup>
<date-select :startDate="childItem.eduStartDate" :endDate="childItem.eduEndDate" />
<date-select
:startDate.sync="childItem.eduStartDate"
:endDate.sync="childItem.eduEndDate"
@childStartDate="childStartDate"
@childEndDate="childEndDate"
/>
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit" @click="updateEduInfo">修改</van-button>
</div>
......@@ -31,18 +36,10 @@
</template>
<script lang="ts">
import Vue from "vue";
import {
Dialog,
Button,
Popup,
Form,
Picker,
Field,
Toast
} from "vant";
import { Dialog, Button, Popup, Form, Picker, Field, Toast } from "vant";
import { Component, Prop, Watch } from "vue-property-decorator";
import { formatDate } from "@/utils/public";
import dateSelect from "@/components/common/dateSelect.vue"
import dateSelect from "@/components/common/dateSelect.vue";
@Component({
components: {
......@@ -87,13 +84,12 @@ export default class eduExperience extends Vue {
this.childItem.education = value;
this.showEdu = false;
}
onConfirmStartDate(time: any) {
this.childItem.eduStartDate = formatDate(time, "yyyy-MM-dd");
this.showStartDate = false;
//获取日期组件中的值
childStartDate(item: any) {
this.childItem.eduStartDate = item;
}
onConfirmEndDate(time: any) {
this.childItem.eduEndDate = formatDate(time, "yyyy-MM-dd");
this.showEndDate = false;
childEndDate(item: any) {
this.childItem.eduEndDate = item;
}
//修改
updateEduInfo() {
......@@ -108,11 +104,8 @@ export default class eduExperience extends Vue {
this.$server.EmployeeService.updateEduExperience(params)
.then(res => {
Toast.success("修改成功");
this.$emit('popupShow')
this.$emit("popupShow");
})
.catch(error => {
console.log(error);
});
}
//删除
deleteEduInfo() {
......@@ -123,14 +116,15 @@ export default class eduExperience extends Vue {
message: "确认删除?"
})
.then(() => {
this.$emit('removeEduItem',this.childItem.id)
// this.$server.EmployeeService.deleteEduExperience(params)
// .then(res => {
// Toast.success("删除成功!");
// })
// .catch(error => {
// console.log(error);
// });
this.$server.EmployeeService.deleteEduExperience(params)
.then(res => {
Toast.success("删除成功!");
this.$emit("removeEduItem", this.childItem.id);
this.$emit("popupShow");
})
.catch(error => {
console.log(error);
});
})
.catch(() => {
// on cancel
......
......@@ -4,7 +4,12 @@
<van-field v-model="childItem.workUnit" label="就职公司" placeholder="请填写公司名称" />
<van-field v-model="childItem.position" label="从事职位" placeholder="请填写职位名称" />
<van-field v-model="childItem.place" label="工作地点" placeholder="请填写工作地点(非必填)" />
<date-select :startDate="childItem.workStartDate" :endDate="childItem.workEndDate" />
<date-select
:startDate="childItem.workStartDate"
:endDate="childItem.workEndDate"
@childStartDate="childStartDate"
@childEndDate="childEndDate"
/>
<van-field v-model="childItem.description" label="工作内容" placeholder="请填写工作内容(非必填)" />
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit" @click="updateEduInfo">修改</van-button>
......@@ -29,7 +34,7 @@ import {
} from "vant";
import { Component, Prop, Watch } from "vue-property-decorator";
import { formatDate } from "@/utils/public";
import dateSelect from "@/components/common/dateSelect.vue"
import dateSelect from "@/components/common/dateSelect.vue";
@Component({
components: {
......@@ -46,8 +51,6 @@ 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();
//获取父组件中的值
@Prop({
......@@ -59,14 +62,12 @@ export default class eduExperience extends Vue {
getVisible(newVal: any, oldVal: any) {
this.childItem = newVal;
}
onConfirmStartDate(time: any) {
this.childItem.workStartDate = formatDate(time, "yyyy-MM-dd");
this.showStartDate = false;
//获取日期组件中的值
childStartDate(item: any) {
this.childItem.workStartDate = item;
}
onConfirmEndDate(time: any) {
this.childItem.workEndDate = formatDate(time, "yyyy-MM-dd");
this.showEndDate = false;
childEndDate(item: any) {
this.childItem.workEndDate = item;
}
//修改
updateEduInfo() {
......@@ -78,13 +79,9 @@ export default class eduExperience extends Vue {
workStartDate: this.childItem.workStartDate,
workUnit: this.childItem.workUnit
};
this.$server.EmployeeService.updateWorkInfo(params)
.then(res => {
Toast.success("修改成功!")
this.$emit('showPopup')
})
.catch(error => {
console.log(error);
this.$server.EmployeeService.updateWorkInfo(params).then(res => {
Toast.success("修改成功!");
this.$emit("showPopup");
});
}
//删除
......@@ -94,20 +91,12 @@ export default class eduExperience extends Vue {
};
Dialog.confirm({
message: "确认删除?"
})
.then(() => {
this.$server.EmployeeService.deleteWorkInfo(params)
.then(res => {
}).then(() => {
this.$server.EmployeeService.deleteWorkInfo(params).then(res => {
this.$emit("removeChileItem", this.childItem.id);
this.$emit('showPopup')
Toast.success("删除成功")
})
.catch(error => {
console.log(error);
this.$emit("showPopup");
Toast.success("删除成功");
});
})
.catch(() => {
// on cancel
});
}
}
......
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