软测宝小程序
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.
keysass_app/pages/personal/personalresume/projectexperience.vue

194 lines
5.0 KiB

7 months ago
<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='请输入项目名称' />
7 months ago
</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>
7 months ago
</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>
7 months ago
</u-form-item>
<u-form-item label="担任角色:" prop="title" required='true'>
<u-input style="width:100%;" v-model="projectobj.title" placeholder='请输入担任角色' />
7 months ago
</u-form-item>
6 months ago
<u-form-item label="应用技术:" prop="applyTech" required='true'>
<u-input style="width:100%;" v-model="projectobj.applyTech" placeholder='请输入应用技术' />
7 months ago
</u-form-item>
<u-form-item label="项目简介:" prop="intro" required='true' class="textare">
<u-input style="width:100%;height: 100px;" border='true' type='textarea'
v-model="projectobj.intro" placeholder='请输入项目简介' />
</u-form-item>
7 months ago
</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: 0,
},
7 months ago
projectRules: {
name: [{
required: true,
message: '请输入项目名称',
trigger: 'blur',
}],
startTime: [{
required: true,
message: '请选择开始时间',
trigger: 'change',
}],
endTime: [{
required: true,
message: '请选择开始时间',
trigger: 'change',
}],
title: [{
required: true,
message: '请输入担任角色',
trigger: 'blur',
}],
applyTech: [{
required: true,
message: '请输入应用技术',
trigger: 'blur',
}],
intro: [{
required: true,
message: '请输入项目简介',
trigger: 'blur',
}],
7 months ago
},
Periodshow: false,
Periodshow1: false,
7 months ago
}
},
onReady() {
7 months ago
this.$refs.projectobj.setRules(this.projectRules);
},
onLoad(option) {
let type = option.type;
if (type && type == 1) {
7 months ago
uni.setNavigationBarTitle({
title: '添加项目经历'
});
} else {
7 months ago
uni.setNavigationBarTitle({
title: '编辑项目经历'
});
let caseId = option.caseId
if (caseId) {
this.http.quickGet(`/personal/case/${caseId}`, true).then(res => {
this.projectobj = res.data
7 months ago
})
}
}
},
methods: {
startTimeChange(e) {
this.projectobj.startTime = e.year + '-' + e.month
},
startTimeChange1(e) {
this.projectobj.endTime = e.year + '-' + e.month
7 months ago
},
resource() {
7 months ago
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) {
7 months ago
this.$refs.uToast.show({
title: '编辑项目成功',
type: 'success',
url: 'pages/personal/personalresume/personalresume'
7 months ago
})
}
})
} else {
console.log( this.projectobj);
this.http.quickPost(`/personal/case/add`, this.projectobj, true).then(res => {
if (res.data.code == 200) {
7 months ago
this.$refs.uToast.show({
title: '添加项目成功',
type: 'success',
url: 'pages/personal/personalresume/personalresume'
7 months ago
})
}
})
}
}
})
},
// 删除
delpro() {
this.http.quickDelete(`/personal/case/${this.projectobj.caseId}`, true).then(res => {
console.log('res---', res)
7 months ago
this.$refs.uToast.show({
title: '删除项目成功',
type: 'info',
url: 'pages/personal/personalresume/personalresume'
7 months ago
})
})
}
}
}
</script>
<style>
.navTab {
7 months ago
background-color: #ffffff;
width: 96vw;
margin: 2vh auto;
padding: 10px 15px 30px 25px;
border-radius: 5px;
7 months ago
}
.u-form-left__content__label {
color: #808080 !important;
7 months ago
}
.navTab .u-input {
7 months ago
/* height:35px; */
border-bottom: 1px solid #EBEBEB !important;
7 months ago
}
.textare .u-input {
min-height: 100px;
7 months ago
}
.bottbtn {
7 months ago
/* width:94vw; */
margin: 30px 3vw 15px 3vw;
height: 75rpx;
7 months ago
background: linear-gradient(90deg, #5EA6FD, #1A81F9);
border-radius: 15rpx;
7 months ago
text-align: center;
line-height: 75rpx;
7 months ago
color: #FFFFFF;
font-size: 33rpx;
}
.title {
7 months ago
color: #1A81F9;
text-align: center;
padding: 20rpx 0 0 0;
}
</style>