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.
194 lines
5.0 KiB
194 lines
5.0 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="title" required='true'>
|
|
<u-input style="width:100%;" v-model="projectobj.title" placeholder='请输入担任角色' />
|
|
</u-form-item>
|
|
<u-form-item label="应用技术:" prop="applyTech" required='true'>
|
|
<u-input style="width:100%;" v-model="projectobj.applyTech" placeholder='请输入应用技术' />
|
|
</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>
|
|
|
|
</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,
|
|
},
|
|
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',
|
|
}],
|
|
},
|
|
Periodshow: false,
|
|
Periodshow1: false,
|
|
}
|
|
},
|
|
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: {
|
|
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> |