软测宝小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

203 lines
5.2 KiB

<template>
<view class="navTab">
<u-form :model="projectobj" ref="projectobj" label-position='left' label-width='150'>
<u-form-item label="学校名称:" prop="name" required='true'>
<u-input style="width:100%;" v-model="projectobj.name" placeholder='请输入公司名称' />
</u-form-item>
<u-form-item label="开始时间:" prop="startTime" required='true'>
<u-input class="seleclas" v-model="projectobj.startTime" type="select" @click="Periodshow = true"
placeholder='请选择' />
<u-picker mode="time" v-model="Periodshow" :params="{year: true,month:true}"
@confirm="startTimeChange"></u-picker>
</u-form-item>
<u-form-item label="结束时间:" prop="endTime" required='true'>
<u-input class="seleclas" v-model="projectobj.endTime" type="select" @click="Periodshow1 = true"
placeholder='请选择' />
<u-picker mode="time" v-model="Periodshow1" :params="{year: true,month:true}"
@confirm="startTimeChange1"></u-picker>
</u-form-item>
<u-form-item label="学历:" prop="education" required='true'>
<u-input class="seleclas" v-model="projectobj.education" type="select" @click="Periodshow2 = true"
placeholder='请选择学历' />
<u-select v-model="Periodshow2" :list="PeriodList" @confirm="Periodchange"></u-select>
</u-form-item>
<u-form-item label="专业名称:" prop="major" required='true'>
<u-input style="width:100%;" v-model="projectobj.major" placeholder='请输入专业名称' />
</u-form-item>
</u-form>
<view class="bottbtn" @click="resource">保存</view>
<!-- <view class="bottbtn" @click="delpro">删除</view> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
export default {
data() {
return {
projectobj: {
type: 2,
},
projectRules: {
name: [{
required: true,
message: '请输入公司名称',
trigger: 'blur',
}],
startTime: [{
required: true,
message: '请选择开始时间',
trigger: 'change',
}],
endTime: [{
required: true,
message: '请选择结束时间',
trigger: 'change',
}],
education: [{
required: true,
message: '请输入职位名称',
trigger: 'blur',
}],
major: [{
required: true,
message: '请输入工作内容',
trigger: 'blur',
}],
},
Periodshow: false,
Periodshow1: false,
Periodshow2: false,
PeriodList: [{
value: '专科',
label: '专科'
}, {
value: '本科',
label: '本科'
}, {
value: '硕士研究生',
label: '硕士研究生'
}, {
value: '博士研究生',
label: '博士研究生'
}],
}
},
onReady() {
this.$refs.projectobj.setRules(this.projectRules);
},
onLoad(option) {
let type = option.type;
if (type && type == 1) {
uni.setNavigationBarTitle({
title: '添加教育经历'
});
} else {
uni.setNavigationBarTitle({
title: '编辑教育经历'
});
let caseId = option.caseId
if (caseId) {
this.http.quickGet(`/personal/case/${caseId}`, true).then(res => {
this.projectobj = res.data
})
}
}
},
methods: {
Periodchange(e) {
this.projectobj.education = e[0].label
},
startTimeChange(e) {
this.projectobj.startTime = e.year + '-' + e.month
},
startTimeChange1(e) {
this.projectobj.endTime = e.year + '-' + e.month
},
resource() {
this.$refs.projectobj.validate(valid => {
if (valid) {
if (this.projectobj.caseId) {
this.http.quickPost(`/personal/case/update`, this.projectobj, true).then(res => {
if (res.data.code == 200) {
this.$refs.uToast.show({
title: '编辑教育经历成功',
type: 'success',
url: 'pages/personal/personalresume/personalresume'
})
}
})
} else {
console.log(this.projectobj);
this.http.quickPost(`/personal/case/add`, this.projectobj, true).then(res => {
if (res.data.code == 200) {
this.$refs.uToast.show({
title: '添加教育经历成功',
type: 'success',
url: 'pages/personal/personalresume/personalresume'
})
}
})
}
}
})
},
// 删除
delpro() {
this.http.quickDelete(`/personal/case/${this.projectobj.caseId}`, true).then(res => {
console.log('res---', res)
this.$refs.uToast.show({
title: '删除工作成功',
type: 'info',
url: 'pages/personal/personalresume/personalresume'
})
})
}
}
}
</script>
<style>
.navTab {
background-color: #ffffff;
width: 96vw;
margin: 2vh auto;
padding: 10px 15px 30px 25px;
border-radius: 5px;
}
.u-form-left__content__label {
color: #808080 !important;
}
.navTab .u-input {
/* height:35px; */
border-bottom: 1px solid #EBEBEB !important;
}
.textare .u-input {
min-height: 100px;
}
.bottbtn {
/* width:94vw; */
margin: 30px 3vw 15px 3vw;
height: 75rpx;
background: linear-gradient(90deg, #5EA6FD, #1A81F9);
border-radius: 15rpx;
text-align: center;
line-height: 75rpx;
color: #FFFFFF;
font-size: 33rpx;
}
.title {
color: #1A81F9;
text-align: center;
padding: 20rpx 0 0 0;
}
</style>