Personal.js 53 KB

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