| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119 |
- <template>
- <view class="work-experience">
- <!-- 自定义导航栏 -->
- <view class="custom-navbar" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
- <view class="navbar-content">
- <view class="nav-left" @click="goBack">
- <u-icon name="arrow-leftward" color="#333" size="42"></u-icon>
- </view>
- <view class="nav-title">工作经历</view>
- <view class="nav-right"></view>
- </view>
- </view>
- <!-- 主要内容 -->
- <view class="main-content">
- <!-- 公司信息 -->
- <view class="form-section">
- <!-- 公司名称 -->
- <view class="form-item">
- <view class="form-label">
- <text class="required-mark">*</text>
- <text class="label-text">公司名称</text>
- </view>
- <view class="form-input">
- <input v-model="formData.companyName" placeholder="请填写公司名称" maxlength="50" />
- <u-icon v-if="formData.companyName" name="close-circle-fill" color="#C9CDD4" size="28"
- @click="formData.companyName = ''" class="clear-icon"></u-icon>
- </view>
- </view>
- <!-- 公司业务类型 -->
- <view class="form-item">
- <view class="form-label" style="margin-bottom: 20rpx;">
- <text class="required-mark">*</text>
- <text class="label-text">公司业务类型</text>
- </view>
- <view class="checkbox-container">
- <u-checkbox-group @change="checkboxGroupChange" :wrap="false" shape="square"
- active-color="#007AFF">
- <u-checkbox v-for="(option, index) in businessTypeOptions" :key="index" :name="option.value"
- v-model="option.checked" class="checkbox-item">
- {{ option.label }}
- </u-checkbox>
- </u-checkbox-group>
- </view>
- </view>
- </view>
- <!-- 岗位履历 -->
- <view class="form-section" v-for="(resume, index) in formData.resumes" :key="index">
- <!-- <view class="section-title" v-if="hasCrossBorderExperience"><text>岗位履历 ({{ index + 1 }})</text> -->
- <view class="section-title"><text>岗位履历 ({{ index + 1 }})</text>
- <image src="@/static/images/index/delete.svg" style="width: 40rpx;height: 40rpx;"
- @click="deleteResume(index)" v-if="formData.resumes && formData.resumes.length > 1" />
- </view>
- <!-- 任职时间 -->
- <view class="form-item">
- <view class="form-label">
- <text class="required-mark">*</text>
- <text class="label-text">在职时间</text>
- </view>
- <view class="form-input time-range">
- <view class="time-input" @click="handleSelectDate(index, 'start', resume.employmentTime[0])">
- {{ resume.employmentTime[0] || '开始时间' }}
- <!-- <uni-datetime-picker v-model="resume.employmentTime[0]" type="date"
- :border="false" placeholder="开始时间" /> -->
- <!-- <image src="../../static/images/index/Iconly_Light_Calendar.svg"
- style="width: 48rpx; height: 48rpx;" mode="aspectFit"></image> -->
- </view>
- <view class="time-separator">至</view>
- <view class="time-input" @click="handleSelectDate(index, 'end', resume.employmentTime[1])">
- {{ resume.employmentTime[1] || '结束时间' }}
- <!-- <uni-datetime-picker v-model="resume.employmentTime[1]" type="date"
- :border="false" placeholder="结束时间" /> -->
- </view>
- <image src="../../static/images/index/Iconly_Light_Calendar.svg"
- style="width: 48rpx; height: 48rpx;" mode="aspectFit"></image>
- </view>
- </view>
- <!-- 所在部门 -->
- <!-- <view class="form-item">
- <view class="form-label">
- <text class="required-mark">*</text>
- <text class="label-text">所在部门</text>
- </view>
- <view class="form-input">
- <picker class="picker" :data-index="index" mode="selector" :range="departments"
- @change="selectDepartment">
- <text>{{ departments.length > 0 ? departments[resume.departmentIndex] : '请选择部门' }}</text>
- </picker>
- <u-icon name="arrow-down" color="#999" size="36"></u-icon>
- </view>
- </view> -->
- <!-- 岗位 -->
- <view class="form-item">
- <view class="form-label">
- <text class="required-mark">*</text>
- <text class="label-text">岗位</text>
- </view>
- <view class="form-input" @click="selectPosition(index)">
- <text v-if="resume.position">{{ resume.position }}</text>
- <text v-else class="placeholder">请选择岗位</text>
- <u-icon name="arrow-right" color="#999" size="36"></u-icon>
- </view>
- </view>
- <!-- 岗位职级 -->
- <!-- <view class="form-item">
- <view class="form-label">岗位职级</view>
- <view class="form-input">
- <picker class="picker" :data-index="index" mode="selector" :range="positionLevels"
- @change="selectPositionLevel">
- <text>{{ resume.positionLevel || '请选择' }}</text>
- </picker>
- <u-icon name="arrow-down" color="#999" size="36"></u-icon>
- </view>
- </view> -->
- <!-- 岗位职业技能 -->
- <view class="form-item">
- <view class="form-label">
- <text class="required-mark">*</text>
- <text class="label-text">跨境职业技能</text>
- </view>
- <view class="skills-input-container">
- <view class="skills-tags">
- <view v-for="(skill, skillIndex) in resume.skills" :key="skillIndex" class="skill-tag">
- <text>{{ skill }}</text>
- <u-icon name="close" color="#999" size="16"
- @click="removeSkill(index, skillIndex)"></u-icon>
- </view>
- </view>
- <view class="add-skill-btn" @click="addSkill(index)">
- <u-icon name="plus" color="rgba(102, 102, 102, 1)" size="28"></u-icon>
- </view>
- </view>
- </view>
- <!-- 工作内容 -->
- <view class="form-item">
- <view class="form-label">
- <text class="required-mark">*</text>
- <text class="label-text">工作内容</text>
- </view>
- <view class="form-input">
- <textarea v-model="resume.workContent" placeholder="请输入工作内容" auto-height
- @input="handleTextareaInput($event, 'workContent', index)" class="form-textarea"></textarea>
- <view class="textarea-clear" v-if="resume.workContent"
- @click="clearTextarea('workContent', index)">
- <u-icon name="close-circle-fill" color="#C9CDD4" size="28"></u-icon>
- </view>
- </view>
- </view>
- <!-- 工作业绩 -->
- <view class="form-item">
- <view class="form-label">工作业绩</view>
- <view class="form-input">
- <textarea v-model="resume.workPerformance" placeholder="请输入工作绩效" auto-height
- @input="handleTextareaInput($event, 'workPerformance', index)"
- class="form-textarea"></textarea>
- <view class="textarea-clear" v-if="resume.workPerformance"
- @click="clearTextarea('workPerformance', index)">
- <u-icon name="close-circle-fill" color="#C9CDD4" size="28"></u-icon>
- </view>
- </view>
- </view>
- <!-- 添加岗位履历按钮 -->
- <view class="add-resume-btn" @click="addResume"
- v-if="index === formData.resumes.length - 1">
- <text>添加岗位履历</text>
- </view>
- </view>
-
- <!-- 删除工作经历 -->
- <view class="delete-experience" v-if="isEdit" @click="handleDeleteExp">删除全部工作经验</view>
- <!-- 底部保存按钮 -->
- <view class="fixed-section">
- <u-button type="primary" class="submit-btn" @click="saveWorkExperience">保存</u-button>
- </view>
- </view>
- <!-- 添加技能弹窗 -->
- <u-popup v-model="showAddSkill" mode="center" border-radius="24" width="80%">
- <view class="add-skill-popup">
- <view class="popup-title">添加技能</view>
- <view class="popup-content">
- <input v-model="newSkillName" placeholder="请输入技能名称" class="skill-input" maxlength="10" />
- </view>
- <view class="popup-buttons">
- <view class="popup-btn cancel-btn" @click="cancelAddSkill">取消</view>
- <view class="popup-btn confirm-btn" @click="confirmAddSkill">确定</view>
- </view>
- </view>
- </u-popup>
- <!-- 清除确认弹窗 -->
- <u-modal v-model="showClearConfirm" :content="'确定要清除所有填写的内容吗?'" show-cancel-button confirm-text="确定清除"
- cancel-text="取消" @confirm="clearAllContent" confirm-color="#FF4444"></u-modal>
-
- <!-- 时间控件弹窗 -->
- <u-select v-model="showSelectDate" :default-value="defaultDate" :list="dateList" @confirm="handleConfirmDate"></u-select>
- </view>
- </template>
- <script>
- var id = '';
- export default {
- data() {
- return {
- statusBarHeight: 0, // 状态栏高度
- showAddSkill: false,
- newSkillName: '',
- currentResumeIndex: 0,
- showClearConfirm: false, // 清除确认弹窗
- businessTypeOptions: [{
- label: '跨境电商',
- value: '0',
- checked: false
- },
- {
- label: '国内电商',
- value: '1',
- checked: false
- },
- {
- label: '外贸',
- value: '2',
- checked: false
- },
- {
- label: '其他',
- value: '3',
- checked: false
- }
- ],
- formData: {
- companyName: '',
- businessTypes: [],
- resumes: [{
- workExpDetailId: "",
- workExpId: "",
- employmentTime: [],
- department: '',
- departmentId: 0,
- departmentIndex: 0,
- position: '',
- positionId: 0,
- positionLevel: '初级',
- skills: [],
- workContent: '',
- workPerformance: ''
- }]
- },
- departments: [],
- departmentsIds: [],
- positionLevels: ['初级', '中级','高级','资深','其它'],
- operateKey: 0,
- isWork: false,
- isEdit: false, // 是否是编辑
- showSelectDate: false,
- selectParams: {
- index: 0,
- type: 'start', // start、end
- },
- currentDate: '', // 当前时间,记录选中的时间,用于u-select控件回显
- dateList: []
- }
- },
- onLoad(options) {
- // 获取状态栏高度
- let systemInfo = uni.getSystemInfoSync();
- this.statusBarHeight = systemInfo.statusBarHeight || 0;
- // 接收从在线简历页面传递的业务类型参数
- if (options.businessTypes) {
- try {
- const businessTypes = JSON.parse(decodeURIComponent(options.businessTypes))
- this.formData.businessTypes = businessTypes
- console.log('接收到的业务类型:', businessTypes)
- // console.log('是否有跨境经验:', this.hasCrossBorderExperience)
- // if (this.hasCrossBorderExperience)
- // this.businessTypeOptions[0].checked = true
- } catch (e) {
- console.error('解析业务类型参数失败:', e)
- }
- }
- this.getDepartment()
- id = options && options.id ? options.id : ''
- if (options && options.id) {
- this.isEdit = true;
- }
- // 监听技能设置更新
- uni.$on('jobs', (data) => {
- console.log('岗位设置已更新:', data)
- // 这里可以更新对应的技能显示
- this.formData.resumes[this.operateKey].position = data.ruleClassifyName
- this.formData.resumes[this.operateKey].positionId = data.ruleClassifyId;
- // 更新以后给岗位职业技能设置默认值
- this.getDataInfo(this.formData.resumes[this.operateKey].positionId);
- })
- uni.$on('skillsUpdated', (data) => {
- console.log('技能设置已更新:', data)
- // 这里可以更新对应的技能显示
- this.formData.resumes[this.operateKey].skills = data.selectedTags
- })
-
- // 生成时间组件数据
- this.dateList = this.generateYearMonthArray()
- },
- beforeDestroy() {
- // 移除事件监听
- uni.$off('jobs')
- uni.$off('skillsUpdated')
- },
- computed: {
- hasCrossBorderExperience() {
- return this.formData.businessTypes.includes('0')
- },
- hasContentToClear() {
- // 检查是否有内容可以清除
- return this.formData.companyName ||
- this.formData.businessTypes.length > 0 ||
- this.formData.resumes.some(resume =>
- resume.position ||
- resume.workContent ||
- resume.workPerformance ||
- resume.skills.length > 0
- )
- },
- // 时间控件回显
- defaultDate() {
- let currentIndex = 0
- this.dateList.forEach((date, index) => {
- if (this.currentDate == date.value) {
- currentIndex = index
- }
- })
- return [currentIndex]
- }
- },
- methods: {
- // 生成时间控件列表数据
- generateYearMonthArray() {
- // 定义起始年份和月份
- const startYear = 1950;
- const startMonth = 1; // 1月
-
- // 获取当前日期
- const now = new Date();
- const endYear = now.getFullYear();
- const endMonth = now.getMonth() + 1; // 月份从0开始,所以要+1
-
- // 存储最终结果的数组
- const result = [];
-
- // 遍历年份,从起始年到当前年
- for (let year = startYear; year <= endYear; year++) {
- // 确定当前年份需要遍历的月份范围
- let currentEndMonth = 12; // 默认到12月
- // 如果是当前年份,只遍历到当前月份
- if (year === endYear) {
- currentEndMonth = endMonth;
- }
-
- // 遍历月份,从1月到当前年份的结束月份
- for (let month = startMonth; month <= currentEndMonth; month++) {
- // 格式化value:确保月份是两位数(如1月显示为01)
- const formattedMonth = month.toString().padStart(2, '0');
- const value = `${year}-${formattedMonth}`;
-
- // 格式化label:直接显示月份数字(如1月)
- const label = `${year}年 ${month}月`;
-
- // 添加到结果数组
- result.unshift({ value, label });
- }
- }
-
- // 添加“至今”选项
- result.unshift({
- value: '至今',
- label: '至今'
- })
-
- return result;
- },
- // 打开日期选择控件
- handleSelectDate(index, type, date) {
- this.selectParams.index = index;
- this.selectParams.type = type;
- this.currentDate = date;
- this.showSelectDate = true;
- },
- // 选择时间
- handleConfirmDate(data) {
- for (let i = 0; i < this.formData.resumes.length; i++) {
- if (i === this.selectParams.index) {
- if (this.selectParams.type == 'end') {
- this.formData.resumes[i].employmentTime[1] = data[0].value
- } else {
- this.formData.resumes[i].employmentTime[0] = data[0].value
- }
- break
- }
- }
- },
- getDataInfo(jobId) {
- let data = {
- ruleClassifyId: jobId
- }
- this.$Request.getT('/app/userFirst/getPostSkill', data).then(res => {
- if (res.code == 0) {
- if (res.data.length > 0 && res.data[0]?.childrenList[0]?.postSkillName)
- this.formData.resumes[this.operateKey].skills = []
- this.formData.resumes[this.operateKey].skills.push(res.data[0]?.childrenList[0]?.postSkillName)
- }
- })
- },
- goBack() {
- uni.navigateBack()
- },
- getDepartment() {
- var that = this
- this.$Request.postJson("/app/userFirst/getDepartment", {}).then((res) => {
- if (res.code == 0) {
- that.departments = that.$queue.array_column(res.data, 'departmentName')
- that.departmentsIds = that.$queue.array_column(res.data, 'departmentId')
- that.formData.resumes.forEach(function (item) {
- item.departmentId = that.departmentsIds[item.departmentIndex]
- item.department = that.departments[item.departmentIndex]
- })
- if (id != '' && id != 0)
- that.getData()
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none",
- });
- }
- });
- },
- getData() {
- var that = this
- this.$Request.getT("/app/userFirst/getWorkExpDetailOne", {
- workExpId: id
- }).then((res) => {
- if (res.code == 0) {
- res = res.data
- that.formData.companyName = res.workExp.companyName
- that.formData.businessTypes = JSON.parse(res.workExp.type)
- // 设置公司业务类型回显
- if (this.formData.businessTypes?.length) {
- for (let i = 0; i < this.formData.businessTypes.length; i++) {
- for (let opt = 0; i < this.businessTypeOptions.length; opt++) {
- const option = this.businessTypeOptions[opt]
- if (this.formData.businessTypes[i] == option.value) {
- this.businessTypeOptions[opt].checked = true
- break
- }
- }
- }
- }
- console.log(that.formData.businessTypes)
- res.workExpDetails.forEach(function (item) {
- item.skills = JSON.parse(item.skills)
- item.employmentTime = item.startTime == '' ? [] : [item.startTime, item
- .endTime],
- item.departmentIndex = that.departmentsIds.indexOf(item.departmentId) < 0 ?
- 0 : that.departmentsIds.indexOf(item.departmentId)
- })
- that.formData.resumes = res.workExpDetails
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none",
- });
- }
- });
- },
- // selectDepartment(e) {
- // var key = Number(e.currentTarget.dataset.index)
- // this.formData.resumes[key].departmentId = this.departmentsIds[e.detail.value]
- // this.formData.resumes[key].departmentIndex = e.detail.value
- // this.formData.resumes[key].department = this.departments[e.detail.value]
- // },
- formatter(type, value) {
- if (type === 'year') {
- return `${value}年`
- }
- if (type === 'month') {
- return `${value}月`
- }
- if (type === 'day') {
- return `${value}日`
- }
- return value
- },
- checkboxGroupChange(e) {
- console.log('选中的业务类型:', e)
- // 更新 formData.businessTypes 以保持数据同步
- this.formData.businessTypes = e
- },
- selectEmploymentTime(index) {
- // 选择任职时间
- uni.showToast({
- title: '选择任职时间',
- icon: 'none'
- })
- },
- selectPosition(index) {
- this.operateKey = index
- // 选择岗位
- uni.navigateTo({
- url: '/package/jobIntention/jobList'
- })
- },
- // selectPositionLevel(e) {
- // var key = Number(e.currentTarget.dataset.index)
- // this.formData.resumes[key].positionLevel = this.positionLevels[e.detail.value]
- // },
- addSkill(index) {
- this.operateKey = index
- //this.currentResumeIndex = index
- //this.showAddSkill = true
- //this.newSkillName = ''
- if (this.formData.resumes[index].positionId == '' || this.formData.resumes[index].positionId == 0)
- return this.$queue.showToast('请先选择岗位')
- uni.navigateTo({
- url: '/package/jobIntention/jobSkills?jobId=' + this.formData.resumes[index].positionId +
- '&jobTitle=' + this.formData.resumes[index].position + '&skill=' + encodeURIComponent(JSON
- .stringify(this.formData.resumes[index].skills))
- })
- },
- removeSkill(resumeIndex, skillIndex) {
- this.formData.resumes[resumeIndex].skills.splice(skillIndex, 1)
- },
- cancelAddSkill() {
- this.showAddSkill = false
- this.newSkillName = ''
- },
- confirmAddSkill() {
- if (this.newSkillName.trim()) {
- this.formData.resumes[this.currentResumeIndex].skills.push(this.newSkillName.trim())
- this.showAddSkill = false
- this.newSkillName = ''
- } else {
- uni.showToast({
- title: '请输入技能名称',
- icon: 'none'
- })
- }
- },
- selectWorkContent(index) {
- // 选择工作内容
- uni.showToast({
- title: '选择工作内容',
- icon: 'none'
- })
- },
- selectWorkPerformance(index) {
- // 选择工作业绩
- uni.showToast({
- title: '选择工作业绩',
- icon: 'none'
- })
- },
- addResume() {
- this.formData.resumes.push({
- workExpDetailId: "",
- workExpId: "",
- employmentTime: [],
- department: this.departments[0],
- departmentId: this.departmentsIds[0],
- departmentIndex: 0,
- position: '',
- positionId: 0,
- positionLevel: '初级',
- skills: [],
- workContent: '',
- workPerformance: ''
- })
- },
- deleteResume(index) {
- this.formData.resumes.splice(index, 1)
- },
- // 处理文本域输入
- handleTextareaInput(e, field, index) {
- const value = e.detail.value;
- // 如果超过1000字,截断
- if (value.length > 1000) {
- this.formData.resumes[index][field] = value.substring(0, 1000);
- }
- },
- // 清除单个文本域
- clearTextarea(field, index) {
- this.formData.resumes[index][field] = '';
- },
- // 显示清除确认弹窗
- showClearAllConfirm() {
- this.showClearConfirm = true;
- },
- // 清除所有内容
- clearAllContent() {
- // 清空公司名称
- this.formData.companyName = '';
- // 清空业务类型选择
- this.formData.businessTypes = [];
- this.businessTypeOptions.forEach(option => {
- option.checked = false;
- });
- // 清空所有履历
- this.formData.resumes = [{
- workExpDetailId: "",
- workExpId: "",
- employmentTime: [],
- department: this.departments.length > 0 ? this.departments[0] : '',
- departmentId: this.departmentsIds.length > 0 ? this.departmentsIds[0] : 0,
- departmentIndex: 0,
- position: '',
- positionId: 0,
- positionLevel: '初级',
- skills: [],
- workContent: '',
- workPerformance: ''
- }];
- this.showClearConfirm = false;
- uni.showToast({
- title: '已清除所有内容',
- icon: 'success'
- });
- },
-
- // 删除工作经历
- handleDeleteExp() {
- this.$queue.appConfirm('确定删除该工作经历吗?', (res) => {
- if (!res) {
- return;
- }
- this.$Request.postJson('/app/userFirst/deleteWorkExp', {
- workExpId: id
- }).then((res) => {
- if (res.code == 0) {
- uni.showToast({
- title: "操作成功",
- icon: "none"
- });
- // 实际开发中可以在这里添加跳转逻辑
- uni.$emit('updateResume')
- setTimeout(() => {
- uni.navigateBack()
- }, 1000);
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none",
- });
- }
- });
- })
- },
- saveWorkExperience() {
- console.log(this.formData.resumes)
- if (!this.formData.companyName) {
- uni.showToast({
- title: "请输入公司名称",
- icon: "none"
- });
- return;
- }
- if (this.formData.businessTypes.length <= 0) {
- uni.showToast({
- title: "请选择公司业务类型",
- icon: "none"
- });
- return;
- }
- if (this.formData.resumes.length <= 0) {
- uni.showToast({
- title: "请至少填写一份履历",
- icon: "none"
- });
- return;
- }
- for (let i = 0; i < this.formData.resumes.length; i++) {
- const item = this.formData.resumes[i];
- const timeArr = item.employmentTime.filter(time => {
- if (time) {
- return time
- }
- });
- if (timeArr.length <= 0) {
- this.$queue.showToast('任职时间不能为空')
- return false;
- }
- if (timeArr.length < 2) {
- this.$queue.showToast('请选择完整的任职时间')
- return false;
- }
-
- // 判断开始时间是否大于结束时间
- let startTime = ''
- let endTime = ''
- if (item.employmentTime.length == 2) {
- startTime = item.employmentTime[0].split(' ')[0]
- endTime = item.employmentTime[1].split(' ')[0]
- }
- if (startTime && endTime && startTime > endTime) {
- this.$queue.showToast('任职开始时间不能大于任职结束时间')
- return false;
- }
-
- if (item.position == '') {
- this.$queue.showToast('岗位不能为空')
- return false;
- }
- if (item.skills.length <= 0) {
- this.$queue.showToast('岗位技能不能为空')
- return false;
- }
- if (!item.workContent) {
- this.$queue.showToast('请输入工作内容')
- return false;
- } else if (item.workContent.length < 80) {
- this.$queue.showToast('工作内容至少输入80个字')
- return false;
- }
- }
- let postData = this.formData.resumes.map(({
- employmentTime,
- departmentIndex,
- ...rest
- }) => {
- return {
- ...rest,
- skills: JSON.stringify(rest.skills),
- startTime: employmentTime?.[0] || '',
- endTime: employmentTime?.[1] || ''
- }
- })
- // this.formData.resumes.forEach(function(item){
- // console.log(item.skills)
- // item.skills=JSON.stringify(item.skills);
- // console.log(item.skills)
- // item.startTime=item.employmentTime[0]?item.employmentTime[0]:'';
- // item.endTime=item.employmentTime[1]?item.employmentTime[1]:'';
- // delete item.employmentTime;
- // delete item.departmentIndex;
- // })
- let data = {
- workExp: {
- workExpId: id,
- companyName: this.formData.companyName,
- type: JSON.stringify(this.formData.businessTypes),
- },
- workExpDetails: postData
- }
- if (this.isWork)
- return
- this.isWork = true
- uni.showLoading({
- title: "提交中..."
- });
- this.$Request.postJson("/app/userFirst/addWorkExp", data).then((res) => {
- uni.hideLoading();
- this.isWork = false
- this.formData.companyName == ''
- if (res.code == 0) {
- uni.showToast({
- title: "保存成功",
- icon: "none"
- });
- // 实际开发中可以在这里添加跳转逻辑
- uni.$emit('updateResume')
- setTimeout(() => {
- uni.navigateBack()
- }, 1000);
- } else {
- uni.showToast({
- title: res.msg,
- icon: "none",
- });
- }
- });
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- @import '@/common.scss';
-
- .work-experience {
- height: 100vh;
- padding-bottom: 172rpx;
- display: flex;
- flex-direction: column;
- }
- .custom-navbar {
- // position: fixed;
- // top: 0;
- // left: 0;
- // right: 0;
- background-color: #ffffff;
- // z-index: 9999;
- .navbar-content {
- display: flex;
- align-items: center;
- justify-content: space-between;
- height: 100%;
- padding: 0 40rpx;
- .nav-left,
- .nav-right {
- width: 60rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .nav-title {
- color: rgba(51, 51, 51, 1);
- font-family: DM Sans;
- font-size: 36rpx;
- font-weight: 700;
- line-height: 26px;
- letter-spacing: 0px;
- text-align: center;
- }
- }
- }
- .main-content {
- margin-top: 68rpx;
- padding: 0 20rpx 40rpx 20rpx;
- flex: 1;
- overflow: auto;
- }
- .form-section {
- background: #fff;
- border-radius: 16rpx;
- padding: 0rpx 10rpx;
- .section-title {
- color: rgba(23, 23, 37, 1);
- font-family: Inter;
- font-size: 32rpx;
- font-weight: 600;
- line-height: 48rpx;
- letter-spacing: 0%;
- text-align: left;
- padding: 16rpx 0 32rpx 0;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- }
- .form-item {
- margin-bottom: 32rpx;
- .form-label {
- color: rgba(31, 44, 55, 1);
- font-family: DM Sans;
- font-size: 32rpx;
- font-weight: 500;
- line-height: 22px;
- letter-spacing: 0%;
- text-align: left;
- margin-bottom: 20rpx;
- position: relative;
- .word-count {
- font-size: 24rpx;
- color: #aaa;
- position: absolute;
- bottom: 0;
- right: 0;
- }
- .required-mark {
- color: #FF3B30;
- font-size: 18px;
- font-weight: 500;
- margin-right: 4rpx;
- }
- .label-text {
- color: rgba(31, 44, 55, 1);
- font-family: DM Sans;
- font-size: 16px;
- font-weight: 500;
- line-height: 22px;
- letter-spacing: 0%;
- text-align: left;
- }
- }
- .form-input {
- width: 100%;
- min-height: 80rpx;
- padding: 0 40rpx;
- border: 1px solid rgba(227, 231, 236, 1);
- border-radius: 24px;
- background: rgba(255, 255, 255, 1);
- display: flex;
- align-items: center;
- justify-content: space-between;
- .placeholder {
- color: #999999;
- }
- picker {
- width: 100%;
- }
- textarea {
- width: 100%;
- padding: 20rpx 0;
- height: auto !important;
- // min-height: 40rpx;
- resize: none;
- line-height: 1.5;
- overflow-y: hidden;
- }
- .form-textarea {
- font-size: 28rpx;
- line-height: 32rpx;
- }
- }
- }
- .skills-input-container {
- width: 100%;
- min-height: 80rpx;
- padding: 0rpx 40rpx;
- border: 1px solid rgba(227, 231, 236, 1);
- border-radius: 32px;
- background: rgba(255, 255, 255, 1);
- display: flex;
- align-items: center;
- justify-content: space-between;
- .skills-tags {
- display: flex;
- flex-wrap: wrap;
- gap: 12rpx;
- flex: 1;
- padding: 16rpx 0;
- .skill-tag {
- padding: 8rpx 16rpx;
- background: #F5F5F5;
- border-radius: 8rpx;
- display: flex;
- align-items: center;
- gap: 8rpx;
- text {
- font-size: 24rpx;
- color: #666666;
- }
- }
- }
- .add-skill-btn {
- width: 40rpx;
- height: 40rpx;
- border: 1rpx solid rgba(102, 102, 102, 1);
- border-radius: 8rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #fff;
- flex-shrink: 0;
- }
- }
- .add-resume-btn {
- width: 100%;
- height: 80rpx;
- border-radius: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 20rpx;
- border-radius: 100px;
- background: rgba(1, 107, 246, 0.1);
- text {
- color: #016bf6;
- font-size: 32rpx;
- font-weight: 500;
- }
- }
- // 删除工作经历
- .delete-experience {
- font-size: 32rpx;
- text-align: center;
- line-height: 88rpx;
- color: rgba(153, 153, 153, 1);
- margin-top: 32rpx;
- }
- .add-skill-popup {
- background: #fff;
- border-radius: 24rpx;
- padding: 40rpx;
- .popup-title {
- color: rgba(34, 37, 42, 1);
- font-size: 36rpx;
- font-weight: 500;
- text-align: center;
- margin-bottom: 30rpx;
- }
- .popup-content {
- margin-bottom: 30rpx;
- .skill-input {
- width: 100%;
- height: 80rpx;
- padding: 0 20rpx;
- border: 1rpx solid #E5E5EA;
- border-radius: 12rpx;
- font-size: 28rpx;
- color: rgba(34, 37, 42, 1);
- background: #F7F8FA;
- }
- }
- .popup-buttons {
- display: flex;
- gap: 20rpx;
- .popup-btn {
- flex: 1;
- height: 80rpx;
- border-radius: 12rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 28rpx;
- font-weight: 500;
- }
- .cancel-btn {
- background: #F7F8FA;
- color: rgba(102, 102, 102, 1);
- }
- .confirm-btn {
- background: #007AFF;
- color: #fff;
- }
- }
- }
- .checkbox-container {
- display: flex;
- flex-wrap: nowrap;
- gap: 10rpx;
- /deep/ .u-checkbox-group {
- display: flex;
- flex-wrap: nowrap;
- width: 100%;
- }
- /deep/ .u-checkbox {
- flex: 1;
- min-width: 0;
- margin-right: 0;
- }
- /deep/ .u-checkbox__label {
- color: var(--Grayscale/Grayscale 100, rgba(23, 23, 37, 1));
- font-family: DM Sans;
- font-size: 24rpx;
- font-weight: 400;
- line-height: 48rpx;
- letter-spacing: 0%;
- text-align: left;
- }
- }
- /* 时间选择器样式 */
- .time-range {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .time-input {
- flex: 1;
- text-align: center;
- }
- }
- </style>
|