|
@@ -38,12 +38,10 @@
|
|
|
<text class="required-mark">*</text>
|
|
<text class="required-mark">*</text>
|
|
|
<text class="label-text">在校时间</text>
|
|
<text class="label-text">在校时间</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="form-input time-range">
|
|
|
|
|
|
|
+ <!-- <view class="form-input time-range">
|
|
|
<view class="time-input">
|
|
<view class="time-input">
|
|
|
<uni-datetime-picker v-model="formData.employmentTime[0]" type="date"
|
|
<uni-datetime-picker v-model="formData.employmentTime[0]" type="date"
|
|
|
:border="false" placeholder="开始时间" />
|
|
:border="false" placeholder="开始时间" />
|
|
|
- <!-- <image src="../../static/images/index/Iconly_Light_Calendar.svg"
|
|
|
|
|
- style="width: 48rpx; height: 48rpx;" mode="aspectFit"></image> -->
|
|
|
|
|
</view>
|
|
</view>
|
|
|
<view class="time-separator">至</view>
|
|
<view class="time-separator">至</view>
|
|
|
<view class="time-input">
|
|
<view class="time-input">
|
|
@@ -52,7 +50,46 @@
|
|
|
<image src="../../static/images/index/Iconly_Light_Calendar.svg"
|
|
<image src="../../static/images/index/Iconly_Light_Calendar.svg"
|
|
|
style="width: 48rpx; height: 48rpx;" mode="aspectFit"></image>
|
|
style="width: 48rpx; height: 48rpx;" mode="aspectFit"></image>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ </view> -->
|
|
|
|
|
+ <view class="form-input time-range">
|
|
|
|
|
+ <!-- 开始年月 -->
|
|
|
|
|
+ <view class="time-input">
|
|
|
|
|
+ <picker
|
|
|
|
|
+ mode="multiSelector"
|
|
|
|
|
+ :range="yearMonthRange"
|
|
|
|
|
+ :value="employmentTimeIndex[0]"
|
|
|
|
|
+ @change="onStartChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <view class="picker-label">
|
|
|
|
|
+ {{ formData.employmentTime[0] || '开始年月' }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </picker>
|
|
|
|
|
+ </view>
|
|
|
|
|
+
|
|
|
|
|
+ <view class="time-separator">至</view>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 结束年月 -->
|
|
|
|
|
+ <view class="time-input" @click="onEndClick">
|
|
|
|
|
+ <picker
|
|
|
|
|
+ mode="multiSelector"
|
|
|
|
|
+ :range="yearMonthRange"
|
|
|
|
|
+ :value="employmentTimeIndex[1]"
|
|
|
|
|
+ @change="onEndChange"
|
|
|
|
|
+ :disabled="!formData.employmentTime[0]"
|
|
|
|
|
+ >
|
|
|
|
|
+ <view class="picker-label">
|
|
|
|
|
+ {{ formData.employmentTime[1] || '结束年月' }}
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </picker>
|
|
|
|
|
+ <image
|
|
|
|
|
+ src="../../static/images/index/Iconly_Light_Calendar.svg"
|
|
|
|
|
+ style="width: 48rpx; height: 48rpx;"
|
|
|
|
|
+ mode="aspectFit"
|
|
|
|
|
+ />
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<!-- 所在部门 -->
|
|
<!-- 所在部门 -->
|
|
@@ -125,14 +162,15 @@ export default {
|
|
|
showAddSkill: false,
|
|
showAddSkill: false,
|
|
|
newSkillName: '',
|
|
newSkillName: '',
|
|
|
currentResumeIndex: 0,
|
|
currentResumeIndex: 0,
|
|
|
-
|
|
|
|
|
formData: {
|
|
formData: {
|
|
|
companyName: '',
|
|
companyName: '',
|
|
|
- employmentTime: [],
|
|
|
|
|
|
|
+ employmentTime: ['', ''],
|
|
|
departmentIndex: 0,
|
|
departmentIndex: 0,
|
|
|
workContent: '',
|
|
workContent: '',
|
|
|
workPerformance: ''
|
|
workPerformance: ''
|
|
|
},
|
|
},
|
|
|
|
|
+ employmentTimeIndex: [[0, 0], [0, 0]],
|
|
|
|
|
+ yearMonthRange: [],
|
|
|
departments:[
|
|
departments:[
|
|
|
"初中",
|
|
"初中",
|
|
|
"高中",
|
|
"高中",
|
|
@@ -154,6 +192,7 @@ export default {
|
|
|
id=options&&options.id?options.id:''
|
|
id=options&&options.id?options.id:''
|
|
|
if(id!=''&&id!=0)
|
|
if(id!=''&&id!=0)
|
|
|
this.getData()
|
|
this.getData()
|
|
|
|
|
+ this.initYearMonth();
|
|
|
// 监听技能设置更新
|
|
// 监听技能设置更新
|
|
|
},
|
|
},
|
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
@@ -163,6 +202,79 @@ export default {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 初始化年份-月份列表
|
|
|
|
|
+ initYearMonth() {
|
|
|
|
|
+ const years = []
|
|
|
|
|
+ const months = []
|
|
|
|
|
+ const currentDate = new Date()
|
|
|
|
|
+ const currentYear = currentDate.getFullYear()
|
|
|
|
|
+ const currentMonth = currentDate.getMonth() + 1
|
|
|
|
|
+
|
|
|
|
|
+ for (let y = currentYear - 50; y <= currentYear + 5; y++) {
|
|
|
|
|
+ years.push(y)
|
|
|
|
|
+ }
|
|
|
|
|
+ for (let m = 1; m <= 12; m++) {
|
|
|
|
|
+ months.push(m < 10 ? '0' + m : '' + m)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.yearMonthRange = [years, months]
|
|
|
|
|
+
|
|
|
|
|
+ // 计算当前年月对应的索引
|
|
|
|
|
+ const yearIndex = years.indexOf(currentYear)
|
|
|
|
|
+ const monthIndex = months.indexOf(currentMonth < 10 ? '0' + currentMonth : '' + currentMonth)
|
|
|
|
|
+
|
|
|
|
|
+ // 设置默认滚轮位置
|
|
|
|
|
+ this.employmentTimeIndex = [
|
|
|
|
|
+ [yearIndex, monthIndex],
|
|
|
|
|
+ [yearIndex, monthIndex]
|
|
|
|
|
+ ]
|
|
|
|
|
+ },
|
|
|
|
|
+ onStartChange(e) {
|
|
|
|
|
+ const [yIndex, mIndex] = e.detail.value
|
|
|
|
|
+ this.employmentTimeIndex[0] = e.detail.value
|
|
|
|
|
+ this.$set(this.formData.employmentTime, 0, `${this.yearMonthRange[0][yIndex]}-${this.yearMonthRange[1][mIndex]}`)
|
|
|
|
|
+
|
|
|
|
|
+ // 如果结束年月已选择,检查是否小于开始年月
|
|
|
|
|
+ if (this.formData.employmentTime[1]) {
|
|
|
|
|
+ const [endYear, endMonth] = this.formData.employmentTime[1].split('-').map(Number)
|
|
|
|
|
+ const startYear = this.yearMonthRange[0][yIndex]
|
|
|
|
|
+ const startMonth = Number(this.yearMonthRange[1][mIndex])
|
|
|
|
|
+
|
|
|
|
|
+ if (endYear < startYear || (endYear === startYear && endMonth < startMonth)) {
|
|
|
|
|
+ // 如果结束年月小于开始年月,清空结束年月
|
|
|
|
|
+ this.$set(this.formData.employmentTime, 1, '')
|
|
|
|
|
+ this.employmentTimeIndex[1] = [yIndex, mIndex] // 重置 picker 滚轮到开始年月
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onEndClick(){
|
|
|
|
|
+ if (!this.formData.employmentTime[0]) {
|
|
|
|
|
+ uni.showToast({ title: '请先选择开始年月', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ onEndChange(e) {
|
|
|
|
|
+ if (!this.formData.employmentTime[0]) {
|
|
|
|
|
+ uni.showToast({ title: '请先选择开始年月', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const [yIndex, mIndex] = e.detail.value
|
|
|
|
|
+ const startDate = this.formData.employmentTime[0].split('-').map(Number)
|
|
|
|
|
+ const startYear = startDate[0]
|
|
|
|
|
+ const startMonth = startDate[1]
|
|
|
|
|
+ const selectedYear = this.yearMonthRange[0][yIndex]
|
|
|
|
|
+ const selectedMonth = Number(this.yearMonthRange[1][mIndex])
|
|
|
|
|
+
|
|
|
|
|
+ // 校验结束年月是否小于开始年月
|
|
|
|
|
+ if (selectedYear < startYear || (selectedYear === startYear && selectedMonth < startMonth)) {
|
|
|
|
|
+ uni.showToast({ title: '结束年月不能小于开始年月', icon: 'none' })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ this.employmentTimeIndex[1] = e.detail.value
|
|
|
|
|
+ this.$set(this.formData.employmentTime, 1, `${selectedYear}-${this.yearMonthRange[1][mIndex]}`)
|
|
|
|
|
+ },
|
|
|
goBack() {
|
|
goBack() {
|
|
|
uni.navigateBack()
|
|
uni.navigateBack()
|
|
|
},
|
|
},
|
|
@@ -171,8 +283,8 @@ export default {
|
|
|
this.$Request.getT("/app/userFirst/selectEdu", {eduId:id}).then((res) => {
|
|
this.$Request.getT("/app/userFirst/selectEdu", {eduId:id}).then((res) => {
|
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
|
res=res.data
|
|
res=res.data
|
|
|
- that.formData.companyName= res.school
|
|
|
|
|
- that.formData.employmentTime= [res.startTime,res.endTime]
|
|
|
|
|
|
|
+ that.formData.companyName= res.school
|
|
|
|
|
+ that.formData.employmentTime= [res.startTime ? res.startTime.slice(0, 7) : '',res.endTime ? res.endTime.slice(0, 7) : '']
|
|
|
that.formData.departmentIndex= that.departments.indexOf(res.degree)<=0?0:that.departments.indexOf(res.degree)
|
|
that.formData.departmentIndex= that.departments.indexOf(res.degree)<=0?0:that.departments.indexOf(res.degree)
|
|
|
that.formData.workContent= res.detail
|
|
that.formData.workContent= res.detail
|
|
|
that.formData.workPerformance= res.profession
|
|
that.formData.workPerformance= res.profession
|
|
@@ -215,8 +327,8 @@ export default {
|
|
|
eduId:id,
|
|
eduId:id,
|
|
|
school:this.formData.companyName,
|
|
school:this.formData.companyName,
|
|
|
profession:this.formData.workPerformance,
|
|
profession:this.formData.workPerformance,
|
|
|
- startTime:this.formData.employmentTime.length<=0?'':this.formData.employmentTime[0],
|
|
|
|
|
- endTime:this.formData.employmentTime.length<=0?'':this.formData.employmentTime[1],
|
|
|
|
|
|
|
+ startTime:this.formData.employmentTime.length<=0?'':this.formData.employmentTime[0] + '-' + '01',
|
|
|
|
|
+ endTime:this.formData.employmentTime.length<=0?'':this.formData.employmentTime[1] + '-' + '01',
|
|
|
degree:this.departments[this.formData.departmentIndex],
|
|
degree:this.departments[this.formData.departmentIndex],
|
|
|
detail:this.formData.workContent
|
|
detail:this.formData.workContent
|
|
|
}
|
|
}
|