workExperience.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041
  1. <template>
  2. <view class="work-experience">
  3. <!-- 自定义导航栏 -->
  4. <view class="custom-navbar" :style="{ paddingTop: (12 + statusBarHeight) + 'px' }">
  5. <view class="navbar-content">
  6. <view class="nav-left" @click="goBack">
  7. <u-icon name="arrow-leftward" color="#333" size="42"></u-icon>
  8. </view>
  9. <view class="nav-title">工作经历</view>
  10. <view class="nav-right"></view>
  11. </view>
  12. </view>
  13. <!-- 主要内容 -->
  14. <view class="main-content">
  15. <!-- 公司信息 -->
  16. <view class="form-section">
  17. <!-- 公司名称 -->
  18. <view class="form-item">
  19. <view class="form-label">公司名称</view>
  20. <view class="form-input">
  21. <input v-model="formData.companyName" placeholder="请填写公司名称" maxlength="50" />
  22. <u-icon v-if="formData.companyName" name="close-circle-fill" color="#C9CDD4" size="28"
  23. @click="formData.companyName = ''" class="clear-icon"></u-icon>
  24. </view>
  25. </view>
  26. <!-- 公司业务类型 -->
  27. <view class="form-item">
  28. <view class="form-label" style="margin-bottom: 20rpx;">
  29. <text class="required-mark">*</text>
  30. <text class="label-text">公司业务类型</text>
  31. </view>
  32. <view class="checkbox-container">
  33. <u-checkbox-group @change="checkboxGroupChange" :wrap="false" shape="square"
  34. active-color="#007AFF">
  35. <u-checkbox v-for="(option, index) in businessTypeOptions" :key="index" :name="option.value"
  36. v-model="option.checked" class="checkbox-item">
  37. {{ option.label }}
  38. </u-checkbox>
  39. </u-checkbox-group>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 岗位履历 -->
  44. <view class="form-section" v-for="(resume, index) in formData.resumes" :key="index">
  45. <view class="section-title" v-if="hasCrossBorderExperience"><text>岗位履历 ({{ index + 1 }})</text>
  46. <image src="@/static/images/index/delete.svg" style="width: 40rpx;height: 40rpx;"
  47. @click="deleteResume(index)" v-if="formData.resumes && formData.resumes.length > 1" />
  48. </view>
  49. <!-- 任职时间 -->
  50. <view class="form-item">
  51. <view class="form-label">
  52. <text class="required-mark">*</text>
  53. <text class="label-text">{{ hasCrossBorderExperience ? '任职时间' : '在职时间' }}</text>
  54. </view>
  55. <view class="form-input time-range">
  56. <view class="time-input">
  57. <uni-datetime-picker v-model="resume.employmentTime[0]" type="date"
  58. :border="false" placeholder="开始时间" />
  59. <!-- <image src="../../static/images/index/Iconly_Light_Calendar.svg"
  60. style="width: 48rpx; height: 48rpx;" mode="aspectFit"></image> -->
  61. </view>
  62. <view class="time-separator">至</view>
  63. <view class="time-input">
  64. <uni-datetime-picker v-model="resume.employmentTime[1]" type="date"
  65. :border="false" placeholder="结束时间" />
  66. <image src="../../static/images/index/Iconly_Light_Calendar.svg"
  67. style="width: 48rpx; height: 48rpx;" mode="aspectFit"></image>
  68. </view>
  69. </view>
  70. </view>
  71. <!-- 所在部门 -->
  72. <view class="form-item">
  73. <view class="form-label">
  74. <text class="required-mark">*</text>
  75. <text class="label-text">所在部门</text>
  76. </view>
  77. <view class="form-input">
  78. <picker class="picker" :data-index="index" mode="selector" :range="departments"
  79. @change="selectDepartment">
  80. <text>{{ departments.length > 0 ? departments[resume.departmentIndex] : '请选择部门' }}</text>
  81. </picker>
  82. <u-icon name="arrow-down" color="#999" size="36"></u-icon>
  83. </view>
  84. </view>
  85. <!-- 岗位 -->
  86. <view class="form-item">
  87. <view class="form-label">
  88. <text class="required-mark">*</text>
  89. <text class="label-text">岗位</text>
  90. </view>
  91. <view class="form-input" @click="selectPosition(index)">
  92. <text v-if="resume.position">{{ resume.position }}</text>
  93. <text v-else class="placeholder">请选择岗位</text>
  94. <u-icon name="arrow-right" color="#999" size="36"></u-icon>
  95. </view>
  96. </view>
  97. <!-- 岗位职级 -->
  98. <view class="form-item">
  99. <view class="form-label">岗位职级</view>
  100. <view class="form-input">
  101. <picker class="picker" :data-index="index" mode="selector" :range="positionLevels"
  102. @change="selectPositionLevel">
  103. <text>{{ resume.positionLevel || '请选择' }}</text>
  104. </picker>
  105. <u-icon name="arrow-down" color="#999" size="36"></u-icon>
  106. </view>
  107. </view>
  108. <!-- 岗位职业技能 -->
  109. <view class="form-item">
  110. <view class="form-label">
  111. <text class="required-mark">*</text>
  112. <text class="label-text">跨境职业技能</text>
  113. </view>
  114. <view class="skills-input-container">
  115. <view class="skills-tags">
  116. <view v-for="(skill, skillIndex) in resume.skills" :key="skillIndex" class="skill-tag">
  117. <text>{{ skill }}</text>
  118. <u-icon name="close" color="#999" size="16"
  119. @click="removeSkill(index, skillIndex)"></u-icon>
  120. </view>
  121. </view>
  122. <view class="add-skill-btn" @click="addSkill(index)">
  123. <u-icon name="plus" color="rgba(102, 102, 102, 1)" size="28"></u-icon>
  124. </view>
  125. </view>
  126. </view>
  127. <!-- 工作内容 -->
  128. <view class="form-item">
  129. <view class="form-label">
  130. 工作内容
  131. <text class="word-count">{{ resume.workContent && resume.workContent.length || 0 }}/1000</text>
  132. </view>
  133. <view class="form-input">
  134. <textarea v-model="resume.workContent" placeholder="选填,请输入" maxlength="1000" auto-height
  135. @input="handleTextareaInput($event, 'workContent', index)" class="form-textarea"></textarea>
  136. <view class="textarea-clear" v-if="resume.workContent"
  137. @click="clearTextarea('workContent', index)">
  138. <u-icon name="close-circle-fill" color="#C9CDD4" size="28"></u-icon>
  139. </view>
  140. </view>
  141. </view>
  142. <!-- 工作业绩 -->
  143. <view class="form-item">
  144. <view class="form-label">
  145. 工作业绩
  146. <text class="word-count">{{ resume.workPerformance && resume.workPerformance.length || 0 }}/1000</text>
  147. </view>
  148. <view class="form-input">
  149. <textarea v-model="resume.workPerformance" placeholder="选填,请输入" maxlength="1000" auto-height
  150. @input="handleTextareaInput($event, 'workPerformance', index)"
  151. class="form-textarea"></textarea>
  152. <view class="textarea-clear" v-if="resume.workPerformance"
  153. @click="clearTextarea('workPerformance', index)">
  154. <u-icon name="close-circle-fill" color="#C9CDD4" size="28"></u-icon>
  155. </view>
  156. </view>
  157. </view>
  158. <!-- 添加岗位履历按钮 -->
  159. <view class="add-resume-btn" @click="addResume"
  160. v-if="index === formData.resumes.length - 1 && hasCrossBorderExperience">
  161. <text>添加岗位履历</text>
  162. </view>
  163. </view>
  164. <!-- 底部保存按钮 -->
  165. <view class="bottom-btn-container">
  166. <view class="save-btn" @click="saveWorkExperience">
  167. <text>保存</text>
  168. </view>
  169. </view>
  170. </view>
  171. <!-- 添加技能弹窗 -->
  172. <u-popup v-model="showAddSkill" mode="center" border-radius="24" width="80%">
  173. <view class="add-skill-popup">
  174. <view class="popup-title">添加技能</view>
  175. <view class="popup-content">
  176. <input v-model="newSkillName" placeholder="请输入技能名称" class="skill-input" maxlength="10" />
  177. </view>
  178. <view class="popup-buttons">
  179. <view class="popup-btn cancel-btn" @click="cancelAddSkill">取消</view>
  180. <view class="popup-btn confirm-btn" @click="confirmAddSkill">确定</view>
  181. </view>
  182. </view>
  183. </u-popup>
  184. <!-- 清除确认弹窗 -->
  185. <u-modal v-model="showClearConfirm" :content="'确定要清除所有填写的内容吗?'" show-cancel-button confirm-text="确定清除"
  186. cancel-text="取消" @confirm="clearAllContent" confirm-color="#FF4444"></u-modal>
  187. </view>
  188. </template>
  189. <script>
  190. var id = '';
  191. export default {
  192. data() {
  193. return {
  194. statusBarHeight: 0, // 状态栏高度
  195. showAddSkill: false,
  196. newSkillName: '',
  197. currentResumeIndex: 0,
  198. showClearConfirm: false, // 清除确认弹窗
  199. businessTypeOptions: [{
  200. label: '跨境电商',
  201. value: '0',
  202. checked: false
  203. },
  204. {
  205. label: '国内电商',
  206. value: '1',
  207. checked: false
  208. },
  209. {
  210. label: '外贸',
  211. value: '2',
  212. checked: false
  213. },
  214. {
  215. label: '其他',
  216. value: '3',
  217. checked: false
  218. }
  219. ],
  220. formData: {
  221. companyName: '',
  222. businessTypes: [],
  223. resumes: [{
  224. workExpDetailId: "",
  225. workExpId: "",
  226. employmentTime: [],
  227. department: '',
  228. departmentId: 0,
  229. departmentIndex: 0,
  230. position: '',
  231. positionId: 0,
  232. positionLevel: '初级',
  233. skills: [],
  234. workContent: '',
  235. workPerformance: ''
  236. }]
  237. },
  238. departments: [],
  239. departmentsIds: [],
  240. positionLevels: ['初级', '中级','高级','资深','其它'],
  241. operateKey: 0,
  242. isWork: false
  243. }
  244. },
  245. onLoad(options) {
  246. // 获取状态栏高度
  247. let systemInfo = uni.getSystemInfoSync();
  248. this.statusBarHeight = systemInfo.statusBarHeight || 0;
  249. // 接收从在线简历页面传递的业务类型参数
  250. if (options.businessTypes) {
  251. try {
  252. const businessTypes = JSON.parse(decodeURIComponent(options.businessTypes))
  253. this.formData.businessTypes = businessTypes
  254. console.log('接收到的业务类型:', businessTypes)
  255. console.log('是否有跨境经验:', this.hasCrossBorderExperience)
  256. if (this.hasCrossBorderExperience)
  257. this.businessTypeOptions[0].checked = true
  258. } catch (e) {
  259. console.error('解析业务类型参数失败:', e)
  260. }
  261. }
  262. this.getDepartment()
  263. id = options && options.id ? options.id : ''
  264. // 监听技能设置更新
  265. uni.$on('jobs', (data) => {
  266. console.log('岗位设置已更新:', data)
  267. // 这里可以更新对应的技能显示
  268. this.formData.resumes[this.operateKey].position = data.ruleClassifyName
  269. this.formData.resumes[this.operateKey].positionId = data.ruleClassifyId;
  270. // 更新以后给岗位职业技能设置默认值
  271. this.getDataInfo(this.formData.resumes[this.operateKey].positionId);
  272. })
  273. uni.$on('skillsUpdated', (data) => {
  274. console.log('技能设置已更新:', data)
  275. // 这里可以更新对应的技能显示
  276. this.formData.resumes[this.operateKey].skills = data.selectedTags
  277. })
  278. },
  279. beforeDestroy() {
  280. // 移除事件监听
  281. uni.$off('jobs')
  282. uni.$off('skillsUpdated')
  283. },
  284. computed: {
  285. hasCrossBorderExperience() {
  286. return this.formData.businessTypes.includes('0')
  287. },
  288. hasContentToClear() {
  289. // 检查是否有内容可以清除
  290. return this.formData.companyName ||
  291. this.formData.businessTypes.length > 0 ||
  292. this.formData.resumes.some(resume =>
  293. resume.position ||
  294. resume.workContent ||
  295. resume.workPerformance ||
  296. resume.skills.length > 0
  297. )
  298. }
  299. },
  300. methods: {
  301. getDataInfo(jobId) {
  302. let data = {
  303. ruleClassifyId: jobId
  304. }
  305. this.$Request.getT('/app/userFirst/getPostSkill', data).then(res => {
  306. if (res.code == 0) {
  307. if (res.data.length > 0 && res.data[0]?.childrenList[0]?.postSkillName)
  308. this.formData.resumes[this.operateKey].skills.push(res.data[0]?.childrenList[0]?.postSkillName)
  309. }
  310. })
  311. },
  312. goBack() {
  313. uni.navigateBack()
  314. },
  315. getDepartment() {
  316. var that = this
  317. this.$Request.postJson("/app/userFirst/getDepartment", {}).then((res) => {
  318. if (res.code == 0) {
  319. that.departments = that.$queue.array_column(res.data, 'departmentName')
  320. that.departmentsIds = that.$queue.array_column(res.data, 'departmentId')
  321. that.formData.resumes.forEach(function (item) {
  322. item.departmentId = that.departmentsIds[item.departmentIndex]
  323. item.department = that.departments[item.departmentIndex]
  324. })
  325. if (id != '' && id != 0)
  326. that.getData()
  327. } else {
  328. uni.showToast({
  329. title: res.msg,
  330. icon: "none",
  331. });
  332. }
  333. });
  334. },
  335. getData() {
  336. var that = this
  337. this.$Request.getT("/app/userFirst/getWorkExpDetailOne", {
  338. workExpId: id
  339. }).then((res) => {
  340. if (res.code == 0) {
  341. res = res.data
  342. that.formData.companyName = res.workExp.companyName
  343. that.formData.businessTypes = JSON.parse(res.workExp.type)
  344. // 设置公司业务类型回显
  345. if (this.formData.businessTypes.length) {
  346. for (let i = 0; i < this.formData.businessTypes.length; i++) {
  347. for (let opt = 0; i < this.businessTypeOptions.length; opt++) {
  348. const option = this.businessTypeOptions[opt]
  349. if (this.formData.businessTypes[i] == option.value) {
  350. this.businessTypeOptions[opt].checked = true
  351. break
  352. }
  353. }
  354. }
  355. }
  356. console.log(that.formData.businessTypes)
  357. res.workExpDetails.forEach(function (item) {
  358. item.skills = JSON.parse(item.skills)
  359. item.employmentTime = item.startTime == '' ? [] : [item.startTime, item
  360. .endTime],
  361. item.departmentIndex = that.departmentsIds.indexOf(item.departmentId) < 0 ?
  362. 0 : that.departmentsIds.indexOf(item.departmentId)
  363. })
  364. that.formData.resumes = res.workExpDetails
  365. } else {
  366. uni.showToast({
  367. title: res.msg,
  368. icon: "none",
  369. });
  370. }
  371. });
  372. },
  373. selectDepartment(e) {
  374. var key = Number(e.currentTarget.dataset.index)
  375. this.formData.resumes[key].departmentId = this.departmentsIds[e.detail.value]
  376. this.formData.resumes[key].departmentIndex = e.detail.value
  377. this.formData.resumes[key].department = this.departments[e.detail.value]
  378. },
  379. formatter(type, value) {
  380. if (type === 'year') {
  381. return `${value}年`
  382. }
  383. if (type === 'month') {
  384. return `${value}月`
  385. }
  386. if (type === 'day') {
  387. return `${value}日`
  388. }
  389. return value
  390. },
  391. checkboxGroupChange(e) {
  392. console.log('选中的业务类型:', e)
  393. // 更新 formData.businessTypes 以保持数据同步
  394. this.formData.businessTypes = e
  395. },
  396. selectEmploymentTime(index) {
  397. // 选择任职时间
  398. uni.showToast({
  399. title: '选择任职时间',
  400. icon: 'none'
  401. })
  402. },
  403. selectPosition(index) {
  404. this.operateKey = index
  405. // 选择岗位
  406. uni.navigateTo({
  407. url: '/package/jobIntention/jobList'
  408. })
  409. },
  410. selectPositionLevel(e) {
  411. var key = Number(e.currentTarget.dataset.index)
  412. this.formData.resumes[key].positionLevel = this.positionLevels[e.detail.value]
  413. },
  414. addSkill(index) {
  415. this.operateKey = index
  416. //this.currentResumeIndex = index
  417. //this.showAddSkill = true
  418. //this.newSkillName = ''
  419. if (this.formData.resumes[index].positionId == '' || this.formData.resumes[index].positionId == 0)
  420. return this.$queue.showToast('请先选择岗位')
  421. uni.navigateTo({
  422. url: '/package/jobIntention/jobSkills?jobId=' + this.formData.resumes[index].positionId +
  423. '&jobTitle=' + this.formData.resumes[index].position + '&skill=' + encodeURIComponent(JSON
  424. .stringify(this.formData.resumes[index].skills))
  425. })
  426. },
  427. removeSkill(resumeIndex, skillIndex) {
  428. this.formData.resumes[resumeIndex].skills.splice(skillIndex, 1)
  429. },
  430. cancelAddSkill() {
  431. this.showAddSkill = false
  432. this.newSkillName = ''
  433. },
  434. confirmAddSkill() {
  435. if (this.newSkillName.trim()) {
  436. this.formData.resumes[this.currentResumeIndex].skills.push(this.newSkillName.trim())
  437. this.showAddSkill = false
  438. this.newSkillName = ''
  439. } else {
  440. uni.showToast({
  441. title: '请输入技能名称',
  442. icon: 'none'
  443. })
  444. }
  445. },
  446. selectWorkContent(index) {
  447. // 选择工作内容
  448. uni.showToast({
  449. title: '选择工作内容',
  450. icon: 'none'
  451. })
  452. },
  453. selectWorkPerformance(index) {
  454. // 选择工作业绩
  455. uni.showToast({
  456. title: '选择工作业绩',
  457. icon: 'none'
  458. })
  459. },
  460. addResume() {
  461. this.formData.resumes.push({
  462. workExpDetailId: "",
  463. workExpId: "",
  464. employmentTime: [],
  465. department: this.departments[0],
  466. departmentId: this.departmentsIds[0],
  467. departmentIndex: 0,
  468. position: '',
  469. positionId: 0,
  470. positionLevel: '初级',
  471. skills: [],
  472. workContent: '',
  473. workPerformance: ''
  474. })
  475. },
  476. deleteResume(index) {
  477. this.formData.resumes.splice(index, 1)
  478. },
  479. // 处理文本域输入
  480. handleTextareaInput(e, field, index) {
  481. const value = e.detail.value;
  482. // 如果超过1000字,截断
  483. if (value.length > 1000) {
  484. this.formData.resumes[index][field] = value.substring(0, 1000);
  485. }
  486. },
  487. // 清除单个文本域
  488. clearTextarea(field, index) {
  489. this.formData.resumes[index][field] = '';
  490. },
  491. // 显示清除确认弹窗
  492. showClearAllConfirm() {
  493. this.showClearConfirm = true;
  494. },
  495. // 清除所有内容
  496. clearAllContent() {
  497. // 清空公司名称
  498. this.formData.companyName = '';
  499. // 清空业务类型选择
  500. this.formData.businessTypes = [];
  501. this.businessTypeOptions.forEach(option => {
  502. option.checked = false;
  503. });
  504. // 清空所有履历
  505. this.formData.resumes = [{
  506. workExpDetailId: "",
  507. workExpId: "",
  508. employmentTime: [],
  509. department: this.departments.length > 0 ? this.departments[0] : '',
  510. departmentId: this.departmentsIds.length > 0 ? this.departmentsIds[0] : 0,
  511. departmentIndex: 0,
  512. position: '',
  513. positionId: 0,
  514. positionLevel: '初级',
  515. skills: [],
  516. workContent: '',
  517. workPerformance: ''
  518. }];
  519. this.showClearConfirm = false;
  520. uni.showToast({
  521. title: '已清除所有内容',
  522. icon: 'success'
  523. });
  524. },
  525. saveWorkExperience() {
  526. console.log(this.formData.resumes)
  527. if (!this.formData.companyName) {
  528. uni.showToast({
  529. title: "请输入公司名称",
  530. icon: "none"
  531. });
  532. return;
  533. }
  534. if (this.formData.businessTypes.length <= 0) {
  535. uni.showToast({
  536. title: "请选择公司业务类型",
  537. icon: "none"
  538. });
  539. return;
  540. }
  541. if (this.formData.resumes.length <= 0) {
  542. uni.showToast({
  543. title: "请至少填写一份履历",
  544. icon: "none"
  545. });
  546. return;
  547. }
  548. for (let i = 0; i < this.formData.resumes.length; i++) {
  549. const item = this.formData.resumes[i];
  550. const timeArr = item.employmentTime.filter(time => {
  551. if (time) {
  552. return time
  553. }
  554. });
  555. if (timeArr.length <= 0) {
  556. this.$queue.showToast('任职时间不能为空')
  557. return false;
  558. }
  559. if (timeArr.length < 2) {
  560. this.$queue.showToast('请选择完整的任职时间')
  561. return false;
  562. }
  563. // 判断开始时间是否大于结束时间
  564. let startTime = ''
  565. let endTime = ''
  566. if (item.employmentTime.length == 2) {
  567. startTime = item.employmentTime[0].split(' ')[0]
  568. endTime = item.employmentTime[1].split(' ')[0]
  569. }
  570. if (startTime && endTime && startTime > endTime) {
  571. this.$queue.showToast('任职开始时间不能大于任职结束时间')
  572. return false;
  573. }
  574. if (item.position == '') {
  575. this.$queue.showToast('岗位不能为空')
  576. return false;
  577. }
  578. if (item.skills.length <= 0) {
  579. this.$queue.showToast('岗位技能不能为空')
  580. return false;
  581. }
  582. }
  583. return;
  584. let postData = this.formData.resumes.map(({
  585. employmentTime,
  586. departmentIndex,
  587. ...rest
  588. }) => {
  589. return {
  590. ...rest,
  591. skills: JSON.stringify(rest.skills),
  592. startTime: employmentTime?.[0] || '',
  593. endTime: employmentTime?.[1] || ''
  594. }
  595. })
  596. // this.formData.resumes.forEach(function(item){
  597. // console.log(item.skills)
  598. // item.skills=JSON.stringify(item.skills);
  599. // console.log(item.skills)
  600. // item.startTime=item.employmentTime[0]?item.employmentTime[0]:'';
  601. // item.endTime=item.employmentTime[1]?item.employmentTime[1]:'';
  602. // delete item.employmentTime;
  603. // delete item.departmentIndex;
  604. // })
  605. let data = {
  606. workExp: {
  607. workExpId: id,
  608. companyName: this.formData.companyName,
  609. type: JSON.stringify(this.formData.businessTypes),
  610. },
  611. workExpDetails: postData
  612. }
  613. if (this.isWork)
  614. return
  615. this.isWork = true
  616. uni.showLoading({
  617. title: "提交中..."
  618. });
  619. this.$Request.postJson("/app/userFirst/addWorkExp", data).then((res) => {
  620. uni.hideLoading();
  621. this.isWork = false
  622. this.formData.companyName == ''
  623. if (res.code == 0) {
  624. uni.showToast({
  625. title: "保存成功",
  626. icon: "none"
  627. });
  628. // 实际开发中可以在这里添加跳转逻辑
  629. uni.$emit('updateResume')
  630. setTimeout(() => {
  631. uni.navigateBack()
  632. }, 1000);
  633. } else {
  634. uni.showToast({
  635. title: res.msg,
  636. icon: "none",
  637. });
  638. }
  639. });
  640. },
  641. }
  642. }
  643. </script>
  644. <style lang="scss" scoped>
  645. .work-experience {
  646. height: 100vh;
  647. padding-bottom: 120rpx;
  648. display: flex;
  649. flex-direction: column;
  650. }
  651. .custom-navbar {
  652. // position: fixed;
  653. // top: 0;
  654. // left: 0;
  655. // right: 0;
  656. background-color: #ffffff;
  657. // z-index: 9999;
  658. .navbar-content {
  659. display: flex;
  660. align-items: center;
  661. justify-content: space-between;
  662. height: 100%;
  663. padding: 0 40rpx;
  664. .nav-left,
  665. .nav-right {
  666. width: 60rpx;
  667. height: 60rpx;
  668. display: flex;
  669. align-items: center;
  670. justify-content: center;
  671. }
  672. .nav-title {
  673. color: rgba(51, 51, 51, 1);
  674. font-family: DM Sans;
  675. font-size: 36rpx;
  676. font-weight: 700;
  677. line-height: 26px;
  678. letter-spacing: 0px;
  679. text-align: center;
  680. }
  681. }
  682. }
  683. .main-content {
  684. margin-top: 68rpx;
  685. padding: 0 20rpx 40rpx 20rpx;
  686. flex: 1;
  687. overflow: auto;
  688. }
  689. .form-section {
  690. background: #fff;
  691. border-radius: 16rpx;
  692. padding: 0rpx 10rpx;
  693. .section-title {
  694. color: rgba(23, 23, 37, 1);
  695. font-family: Inter;
  696. font-size: 32rpx;
  697. font-weight: 600;
  698. line-height: 48rpx;
  699. letter-spacing: 0%;
  700. text-align: left;
  701. padding: 16rpx 0 32rpx 0;
  702. display: flex;
  703. justify-content: space-between;
  704. align-items: center;
  705. }
  706. }
  707. .form-item {
  708. margin-bottom: 32rpx;
  709. .form-label {
  710. color: rgba(31, 44, 55, 1);
  711. font-family: DM Sans;
  712. font-size: 32rpx;
  713. font-weight: 500;
  714. line-height: 22px;
  715. letter-spacing: 0%;
  716. text-align: left;
  717. margin-bottom: 20rpx;
  718. position: relative;
  719. .word-count {
  720. font-size: 24rpx;
  721. color: #aaa;
  722. position: absolute;
  723. bottom: 0;
  724. right: 0;
  725. }
  726. .required-mark {
  727. color: #FF3B30;
  728. font-size: 18px;
  729. font-weight: 500;
  730. margin-right: 4rpx;
  731. }
  732. .label-text {
  733. color: rgba(31, 44, 55, 1);
  734. font-family: DM Sans;
  735. font-size: 16px;
  736. font-weight: 500;
  737. line-height: 22px;
  738. letter-spacing: 0%;
  739. text-align: left;
  740. }
  741. }
  742. .form-input {
  743. width: 100%;
  744. min-height: 80rpx;
  745. padding: 0 40rpx;
  746. border: 1px solid rgba(227, 231, 236, 1);
  747. border-radius: 24px;
  748. background: rgba(255, 255, 255, 1);
  749. display: flex;
  750. align-items: center;
  751. justify-content: space-between;
  752. .placeholder {
  753. color: #999999;
  754. }
  755. picker {
  756. width: 100%;
  757. }
  758. textarea {
  759. width: 100%;
  760. padding: 20rpx 0;
  761. height: auto !important;
  762. // min-height: 40rpx;
  763. resize: none;
  764. line-height: 1.5;
  765. overflow-y: hidden;
  766. }
  767. .form-textarea {
  768. width: 100%;
  769. min-height: 80rpx;
  770. padding: 20rpx 0;
  771. line-height: 1.5;
  772. resize: none;
  773. background: transparent;
  774. }
  775. }
  776. }
  777. .skills-input-container {
  778. width: 100%;
  779. min-height: 80rpx;
  780. padding: 0rpx 40rpx;
  781. border: 1px solid rgba(227, 231, 236, 1);
  782. border-radius: 32px;
  783. background: rgba(255, 255, 255, 1);
  784. display: flex;
  785. align-items: center;
  786. justify-content: space-between;
  787. .skills-tags {
  788. display: flex;
  789. flex-wrap: wrap;
  790. gap: 12rpx;
  791. flex: 1;
  792. .skill-tag {
  793. padding: 8rpx 16rpx;
  794. background: #F5F5F5;
  795. border-radius: 8rpx;
  796. display: flex;
  797. align-items: center;
  798. gap: 8rpx;
  799. text {
  800. font-size: 24rpx;
  801. color: #666666;
  802. }
  803. }
  804. }
  805. .add-skill-btn {
  806. width: 40rpx;
  807. height: 40rpx;
  808. border: 1rpx solid rgba(102, 102, 102, 1);
  809. border-radius: 8rpx;
  810. display: flex;
  811. align-items: center;
  812. justify-content: center;
  813. background: #fff;
  814. flex-shrink: 0;
  815. }
  816. }
  817. .add-resume-btn {
  818. width: 100%;
  819. height: 80rpx;
  820. border: 1rpx solid #007AFF;
  821. border-radius: 60rpx;
  822. display: flex;
  823. align-items: center;
  824. justify-content: center;
  825. margin-top: 20rpx;
  826. text {
  827. color: #007AFF;
  828. font-size: 28rpx;
  829. font-weight: 500;
  830. }
  831. }
  832. .bottom-btn-container {
  833. position: fixed;
  834. bottom: 0;
  835. left: 0;
  836. right: 0;
  837. padding: 30rpx 20rpx;
  838. background: #fff;
  839. border-top: 1px solid #f0f0f0;
  840. z-index: 98;
  841. }
  842. .save-btn {
  843. width: 100%;
  844. height: 88rpx;
  845. background: linear-gradient(90deg, rgba(13, 39, 247, 1), rgba(19, 193, 234, 1) 100%);
  846. border-radius: 44rpx;
  847. display: flex;
  848. align-items: center;
  849. justify-content: center;
  850. text {
  851. font-size: 32rpx;
  852. font-weight: 600;
  853. color: #fff;
  854. }
  855. }
  856. .add-skill-popup {
  857. background: #fff;
  858. border-radius: 24rpx;
  859. padding: 40rpx;
  860. .popup-title {
  861. color: rgba(34, 37, 42, 1);
  862. font-size: 36rpx;
  863. font-weight: 500;
  864. text-align: center;
  865. margin-bottom: 30rpx;
  866. }
  867. .popup-content {
  868. margin-bottom: 30rpx;
  869. .skill-input {
  870. width: 100%;
  871. height: 80rpx;
  872. padding: 0 20rpx;
  873. border: 1rpx solid #E5E5EA;
  874. border-radius: 12rpx;
  875. font-size: 28rpx;
  876. color: rgba(34, 37, 42, 1);
  877. background: #F7F8FA;
  878. }
  879. }
  880. .popup-buttons {
  881. display: flex;
  882. gap: 20rpx;
  883. .popup-btn {
  884. flex: 1;
  885. height: 80rpx;
  886. border-radius: 12rpx;
  887. display: flex;
  888. align-items: center;
  889. justify-content: center;
  890. font-size: 28rpx;
  891. font-weight: 500;
  892. }
  893. .cancel-btn {
  894. background: #F7F8FA;
  895. color: rgba(102, 102, 102, 1);
  896. }
  897. .confirm-btn {
  898. background: #007AFF;
  899. color: #fff;
  900. }
  901. }
  902. }
  903. .checkbox-container {
  904. display: flex;
  905. flex-wrap: nowrap;
  906. gap: 10rpx;
  907. /deep/ .u-checkbox-group {
  908. display: flex;
  909. flex-wrap: nowrap;
  910. width: 100%;
  911. }
  912. /deep/ .u-checkbox {
  913. flex: 1;
  914. min-width: 0;
  915. margin-right: 0;
  916. }
  917. /deep/ .u-checkbox__label {
  918. color: var(--Grayscale/Grayscale 100, rgba(23, 23, 37, 1));
  919. font-family: DM Sans;
  920. font-size: 24rpx;
  921. font-weight: 400;
  922. line-height: 48rpx;
  923. letter-spacing: 0%;
  924. text-align: left;
  925. }
  926. }
  927. .form-textarea {
  928. height: auto;
  929. }
  930. /* 时间选择器样式 */
  931. .time-range {
  932. display: flex;
  933. align-items: center;
  934. justify-content: space-between;
  935. }
  936. .time-input {
  937. flex: 1;
  938. display: flex;
  939. align-items: center;
  940. justify-content: space-between;
  941. // border-bottom: 1rpx solid #E5E5EA;
  942. // padding-bottom: 10rpx;
  943. text-align: center;
  944. }
  945. .time-input:first-child {
  946. margin-right: 20rpx;
  947. }
  948. .time-input:last-child {
  949. margin-left: 20rpx;
  950. }
  951. .time-separator {
  952. font-size: 28rpx;
  953. color: #666;
  954. }
  955. /* 调整日期选择器输入框样式 */
  956. .time-input /deep/ .uni-datetime-picker__input {
  957. width: 100%;
  958. font-size: 28rpx;
  959. color: #333;
  960. }
  961. .time-input /deep/ .uni-datetime-picker__placeholder {
  962. color: #999;
  963. font-size: 28rpx;
  964. }
  965. </style>