Commit 0bcd230c by lishengfu

update

parent 6b3717e5
......@@ -23,11 +23,9 @@ button,
a {
margin: 0;
padding: 0;
color: #333;
font-family: "微软雅黑", "宋体";
box-sizing: border-box;
font-weight: normal;
font-size: 12px;
}
body {
......
......@@ -34,14 +34,14 @@
<van-popup v-model="show" position="right" :style="{ height: '100%',width: '90%' }">
<van-form>
<van-field v-model="username" name="手机号码" label="手机号码" placeholder="请填写手机号码" />
<van-field v-model="phone" name="固定电话" label="固定电话" placeholder="请填写固定电话" />
<van-field v-model="phone" name="紧急联系电话" label="紧急联系电话" placeholder="请填写紧急联系电话" />
<van-field v-model="phone" name="邮政编码" label="邮政编码" placeholder="请填写邮政编码" />
<van-field v-model="phone" name="户口所在地" label="户口所在地" placeholder="请填写户口所在地" />
<van-field v-model="phone" name="现在居住地" label="现在居住地" placeholder="请填写现在居住地" />
<van-field v-model="contactMobile" label="手机号码" placeholder="请填写手机号码" />
<van-field v-model="contactTelephone" label="固定电话" placeholder="请填写固定电话" />
<van-field v-model="contactEmergencyMobile" label="紧急联系电话" placeholder="请填写紧急联系电话" />
<van-field v-model="contactPostcode" label="邮政编码" placeholder="请填写邮政编码" />
<van-field v-model="contactCurrentResidence" label="户口所在地" placeholder="请填写户口所在地" />
<van-field v-model="infoRegisteredResidenceCity" label="现在居住地" placeholder="请填写现在居住地" />
<div style="margin: 16px;">
<van-button round block type="info" native-type="submit">保存</van-button>
<van-button round block type="info" native-type="submit" @click="updateContactInfo">保存</van-button>
</div>
</van-form>
</van-popup>
......@@ -50,8 +50,9 @@
<script lang="ts">
import Vue from "vue";
import { Button,Icon, Popup, Form, Picker, Field } from "vant";
import { Button, Icon, Popup, Form, Picker, Field, Toast } from "vant";
import { Component } from "vue-property-decorator";
import qs from "qs";
@Component({
components: {
......@@ -64,8 +65,12 @@ import { Component } from "vue-property-decorator";
}
})
export default class contactInfo extends Vue {
private username: string = "";
private phone: string = "";
private contactMobile: string = "";
private contactTelephone: string = "";
private contactEmergencyMobile: string = "";
private contactPostcode: string = "";
private contactCurrentResidence: string = "";
private infoRegisteredResidenceCity: string = "";
private obj: object = {};
private show: boolean = false;
created() {
......@@ -81,6 +86,50 @@ export default class contactInfo extends Vue {
editInfo(): void {
this.show = true;
}
updateContactInfo() {
let data = {
id: this.$route.query.ed_id,
contactCurrentResidence: this.contactCurrentResidence,
contactEmergencyMobile: this.contactEmergencyMobile,
contactMobile: this.contactMobile,
contactPostcode: this.contactPostcode,
contactTelephone: this.contactTelephone,
infoRegisteredResidenceCity: this.infoRegisteredResidenceCity
};
if (!this.contactMobile || !(/^1\d{10}$/.test(this.contactMobile))) {
Toast("请填写正确的手机号码");
return;
}
if (!this.contactTelephone || !(/^(\(\d{3,4}\)|\d{3,4}-|\s)?\d{7,14}$/.test(this.contactTelephone))) {
Toast("请填写正确的固定电话");
return;
}
if (!this.contactEmergencyMobile) {
Toast("请填写紧急联系电话");
return;
}
if (!this.contactPostcode || !(/^[0-9]\d{5}(?!\d)$/.test(this.contactPostcode))) {
Toast("请填写正确的邮政编码");
return;
}
if (!this.contactCurrentResidence) {
Toast("请填写户口所在地");
return;
}
if (!this.infoRegisteredResidenceCity) {
Toast("请填写现在居住地");
return;
}
this.$server.EmployeeService.saveContactInfo(data)
.then(res => {
if (res == true) {
Toast.success("保存成功");
}
})
.catch(error => {
console.log(error);
});
}
}
</script>
......
......@@ -41,24 +41,54 @@
</div>
<van-popup v-model="show" position="right" :style="{ height: '100%',width: '90%' }">
<!-- 出生地 -->
<!-- <select-info :title="list.title" :value="list.value" /> -->
<van-field
readonly
clickable
name="datetimePicker"
:value="value"
label="出生地"
placeholder="请选择出生地"
@click="showBirthplace = true"
/>
<van-popup v-model="showBirthplace" position="bottom">
<van-area :area-list="areaList" @confirm="onConfirm" @cancel="showArea = false" />
</van-popup>
<!-- <van-field
readonly
clickable
name="picker"
:value="value"
label="出生地"
placeholder="点击选择出生地"
@click="showPicker = true"
/>
<select-info v-model="showPicker" />-->
</van-popup>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import { Icon, Popup } from "vant";
import { Icon, Popup, Field, Area } from "vant";
import { Component } from "vue-property-decorator";
import selectInfo from "@/components/archives/selectInfo.vue";
@Component({
components: {
[Icon.name]: Icon,
[Popup.name]: Popup,
[Field.name]: Field,
[Area.name]: Area,
selectInfo
}
})
export default class personInfo extends Vue {
private obj: object = {};
private showPicker: boolean = false;
private showBirthplace: boolean = false;
private areaList:object= {};
private value: any = "";
private show: boolean = false;
created() {
......@@ -74,6 +104,10 @@ export default class personInfo extends Vue {
editInfo(): void {
this.show = true;
}
onConfirm(values:any) {
this.value = values.map((item:any) => item.name).join('/');
this.showBirthplace = false;
}
}
</script>
......
......@@ -2,19 +2,10 @@
<template>
<div>
<van-form>
<van-field
readonly
clickable
name="picker"
:value="value"
label="出生地"
placeholder="点击选择出生地"
@click="showPicker = true"
/>
<van-popup v-model="showPicker" position="bottom">
<van-popup position="bottom">
<van-picker
show-toolbar
:columns="columns"
:columns="columns.list.one"
@confirm="onConfirm"
@cancel="showPicker = false"
/>
......@@ -39,12 +30,16 @@ export default class personInfo extends Vue {
private obj: object = {};
private show: boolean = false;
private value: string = "";
private showPicker: boolean = false;
private columns: any = ["杭州", "宁波", "温州", "嘉兴", "湖州"];
private columns: any = {
list:{
one:['1','2','3'],
two:['4','5','6'],
three:['7','8','9']
}
};
onConfirm(value: string): void {
this.value = value;
this.showPicker = false;
}
}
</script>
......
......@@ -14,13 +14,13 @@ export interface EmployeeInterface {
getSocialInfo(params: any): Promise<any>; //获取社保信息
saveSocialInfo(params: any): Promise<any>; //保存社保信息
getWageCardInfo(params: any): Promise<any>; //获取工资卡信息
saveWageCardInfo(params:any):Promise<any>; //保存工资卡信息
getEduExperience(params:any):Promise<any>; //获取教育经历
getEduExperienceDetial(params:any):Promise<any>; //获取教育信息详情
addEduExperience(params:any):Promise<any>; //新增教育信息
updateEduExperience(params:any):Promise<any>; //修改教育信息
getTechnologyExperience(params:any):Promise<any>; //获取技术特长
updateTechnologyExperience(params:any):Promise<any>; //修改技术特长
saveWageCardInfo(params: any): Promise<any>; //保存工资卡信息
getEduExperience(params: any): Promise<any>; //获取教育经历
getEduExperienceDetial(params: any): Promise<any>; //获取教育信息详情
addEduExperience(params: any): Promise<any>; //新增教育信息
updateEduExperience(params: any): Promise<any>; //修改教育信息
getTechnologyExperience(params: any): Promise<any>; //获取技术特长
updateTechnologyExperience(params: any): Promise<any>; //修改技术特长
getAgileWorker(params:any):Promise<any>; //灵活用工
getAgileWorker(params: any): Promise<any>; //灵活用工
}
......@@ -44,7 +44,7 @@ class EmployeeService implements EmployeeInterface {
*/
public async getUserInfo(params: any): Promise<any> {
const url = urls.userInfoUrl + `/userAuthDetails`;
return request.postWithAuthHeader(url, params, this.header)
return request.post(url, params, this.header)
}
/**
......@@ -116,7 +116,7 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public saveContactInfo(params: any): Promise<any> {
let url = urls.employeeUrl + `/api/user/contact/${params.edId}/info`;
let url = urls.employeeUrl + `/api/user/contact/${params.id}/info`;
return request.post(url, params, this.header)
}
......
......@@ -28,29 +28,10 @@ class Request {
*/
public post(url: string, params: any = {}, headers: any = {}) {
return new Promise((resolve, reject) => {
resolve(http.post(`${url}?${GetCommonPms()}`, {
params: params,
headers: headers
}));
resolve(http.post(`${url}?${GetCommonPms()}`, params, { headers: headers }));
})
}
/**
*
* POST 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public postWithAuthHeader(url: string, params: any = {}, headers: any = {}) {
let options: any = {};
if (headers) {
options.headers = headers;
}
return new Promise((resolve, reject) => {
resolve(http.post(`${url}?${GetCommonPms(true)}`, params, options));
})
}
/**
*
......
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