Personal.js 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const common_config = require("../../common/config.js");
  4. const _sfc_main = {
  5. data() {
  6. return {
  7. // 添加承诺书相关数据
  8. showPromiseModal: true,
  9. promiseChecked: false,
  10. formData: {
  11. name: "",
  12. gender: "",
  13. threePeriod: "",
  14. birthDate: "",
  15. idCard: "",
  16. political: "",
  17. ethnic: "",
  18. height: "",
  19. weight: "",
  20. nativePlace: "",
  21. residence: "",
  22. marriage: "",
  23. expectedSalary: "",
  24. phone: "",
  25. email: "",
  26. currentAddress: "",
  27. emergencyContact: "",
  28. emergencyPhone: "",
  29. hobby: "",
  30. motto: "",
  31. // 添加应聘来源相关字段
  32. sourceType: "social",
  33. // 默认为社招
  34. socialSource: "",
  35. // 社招来源
  36. otherSocialSource: "",
  37. // 其他社招来源
  38. otherSchoolSource: "",
  39. // 其他学校来源
  40. // 添加技能和培训字段
  41. skills: "",
  42. training: ""
  43. },
  44. genderOptions: ["男", "女"],
  45. genderIndex: -1,
  46. threePeriodOptions: ["无", "孕期", "产期", "哺乳期"],
  47. threePeriodIndex: -1,
  48. politicalOptions: ["群众", "共青团员", "中共党员", "民主党派"],
  49. politicalIndex: -1,
  50. ethnicOptions: ["汉族", "蒙古族", "回族", "藏族", "维吾尔族", "其他"],
  51. ethnicIndex: -1,
  52. marriageOptions: ["未婚", "已婚", "离异", "丧偶"],
  53. marriageIndex: -1,
  54. familyMembers: [],
  55. familyMemberForm: {
  56. relation: "",
  57. name: "",
  58. workplaceOrAddress: "",
  59. position: "",
  60. phone: "",
  61. isEmergencyContact: false
  62. // 添加新字段
  63. },
  64. isEditing: false,
  65. editingIndex: -1,
  66. // 添加教育经历相关数据
  67. educationList: [],
  68. educationForm: {
  69. startTime: "",
  70. endTime: "",
  71. schoolName: "",
  72. major: "",
  73. degree: ""
  74. },
  75. isEditingEducation: false,
  76. editingEducationIndex: -1,
  77. degreeOptions: ["高中", "中专", "大专", "本科", "硕士", "博士"],
  78. degreeIndex: -1,
  79. // 添加工作经历相关数据
  80. workList: [],
  81. workForm: {
  82. startTime: "",
  83. endTime: "",
  84. companyName: "",
  85. department: "",
  86. employeeCount: "",
  87. position: "",
  88. monthlySalary: "",
  89. supervisor: "",
  90. supervisorPhone: ""
  91. },
  92. isEditingWork: false,
  93. editingWorkIndex: -1,
  94. // 添加步骤控制
  95. currentStep: 1,
  96. steps: [
  97. { id: 1, name: "基本信息" },
  98. { id: 3, name: "家庭成员" },
  99. { id: 5, name: "教育经历" },
  100. { id: 6, name: "专业技能" },
  101. { id: 8, name: "工作经历" }
  102. ],
  103. formErrors: {
  104. name: "",
  105. idCard: "",
  106. phone: "",
  107. gender: "",
  108. ethnic: "",
  109. currentAddress: "",
  110. height: "",
  111. weight: "",
  112. expectedSalary: "",
  113. skills: "",
  114. training: ""
  115. },
  116. // Add loading state
  117. isLoading: true,
  118. familyMemberErrors: {
  119. relation: "",
  120. name: "",
  121. phone: "",
  122. workplaceOrAddress: "",
  123. position: ""
  124. },
  125. workErrors: {
  126. startTime: "",
  127. endTime: "",
  128. companyName: "",
  129. department: "",
  130. position: "",
  131. employeeCount: "",
  132. monthlySalary: "",
  133. supervisor: "",
  134. supervisorPhone: ""
  135. },
  136. // 在 data 中添加教育经历的错误提示对象
  137. educationErrors: {
  138. startTime: "",
  139. endTime: "",
  140. schoolName: "",
  141. major: "",
  142. degree: ""
  143. },
  144. // 添加统一的验证规则
  145. validationRules: {
  146. name: {
  147. required: true,
  148. message: "请输入姓名"
  149. },
  150. phone: {
  151. required: true,
  152. pattern: /^1[3-9]\d{9}$/,
  153. message: "请输入正确的手机号码"
  154. },
  155. idCard: {
  156. required: true,
  157. pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
  158. message: "请输入正确的身份证号码"
  159. },
  160. gender: {
  161. required: true,
  162. message: "请选择性别"
  163. },
  164. ethnic: {
  165. required: true,
  166. message: "请选择民族"
  167. },
  168. currentAddress: {
  169. required: true,
  170. message: "请输入现居住地址"
  171. },
  172. height: {
  173. pattern: /^\d+(\.\d{1,2})?$/,
  174. message: "请输入正确的身高(cm)"
  175. },
  176. weight: {
  177. pattern: /^\d+(\.\d{1,2})?$/,
  178. message: "请输入正确的体重(kg)"
  179. },
  180. expectedSalary: {
  181. pattern: /^\d+(\.\d{1,2})?$/,
  182. message: "请输入正确的期望薪资"
  183. }
  184. }
  185. };
  186. },
  187. onLoad() {
  188. this.fetchUserData();
  189. },
  190. computed: {
  191. // 添加计算属性来控制按钮显示
  192. showPrevButton() {
  193. return this.currentStep !== 1;
  194. },
  195. showNextButton() {
  196. return this.currentStep !== 8;
  197. },
  198. showSubmitButton() {
  199. return this.currentStep === 8;
  200. },
  201. // 获取当前步骤在数组中的索引
  202. currentStepIndex() {
  203. return this.steps.findIndex((step) => step.id === this.currentStep);
  204. }
  205. },
  206. methods: {
  207. // 添加承诺书相关方法
  208. togglePromiseChecked() {
  209. this.promiseChecked = !this.promiseChecked;
  210. },
  211. confirmPromise() {
  212. if (this.promiseChecked) {
  213. this.showPromiseModal = false;
  214. } else {
  215. common_vendor.index.showToast({
  216. title: "请先阅读并同意承诺书内容",
  217. icon: "none"
  218. });
  219. }
  220. },
  221. bindGenderChange(e) {
  222. this.genderIndex = e.detail.value;
  223. this.formData.gender = this.genderOptions[this.genderIndex];
  224. if (this.formErrors.gender) {
  225. this.formErrors.gender = "";
  226. }
  227. if (this.formData.gender !== "女") {
  228. this.formData.threePeriod = "";
  229. this.threePeriodIndex = -1;
  230. }
  231. },
  232. bindThreePeriodChange(e) {
  233. this.threePeriodIndex = e.detail.value;
  234. this.formData.threePeriod = this.threePeriodOptions[this.threePeriodIndex];
  235. },
  236. bindPoliticalChange(e) {
  237. this.politicalIndex = e.detail.value;
  238. this.formData.political = this.politicalOptions[this.politicalIndex];
  239. },
  240. bindEthnicChange(e) {
  241. this.ethnicIndex = e.detail.value;
  242. this.formData.ethnic = this.ethnicOptions[this.ethnicIndex];
  243. if (this.formErrors.ethnic) {
  244. this.formErrors.ethnic = "";
  245. }
  246. },
  247. bindMarriageChange(e) {
  248. this.marriageIndex = e.detail.value;
  249. this.formData.marriage = this.marriageOptions[this.marriageIndex];
  250. },
  251. bindDateChange(e) {
  252. this.formData.birthDate = e.detail.value;
  253. },
  254. saveFamilyMember() {
  255. this.resetFamilyMemberErrors();
  256. let isValid = true;
  257. if (!this.familyMemberForm.relation) {
  258. this.familyMemberErrors.relation = "请输入称谓";
  259. isValid = false;
  260. }
  261. if (!this.familyMemberForm.name) {
  262. this.familyMemberErrors.name = "请输入姓名";
  263. isValid = false;
  264. }
  265. if (!this.familyMemberForm.workplaceOrAddress) {
  266. this.familyMemberErrors.workplaceOrAddress = "请输入工作单位/家庭地址";
  267. isValid = false;
  268. }
  269. if (!this.familyMemberForm.position) {
  270. this.familyMemberErrors.position = "请输入职务";
  271. isValid = false;
  272. }
  273. if (!this.familyMemberForm.phone) {
  274. this.familyMemberErrors.phone = "请输入联系电话";
  275. isValid = false;
  276. } else if (!/^1[3-9]\d{9}$/.test(this.familyMemberForm.phone)) {
  277. this.familyMemberErrors.phone = "请输入正确的手机号";
  278. isValid = false;
  279. }
  280. if (!isValid) {
  281. common_vendor.index.showToast({
  282. title: "请完善家庭成员信息",
  283. icon: "none"
  284. });
  285. return;
  286. }
  287. if (this.isEditing) {
  288. this.familyMembers[this.editingIndex] = { ...this.familyMemberForm };
  289. common_vendor.index.showToast({
  290. title: "修改成功",
  291. icon: "success"
  292. });
  293. this.isEditing = false;
  294. this.editingIndex = -1;
  295. } else {
  296. this.familyMembers.push({ ...this.familyMemberForm });
  297. common_vendor.index.showToast({
  298. title: "添加成功",
  299. icon: "success"
  300. });
  301. }
  302. this.resetFamilyMemberForm();
  303. },
  304. // 添加重置错误信息的方法
  305. resetFamilyMemberErrors() {
  306. this.familyMemberErrors = {
  307. relation: "",
  308. name: "",
  309. phone: "",
  310. workplaceOrAddress: "",
  311. position: ""
  312. };
  313. },
  314. // 修改重置表单的方法
  315. resetFamilyMemberForm() {
  316. this.familyMemberForm = {
  317. relation: "",
  318. name: "",
  319. workplaceOrAddress: "",
  320. position: "",
  321. phone: "",
  322. isEmergencyContact: false
  323. };
  324. this.resetFamilyMemberErrors();
  325. },
  326. editFamilyMember(index) {
  327. this.isEditing = true;
  328. this.editingIndex = index;
  329. this.familyMemberForm = { ...this.familyMembers[index] };
  330. common_vendor.index.pageScrollTo({
  331. selector: ".family-member-form",
  332. duration: 300
  333. });
  334. },
  335. cancelEdit() {
  336. this.isEditing = false;
  337. this.editingIndex = -1;
  338. this.familyMemberForm = {
  339. relation: "",
  340. name: "",
  341. workplaceOrAddress: "",
  342. position: "",
  343. phone: "",
  344. isEmergencyContact: false
  345. };
  346. },
  347. deleteFamilyMember(index) {
  348. if (this.isEditing && this.editingIndex === index) {
  349. this.cancelEdit();
  350. }
  351. this.familyMembers.splice(index, 1);
  352. common_vendor.index.showToast({
  353. title: "已删除",
  354. icon: "none"
  355. });
  356. },
  357. // 选择应聘来源类型
  358. selectSourceType(type) {
  359. this.formData.sourceType = type;
  360. if (type === "social") {
  361. this.formData.socialSource = "BOSS";
  362. } else {
  363. this.formData.socialSource = "";
  364. }
  365. },
  366. // 选择社招来源
  367. selectSocialSource(source) {
  368. this.formData.sourceType = "social";
  369. this.formData.socialSource = source;
  370. },
  371. // 教育经历相关方法
  372. bindStartTimeChange(e) {
  373. this.educationForm.startTime = e.detail.value;
  374. },
  375. bindEndTimeChange(e) {
  376. this.educationForm.endTime = e.detail.value;
  377. },
  378. bindDegreeChange(e) {
  379. this.degreeIndex = e.detail.value;
  380. this.educationForm.degree = this.degreeOptions[this.degreeIndex];
  381. },
  382. saveEducation() {
  383. this.resetEducationErrors();
  384. let isValid = true;
  385. if (!this.educationForm.startTime) {
  386. this.educationErrors.startTime = "请选择开始时间";
  387. isValid = false;
  388. }
  389. if (!this.educationForm.endTime) {
  390. this.educationErrors.endTime = "请选择结束时间";
  391. isValid = false;
  392. }
  393. if (!this.educationForm.schoolName) {
  394. this.educationErrors.schoolName = "请输入学校名称";
  395. isValid = false;
  396. }
  397. if (!this.educationForm.major) {
  398. this.educationErrors.major = "请输入专业";
  399. isValid = false;
  400. }
  401. if (!this.educationForm.degree) {
  402. this.educationErrors.degree = "请选择学历";
  403. isValid = false;
  404. }
  405. if (!isValid) {
  406. common_vendor.index.showToast({
  407. title: "请完善教育经历信息",
  408. icon: "none"
  409. });
  410. return;
  411. }
  412. if (this.isEditingEducation) {
  413. this.educationList[this.editingEducationIndex] = { ...this.educationForm };
  414. common_vendor.index.showToast({
  415. title: "修改成功",
  416. icon: "success"
  417. });
  418. this.isEditingEducation = false;
  419. this.editingEducationIndex = -1;
  420. } else {
  421. this.educationList.push({ ...this.educationForm });
  422. common_vendor.index.showToast({
  423. title: "添加成功",
  424. icon: "success"
  425. });
  426. }
  427. this.educationForm = {
  428. startTime: "",
  429. endTime: "",
  430. schoolName: "",
  431. major: "",
  432. degree: ""
  433. };
  434. this.degreeIndex = -1;
  435. },
  436. editEducation(index) {
  437. this.isEditingEducation = true;
  438. this.editingEducationIndex = index;
  439. this.educationForm = { ...this.educationList[index] };
  440. this.degreeIndex = this.degreeOptions.findIndex((item) => item === this.educationForm.degree);
  441. common_vendor.index.pageScrollTo({
  442. selector: ".education-form",
  443. duration: 300
  444. });
  445. },
  446. cancelEditEducation() {
  447. this.isEditingEducation = false;
  448. this.editingEducationIndex = -1;
  449. this.educationForm = {
  450. startTime: "",
  451. endTime: "",
  452. schoolName: "",
  453. major: "",
  454. degree: ""
  455. };
  456. this.degreeIndex = -1;
  457. },
  458. deleteEducation(index) {
  459. if (this.isEditingEducation && this.editingEducationIndex === index) {
  460. this.cancelEditEducation();
  461. }
  462. this.educationList.splice(index, 1);
  463. common_vendor.index.showToast({
  464. title: "已删除",
  465. icon: "none"
  466. });
  467. },
  468. // 工作经历相关方法
  469. bindWorkStartTimeChange(e) {
  470. this.workForm.startTime = e.detail.value;
  471. },
  472. bindWorkEndTimeChange(e) {
  473. this.workForm.endTime = e.detail.value;
  474. },
  475. saveWork() {
  476. this.workErrors = {
  477. startTime: "",
  478. endTime: "",
  479. companyName: "",
  480. department: "",
  481. position: "",
  482. employeeCount: "",
  483. monthlySalary: "",
  484. supervisor: "",
  485. supervisorPhone: ""
  486. };
  487. let isValid = true;
  488. if (!this.workForm.startTime) {
  489. this.workErrors.startTime = "请选择开始时间";
  490. isValid = false;
  491. }
  492. if (!this.workForm.endTime) {
  493. this.workErrors.endTime = "请选择结束时间";
  494. isValid = false;
  495. }
  496. if (!this.workForm.companyName) {
  497. this.workErrors.companyName = "请输入单位名称";
  498. isValid = false;
  499. }
  500. if (!this.workForm.department) {
  501. this.workErrors.department = "请输入任职部门";
  502. isValid = false;
  503. }
  504. if (!this.workForm.position) {
  505. this.workErrors.position = "请输入担任职务";
  506. isValid = false;
  507. }
  508. if (!this.workForm.employeeCount) {
  509. this.workErrors.employeeCount = "请输入单位人数";
  510. isValid = false;
  511. }
  512. if (!this.workForm.monthlySalary) {
  513. this.workErrors.monthlySalary = "请输入月薪";
  514. isValid = false;
  515. }
  516. if (!this.workForm.supervisor) {
  517. this.workErrors.supervisor = "请输入直属上级";
  518. isValid = false;
  519. }
  520. if (!this.workForm.supervisorPhone) {
  521. this.workErrors.supervisorPhone = "请输入直属上级电话";
  522. isValid = false;
  523. }
  524. if (!isValid) {
  525. common_vendor.index.showToast({
  526. title: "请完善工作经历信息",
  527. icon: "none"
  528. });
  529. return;
  530. }
  531. if (this.isEditingWork) {
  532. this.workList[this.editingWorkIndex] = { ...this.workForm };
  533. common_vendor.index.showToast({
  534. title: "修改成功",
  535. icon: "success"
  536. });
  537. this.isEditingWork = false;
  538. this.editingWorkIndex = -1;
  539. } else {
  540. this.workList.push({ ...this.workForm });
  541. common_vendor.index.showToast({
  542. title: "添加成功",
  543. icon: "success"
  544. });
  545. }
  546. this.workForm = {
  547. startTime: "",
  548. endTime: "",
  549. companyName: "",
  550. department: "",
  551. employeeCount: "",
  552. position: "",
  553. monthlySalary: "",
  554. supervisor: "",
  555. supervisorPhone: ""
  556. };
  557. },
  558. editWork(index) {
  559. this.isEditingWork = true;
  560. this.editingWorkIndex = index;
  561. this.workForm = { ...this.workList[index] };
  562. common_vendor.index.pageScrollTo({
  563. selector: ".work-form",
  564. duration: 300
  565. });
  566. },
  567. cancelEditWork() {
  568. this.isEditingWork = false;
  569. this.editingWorkIndex = -1;
  570. this.workForm = {
  571. startTime: "",
  572. endTime: "",
  573. companyName: "",
  574. department: "",
  575. employeeCount: "",
  576. position: "",
  577. monthlySalary: "",
  578. supervisor: "",
  579. supervisorPhone: ""
  580. };
  581. },
  582. deleteWork(index) {
  583. if (this.isEditingWork && this.editingWorkIndex === index) {
  584. this.cancelEditWork();
  585. }
  586. this.workList.splice(index, 1);
  587. common_vendor.index.showToast({
  588. title: "已删除",
  589. icon: "none"
  590. });
  591. },
  592. submitForm() {
  593. if (!this.validateCurrentStep()) {
  594. return;
  595. }
  596. const allRequired = [
  597. "name",
  598. "gender",
  599. "phone",
  600. "idCard",
  601. "ethnic",
  602. "currentAddress"
  603. ];
  604. let isValid = true;
  605. allRequired.forEach((field) => {
  606. if (!this.validateField(field, this.formData[field])) {
  607. isValid = false;
  608. }
  609. });
  610. if (!isValid) {
  611. common_vendor.index.showToast({
  612. title: "请完善所有必填信息",
  613. icon: "none"
  614. });
  615. return;
  616. }
  617. const userInfo = common_vendor.index.getStorageSync("userInfo");
  618. if (!userInfo) {
  619. common_vendor.index.showToast({
  620. title: "用户信息获取失败,请重新登录",
  621. icon: "none",
  622. duration: 2e3
  623. });
  624. return;
  625. }
  626. try {
  627. const userData = JSON.parse(userInfo);
  628. const submitData = {
  629. tenant_id: 1,
  630. user_id: userData.id,
  631. personal_info: {
  632. name: this.formData.name,
  633. gender: this.formData.gender,
  634. phone: this.formData.phone,
  635. id_card: this.formData.idCard,
  636. address: this.formData.currentAddress,
  637. professional_skills: this.formData.skills ? this.formData.skills.split(",") : []
  638. },
  639. profile: {
  640. female_status: this.getFemaleStatus(),
  641. marital_status: this.getMaritalStatus(),
  642. height: parseFloat(this.formData.height) || 0,
  643. weight: parseFloat(this.formData.weight) || 0,
  644. ethnicity: this.formData.ethnic,
  645. current_address: this.formData.currentAddress,
  646. expected_salary: parseFloat(this.formData.expectedSalary) || 0
  647. },
  648. educations: this.formatEducations(),
  649. family_members: this.formatFamilyMembers(),
  650. work_experiences: this.formatWorkExperiences()
  651. };
  652. if (!submitData.personal_info.name || !submitData.personal_info.gender || !submitData.personal_info.phone) {
  653. common_vendor.index.showToast({
  654. title: "基本信息不完整",
  655. icon: "none",
  656. duration: 2e3
  657. });
  658. return;
  659. }
  660. this.sendFormData(submitData);
  661. } catch (error) {
  662. console.error("数据处理错误:", error);
  663. common_vendor.index.showToast({
  664. title: "数据处理错误,请重试",
  665. icon: "none",
  666. duration: 2e3
  667. });
  668. }
  669. },
  670. // 辅助方法:发送表单数据
  671. sendFormData(submitData) {
  672. common_vendor.index.showLoading({ title: "提交中..." });
  673. const token = common_vendor.index.getStorageSync("token");
  674. common_vendor.index.request({
  675. url: `${common_config.apiBaseUrl}/wechat/user/profile/update`,
  676. method: "POST",
  677. data: submitData,
  678. header: {
  679. "content-type": "application/json",
  680. "Authorization": token ? `Bearer ${token}` : ""
  681. },
  682. success: (res) => {
  683. common_vendor.index.hideLoading();
  684. if (res.statusCode === 200) {
  685. if (res.data.code === 2e3) {
  686. common_vendor.index.showToast({
  687. title: "提交成功",
  688. icon: "success",
  689. duration: 2e3
  690. });
  691. setTimeout(() => {
  692. common_vendor.index.navigateTo({
  693. url: "/pages/interview-notice/interview-notice"
  694. });
  695. }, 2e3);
  696. } else {
  697. common_vendor.index.showToast({
  698. title: res.data.msg || "提交失败",
  699. icon: "none",
  700. duration: 2e3
  701. });
  702. }
  703. } else {
  704. common_vendor.index.showToast({
  705. title: "服务器响应错误",
  706. icon: "none",
  707. duration: 2e3
  708. });
  709. }
  710. },
  711. fail: (err) => {
  712. console.error("提交失败:", err);
  713. common_vendor.index.hideLoading();
  714. if (err.errMsg.includes("timeout")) {
  715. common_vendor.index.showToast({
  716. title: "请求超时,请检查网络后重试",
  717. icon: "none",
  718. duration: 2e3
  719. });
  720. } else if (err.errMsg.includes("fail")) {
  721. common_vendor.index.showToast({
  722. title: "网络连接失败,请检查网络设置",
  723. icon: "none",
  724. duration: 2e3
  725. });
  726. } else {
  727. common_vendor.index.showToast({
  728. title: "提交失败,请稍后重试",
  729. icon: "none",
  730. duration: 2e3
  731. });
  732. }
  733. },
  734. complete: () => {
  735. }
  736. });
  737. },
  738. // 数据格式化方法
  739. getFemaleStatus() {
  740. if (this.formData.gender !== "女")
  741. return 0;
  742. const statusMap = { "孕期": 1, "产期": 2, "哺乳期": 3 };
  743. return statusMap[this.formData.threePeriod] || 0;
  744. },
  745. getMaritalStatus() {
  746. const statusMap = { "未婚": 0, "已婚": 1, "离异": 2, "丧偶": 3 };
  747. return statusMap[this.formData.marriage] || 0;
  748. },
  749. formatEducations() {
  750. return this.educationList.map((edu, index) => ({
  751. education_type: index === 0 ? 1 : 2,
  752. degree: this.mapDegreeToNumber(edu.degree),
  753. start_date: edu.startTime,
  754. end_date: edu.endTime,
  755. school_name: edu.schoolName,
  756. major: edu.major
  757. }));
  758. },
  759. formatFamilyMembers() {
  760. return this.familyMembers.map((member) => ({
  761. relation: member.relation,
  762. name: member.name,
  763. workplace: member.workplaceOrAddress,
  764. position: member.position,
  765. phone: member.phone
  766. //is_emergency_contact: member.isEmergencyContact||false // 添加紧急联系人标识
  767. }));
  768. },
  769. formatWorkExperiences() {
  770. return this.workList.map((work) => ({
  771. start_date: work.startTime,
  772. end_date: work.endTime,
  773. company_name: work.companyName,
  774. department: work.department,
  775. company_size: work.employeeCount,
  776. position: work.position,
  777. monthly_salary: work.monthlySalary,
  778. supervisor_name: work.supervisor,
  779. supervisor_phone: work.supervisorPhone
  780. }));
  781. },
  782. // 学历映射辅助方法
  783. mapDegreeToNumber(degreeText) {
  784. const degreeMap = {
  785. "高中": 1,
  786. "中专": 1,
  787. "大专": 2,
  788. "本科": 3,
  789. "硕士": 4,
  790. "博士": 5
  791. };
  792. return degreeMap[degreeText] || 6;
  793. },
  794. prevStep() {
  795. const prevIndex = this.currentStepIndex - 1;
  796. if (prevIndex >= 0) {
  797. this.currentStep = this.steps[prevIndex].id;
  798. common_vendor.index.pageScrollTo({
  799. scrollTop: 0,
  800. duration: 300
  801. });
  802. }
  803. },
  804. nextStep() {
  805. if (!this.validateCurrentStep()) {
  806. return;
  807. }
  808. if (this.currentStep === 1) {
  809. this.verifyIdentity();
  810. return;
  811. }
  812. const nextIndex = this.currentStepIndex + 1;
  813. if (nextIndex < this.steps.length) {
  814. this.currentStep = this.steps[nextIndex].id;
  815. common_vendor.index.pageScrollTo({
  816. scrollTop: 0,
  817. duration: 300
  818. });
  819. }
  820. },
  821. // 身份验证方法
  822. verifyIdentity() {
  823. this.formErrors = {
  824. name: "",
  825. idCard: "",
  826. phone: ""
  827. };
  828. common_vendor.index.showLoading({
  829. title: "身份验证中..."
  830. });
  831. common_vendor.index.request({
  832. url: `${common_config.apiBaseUrl}/wechat/identity/verify`,
  833. method: "POST",
  834. data: {
  835. name: this.formData.name,
  836. id_number: this.formData.idCard,
  837. mobile: this.formData.phone
  838. },
  839. header: {
  840. "content-type": "application/x-www-form-urlencoded"
  841. },
  842. success: (res) => {
  843. common_vendor.index.hideLoading();
  844. console.log(res);
  845. if (res.data.code === 200) {
  846. const nextIndex = this.currentStepIndex + 1;
  847. if (nextIndex < this.steps.length) {
  848. this.currentStep = this.steps[nextIndex].id;
  849. common_vendor.index.pageScrollTo({
  850. scrollTop: 0,
  851. duration: 300
  852. });
  853. }
  854. this.setUserInfo(this.formData);
  855. } else {
  856. this.handleVerificationError(res.data);
  857. }
  858. },
  859. fail: (err) => {
  860. this.handleRequestError(err);
  861. }
  862. });
  863. },
  864. setUserInfo(data) {
  865. common_vendor.index.request({
  866. url: `${common_config.apiBaseUrl}/wechat/updateUserInfo`,
  867. method: "POST",
  868. data: {
  869. openid: JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid,
  870. name: data.name,
  871. id_number: data.idCard,
  872. purePhoneNumber: data.phone,
  873. tenant_id: 1,
  874. examine: 0
  875. },
  876. header: {
  877. "content-type": "application/x-www-form-urlencoded"
  878. },
  879. success: (res) => {
  880. console.log(res);
  881. }
  882. });
  883. },
  884. // 处理验证错误
  885. handleVerificationError(data) {
  886. this.formErrors.name = "姓名验证失败,请检查姓名是否正确";
  887. this.formErrors.idCard = "身份证号验证失败,请检查身份证号是否正确";
  888. this.formErrors.phone = "手机号验证失败,请检查手机号是否正确";
  889. common_vendor.index.showToast({
  890. title: data.msg || "身份验证失败",
  891. icon: "none"
  892. });
  893. },
  894. // 处理请求错误
  895. handleRequestError(err) {
  896. common_vendor.index.hideLoading();
  897. common_vendor.index.showToast({
  898. title: "网络错误,请检查网络连接",
  899. icon: "none",
  900. duration: 2e3
  901. });
  902. console.error("请求失败:", err);
  903. },
  904. // 验证当前步骤的必填项
  905. validateCurrentStep() {
  906. var _a, _b;
  907. let isValid = true;
  908. switch (this.currentStep) {
  909. case 1:
  910. const basicFields = ["name", "gender", "phone", "idCard", "ethnic", "currentAddress"];
  911. basicFields.forEach((field) => {
  912. if (!this.validateField(field, this.formData[field])) {
  913. isValid = false;
  914. }
  915. });
  916. if (this.formData.gender === "女" && this.threePeriodIndex === -1) {
  917. this.formErrors.threePeriod = "请选择三期状态";
  918. isValid = false;
  919. }
  920. if (this.formData.height) {
  921. isValid = this.validateField("height", this.formData.height) && isValid;
  922. }
  923. if (this.formData.weight) {
  924. isValid = this.validateField("weight", this.formData.weight) && isValid;
  925. }
  926. if (this.formData.expectedSalary) {
  927. isValid = this.validateField("expectedSalary", this.formData.expectedSalary) && isValid;
  928. }
  929. break;
  930. case 3:
  931. console.log(this.familyMembers.length);
  932. if (this.familyMembers.length == 0) {
  933. common_vendor.index.showToast({
  934. title: "请至少添加一位家庭成员",
  935. icon: "none"
  936. });
  937. isValid = false;
  938. }
  939. break;
  940. case 5:
  941. if (this.educationList.length === 0) {
  942. common_vendor.index.showToast({
  943. title: "请至少添加一项教育经历",
  944. icon: "none"
  945. });
  946. isValid = false;
  947. }
  948. break;
  949. case 6:
  950. if (!((_a = this.formData.skills) == null ? void 0 : _a.trim())) {
  951. this.formErrors.skills = "请描述您的专业技能";
  952. isValid = false;
  953. }
  954. if (!((_b = this.formData.training) == null ? void 0 : _b.trim())) {
  955. this.formErrors.training = "请描述您的培训经历";
  956. isValid = false;
  957. }
  958. break;
  959. case 8:
  960. if (this.workList.length === 0) {
  961. common_vendor.index.showToast({
  962. title: "请至少添加一项工作经历",
  963. icon: "none"
  964. });
  965. isValid = false;
  966. }
  967. break;
  968. }
  969. if (!isValid) {
  970. common_vendor.index.showToast({
  971. title: "请完善所有必填信息",
  972. icon: "none"
  973. });
  974. }
  975. return isValid;
  976. },
  977. // Add method to fetch user data
  978. fetchUserData() {
  979. this.isLoading = true;
  980. const userInfo = common_vendor.index.getStorageSync("userInfo") ? JSON.parse(common_vendor.index.getStorageSync("userInfo")) : {};
  981. const openid = userInfo.openid;
  982. if (!openid) {
  983. common_vendor.index.showToast({
  984. title: "用户信息获取失败,请重新登录",
  985. icon: "none"
  986. });
  987. this.isLoading = false;
  988. return;
  989. }
  990. common_vendor.index.request({
  991. url: `${common_config.apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=1&openid=${openid}`,
  992. method: "GET",
  993. success: (res) => {
  994. this.showPromiseModal = true;
  995. this.populateFormData(res.data.data);
  996. },
  997. fail: (err) => {
  998. },
  999. complete: () => {
  1000. this.isLoading = false;
  1001. }
  1002. });
  1003. },
  1004. // Add method to populate form data with fetched data
  1005. populateFormData(data) {
  1006. const { user_info, profile, educations, work_experiences, family_members } = data;
  1007. if (user_info) {
  1008. this.formData.name = user_info.name || "";
  1009. this.formData.gender = user_info.gender_text || "";
  1010. this.genderIndex = this.genderOptions.findIndex((item) => item === this.formData.gender);
  1011. this.formData.idCard = user_info.id_card || "";
  1012. this.formData.phone = user_info.phone || "";
  1013. this.formData.email = user_info.email || "";
  1014. }
  1015. if (profile) {
  1016. this.formData.political = profile.political_status || "";
  1017. this.politicalIndex = this.politicalOptions.findIndex((item) => item === this.formData.political);
  1018. this.formData.ethnic = profile.ethnicity || "";
  1019. this.ethnicIndex = this.ethnicOptions.findIndex((item) => item === this.formData.ethnic);
  1020. this.formData.height = profile.height || "";
  1021. this.formData.weight = profile.weight || "";
  1022. this.formData.nativePlace = profile.native_place || "";
  1023. this.formData.residence = profile.household_location || "";
  1024. this.formData.currentAddress = profile.current_address || "";
  1025. this.formData.marriage = profile.marital_status_text || "";
  1026. this.marriageIndex = this.marriageOptions.findIndex((item) => item === this.formData.marriage);
  1027. if (this.formData.gender === "女" && profile.female_status !== void 0) {
  1028. const femaleStatusMap = { 0: "无", 1: "孕期", 2: "产期", 3: "哺乳期" };
  1029. this.formData.threePeriod = femaleStatusMap[profile.female_status] || "无";
  1030. this.threePeriodIndex = this.threePeriodOptions.findIndex((item) => item === this.formData.threePeriod);
  1031. }
  1032. this.formData.expectedSalary = profile.expected_salary || "";
  1033. this.formData.emergencyContact = profile.emergency_contact || "";
  1034. this.formData.emergencyPhone = profile.emergency_phone || "";
  1035. this.formData.hobby = profile.specialties || "";
  1036. this.formData.motto = profile.life_motto || "";
  1037. const sourceTypeMap = {
  1038. 1: "school",
  1039. 2: "social",
  1040. 3: "social",
  1041. 4: "social",
  1042. 5: "social"
  1043. };
  1044. const socialSourceMap = {
  1045. 2: "BOSS",
  1046. 3: "zhilian",
  1047. 4: "liepin",
  1048. 5: "other"
  1049. };
  1050. this.formData.sourceType = sourceTypeMap[profile.recruitment_source] || "social";
  1051. if (this.formData.sourceType === "social") {
  1052. this.formData.socialSource = socialSourceMap[profile.recruitment_source] || "";
  1053. if (this.formData.socialSource === "other") {
  1054. this.formData.otherSocialSource = profile.recruitment_source_detail || "";
  1055. }
  1056. } else if (this.formData.sourceType === "school") {
  1057. this.formData.otherSchoolSource = profile.recruitment_source_detail || "";
  1058. }
  1059. }
  1060. if (educations && educations.length > 0) {
  1061. this.educationList = educations.map((edu) => {
  1062. const degreeMap = {
  1063. 1: "高中",
  1064. 2: "大专",
  1065. 3: "本科",
  1066. 4: "硕士",
  1067. 5: "博士"
  1068. };
  1069. return {
  1070. startTime: edu.start_date || "",
  1071. endTime: edu.end_date || "",
  1072. schoolName: edu.school_name || "",
  1073. major: edu.major || "",
  1074. degree: degreeMap[edu.degree] || ""
  1075. };
  1076. });
  1077. }
  1078. if (work_experiences && work_experiences.length > 0) {
  1079. this.workList = work_experiences.map((work) => {
  1080. return {
  1081. startTime: work.start_date || "",
  1082. endTime: work.end_date || "",
  1083. companyName: work.company_name || "",
  1084. department: work.department || "",
  1085. employeeCount: work.company_size || "",
  1086. position: work.position || "",
  1087. monthlySalary: work.monthly_salary || "",
  1088. supervisor: work.supervisor_name || "",
  1089. supervisorPhone: work.supervisor_phone || ""
  1090. };
  1091. });
  1092. }
  1093. if (family_members && family_members.length > 0) {
  1094. this.familyMembers = family_members.map((member) => {
  1095. return {
  1096. relation: member.relation || "",
  1097. name: member.name || "",
  1098. workplaceOrAddress: member.workplace || "",
  1099. position: member.position || "",
  1100. phone: member.phone || "",
  1101. isEmergencyContact: member.isEmergencyContact || false
  1102. };
  1103. });
  1104. }
  1105. },
  1106. // 处理紧急联系人开关变化
  1107. handleEmergencyContactChange(e) {
  1108. this.familyMemberForm.isEmergencyContact = e.detail.value;
  1109. if (e.detail.value) {
  1110. this.formData.emergencyContact = this.familyMemberForm.name;
  1111. this.formData.emergencyPhone = this.familyMemberForm.phone;
  1112. }
  1113. },
  1114. // 添加重置教育经历错误信息的方法
  1115. resetEducationErrors() {
  1116. this.educationErrors = {
  1117. startTime: "",
  1118. endTime: "",
  1119. schoolName: "",
  1120. major: "",
  1121. degree: ""
  1122. };
  1123. },
  1124. // 添加通用验证方法
  1125. validateField(fieldName, value) {
  1126. const rule = this.validationRules[fieldName];
  1127. if (!rule)
  1128. return true;
  1129. this.formErrors[fieldName] = "";
  1130. if (rule.required && !value) {
  1131. this.formErrors[fieldName] = rule.message;
  1132. return false;
  1133. }
  1134. if (rule.pattern && !rule.pattern.test(value)) {
  1135. this.formErrors[fieldName] = rule.message;
  1136. return false;
  1137. }
  1138. return true;
  1139. }
  1140. },
  1141. // 添加监听器来清除错误信息
  1142. watch: {
  1143. "formData.name": function(newVal) {
  1144. if (newVal && this.formErrors.name) {
  1145. this.formErrors.name = "";
  1146. }
  1147. },
  1148. "formData.idCard": function(newVal) {
  1149. if (newVal && this.formErrors.idCard) {
  1150. this.formErrors.idCard = "";
  1151. }
  1152. },
  1153. "formData.phone": function(newVal) {
  1154. if (newVal && this.formErrors.phone) {
  1155. this.formErrors.phone = "";
  1156. }
  1157. },
  1158. "formData.gender": function(newVal) {
  1159. if (newVal && this.formErrors.gender) {
  1160. this.formErrors.gender = "";
  1161. }
  1162. },
  1163. "formData.ethnic": function(newVal) {
  1164. if (newVal && this.formErrors.ethnic) {
  1165. this.formErrors.ethnic = "";
  1166. }
  1167. },
  1168. "formData.currentAddress": function(newVal) {
  1169. if (newVal && this.formErrors.currentAddress) {
  1170. this.formErrors.currentAddress = "";
  1171. }
  1172. },
  1173. "formData.height": function(newVal) {
  1174. if (newVal && this.formErrors.height) {
  1175. this.formErrors.height = "";
  1176. }
  1177. },
  1178. "formData.weight": function(newVal) {
  1179. if (newVal && this.formErrors.weight) {
  1180. this.formErrors.weight = "";
  1181. }
  1182. },
  1183. "formData.expectedSalary": function(newVal) {
  1184. if (newVal && this.formErrors.expectedSalary) {
  1185. this.formErrors.expectedSalary = "";
  1186. }
  1187. },
  1188. "familyMemberForm.relation": function(newVal) {
  1189. if (newVal)
  1190. this.familyMemberErrors.relation = "";
  1191. },
  1192. "familyMemberForm.name": function(newVal) {
  1193. if (newVal)
  1194. this.familyMemberErrors.name = "";
  1195. },
  1196. "familyMemberForm.phone": function(newVal) {
  1197. if (newVal)
  1198. this.familyMemberErrors.phone = "";
  1199. },
  1200. "familyMemberForm.workplaceOrAddress": function(newVal) {
  1201. if (newVal)
  1202. this.familyMemberErrors.workplaceOrAddress = "";
  1203. },
  1204. "familyMemberForm.position": function(newVal) {
  1205. if (newVal)
  1206. this.familyMemberErrors.position = "";
  1207. },
  1208. "workForm.companyName": function(newVal) {
  1209. if (newVal && this.workErrors.companyName) {
  1210. this.workErrors.companyName = "";
  1211. }
  1212. },
  1213. "workForm.department": function(newVal) {
  1214. if (newVal && this.workErrors.department) {
  1215. this.workErrors.department = "";
  1216. }
  1217. },
  1218. "workForm.position": function(newVal) {
  1219. if (newVal && this.workErrors.position) {
  1220. this.workErrors.position = "";
  1221. }
  1222. },
  1223. "workForm.employeeCount": function(newVal) {
  1224. if (newVal && this.workErrors.employeeCount) {
  1225. this.workErrors.employeeCount = "";
  1226. }
  1227. },
  1228. "workForm.monthlySalary": function(newVal) {
  1229. if (newVal && this.workErrors.monthlySalary) {
  1230. this.workErrors.monthlySalary = "";
  1231. }
  1232. },
  1233. "workForm.supervisor": function(newVal) {
  1234. if (newVal && this.workErrors.supervisor) {
  1235. this.workErrors.supervisor = "";
  1236. }
  1237. },
  1238. "workForm.supervisorPhone": function(newVal) {
  1239. if (newVal && this.workErrors.supervisorPhone) {
  1240. this.workErrors.supervisorPhone = "";
  1241. }
  1242. },
  1243. "formData.training": function(newVal) {
  1244. if (newVal && this.formErrors.training) {
  1245. this.formErrors.training = "";
  1246. }
  1247. },
  1248. "educationForm.startTime": function(newVal) {
  1249. if (newVal)
  1250. this.educationErrors.startTime = "";
  1251. },
  1252. "educationForm.endTime": function(newVal) {
  1253. if (newVal)
  1254. this.educationErrors.endTime = "";
  1255. },
  1256. "educationForm.schoolName": function(newVal) {
  1257. if (newVal)
  1258. this.educationErrors.schoolName = "";
  1259. },
  1260. "educationForm.major": function(newVal) {
  1261. if (newVal)
  1262. this.educationErrors.major = "";
  1263. },
  1264. "educationForm.degree": function(newVal) {
  1265. if (newVal)
  1266. this.educationErrors.degree = "";
  1267. },
  1268. // 添加对表单字段的实时验证
  1269. "formData": {
  1270. handler(newVal) {
  1271. const currentStepFields = {
  1272. 1: ["name", "gender", "phone", "idCard", "ethnic", "currentAddress", "height", "weight", "expectedSalary"],
  1273. 6: ["skills", "training"]
  1274. }[this.currentStep];
  1275. if (currentStepFields) {
  1276. currentStepFields.forEach((field) => {
  1277. if (newVal[field] !== void 0) {
  1278. this.validateField(field, newVal[field]);
  1279. }
  1280. });
  1281. }
  1282. },
  1283. deep: true
  1284. }
  1285. }
  1286. };
  1287. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  1288. return common_vendor.e({
  1289. a: $data.isLoading
  1290. }, $data.isLoading ? {} : {}, {
  1291. b: $data.showPromiseModal
  1292. }, $data.showPromiseModal ? {
  1293. c: $data.promiseChecked,
  1294. d: common_vendor.o((...args) => $options.togglePromiseChecked && $options.togglePromiseChecked(...args)),
  1295. e: !$data.promiseChecked,
  1296. f: common_vendor.o((...args) => $options.confirmPromise && $options.confirmPromise(...args))
  1297. } : {}, {
  1298. g: $data.currentStep === 1
  1299. }, $data.currentStep === 1 ? common_vendor.e({
  1300. h: $data.formErrors.name ? 1 : "",
  1301. i: $data.formData.name,
  1302. j: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
  1303. k: $data.formErrors.name
  1304. }, $data.formErrors.name ? {
  1305. l: common_vendor.t($data.formErrors.name)
  1306. } : {}, {
  1307. m: common_vendor.t($data.genderOptions[$data.genderIndex] || "请选择性别"),
  1308. n: $data.formErrors.gender ? 1 : "",
  1309. o: common_vendor.o((...args) => $options.bindGenderChange && $options.bindGenderChange(...args)),
  1310. p: $data.genderIndex,
  1311. q: $data.genderOptions,
  1312. r: $data.formErrors.gender
  1313. }, $data.formErrors.gender ? {
  1314. s: common_vendor.t($data.formErrors.gender)
  1315. } : {}, {
  1316. t: $data.formData.gender === "女"
  1317. }, $data.formData.gender === "女" ? {
  1318. v: common_vendor.t($data.threePeriodOptions[$data.threePeriodIndex] || "请选择"),
  1319. w: common_vendor.o((...args) => $options.bindThreePeriodChange && $options.bindThreePeriodChange(...args)),
  1320. x: $data.threePeriodIndex,
  1321. y: $data.threePeriodOptions
  1322. } : {}, {
  1323. z: $data.formErrors.phone ? 1 : "",
  1324. A: $data.formData.phone,
  1325. B: common_vendor.o(($event) => $data.formData.phone = $event.detail.value),
  1326. C: $data.formErrors.phone
  1327. }, $data.formErrors.phone ? {
  1328. D: common_vendor.t($data.formErrors.phone)
  1329. } : {}, {
  1330. E: $data.formErrors.idCard ? 1 : "",
  1331. F: $data.formData.idCard,
  1332. G: common_vendor.o(($event) => $data.formData.idCard = $event.detail.value),
  1333. H: $data.formErrors.idCard
  1334. }, $data.formErrors.idCard ? {
  1335. I: common_vendor.t($data.formErrors.idCard)
  1336. } : {}, {
  1337. J: common_vendor.t($data.ethnicOptions[$data.ethnicIndex] || "请选择民族"),
  1338. K: $data.formErrors.ethnic ? 1 : "",
  1339. L: common_vendor.o((...args) => $options.bindEthnicChange && $options.bindEthnicChange(...args)),
  1340. M: $data.ethnicIndex,
  1341. N: $data.ethnicOptions,
  1342. O: $data.formErrors.ethnic
  1343. }, $data.formErrors.ethnic ? {
  1344. P: common_vendor.t($data.formErrors.ethnic)
  1345. } : {}, {
  1346. Q: $data.formData.height,
  1347. R: common_vendor.o(($event) => $data.formData.height = $event.detail.value),
  1348. S: $data.formData.weight,
  1349. T: common_vendor.o(($event) => $data.formData.weight = $event.detail.value),
  1350. U: $data.formErrors.currentAddress ? 1 : "",
  1351. V: $data.formData.currentAddress,
  1352. W: common_vendor.o(($event) => $data.formData.currentAddress = $event.detail.value),
  1353. X: $data.formErrors.currentAddress
  1354. }, $data.formErrors.currentAddress ? {
  1355. Y: common_vendor.t($data.formErrors.currentAddress)
  1356. } : {}, {
  1357. Z: $data.formData.residence,
  1358. aa: common_vendor.o(($event) => $data.formData.residence = $event.detail.value),
  1359. ab: common_vendor.t($data.marriageOptions[$data.marriageIndex] || "请选择婚育状况"),
  1360. ac: common_vendor.o((...args) => $options.bindMarriageChange && $options.bindMarriageChange(...args)),
  1361. ad: $data.marriageIndex,
  1362. ae: $data.marriageOptions,
  1363. af: $data.formData.expectedSalary,
  1364. ag: common_vendor.o(($event) => $data.formData.expectedSalary = $event.detail.value)
  1365. }) : {}, {
  1366. ah: $data.currentStep === 3
  1367. }, $data.currentStep === 3 ? common_vendor.e({
  1368. ai: $data.familyMembers.length > 0
  1369. }, $data.familyMembers.length > 0 ? {
  1370. aj: common_vendor.f($data.familyMembers, (member, index, i0) => {
  1371. return {
  1372. a: common_vendor.t(index + 1),
  1373. b: common_vendor.o(($event) => $options.editFamilyMember(index), index),
  1374. c: common_vendor.o(($event) => $options.deleteFamilyMember(index), index),
  1375. d: common_vendor.t(member.relation),
  1376. e: common_vendor.t(member.name),
  1377. f: common_vendor.t(member.workplaceOrAddress),
  1378. g: common_vendor.t(member.position),
  1379. h: common_vendor.t(member.phone),
  1380. i: common_vendor.t(member.isEmergencyContact ? "是" : "否"),
  1381. j: index
  1382. };
  1383. })
  1384. } : {}, {
  1385. ak: common_vendor.t($data.isEditing ? "编辑家庭成员" : "添加家庭成员"),
  1386. al: $data.isEditing
  1387. }, $data.isEditing ? {
  1388. am: common_vendor.o((...args) => $options.cancelEdit && $options.cancelEdit(...args))
  1389. } : {}, {
  1390. an: $data.familyMemberErrors.relation ? 1 : "",
  1391. ao: $data.familyMemberForm.relation,
  1392. ap: common_vendor.o(($event) => $data.familyMemberForm.relation = $event.detail.value),
  1393. aq: $data.familyMemberErrors.relation
  1394. }, $data.familyMemberErrors.relation ? {
  1395. ar: common_vendor.t($data.familyMemberErrors.relation)
  1396. } : {}, {
  1397. as: $data.familyMemberErrors.name ? 1 : "",
  1398. at: $data.familyMemberForm.name,
  1399. av: common_vendor.o(($event) => $data.familyMemberForm.name = $event.detail.value),
  1400. aw: $data.familyMemberErrors.name
  1401. }, $data.familyMemberErrors.name ? {
  1402. ax: common_vendor.t($data.familyMemberErrors.name)
  1403. } : {}, {
  1404. ay: $data.familyMemberForm.workplaceOrAddress,
  1405. az: common_vendor.o(($event) => $data.familyMemberForm.workplaceOrAddress = $event.detail.value),
  1406. aA: $data.familyMemberErrors.workplaceOrAddress
  1407. }, $data.familyMemberErrors.workplaceOrAddress ? {
  1408. aB: common_vendor.t($data.familyMemberErrors.workplaceOrAddress)
  1409. } : {}, {
  1410. aC: $data.familyMemberForm.position,
  1411. aD: common_vendor.o(($event) => $data.familyMemberForm.position = $event.detail.value),
  1412. aE: $data.familyMemberErrors.position
  1413. }, $data.familyMemberErrors.position ? {
  1414. aF: common_vendor.t($data.familyMemberErrors.position)
  1415. } : {}, {
  1416. aG: $data.familyMemberErrors.phone ? 1 : "",
  1417. aH: $data.familyMemberForm.phone,
  1418. aI: common_vendor.o(($event) => $data.familyMemberForm.phone = $event.detail.value),
  1419. aJ: $data.familyMemberErrors.phone
  1420. }, $data.familyMemberErrors.phone ? {
  1421. aK: common_vendor.t($data.familyMemberErrors.phone)
  1422. } : {}, {
  1423. aL: $data.familyMemberForm.isEmergencyContact,
  1424. aM: common_vendor.o((...args) => $options.handleEmergencyContactChange && $options.handleEmergencyContactChange(...args)),
  1425. aN: common_vendor.t($data.isEditing ? "✓" : "+"),
  1426. aO: common_vendor.o((...args) => $options.saveFamilyMember && $options.saveFamilyMember(...args)),
  1427. aP: common_vendor.t($data.isEditing ? "保存修改" : "添加成员")
  1428. }) : {}, {
  1429. aQ: $data.currentStep === 5
  1430. }, $data.currentStep === 5 ? common_vendor.e({
  1431. aR: $data.educationList.length > 0
  1432. }, $data.educationList.length > 0 ? {
  1433. aS: common_vendor.f($data.educationList, (edu, index, i0) => {
  1434. return {
  1435. a: common_vendor.t(index === 0 ? "第一学历" : "最高学历"),
  1436. b: common_vendor.o(($event) => $options.editEducation(index), index),
  1437. c: common_vendor.o(($event) => $options.deleteEducation(index), index),
  1438. d: common_vendor.t(edu.startTime),
  1439. e: common_vendor.t(edu.endTime),
  1440. f: common_vendor.t(edu.schoolName),
  1441. g: common_vendor.t(edu.major),
  1442. h: common_vendor.t(edu.degree),
  1443. i: index
  1444. };
  1445. })
  1446. } : {}, {
  1447. aT: $data.educationList.length < 2 || $data.isEditingEducation
  1448. }, $data.educationList.length < 2 || $data.isEditingEducation ? common_vendor.e({
  1449. aU: common_vendor.t($data.isEditingEducation ? "编辑教育经历" : $data.educationList.length === 0 ? "添加第一学历" : "添加最高学历"),
  1450. aV: $data.isEditingEducation
  1451. }, $data.isEditingEducation ? {
  1452. aW: common_vendor.o((...args) => $options.cancelEditEducation && $options.cancelEditEducation(...args))
  1453. } : {}, {
  1454. aX: common_vendor.t($data.educationForm.startTime || "开始时间"),
  1455. aY: $data.educationForm.startTime,
  1456. aZ: common_vendor.o((...args) => $options.bindStartTimeChange && $options.bindStartTimeChange(...args)),
  1457. ba: $data.educationErrors.startTime ? 1 : "",
  1458. bb: common_vendor.t($data.educationForm.endTime || "结束时间"),
  1459. bc: $data.educationForm.endTime,
  1460. bd: common_vendor.o((...args) => $options.bindEndTimeChange && $options.bindEndTimeChange(...args)),
  1461. be: $data.educationErrors.endTime ? 1 : "",
  1462. bf: $data.educationErrors.startTime
  1463. }, $data.educationErrors.startTime ? {
  1464. bg: common_vendor.t($data.educationErrors.startTime)
  1465. } : {}, {
  1466. bh: $data.educationErrors.endTime
  1467. }, $data.educationErrors.endTime ? {
  1468. bi: common_vendor.t($data.educationErrors.endTime)
  1469. } : {}, {
  1470. bj: $data.educationErrors.schoolName ? 1 : "",
  1471. bk: $data.educationForm.schoolName,
  1472. bl: common_vendor.o(($event) => $data.educationForm.schoolName = $event.detail.value),
  1473. bm: $data.educationErrors.schoolName
  1474. }, $data.educationErrors.schoolName ? {
  1475. bn: common_vendor.t($data.educationErrors.schoolName)
  1476. } : {}, {
  1477. bo: $data.educationErrors.major ? 1 : "",
  1478. bp: $data.educationForm.major,
  1479. bq: common_vendor.o(($event) => $data.educationForm.major = $event.detail.value),
  1480. br: $data.educationErrors.major
  1481. }, $data.educationErrors.major ? {
  1482. bs: common_vendor.t($data.educationErrors.major)
  1483. } : {}, {
  1484. bt: common_vendor.t($data.degreeOptions[$data.degreeIndex] || "请选择学历"),
  1485. bv: common_vendor.o((...args) => $options.bindDegreeChange && $options.bindDegreeChange(...args)),
  1486. bw: $data.degreeIndex,
  1487. bx: $data.degreeOptions,
  1488. by: $data.educationErrors.degree ? 1 : "",
  1489. bz: $data.educationErrors.degree
  1490. }, $data.educationErrors.degree ? {
  1491. bA: common_vendor.t($data.educationErrors.degree)
  1492. } : {}, {
  1493. bB: common_vendor.t($data.isEditingEducation ? "✓" : "+"),
  1494. bC: common_vendor.o((...args) => $options.saveEducation && $options.saveEducation(...args)),
  1495. bD: common_vendor.t($data.isEditingEducation ? "保存修改" : "添加学历")
  1496. }) : {}) : {}, {
  1497. bE: $data.currentStep === 6
  1498. }, $data.currentStep === 6 ? common_vendor.e({
  1499. bF: $data.formErrors.skills ? 1 : "",
  1500. bG: $data.formData.skills,
  1501. bH: common_vendor.o(($event) => $data.formData.skills = $event.detail.value),
  1502. bI: $data.formErrors.skills
  1503. }, $data.formErrors.skills ? {
  1504. bJ: common_vendor.t($data.formErrors.skills)
  1505. } : {}, {
  1506. bK: $data.formErrors.training ? 1 : "",
  1507. bL: $data.formData.training,
  1508. bM: common_vendor.o(($event) => $data.formData.training = $event.detail.value),
  1509. bN: $data.formErrors.training
  1510. }, $data.formErrors.training ? {
  1511. bO: common_vendor.t($data.formErrors.training)
  1512. } : {}) : {}, {
  1513. bP: $data.currentStep === 8
  1514. }, $data.currentStep === 8 ? common_vendor.e({
  1515. bQ: $data.workList.length > 0
  1516. }, $data.workList.length > 0 ? {
  1517. bR: common_vendor.f($data.workList, (work, index, i0) => {
  1518. return {
  1519. a: common_vendor.t(index + 1),
  1520. b: common_vendor.o(($event) => $options.editWork(index), index),
  1521. c: common_vendor.o(($event) => $options.deleteWork(index), index),
  1522. d: common_vendor.t(work.startTime),
  1523. e: common_vendor.t(work.endTime),
  1524. f: common_vendor.t(work.companyName),
  1525. g: common_vendor.t(work.department),
  1526. h: common_vendor.t(work.employeeCount),
  1527. i: common_vendor.t(work.position),
  1528. j: common_vendor.t(work.monthlySalary),
  1529. k: common_vendor.t(work.supervisor),
  1530. l: common_vendor.t(work.supervisorPhone),
  1531. m: index
  1532. };
  1533. })
  1534. } : {}, {
  1535. bS: $data.workList.length < 2 || $data.isEditingWork
  1536. }, $data.workList.length < 2 || $data.isEditingWork ? common_vendor.e({
  1537. bT: common_vendor.t($data.isEditingWork ? "编辑工作经历" : "添加工作经历"),
  1538. bU: $data.isEditingWork
  1539. }, $data.isEditingWork ? {
  1540. bV: common_vendor.o((...args) => $options.cancelEditWork && $options.cancelEditWork(...args))
  1541. } : {}, {
  1542. bW: common_vendor.t($data.workForm.startTime || "开始时间"),
  1543. bX: $data.workForm.startTime,
  1544. bY: common_vendor.o((...args) => $options.bindWorkStartTimeChange && $options.bindWorkStartTimeChange(...args)),
  1545. bZ: $data.workErrors.startTime ? 1 : "",
  1546. ca: common_vendor.t($data.workForm.endTime || "结束时间"),
  1547. cb: $data.workForm.endTime,
  1548. cc: common_vendor.o((...args) => $options.bindWorkEndTimeChange && $options.bindWorkEndTimeChange(...args)),
  1549. cd: $data.workErrors.endTime ? 1 : "",
  1550. ce: $data.workErrors.startTime
  1551. }, $data.workErrors.startTime ? {
  1552. cf: common_vendor.t($data.workErrors.startTime)
  1553. } : {}, {
  1554. cg: $data.workErrors.endTime
  1555. }, $data.workErrors.endTime ? {
  1556. ch: common_vendor.t($data.workErrors.endTime)
  1557. } : {}, {
  1558. ci: $data.workErrors.companyName ? 1 : "",
  1559. cj: $data.workForm.companyName,
  1560. ck: common_vendor.o(($event) => $data.workForm.companyName = $event.detail.value),
  1561. cl: $data.workErrors.companyName
  1562. }, $data.workErrors.companyName ? {
  1563. cm: common_vendor.t($data.workErrors.companyName)
  1564. } : {}, {
  1565. cn: $data.workErrors.employeeCount ? 1 : "",
  1566. co: $data.workForm.employeeCount,
  1567. cp: common_vendor.o(($event) => $data.workForm.employeeCount = $event.detail.value),
  1568. cq: $data.workErrors.employeeCount
  1569. }, $data.workErrors.employeeCount ? {
  1570. cr: common_vendor.t($data.workErrors.employeeCount)
  1571. } : {}, {
  1572. cs: $data.workErrors.department ? 1 : "",
  1573. ct: $data.workForm.department,
  1574. cv: common_vendor.o(($event) => $data.workForm.department = $event.detail.value),
  1575. cw: $data.workErrors.department
  1576. }, $data.workErrors.department ? {
  1577. cx: common_vendor.t($data.workErrors.department)
  1578. } : {}, {
  1579. cy: $data.workErrors.position ? 1 : "",
  1580. cz: $data.workForm.position,
  1581. cA: common_vendor.o(($event) => $data.workForm.position = $event.detail.value),
  1582. cB: $data.workErrors.position
  1583. }, $data.workErrors.position ? {
  1584. cC: common_vendor.t($data.workErrors.position)
  1585. } : {}, {
  1586. cD: $data.workForm.monthlySalary,
  1587. cE: common_vendor.o(($event) => $data.workForm.monthlySalary = $event.detail.value),
  1588. cF: $data.workErrors.monthlySalary
  1589. }, $data.workErrors.monthlySalary ? {
  1590. cG: common_vendor.t($data.workErrors.monthlySalary)
  1591. } : {}, {
  1592. cH: $data.workForm.supervisor,
  1593. cI: common_vendor.o(($event) => $data.workForm.supervisor = $event.detail.value),
  1594. cJ: $data.workErrors.supervisor
  1595. }, $data.workErrors.supervisor ? {
  1596. cK: common_vendor.t($data.workErrors.supervisor)
  1597. } : {}, {
  1598. cL: $data.workForm.supervisorPhone,
  1599. cM: common_vendor.o(($event) => $data.workForm.supervisorPhone = $event.detail.value),
  1600. cN: $data.workErrors.supervisorPhone
  1601. }, $data.workErrors.supervisorPhone ? {
  1602. cO: common_vendor.t($data.workErrors.supervisorPhone)
  1603. } : {}, {
  1604. cP: common_vendor.t($data.isEditingWork ? "✓" : "+"),
  1605. cQ: common_vendor.o((...args) => $options.saveWork && $options.saveWork(...args)),
  1606. cR: common_vendor.t($data.isEditingWork ? "保存修改" : "添加工作经历")
  1607. }) : {}) : {}, {
  1608. cS: $options.showPrevButton
  1609. }, $options.showPrevButton ? {
  1610. cT: common_vendor.o((...args) => $options.prevStep && $options.prevStep(...args))
  1611. } : {}, {
  1612. cU: $options.showNextButton
  1613. }, $options.showNextButton ? {
  1614. cV: common_vendor.o((...args) => $options.nextStep && $options.nextStep(...args))
  1615. } : {}, {
  1616. cW: $options.showSubmitButton
  1617. }, $options.showSubmitButton ? {
  1618. cX: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args))
  1619. } : {});
  1620. }
  1621. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  1622. wx.createPage(MiniProgramPage);