Personal.js 54 KB

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