Personal.js 53 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579
  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. 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_number: 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. "workForm.companyName": function(newVal) {
  1189. if (newVal && this.workErrors.companyName) {
  1190. this.workErrors.companyName = "";
  1191. }
  1192. },
  1193. "workForm.department": function(newVal) {
  1194. if (newVal && this.workErrors.department) {
  1195. this.workErrors.department = "";
  1196. }
  1197. },
  1198. "workForm.position": function(newVal) {
  1199. if (newVal && this.workErrors.position) {
  1200. this.workErrors.position = "";
  1201. }
  1202. },
  1203. "workForm.employeeCount": function(newVal) {
  1204. if (newVal && this.workErrors.employeeCount) {
  1205. this.workErrors.employeeCount = "";
  1206. }
  1207. },
  1208. "workForm.monthlySalary": function(newVal) {
  1209. if (newVal && this.workErrors.monthlySalary) {
  1210. this.workErrors.monthlySalary = "";
  1211. }
  1212. },
  1213. "workForm.supervisor": function(newVal) {
  1214. if (newVal && this.workErrors.supervisor) {
  1215. this.workErrors.supervisor = "";
  1216. }
  1217. },
  1218. "workForm.supervisorPhone": function(newVal) {
  1219. if (newVal && this.workErrors.supervisorPhone) {
  1220. this.workErrors.supervisorPhone = "";
  1221. }
  1222. },
  1223. "formData.training": function(newVal) {
  1224. if (newVal && this.formErrors.training) {
  1225. this.formErrors.training = "";
  1226. }
  1227. },
  1228. "educationForm.startTime": function(newVal) {
  1229. if (newVal)
  1230. this.educationErrors.startTime = "";
  1231. },
  1232. "educationForm.endTime": function(newVal) {
  1233. if (newVal)
  1234. this.educationErrors.endTime = "";
  1235. },
  1236. "educationForm.schoolName": function(newVal) {
  1237. if (newVal)
  1238. this.educationErrors.schoolName = "";
  1239. },
  1240. "educationForm.major": function(newVal) {
  1241. if (newVal)
  1242. this.educationErrors.major = "";
  1243. },
  1244. "educationForm.degree": function(newVal) {
  1245. if (newVal)
  1246. this.educationErrors.degree = "";
  1247. },
  1248. // 添加对表单字段的实时验证
  1249. "formData": {
  1250. handler(newVal) {
  1251. const currentStepFields = {
  1252. 1: ["name", "gender", "phone", "idCard", "ethnic", "currentAddress", "height", "weight", "expectedSalary"],
  1253. 6: ["skills", "training"]
  1254. }[this.currentStep];
  1255. if (currentStepFields) {
  1256. currentStepFields.forEach((field) => {
  1257. if (newVal[field] !== void 0) {
  1258. this.validateField(field, newVal[field]);
  1259. }
  1260. });
  1261. }
  1262. },
  1263. deep: true
  1264. }
  1265. }
  1266. };
  1267. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  1268. return common_vendor.e({
  1269. a: $data.isLoading
  1270. }, $data.isLoading ? {} : {}, {
  1271. b: $data.showPromiseModal
  1272. }, $data.showPromiseModal ? {
  1273. c: $data.promiseChecked,
  1274. d: common_vendor.o((...args) => $options.togglePromiseChecked && $options.togglePromiseChecked(...args)),
  1275. e: !$data.promiseChecked,
  1276. f: common_vendor.o((...args) => $options.confirmPromise && $options.confirmPromise(...args))
  1277. } : {}, {
  1278. g: $data.currentStep === 1
  1279. }, $data.currentStep === 1 ? common_vendor.e({
  1280. h: $data.formErrors.name ? 1 : "",
  1281. i: $data.formData.name,
  1282. j: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
  1283. k: $data.formErrors.name
  1284. }, $data.formErrors.name ? {
  1285. l: common_vendor.t($data.formErrors.name)
  1286. } : {}, {
  1287. m: common_vendor.t($data.genderOptions[$data.genderIndex] || "请选择性别"),
  1288. n: common_vendor.o((...args) => $options.bindGenderChange && $options.bindGenderChange(...args)),
  1289. o: $data.genderIndex,
  1290. p: $data.genderOptions,
  1291. q: $data.formData.gender === "女"
  1292. }, $data.formData.gender === "女" ? {
  1293. r: common_vendor.t($data.threePeriodOptions[$data.threePeriodIndex] || "请选择"),
  1294. s: common_vendor.o((...args) => $options.bindThreePeriodChange && $options.bindThreePeriodChange(...args)),
  1295. t: $data.threePeriodIndex,
  1296. v: $data.threePeriodOptions
  1297. } : {}, {
  1298. w: $data.formErrors.phone ? 1 : "",
  1299. x: $data.formData.phone,
  1300. y: common_vendor.o(($event) => $data.formData.phone = $event.detail.value),
  1301. z: $data.formErrors.phone
  1302. }, $data.formErrors.phone ? {
  1303. A: common_vendor.t($data.formErrors.phone)
  1304. } : {}, {
  1305. B: $data.formErrors.idCard ? 1 : "",
  1306. C: $data.formData.idCard,
  1307. D: common_vendor.o(($event) => $data.formData.idCard = $event.detail.value),
  1308. E: $data.formErrors.idCard
  1309. }, $data.formErrors.idCard ? {
  1310. F: common_vendor.t($data.formErrors.idCard)
  1311. } : {}, {
  1312. G: common_vendor.t($data.ethnicOptions[$data.ethnicIndex] || "请选择民族"),
  1313. H: common_vendor.o((...args) => $options.bindEthnicChange && $options.bindEthnicChange(...args)),
  1314. I: $data.ethnicIndex,
  1315. J: $data.ethnicOptions,
  1316. K: $data.formData.height,
  1317. L: common_vendor.o(($event) => $data.formData.height = $event.detail.value),
  1318. M: $data.formData.weight,
  1319. N: common_vendor.o(($event) => $data.formData.weight = $event.detail.value),
  1320. O: $data.formData.currentAddress,
  1321. P: common_vendor.o(($event) => $data.formData.currentAddress = $event.detail.value),
  1322. Q: $data.formData.residence,
  1323. R: common_vendor.o(($event) => $data.formData.residence = $event.detail.value),
  1324. S: common_vendor.t($data.marriageOptions[$data.marriageIndex] || "请选择婚育状况"),
  1325. T: common_vendor.o((...args) => $options.bindMarriageChange && $options.bindMarriageChange(...args)),
  1326. U: $data.marriageIndex,
  1327. V: $data.marriageOptions,
  1328. W: $data.formData.expectedSalary,
  1329. X: common_vendor.o(($event) => $data.formData.expectedSalary = $event.detail.value)
  1330. }) : {}, {
  1331. Y: $data.currentStep === 3
  1332. }, $data.currentStep === 3 ? common_vendor.e({
  1333. Z: $data.familyMembers.length > 0
  1334. }, $data.familyMembers.length > 0 ? {
  1335. aa: common_vendor.f($data.familyMembers, (member, index, i0) => {
  1336. return {
  1337. a: common_vendor.t(index + 1),
  1338. b: common_vendor.o(($event) => $options.editFamilyMember(index), index),
  1339. c: common_vendor.o(($event) => $options.deleteFamilyMember(index), index),
  1340. d: common_vendor.t(member.relation),
  1341. e: common_vendor.t(member.name),
  1342. f: common_vendor.t(member.workplaceOrAddress),
  1343. g: common_vendor.t(member.position),
  1344. h: common_vendor.t(member.phone),
  1345. i: common_vendor.t(member.isEmergencyContact ? "是" : "否"),
  1346. j: index
  1347. };
  1348. })
  1349. } : {}, {
  1350. ab: common_vendor.t($data.isEditing ? "编辑家庭成员" : "添加家庭成员"),
  1351. ac: $data.isEditing
  1352. }, $data.isEditing ? {
  1353. ad: common_vendor.o((...args) => $options.cancelEdit && $options.cancelEdit(...args))
  1354. } : {}, {
  1355. ae: $data.familyMemberErrors.relation ? 1 : "",
  1356. af: $data.familyMemberForm.relation,
  1357. ag: common_vendor.o(($event) => $data.familyMemberForm.relation = $event.detail.value),
  1358. ah: $data.familyMemberErrors.relation
  1359. }, $data.familyMemberErrors.relation ? {
  1360. ai: common_vendor.t($data.familyMemberErrors.relation)
  1361. } : {}, {
  1362. aj: $data.familyMemberErrors.name ? 1 : "",
  1363. ak: $data.familyMemberForm.name,
  1364. al: common_vendor.o(($event) => $data.familyMemberForm.name = $event.detail.value),
  1365. am: $data.familyMemberErrors.name
  1366. }, $data.familyMemberErrors.name ? {
  1367. an: common_vendor.t($data.familyMemberErrors.name)
  1368. } : {}, {
  1369. ao: $data.familyMemberForm.workplaceOrAddress,
  1370. ap: common_vendor.o(($event) => $data.familyMemberForm.workplaceOrAddress = $event.detail.value),
  1371. aq: $data.familyMemberForm.position,
  1372. ar: common_vendor.o(($event) => $data.familyMemberForm.position = $event.detail.value),
  1373. as: $data.familyMemberErrors.phone ? 1 : "",
  1374. at: $data.familyMemberForm.phone,
  1375. av: common_vendor.o(($event) => $data.familyMemberForm.phone = $event.detail.value),
  1376. aw: $data.familyMemberErrors.phone
  1377. }, $data.familyMemberErrors.phone ? {
  1378. ax: common_vendor.t($data.familyMemberErrors.phone)
  1379. } : {}, {
  1380. ay: $data.familyMemberForm.isEmergencyContact,
  1381. az: common_vendor.o((...args) => $options.handleEmergencyContactChange && $options.handleEmergencyContactChange(...args)),
  1382. aA: common_vendor.t($data.isEditing ? "✓" : "+"),
  1383. aB: common_vendor.o((...args) => $options.saveFamilyMember && $options.saveFamilyMember(...args)),
  1384. aC: common_vendor.t($data.isEditing ? "保存修改" : "添加成员")
  1385. }) : {}, {
  1386. aD: $data.currentStep === 5
  1387. }, $data.currentStep === 5 ? common_vendor.e({
  1388. aE: $data.educationList.length > 0
  1389. }, $data.educationList.length > 0 ? {
  1390. aF: common_vendor.f($data.educationList, (edu, index, i0) => {
  1391. return {
  1392. a: common_vendor.t(index === 0 ? "第一学历" : "最高学历"),
  1393. b: common_vendor.o(($event) => $options.editEducation(index), index),
  1394. c: common_vendor.o(($event) => $options.deleteEducation(index), index),
  1395. d: common_vendor.t(edu.startTime),
  1396. e: common_vendor.t(edu.endTime),
  1397. f: common_vendor.t(edu.schoolName),
  1398. g: common_vendor.t(edu.major),
  1399. h: common_vendor.t(edu.degree),
  1400. i: index
  1401. };
  1402. })
  1403. } : {}, {
  1404. aG: $data.educationList.length < 2 || $data.isEditingEducation
  1405. }, $data.educationList.length < 2 || $data.isEditingEducation ? common_vendor.e({
  1406. aH: common_vendor.t($data.isEditingEducation ? "编辑教育经历" : $data.educationList.length === 0 ? "添加第一学历" : "添加最高学历"),
  1407. aI: $data.isEditingEducation
  1408. }, $data.isEditingEducation ? {
  1409. aJ: common_vendor.o((...args) => $options.cancelEditEducation && $options.cancelEditEducation(...args))
  1410. } : {}, {
  1411. aK: common_vendor.t($data.educationForm.startTime || "开始时间"),
  1412. aL: $data.educationForm.startTime,
  1413. aM: common_vendor.o((...args) => $options.bindStartTimeChange && $options.bindStartTimeChange(...args)),
  1414. aN: $data.educationErrors.startTime ? 1 : "",
  1415. aO: common_vendor.t($data.educationForm.endTime || "结束时间"),
  1416. aP: $data.educationForm.endTime,
  1417. aQ: common_vendor.o((...args) => $options.bindEndTimeChange && $options.bindEndTimeChange(...args)),
  1418. aR: $data.educationErrors.endTime ? 1 : "",
  1419. aS: $data.educationErrors.startTime
  1420. }, $data.educationErrors.startTime ? {
  1421. aT: common_vendor.t($data.educationErrors.startTime)
  1422. } : {}, {
  1423. aU: $data.educationErrors.endTime
  1424. }, $data.educationErrors.endTime ? {
  1425. aV: common_vendor.t($data.educationErrors.endTime)
  1426. } : {}, {
  1427. aW: $data.educationErrors.schoolName ? 1 : "",
  1428. aX: $data.educationForm.schoolName,
  1429. aY: common_vendor.o(($event) => $data.educationForm.schoolName = $event.detail.value),
  1430. aZ: $data.educationErrors.schoolName
  1431. }, $data.educationErrors.schoolName ? {
  1432. ba: common_vendor.t($data.educationErrors.schoolName)
  1433. } : {}, {
  1434. bb: $data.educationErrors.major ? 1 : "",
  1435. bc: $data.educationForm.major,
  1436. bd: common_vendor.o(($event) => $data.educationForm.major = $event.detail.value),
  1437. be: $data.educationErrors.major
  1438. }, $data.educationErrors.major ? {
  1439. bf: common_vendor.t($data.educationErrors.major)
  1440. } : {}, {
  1441. bg: common_vendor.t($data.degreeOptions[$data.degreeIndex] || "请选择学历"),
  1442. bh: common_vendor.o((...args) => $options.bindDegreeChange && $options.bindDegreeChange(...args)),
  1443. bi: $data.degreeIndex,
  1444. bj: $data.degreeOptions,
  1445. bk: $data.educationErrors.degree ? 1 : "",
  1446. bl: $data.educationErrors.degree
  1447. }, $data.educationErrors.degree ? {
  1448. bm: common_vendor.t($data.educationErrors.degree)
  1449. } : {}, {
  1450. bn: common_vendor.t($data.isEditingEducation ? "✓" : "+"),
  1451. bo: common_vendor.o((...args) => $options.saveEducation && $options.saveEducation(...args)),
  1452. bp: common_vendor.t($data.isEditingEducation ? "保存修改" : "添加学历")
  1453. }) : {}) : {}, {
  1454. bq: $data.currentStep === 6
  1455. }, $data.currentStep === 6 ? common_vendor.e({
  1456. br: $data.formErrors.skills ? 1 : "",
  1457. bs: $data.formData.skills,
  1458. bt: common_vendor.o(($event) => $data.formData.skills = $event.detail.value),
  1459. bv: $data.formErrors.skills
  1460. }, $data.formErrors.skills ? {
  1461. bw: common_vendor.t($data.formErrors.skills)
  1462. } : {}, {
  1463. bx: $data.formErrors.training ? 1 : "",
  1464. by: $data.formData.training,
  1465. bz: common_vendor.o(($event) => $data.formData.training = $event.detail.value),
  1466. bA: $data.formErrors.training
  1467. }, $data.formErrors.training ? {
  1468. bB: common_vendor.t($data.formErrors.training)
  1469. } : {}) : {}, {
  1470. bC: $data.currentStep === 8
  1471. }, $data.currentStep === 8 ? common_vendor.e({
  1472. bD: $data.workList.length > 0
  1473. }, $data.workList.length > 0 ? {
  1474. bE: common_vendor.f($data.workList, (work, index, i0) => {
  1475. return {
  1476. a: common_vendor.t(index + 1),
  1477. b: common_vendor.o(($event) => $options.editWork(index), index),
  1478. c: common_vendor.o(($event) => $options.deleteWork(index), index),
  1479. d: common_vendor.t(work.startTime),
  1480. e: common_vendor.t(work.endTime),
  1481. f: common_vendor.t(work.companyName),
  1482. g: common_vendor.t(work.department),
  1483. h: common_vendor.t(work.employeeCount),
  1484. i: common_vendor.t(work.position),
  1485. j: common_vendor.t(work.monthlySalary),
  1486. k: common_vendor.t(work.supervisor),
  1487. l: common_vendor.t(work.supervisorPhone),
  1488. m: index
  1489. };
  1490. })
  1491. } : {}, {
  1492. bF: $data.workList.length < 2 || $data.isEditingWork
  1493. }, $data.workList.length < 2 || $data.isEditingWork ? common_vendor.e({
  1494. bG: common_vendor.t($data.isEditingWork ? "编辑工作经历" : "添加工作经历"),
  1495. bH: $data.isEditingWork
  1496. }, $data.isEditingWork ? {
  1497. bI: common_vendor.o((...args) => $options.cancelEditWork && $options.cancelEditWork(...args))
  1498. } : {}, {
  1499. bJ: common_vendor.t($data.workForm.startTime || "开始时间"),
  1500. bK: $data.workForm.startTime,
  1501. bL: common_vendor.o((...args) => $options.bindWorkStartTimeChange && $options.bindWorkStartTimeChange(...args)),
  1502. bM: $data.workErrors.startTime ? 1 : "",
  1503. bN: common_vendor.t($data.workForm.endTime || "结束时间"),
  1504. bO: $data.workForm.endTime,
  1505. bP: common_vendor.o((...args) => $options.bindWorkEndTimeChange && $options.bindWorkEndTimeChange(...args)),
  1506. bQ: $data.workErrors.endTime ? 1 : "",
  1507. bR: $data.workErrors.startTime
  1508. }, $data.workErrors.startTime ? {
  1509. bS: common_vendor.t($data.workErrors.startTime)
  1510. } : {}, {
  1511. bT: $data.workErrors.endTime
  1512. }, $data.workErrors.endTime ? {
  1513. bU: common_vendor.t($data.workErrors.endTime)
  1514. } : {}, {
  1515. bV: $data.workErrors.companyName ? 1 : "",
  1516. bW: $data.workForm.companyName,
  1517. bX: common_vendor.o(($event) => $data.workForm.companyName = $event.detail.value),
  1518. bY: $data.workErrors.companyName
  1519. }, $data.workErrors.companyName ? {
  1520. bZ: common_vendor.t($data.workErrors.companyName)
  1521. } : {}, {
  1522. ca: $data.workErrors.employeeCount ? 1 : "",
  1523. cb: $data.workForm.employeeCount,
  1524. cc: common_vendor.o(($event) => $data.workForm.employeeCount = $event.detail.value),
  1525. cd: $data.workErrors.employeeCount
  1526. }, $data.workErrors.employeeCount ? {
  1527. ce: common_vendor.t($data.workErrors.employeeCount)
  1528. } : {}, {
  1529. cf: $data.workErrors.department ? 1 : "",
  1530. cg: $data.workForm.department,
  1531. ch: common_vendor.o(($event) => $data.workForm.department = $event.detail.value),
  1532. ci: $data.workErrors.department
  1533. }, $data.workErrors.department ? {
  1534. cj: common_vendor.t($data.workErrors.department)
  1535. } : {}, {
  1536. ck: $data.workErrors.position ? 1 : "",
  1537. cl: $data.workForm.position,
  1538. cm: common_vendor.o(($event) => $data.workForm.position = $event.detail.value),
  1539. cn: $data.workErrors.position
  1540. }, $data.workErrors.position ? {
  1541. co: common_vendor.t($data.workErrors.position)
  1542. } : {}, {
  1543. cp: $data.workForm.monthlySalary,
  1544. cq: common_vendor.o(($event) => $data.workForm.monthlySalary = $event.detail.value),
  1545. cr: $data.workErrors.monthlySalary
  1546. }, $data.workErrors.monthlySalary ? {
  1547. cs: common_vendor.t($data.workErrors.monthlySalary)
  1548. } : {}, {
  1549. ct: $data.workForm.supervisor,
  1550. cv: common_vendor.o(($event) => $data.workForm.supervisor = $event.detail.value),
  1551. cw: $data.workErrors.supervisor
  1552. }, $data.workErrors.supervisor ? {
  1553. cx: common_vendor.t($data.workErrors.supervisor)
  1554. } : {}, {
  1555. cy: $data.workForm.supervisorPhone,
  1556. cz: common_vendor.o(($event) => $data.workForm.supervisorPhone = $event.detail.value),
  1557. cA: $data.workErrors.supervisorPhone
  1558. }, $data.workErrors.supervisorPhone ? {
  1559. cB: common_vendor.t($data.workErrors.supervisorPhone)
  1560. } : {}, {
  1561. cC: common_vendor.t($data.isEditingWork ? "✓" : "+"),
  1562. cD: common_vendor.o((...args) => $options.saveWork && $options.saveWork(...args)),
  1563. cE: common_vendor.t($data.isEditingWork ? "保存修改" : "添加工作经历")
  1564. }) : {}) : {}, {
  1565. cF: $options.showPrevButton
  1566. }, $options.showPrevButton ? {
  1567. cG: common_vendor.o((...args) => $options.prevStep && $options.prevStep(...args))
  1568. } : {}, {
  1569. cH: $options.showNextButton
  1570. }, $options.showNextButton ? {
  1571. cI: common_vendor.o((...args) => $options.nextStep && $options.nextStep(...args))
  1572. } : {}, {
  1573. cJ: $options.showSubmitButton
  1574. }, $options.showSubmitButton ? {
  1575. cK: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args))
  1576. } : {});
  1577. }
  1578. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  1579. wx.createPage(MiniProgramPage);