Personal.js 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024
  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. maxLength: 11
  157. },
  158. idCard: {
  159. required: true,
  160. pattern: /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,
  161. message: "请输入正确的身份证号码"
  162. },
  163. gender: {
  164. required: true,
  165. message: "请选择性别"
  166. },
  167. ethnic: {
  168. required: true,
  169. message: "请选择民族"
  170. },
  171. currentAddress: {
  172. required: true,
  173. message: "请输入现居住地址"
  174. },
  175. height: {
  176. pattern: /^\d+(\.\d{1,2})?$/,
  177. message: "请输入正确的身高(cm)"
  178. },
  179. weight: {
  180. pattern: /^\d+(\.\d{1,2})?$/,
  181. message: "请输入正确的体重(kg)"
  182. },
  183. expectedSalary: {
  184. pattern: /^\d+(\.\d{1,2})?$/,
  185. message: "请输入正确的期望薪资"
  186. }
  187. },
  188. // 获取配置信息
  189. configData: (() => {
  190. try {
  191. const configStr = common_vendor.index.getStorageSync("configData");
  192. if (configStr && configStr.trim()) {
  193. return JSON.parse(configStr);
  194. }
  195. return {};
  196. } catch (error) {
  197. console.warn("解析配置数据失败:", error);
  198. return {};
  199. }
  200. })()
  201. };
  202. },
  203. onLoad() {
  204. this.fetchUserData();
  205. console.log(this.configData);
  206. },
  207. computed: {
  208. // 添加计算属性来控制按钮显示
  209. showPrevButton() {
  210. return this.currentStep !== 1;
  211. },
  212. showNextButton() {
  213. return this.currentStep !== 8;
  214. },
  215. showSubmitButton() {
  216. return this.currentStep === 8;
  217. },
  218. // 获取当前步骤在数组中的索引
  219. currentStepIndex() {
  220. return this.steps.findIndex((step) => step.id === this.currentStep);
  221. },
  222. // 添加安全的配置访问器
  223. safeConfigData() {
  224. return this.configData || {};
  225. },
  226. safeProfileFieldsConfig() {
  227. return this.safeConfigData.profile_fields_config || {};
  228. },
  229. safeFamilyFieldsConfig() {
  230. return this.safeConfigData.family_fields_config || {};
  231. },
  232. safeEducationFieldsConfig() {
  233. return this.safeConfigData.education_fields_config || {};
  234. },
  235. safeWorkFieldsConfig() {
  236. return this.safeConfigData.work_experience_fields_config || {};
  237. },
  238. // 字段显示控制方法
  239. showNameField() {
  240. var _a;
  241. return Object.keys(this.safeProfileFieldsConfig).length === 0 || ((_a = this.safeProfileFieldsConfig.name) == null ? void 0 : _a.visible) !== false;
  242. },
  243. showGenderField() {
  244. var _a;
  245. return Object.keys(this.safeProfileFieldsConfig).length === 0 || ((_a = this.safeProfileFieldsConfig.gender) == null ? void 0 : _a.visible) !== false;
  246. },
  247. showPhoneField() {
  248. var _a;
  249. return Object.keys(this.safeProfileFieldsConfig).length === 0 || ((_a = this.safeProfileFieldsConfig.phone) == null ? void 0 : _a.visible) !== false;
  250. },
  251. showIdCardField() {
  252. var _a;
  253. return Object.keys(this.safeProfileFieldsConfig).length === 0 || ((_a = this.safeProfileFieldsConfig.id_card) == null ? void 0 : _a.visible) !== false;
  254. },
  255. showEthnicField() {
  256. var _a;
  257. return Object.keys(this.safeProfileFieldsConfig).length === 0 || ((_a = this.safeProfileFieldsConfig.ethnic) == null ? void 0 : _a.visible) !== false;
  258. },
  259. showHeightField() {
  260. var _a;
  261. return Object.keys(this.safeProfileFieldsConfig).length === 0 || ((_a = this.safeProfileFieldsConfig.height) == null ? void 0 : _a.visible) !== false;
  262. },
  263. showWeightField() {
  264. var _a;
  265. return Object.keys(this.safeProfileFieldsConfig).length === 0 || ((_a = this.safeProfileFieldsConfig.weight) == null ? void 0 : _a.visible) !== false;
  266. },
  267. // 家庭成员字段显示控制
  268. showFamilyRelationField() {
  269. var _a;
  270. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || ((_a = this.safeFamilyFieldsConfig.relation) == null ? void 0 : _a.visible) !== false;
  271. },
  272. showFamilyNameField() {
  273. var _a;
  274. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || ((_a = this.safeFamilyFieldsConfig.name) == null ? void 0 : _a.visible) !== false;
  275. },
  276. showFamilyWorkplaceField() {
  277. var _a;
  278. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || ((_a = this.safeFamilyFieldsConfig.workplace_or_address) == null ? void 0 : _a.visible) !== false;
  279. },
  280. showFamilyPositionField() {
  281. var _a;
  282. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || ((_a = this.safeFamilyFieldsConfig.position) == null ? void 0 : _a.visible) !== false;
  283. },
  284. showFamilyPhoneField() {
  285. var _a;
  286. return Object.keys(this.safeFamilyFieldsConfig).length === 0 || ((_a = this.safeFamilyFieldsConfig.phone) == null ? void 0 : _a.visible) !== false;
  287. },
  288. // 教育经历字段显示控制
  289. showEducationTimeField() {
  290. var _a;
  291. return Object.keys(this.safeEducationFieldsConfig).length === 0 || ((_a = this.safeEducationFieldsConfig.start_time) == null ? void 0 : _a.visible) !== false;
  292. },
  293. showEducationSchoolField() {
  294. var _a;
  295. return Object.keys(this.safeEducationFieldsConfig).length === 0 || ((_a = this.safeEducationFieldsConfig.school_name) == null ? void 0 : _a.visible) !== false;
  296. },
  297. showEducationMajorField() {
  298. var _a;
  299. return Object.keys(this.safeEducationFieldsConfig).length === 0 || ((_a = this.safeEducationFieldsConfig.major) == null ? void 0 : _a.visible) !== false;
  300. },
  301. showEducationDegreeField() {
  302. var _a;
  303. return Object.keys(this.safeEducationFieldsConfig).length === 0 || ((_a = this.safeEducationFieldsConfig.degree) == null ? void 0 : _a.visible) !== false;
  304. },
  305. // 工作经历字段显示控制
  306. showWorkTimeField() {
  307. var _a;
  308. return Object.keys(this.safeWorkFieldsConfig).length === 0 || ((_a = this.safeWorkFieldsConfig.start_time) == null ? void 0 : _a.visible) !== false;
  309. },
  310. showWorkCompanyField() {
  311. var _a;
  312. return Object.keys(this.safeWorkFieldsConfig).length === 0 || ((_a = this.safeWorkFieldsConfig.company_name) == null ? void 0 : _a.visible) !== false;
  313. },
  314. showWorkDepartmentField() {
  315. var _a;
  316. return Object.keys(this.safeWorkFieldsConfig).length === 0 || ((_a = this.safeWorkFieldsConfig.department) == null ? void 0 : _a.visible) !== false;
  317. },
  318. showWorkEmployeeCountField() {
  319. var _a;
  320. return Object.keys(this.safeWorkFieldsConfig).length === 0 || ((_a = this.safeWorkFieldsConfig.employee_count) == null ? void 0 : _a.visible) !== false;
  321. },
  322. showWorkPositionField() {
  323. var _a;
  324. return Object.keys(this.safeWorkFieldsConfig).length === 0 || ((_a = this.safeWorkFieldsConfig.position) == null ? void 0 : _a.visible) !== false;
  325. },
  326. showRequireProfessionalSkillsField() {
  327. console.log(this.safeConfigData.require_professional_skills);
  328. const value = this.safeConfigData.require_professional_skills;
  329. return value === void 0 || value === null ? true : value;
  330. },
  331. showRequireTrainingInfoField() {
  332. console.log(this.safeConfigData.require_training_info);
  333. const value = this.safeConfigData.require_training_info;
  334. return value === void 0 || value === null ? true : value;
  335. },
  336. shouldShowSkillsStep() {
  337. return this.showRequireTrainingInfoField || this.showRequireProfessionalSkillsField;
  338. }
  339. },
  340. methods: {
  341. // 添加承诺书相关方法
  342. togglePromiseChecked() {
  343. this.promiseChecked = !this.promiseChecked;
  344. },
  345. confirmPromise() {
  346. if (this.promiseChecked) {
  347. this.showPromiseModal = false;
  348. } else {
  349. common_vendor.index.showToast({
  350. title: "请先阅读并同意承诺书内容",
  351. icon: "none"
  352. });
  353. }
  354. },
  355. // 添加字段是否需要验证的判断方法
  356. shouldValidateField(fieldName, section) {
  357. section = section || "profile";
  358. switch (section) {
  359. case "profile":
  360. const fieldShowMap = {
  361. "name": this.showNameField,
  362. "gender": this.showGenderField,
  363. "phone": this.showPhoneField,
  364. "idCard": this.showIdCardField,
  365. "ethnic": this.showEthnicField,
  366. "height": this.showHeightField,
  367. "weight": this.showWeightField,
  368. "currentAddress": true,
  369. // 现居住地址总是显示和必填
  370. "expectedSalary": true,
  371. // 期望薪资总是显示
  372. "skills": this.showRequireTrainingInfoField,
  373. // 专业技能根据配置显示和必填
  374. "training": this.showRequireProfessionalSkillsField,
  375. // 培训经历根据配置显示和必填
  376. "threePeriod": this.formData.gender === "女"
  377. // 只有女性时才需要验证三期状态
  378. };
  379. return fieldShowMap[fieldName] !== false;
  380. case "family":
  381. const familyFieldShowMap = {
  382. "relation": this.showFamilyRelationField,
  383. "name": this.showFamilyNameField,
  384. "phone": this.showFamilyPhoneField,
  385. "workplaceOrAddress": this.showFamilyWorkplaceField,
  386. "position": this.showFamilyPositionField
  387. };
  388. return familyFieldShowMap[fieldName] !== false;
  389. case "education":
  390. const educationFieldShowMap = {
  391. "startTime": this.showEducationTimeField,
  392. "endTime": this.showEducationTimeField,
  393. "schoolName": this.showEducationSchoolField,
  394. "major": this.showEducationMajorField,
  395. "degree": this.showEducationDegreeField
  396. };
  397. return educationFieldShowMap[fieldName] !== false;
  398. case "work":
  399. const workFieldShowMap = {
  400. "startTime": this.showWorkTimeField,
  401. "endTime": this.showWorkTimeField,
  402. "companyName": this.showWorkCompanyField,
  403. "department": this.showWorkDepartmentField,
  404. "position": this.showWorkPositionField,
  405. "employeeCount": this.showWorkEmployeeCountField,
  406. "monthlySalary": true,
  407. // 月薪总是需要验证
  408. "supervisor": true,
  409. // 直接领导总是需要验证
  410. "supervisorPhone": true
  411. // 领导电话总是需要验证
  412. };
  413. return workFieldShowMap[fieldName] !== false;
  414. default:
  415. return true;
  416. }
  417. },
  418. bindGenderChange(e) {
  419. this.genderIndex = e.detail.value;
  420. this.formData.gender = this.genderOptions[this.genderIndex];
  421. if (this.formErrors.gender) {
  422. this.formErrors.gender = "";
  423. }
  424. if (this.formData.gender !== "女") {
  425. this.formData.threePeriod = "";
  426. this.threePeriodIndex = -1;
  427. this.formErrors.threePeriod = "";
  428. }
  429. },
  430. bindThreePeriodChange(e) {
  431. this.threePeriodIndex = e.detail.value;
  432. this.formData.threePeriod = this.threePeriodOptions[this.threePeriodIndex];
  433. if (this.formErrors.threePeriod) {
  434. this.formErrors.threePeriod = "";
  435. }
  436. },
  437. bindPoliticalChange(e) {
  438. this.politicalIndex = e.detail.value;
  439. this.formData.political = this.politicalOptions[this.politicalIndex];
  440. },
  441. bindEthnicChange(e) {
  442. this.ethnicIndex = e.detail.value;
  443. this.formData.ethnic = this.ethnicOptions[this.ethnicIndex];
  444. if (this.formErrors.ethnic) {
  445. this.formErrors.ethnic = "";
  446. }
  447. },
  448. bindMarriageChange(e) {
  449. this.marriageIndex = e.detail.value;
  450. this.formData.marriage = this.marriageOptions[this.marriageIndex];
  451. },
  452. bindDateChange(e) {
  453. this.formData.birthDate = e.detail.value;
  454. },
  455. saveFamilyMember() {
  456. this.resetFamilyMemberErrors();
  457. let isValid = true;
  458. if (this.shouldValidateField("relation", "family") && !this.familyMemberForm.relation) {
  459. this.familyMemberErrors.relation = "请输入称谓";
  460. isValid = false;
  461. }
  462. if (this.shouldValidateField("name", "family") && !this.familyMemberForm.name) {
  463. this.familyMemberErrors.name = "请输入姓名";
  464. isValid = false;
  465. }
  466. if (this.shouldValidateField("phone", "family") && !this.familyMemberForm.phone) {
  467. this.familyMemberErrors.phone = "请输入联系电话";
  468. isValid = false;
  469. } else if (this.shouldValidateField("phone", "family") && this.familyMemberForm.phone && !/^1[3-9]\d{9}$/.test(this.familyMemberForm.phone)) {
  470. this.familyMemberErrors.phone = "请输入正确的手机号";
  471. isValid = false;
  472. }
  473. if (!isValid) {
  474. common_vendor.index.showToast({
  475. title: "请完善家庭成员信息",
  476. icon: "none"
  477. });
  478. return;
  479. }
  480. if (this.isEditing) {
  481. this.familyMembers[this.editingIndex] = { ...this.familyMemberForm };
  482. common_vendor.index.showToast({
  483. title: "修改成功",
  484. icon: "success"
  485. });
  486. this.isEditing = false;
  487. this.editingIndex = -1;
  488. } else {
  489. this.familyMembers.push({ ...this.familyMemberForm });
  490. common_vendor.index.showToast({
  491. title: "添加成功",
  492. icon: "success"
  493. });
  494. }
  495. this.resetFamilyMemberForm();
  496. },
  497. // 添加重置错误信息的方法
  498. resetFamilyMemberErrors() {
  499. this.familyMemberErrors = {
  500. relation: "",
  501. name: "",
  502. phone: "",
  503. workplaceOrAddress: "",
  504. position: ""
  505. };
  506. },
  507. // 修改重置表单的方法
  508. resetFamilyMemberForm() {
  509. this.familyMemberForm = {
  510. relation: "",
  511. name: "",
  512. workplaceOrAddress: "",
  513. position: "",
  514. phone: "",
  515. isEmergencyContact: false
  516. };
  517. this.resetFamilyMemberErrors();
  518. },
  519. editFamilyMember(index) {
  520. this.isEditing = true;
  521. this.editingIndex = index;
  522. this.familyMemberForm = { ...this.familyMembers[index] };
  523. common_vendor.index.pageScrollTo({
  524. selector: ".family-member-form",
  525. duration: 300
  526. });
  527. },
  528. cancelEdit() {
  529. this.isEditing = false;
  530. this.editingIndex = -1;
  531. this.familyMemberForm = {
  532. relation: "",
  533. name: "",
  534. workplaceOrAddress: "",
  535. position: "",
  536. phone: "",
  537. isEmergencyContact: false
  538. };
  539. },
  540. deleteFamilyMember(index) {
  541. if (this.isEditing && this.editingIndex === index) {
  542. this.cancelEdit();
  543. }
  544. this.familyMembers.splice(index, 1);
  545. common_vendor.index.showToast({
  546. title: "已删除",
  547. icon: "none"
  548. });
  549. },
  550. // 选择应聘来源类型
  551. selectSourceType(type) {
  552. this.formData.sourceType = type;
  553. if (type === "social") {
  554. this.formData.socialSource = "BOSS";
  555. } else {
  556. this.formData.socialSource = "";
  557. }
  558. },
  559. // 选择社招来源
  560. selectSocialSource(source) {
  561. this.formData.sourceType = "social";
  562. this.formData.socialSource = source;
  563. },
  564. // 教育经历相关方法
  565. bindStartTimeChange(e) {
  566. const startTime = e.detail.value;
  567. if (this.educationForm.endTime && startTime > this.educationForm.endTime) {
  568. common_vendor.index.showToast({
  569. title: "开始时间不能大于结束时间",
  570. icon: "none"
  571. });
  572. return;
  573. }
  574. this.educationForm.startTime = startTime;
  575. this.educationErrors.startTime = false;
  576. },
  577. bindEndTimeChange(e) {
  578. const endTime = e.detail.value;
  579. if (this.educationForm.startTime && endTime < this.educationForm.startTime) {
  580. common_vendor.index.showToast({
  581. title: "结束时间不能小于开始时间",
  582. icon: "none"
  583. });
  584. return;
  585. }
  586. this.educationForm.endTime = endTime;
  587. this.educationErrors.endTime = false;
  588. },
  589. bindDegreeChange(e) {
  590. this.degreeIndex = e.detail.value;
  591. this.educationForm.degree = this.degreeOptions[this.degreeIndex];
  592. },
  593. saveEducation() {
  594. this.resetEducationErrors();
  595. let isValid = true;
  596. if (this.shouldValidateField("startTime", "education") && !this.educationForm.startTime) {
  597. this.educationErrors.startTime = "请选择开始时间";
  598. isValid = false;
  599. }
  600. if (this.shouldValidateField("endTime", "education") && !this.educationForm.endTime) {
  601. this.educationErrors.endTime = "请选择结束时间";
  602. isValid = false;
  603. }
  604. if (this.shouldValidateField("schoolName", "education") && !this.educationForm.schoolName) {
  605. this.educationErrors.schoolName = "请输入学校名称";
  606. isValid = false;
  607. }
  608. if (this.shouldValidateField("major", "education") && !this.educationForm.major) {
  609. this.educationErrors.major = "请输入专业";
  610. isValid = false;
  611. }
  612. if (this.shouldValidateField("degree", "education") && !this.educationForm.degree) {
  613. this.educationErrors.degree = "请选择学历";
  614. isValid = false;
  615. }
  616. if (!isValid) {
  617. common_vendor.index.showToast({
  618. title: "请完善教育经历信息",
  619. icon: "none"
  620. });
  621. return;
  622. }
  623. if (this.isEditingEducation) {
  624. this.educationList[this.editingEducationIndex] = { ...this.educationForm };
  625. common_vendor.index.showToast({
  626. title: "修改成功",
  627. icon: "success"
  628. });
  629. this.isEditingEducation = false;
  630. this.editingEducationIndex = -1;
  631. } else {
  632. this.educationList.push({ ...this.educationForm });
  633. common_vendor.index.showToast({
  634. title: "添加成功",
  635. icon: "success"
  636. });
  637. }
  638. this.educationForm = {
  639. startTime: "",
  640. endTime: "",
  641. schoolName: "",
  642. major: "",
  643. degree: ""
  644. };
  645. this.degreeIndex = -1;
  646. },
  647. editEducation(index) {
  648. this.isEditingEducation = true;
  649. this.editingEducationIndex = index;
  650. this.educationForm = { ...this.educationList[index] };
  651. this.degreeIndex = this.degreeOptions.findIndex((item) => item === this.educationForm.degree);
  652. common_vendor.index.pageScrollTo({
  653. selector: ".education-form",
  654. duration: 300
  655. });
  656. },
  657. cancelEditEducation() {
  658. this.isEditingEducation = false;
  659. this.editingEducationIndex = -1;
  660. this.educationForm = {
  661. startTime: "",
  662. endTime: "",
  663. schoolName: "",
  664. major: "",
  665. degree: ""
  666. };
  667. this.degreeIndex = -1;
  668. },
  669. deleteEducation(index) {
  670. if (this.isEditingEducation && this.editingEducationIndex === index) {
  671. this.cancelEditEducation();
  672. }
  673. this.educationList.splice(index, 1);
  674. common_vendor.index.showToast({
  675. title: "已删除",
  676. icon: "none"
  677. });
  678. },
  679. // 工作经历相关方法
  680. bindWorkStartTimeChange(e) {
  681. const startTime = e.detail.value;
  682. if (this.workForm.endTime && startTime > this.workForm.endTime) {
  683. common_vendor.index.showToast({
  684. title: "开始时间不能大于结束时间",
  685. icon: "none"
  686. });
  687. return;
  688. }
  689. this.workForm.startTime = startTime;
  690. this.workErrors.startTime = false;
  691. },
  692. bindWorkEndTimeChange(e) {
  693. const endTime = e.detail.value;
  694. if (this.workForm.startTime && endTime < this.workForm.startTime) {
  695. common_vendor.index.showToast({
  696. title: "结束时间不能小于开始时间",
  697. icon: "none"
  698. });
  699. return;
  700. }
  701. this.workForm.endTime = endTime;
  702. this.workErrors.endTime = false;
  703. },
  704. saveWork() {
  705. this.workErrors = {
  706. startTime: "",
  707. endTime: "",
  708. companyName: "",
  709. department: "",
  710. position: "",
  711. employeeCount: "",
  712. monthlySalary: "",
  713. supervisor: "",
  714. supervisorPhone: ""
  715. };
  716. let isValid = true;
  717. if (this.shouldValidateField("startTime", "work") && !this.workForm.startTime) {
  718. this.workErrors.startTime = "请选择开始时间";
  719. isValid = false;
  720. }
  721. if (this.shouldValidateField("endTime", "work") && !this.workForm.endTime) {
  722. this.workErrors.endTime = "请选择结束时间";
  723. isValid = false;
  724. }
  725. if (this.shouldValidateField("companyName", "work") && !this.workForm.companyName) {
  726. this.workErrors.companyName = "请输入单位名称";
  727. isValid = false;
  728. }
  729. if (this.shouldValidateField("department", "work") && !this.workForm.department) {
  730. this.workErrors.department = "请输入任职部门";
  731. isValid = false;
  732. }
  733. if (this.shouldValidateField("position", "work") && !this.workForm.position) {
  734. this.workErrors.position = "请输入担任职务";
  735. isValid = false;
  736. }
  737. if (this.shouldValidateField("employeeCount", "work") && !this.workForm.employeeCount) {
  738. this.workErrors.employeeCount = "请输入单位人数";
  739. isValid = false;
  740. }
  741. if (this.shouldValidateField("monthlySalary", "work") && !this.workForm.monthlySalary) {
  742. this.workErrors.monthlySalary = "请输入月薪";
  743. isValid = false;
  744. }
  745. if (this.shouldValidateField("supervisor", "work") && !this.workForm.supervisor) {
  746. this.workErrors.supervisor = "请输入直属上级";
  747. isValid = false;
  748. }
  749. if (!isValid) {
  750. common_vendor.index.showToast({
  751. title: "请完善工作经历信息",
  752. icon: "none"
  753. });
  754. return;
  755. }
  756. if (this.isEditingWork) {
  757. this.workList[this.editingWorkIndex] = { ...this.workForm };
  758. common_vendor.index.showToast({
  759. title: "修改成功",
  760. icon: "success"
  761. });
  762. this.isEditingWork = false;
  763. this.editingWorkIndex = -1;
  764. } else {
  765. this.workList.push({ ...this.workForm });
  766. common_vendor.index.showToast({
  767. title: "添加成功",
  768. icon: "success"
  769. });
  770. }
  771. this.workForm = {
  772. startTime: "",
  773. endTime: "",
  774. companyName: "",
  775. department: "",
  776. employeeCount: "",
  777. position: "",
  778. monthlySalary: "",
  779. supervisor: "",
  780. supervisorPhone: ""
  781. };
  782. },
  783. editWork(index) {
  784. this.isEditingWork = true;
  785. this.editingWorkIndex = index;
  786. this.workForm = { ...this.workList[index] };
  787. common_vendor.index.pageScrollTo({
  788. selector: ".work-form",
  789. duration: 300
  790. });
  791. },
  792. cancelEditWork() {
  793. this.isEditingWork = false;
  794. this.editingWorkIndex = -1;
  795. this.workForm = {
  796. startTime: "",
  797. endTime: "",
  798. companyName: "",
  799. department: "",
  800. employeeCount: "",
  801. position: "",
  802. monthlySalary: "",
  803. supervisor: "",
  804. supervisorPhone: ""
  805. };
  806. },
  807. deleteWork(index) {
  808. if (this.isEditingWork && this.editingWorkIndex === index) {
  809. this.cancelEditWork();
  810. }
  811. this.workList.splice(index, 1);
  812. common_vendor.index.showToast({
  813. title: "已删除",
  814. icon: "none"
  815. });
  816. },
  817. submitForm() {
  818. var _a, _b;
  819. if (!this.validateCurrentStep()) {
  820. return;
  821. }
  822. const allRequired = [
  823. "name",
  824. "gender",
  825. "phone",
  826. "idCard",
  827. "ethnic",
  828. "currentAddress"
  829. ];
  830. let isValid = true;
  831. allRequired.forEach((field) => {
  832. if (this.shouldValidateField(field) && !this.validateField(field, this.formData[field])) {
  833. isValid = false;
  834. }
  835. });
  836. if (this.shouldValidateField("skills") && !((_a = this.formData.skills) == null ? void 0 : _a.trim())) {
  837. this.formErrors.skills = "请描述您的专业技能";
  838. isValid = false;
  839. }
  840. if (this.shouldValidateField("training") && !((_b = this.formData.training) == null ? void 0 : _b.trim())) {
  841. this.formErrors.training = "请描述您的培训经历";
  842. isValid = false;
  843. }
  844. if (!isValid) {
  845. common_vendor.index.showToast({
  846. title: "请完善所有必填信息",
  847. icon: "none"
  848. });
  849. return;
  850. }
  851. const userInfo = common_vendor.index.getStorageSync("userInfo");
  852. if (!userInfo) {
  853. common_vendor.index.showToast({
  854. title: "用户信息获取失败,请重新登录",
  855. icon: "none",
  856. duration: 2e3
  857. });
  858. return;
  859. }
  860. try {
  861. const userData = JSON.parse(userInfo);
  862. const submitData = {
  863. tenant_id: 1,
  864. user_id: userData.id,
  865. personal_info: {
  866. name: this.formData.name,
  867. gender: this.formData.gender,
  868. phone: this.formData.phone,
  869. id_card: this.formData.idCard,
  870. address: this.formData.currentAddress,
  871. professional_skills: this.formData.skills ? this.formData.skills.split(",") : []
  872. },
  873. profile: {
  874. female_status: this.getFemaleStatus(),
  875. marital_status: this.getMaritalStatus(),
  876. height: parseFloat(this.formData.height) || 0,
  877. weight: parseFloat(this.formData.weight) || 0,
  878. ethnicity: this.formData.ethnic,
  879. current_address: this.formData.currentAddress,
  880. expected_salary: parseFloat(this.formData.expectedSalary) || 0
  881. },
  882. educations: this.formatEducations(),
  883. family_members: this.formatFamilyMembers(),
  884. work_experiences: this.formatWorkExperiences()
  885. };
  886. if (!submitData.personal_info.name || !submitData.personal_info.gender || !submitData.personal_info.phone) {
  887. common_vendor.index.showToast({
  888. title: "基本信息不完整",
  889. icon: "none",
  890. duration: 2e3
  891. });
  892. return;
  893. }
  894. this.sendFormData(submitData);
  895. } catch (error) {
  896. console.error("数据处理错误:", error);
  897. common_vendor.index.showToast({
  898. title: "数据处理错误,请重试",
  899. icon: "none",
  900. duration: 2e3
  901. });
  902. }
  903. },
  904. // 辅助方法:发送表单数据
  905. sendFormData(submitData) {
  906. common_vendor.index.showLoading({ title: "提交中..." });
  907. const token = common_vendor.index.getStorageSync("token");
  908. common_vendor.index.request({
  909. url: `${common_config.apiBaseUrl}/wechat/user/profile/update`,
  910. method: "POST",
  911. data: submitData,
  912. header: {
  913. "content-type": "application/json",
  914. "Authorization": token ? `Bearer ${token}` : ""
  915. },
  916. success: (res) => {
  917. common_vendor.index.hideLoading();
  918. if (res.statusCode === 200) {
  919. if (res.data.code === 2e3) {
  920. common_vendor.index.showToast({
  921. title: "提交成功",
  922. icon: "success",
  923. duration: 2e3
  924. });
  925. setTimeout(() => {
  926. common_vendor.index.navigateTo({
  927. url: "/pages/interview-notice/interview-notice"
  928. });
  929. }, 2e3);
  930. } else {
  931. common_vendor.index.showToast({
  932. title: res.data.msg || "提交失败",
  933. icon: "none",
  934. duration: 2e3
  935. });
  936. }
  937. } else {
  938. common_vendor.index.showToast({
  939. title: "服务器响应错误",
  940. icon: "none",
  941. duration: 2e3
  942. });
  943. }
  944. },
  945. fail: (err) => {
  946. console.error("提交失败:", err);
  947. common_vendor.index.hideLoading();
  948. if (err.errMsg.includes("timeout")) {
  949. common_vendor.index.showToast({
  950. title: "请求超时,请检查网络后重试",
  951. icon: "none",
  952. duration: 2e3
  953. });
  954. } else if (err.errMsg.includes("fail")) {
  955. common_vendor.index.showToast({
  956. title: "网络连接失败,请检查网络设置",
  957. icon: "none",
  958. duration: 2e3
  959. });
  960. } else {
  961. common_vendor.index.showToast({
  962. title: "提交失败,请稍后重试",
  963. icon: "none",
  964. duration: 2e3
  965. });
  966. }
  967. },
  968. complete: () => {
  969. }
  970. });
  971. },
  972. // 数据格式化方法
  973. getFemaleStatus() {
  974. if (this.formData.gender !== "女")
  975. return 0;
  976. const statusMap = { "孕期": 1, "产期": 2, "哺乳期": 3 };
  977. return statusMap[this.formData.threePeriod] || 0;
  978. },
  979. getMaritalStatus() {
  980. const statusMap = { "未婚": 0, "已婚": 1, "离异": 2, "丧偶": 3 };
  981. return statusMap[this.formData.marriage] || 0;
  982. },
  983. formatEducations() {
  984. return this.educationList.map((edu, index) => ({
  985. education_type: index === 0 ? 1 : 2,
  986. degree: this.mapDegreeToNumber(edu.degree),
  987. start_date: edu.startTime,
  988. end_date: edu.endTime,
  989. school_name: edu.schoolName,
  990. major: edu.major
  991. }));
  992. },
  993. formatFamilyMembers() {
  994. return this.familyMembers.map((member) => ({
  995. relation: member.relation,
  996. name: member.name,
  997. workplace: member.workplaceOrAddress,
  998. position: member.position,
  999. phone: member.phone
  1000. //is_emergency_contact: member.isEmergencyContact||false // 添加紧急联系人标识
  1001. }));
  1002. },
  1003. formatWorkExperiences() {
  1004. return this.workList.map((work) => ({
  1005. start_date: work.startTime,
  1006. end_date: work.endTime,
  1007. company_name: work.companyName,
  1008. department: work.department,
  1009. company_size: work.employeeCount,
  1010. position: work.position,
  1011. monthly_salary: work.monthlySalary,
  1012. supervisor_name: work.supervisor,
  1013. supervisor_phone: work.supervisorPhone
  1014. }));
  1015. },
  1016. // 学历映射辅助方法
  1017. mapDegreeToNumber(degreeText) {
  1018. const degreeMap = {
  1019. "高中": 1,
  1020. "中专": 1,
  1021. "大专": 2,
  1022. "本科": 3,
  1023. "硕士": 4,
  1024. "博士": 5
  1025. };
  1026. return degreeMap[degreeText] || 6;
  1027. },
  1028. prevStep() {
  1029. const prevIndex = this.currentStepIndex - 1;
  1030. if (prevIndex >= 0) {
  1031. this.currentStep = this.steps[prevIndex].id;
  1032. common_vendor.index.pageScrollTo({
  1033. scrollTop: 0,
  1034. duration: 300
  1035. });
  1036. }
  1037. },
  1038. nextStep() {
  1039. if (!this.validateCurrentStep()) {
  1040. return;
  1041. }
  1042. if (this.currentStep === 1) {
  1043. this.verifyIdentity();
  1044. return;
  1045. }
  1046. const nextIndex = this.currentStepIndex + 1;
  1047. if (nextIndex < this.steps.length) {
  1048. if (this.steps[nextIndex].id === 6 && !this.shouldShowSkillsStep) {
  1049. const skipIndex = nextIndex + 1;
  1050. if (skipIndex < this.steps.length) {
  1051. this.currentStep = this.steps[skipIndex].id;
  1052. }
  1053. } else {
  1054. this.currentStep = this.steps[nextIndex].id;
  1055. }
  1056. common_vendor.index.pageScrollTo({
  1057. scrollTop: 0,
  1058. duration: 300
  1059. });
  1060. }
  1061. },
  1062. // 身份验证方法
  1063. verifyIdentity() {
  1064. this.formErrors = {
  1065. name: "",
  1066. idCard: "",
  1067. phone: ""
  1068. };
  1069. common_vendor.index.showLoading({
  1070. title: "身份验证中..."
  1071. });
  1072. common_vendor.index.request({
  1073. url: `${common_config.apiBaseUrl}/wechat/identity/verify`,
  1074. method: "POST",
  1075. data: {
  1076. name: this.formData.name,
  1077. id_number: this.formData.idCard,
  1078. mobile: this.formData.phone
  1079. },
  1080. header: {
  1081. "content-type": "application/x-www-form-urlencoded"
  1082. },
  1083. success: (res) => {
  1084. common_vendor.index.hideLoading();
  1085. console.log(res);
  1086. if (res.data.code === 200) {
  1087. const nextIndex = this.currentStepIndex + 1;
  1088. if (nextIndex < this.steps.length) {
  1089. this.currentStep = this.steps[nextIndex].id;
  1090. common_vendor.index.pageScrollTo({
  1091. scrollTop: 0,
  1092. duration: 300
  1093. });
  1094. }
  1095. this.setUserInfo(this.formData);
  1096. } else {
  1097. this.handleVerificationError(res.data);
  1098. }
  1099. },
  1100. fail: (err) => {
  1101. this.handleRequestError(err);
  1102. }
  1103. });
  1104. },
  1105. setUserInfo(data) {
  1106. common_vendor.index.request({
  1107. url: `${common_config.apiBaseUrl}/wechat/updateUserInfo`,
  1108. method: "POST",
  1109. data: {
  1110. openid: JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid,
  1111. name: data.name,
  1112. id_card: data.idCard,
  1113. purePhoneNumber: data.phone,
  1114. tenant_id: 1,
  1115. examine: 0
  1116. },
  1117. header: {
  1118. "content-type": "application/x-www-form-urlencoded"
  1119. },
  1120. success: (res) => {
  1121. console.log(res);
  1122. }
  1123. });
  1124. },
  1125. // 处理验证错误
  1126. handleVerificationError(data) {
  1127. this.formErrors.name = "姓名验证失败,请检查姓名是否正确";
  1128. this.formErrors.idCard = "身份证号验证失败,请检查身份证号是否正确";
  1129. this.formErrors.phone = "手机号验证失败,请检查手机号是否正确";
  1130. common_vendor.index.showToast({
  1131. title: data.msg || "身份验证失败",
  1132. icon: "none"
  1133. });
  1134. },
  1135. // 处理请求错误
  1136. handleRequestError(err) {
  1137. common_vendor.index.hideLoading();
  1138. common_vendor.index.showToast({
  1139. title: "网络错误,请检查网络连接",
  1140. icon: "none",
  1141. duration: 2e3
  1142. });
  1143. console.error("请求失败:", err);
  1144. },
  1145. // 验证当前步骤的必填项
  1146. validateCurrentStep() {
  1147. var _a, _b;
  1148. let isValid = true;
  1149. switch (this.currentStep) {
  1150. case 1:
  1151. const basicFields = ["name", "gender", "phone", "idCard", "ethnic", "currentAddress"];
  1152. basicFields.forEach((field) => {
  1153. if (this.shouldValidateField(field) && !this.validateField(field, this.formData[field])) {
  1154. isValid = false;
  1155. }
  1156. });
  1157. if (this.shouldValidateField("threePeriod") && this.formData.gender === "女" && this.threePeriodIndex === -1) {
  1158. this.formErrors.threePeriod = "请选择三期状态";
  1159. isValid = false;
  1160. }
  1161. if (this.shouldValidateField("height") && this.formData.height) {
  1162. isValid = this.validateField("height", this.formData.height) && isValid;
  1163. }
  1164. if (this.shouldValidateField("weight") && this.formData.weight) {
  1165. isValid = this.validateField("weight", this.formData.weight) && isValid;
  1166. }
  1167. if (this.shouldValidateField("expectedSalary") && this.formData.expectedSalary) {
  1168. isValid = this.validateField("expectedSalary", this.formData.expectedSalary) && isValid;
  1169. }
  1170. break;
  1171. case 3:
  1172. console.log(this.familyMembers.length);
  1173. if (this.familyMembers.length == 0) {
  1174. common_vendor.index.showToast({
  1175. title: "请至少添加一位家庭成员",
  1176. icon: "none"
  1177. });
  1178. isValid = false;
  1179. }
  1180. break;
  1181. case 5:
  1182. if (this.educationList.length === 0) {
  1183. common_vendor.index.showToast({
  1184. title: "请至少添加一项教育经历",
  1185. icon: "none"
  1186. });
  1187. isValid = false;
  1188. }
  1189. break;
  1190. case 6:
  1191. if (this.shouldValidateField("skills") && !((_a = this.formData.skills) == null ? void 0 : _a.trim())) {
  1192. this.formErrors.skills = "请描述您的专业技能";
  1193. isValid = false;
  1194. }
  1195. if (this.shouldValidateField("training") && !((_b = this.formData.training) == null ? void 0 : _b.trim())) {
  1196. this.formErrors.training = "请描述您的培训经历";
  1197. isValid = false;
  1198. }
  1199. break;
  1200. case 8:
  1201. if (this.workList.length === 0) {
  1202. common_vendor.index.showToast({
  1203. title: "请至少添加一项工作经历",
  1204. icon: "none"
  1205. });
  1206. isValid = false;
  1207. }
  1208. break;
  1209. }
  1210. return isValid;
  1211. },
  1212. // Add method to fetch user data
  1213. fetchUserData() {
  1214. this.isLoading = true;
  1215. const userInfo = common_vendor.index.getStorageSync("userInfo") ? JSON.parse(common_vendor.index.getStorageSync("userInfo")) : {};
  1216. const openid = userInfo.openid;
  1217. if (!openid) {
  1218. common_vendor.index.showToast({
  1219. title: "用户信息获取失败,请重新登录",
  1220. icon: "none"
  1221. });
  1222. this.isLoading = false;
  1223. return;
  1224. }
  1225. common_vendor.index.request({
  1226. url: `${common_config.apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=1&openid=${openid}`,
  1227. method: "GET",
  1228. success: (res) => {
  1229. this.showPromiseModal = true;
  1230. this.populateFormData(res.data.data);
  1231. },
  1232. fail: (err) => {
  1233. },
  1234. complete: () => {
  1235. this.isLoading = false;
  1236. }
  1237. });
  1238. },
  1239. // Add method to populate form data with fetched data
  1240. populateFormData(data) {
  1241. const { user_info, profile, educations, work_experiences, family_members } = data;
  1242. if (user_info) {
  1243. this.formData.name = user_info.name || "";
  1244. this.formData.gender = user_info.gender_text || "";
  1245. this.genderIndex = this.genderOptions.findIndex((item) => item === this.formData.gender);
  1246. this.formData.idCard = user_info.id_card || "";
  1247. this.formData.phone = user_info.phone || "";
  1248. this.formData.email = user_info.email || "";
  1249. }
  1250. if (profile) {
  1251. this.formData.political = profile.political_status || "";
  1252. this.politicalIndex = this.politicalOptions.findIndex((item) => item === this.formData.political);
  1253. this.formData.ethnic = profile.ethnicity || "";
  1254. this.ethnicIndex = this.ethnicOptions.findIndex((item) => item === this.formData.ethnic);
  1255. this.formData.height = profile.height || "";
  1256. this.formData.weight = profile.weight || "";
  1257. this.formData.nativePlace = profile.native_place || "";
  1258. this.formData.residence = profile.household_location || "";
  1259. this.formData.currentAddress = profile.current_address || "";
  1260. this.formData.marriage = profile.marital_status_text || "";
  1261. this.marriageIndex = this.marriageOptions.findIndex((item) => item === this.formData.marriage);
  1262. if (this.formData.gender === "女" && profile.female_status !== void 0) {
  1263. const femaleStatusMap = { 0: "无", 1: "孕期", 2: "产期", 3: "哺乳期" };
  1264. this.formData.threePeriod = femaleStatusMap[profile.female_status] || "无";
  1265. this.threePeriodIndex = this.threePeriodOptions.findIndex((item) => item === this.formData.threePeriod);
  1266. }
  1267. this.formData.expectedSalary = profile.expected_salary || "";
  1268. this.formData.emergencyContact = profile.emergency_contact || "";
  1269. this.formData.emergencyPhone = profile.emergency_phone || "";
  1270. this.formData.hobby = profile.specialties || "";
  1271. this.formData.motto = profile.life_motto || "";
  1272. const sourceTypeMap = {
  1273. 1: "school",
  1274. 2: "social",
  1275. 3: "social",
  1276. 4: "social",
  1277. 5: "social"
  1278. };
  1279. const socialSourceMap = {
  1280. 2: "BOSS",
  1281. 3: "zhilian",
  1282. 4: "liepin",
  1283. 5: "other"
  1284. };
  1285. this.formData.sourceType = sourceTypeMap[profile.recruitment_source] || "social";
  1286. if (this.formData.sourceType === "social") {
  1287. this.formData.socialSource = socialSourceMap[profile.recruitment_source] || "";
  1288. if (this.formData.socialSource === "other") {
  1289. this.formData.otherSocialSource = profile.recruitment_source_detail || "";
  1290. }
  1291. } else if (this.formData.sourceType === "school") {
  1292. this.formData.otherSchoolSource = profile.recruitment_source_detail || "";
  1293. }
  1294. }
  1295. if (educations && educations.length > 0) {
  1296. this.educationList = educations.map((edu) => {
  1297. const degreeMap = {
  1298. 1: "高中",
  1299. 2: "大专",
  1300. 3: "本科",
  1301. 4: "硕士",
  1302. 5: "博士"
  1303. };
  1304. return {
  1305. startTime: edu.start_date || "",
  1306. endTime: edu.end_date || "",
  1307. schoolName: edu.school_name || "",
  1308. major: edu.major || "",
  1309. degree: degreeMap[edu.degree] || ""
  1310. };
  1311. });
  1312. }
  1313. if (work_experiences && work_experiences.length > 0) {
  1314. this.workList = work_experiences.map((work) => {
  1315. return {
  1316. startTime: work.start_date || "",
  1317. endTime: work.end_date || "",
  1318. companyName: work.company_name || "",
  1319. department: work.department || "",
  1320. employeeCount: work.company_size || "",
  1321. position: work.position || "",
  1322. monthlySalary: work.monthly_salary || "",
  1323. supervisor: work.supervisor_name || "",
  1324. supervisorPhone: work.supervisor_phone || ""
  1325. };
  1326. });
  1327. }
  1328. if (family_members && family_members.length > 0) {
  1329. this.familyMembers = family_members.map((member) => {
  1330. return {
  1331. relation: member.relation || "",
  1332. name: member.name || "",
  1333. workplaceOrAddress: member.workplace || "",
  1334. position: member.position || "",
  1335. phone: member.phone || "",
  1336. isEmergencyContact: member.isEmergencyContact || false
  1337. };
  1338. });
  1339. }
  1340. },
  1341. // 处理紧急联系人开关变化
  1342. handleEmergencyContactChange(e) {
  1343. this.familyMemberForm.isEmergencyContact = e.detail.value;
  1344. if (e.detail.value) {
  1345. this.formData.emergencyContact = this.familyMemberForm.name;
  1346. this.formData.emergencyPhone = this.familyMemberForm.phone;
  1347. }
  1348. },
  1349. // 添加重置教育经历错误信息的方法
  1350. resetEducationErrors() {
  1351. this.educationErrors = {
  1352. startTime: "",
  1353. endTime: "",
  1354. schoolName: "",
  1355. major: "",
  1356. degree: ""
  1357. };
  1358. },
  1359. // 添加通用验证方法
  1360. validateField(fieldName, value) {
  1361. const rule = this.validationRules[fieldName];
  1362. if (!rule)
  1363. return true;
  1364. if (!this.shouldValidateField(fieldName)) {
  1365. return true;
  1366. }
  1367. this.formErrors[fieldName] = "";
  1368. if (rule.required && !value) {
  1369. this.formErrors[fieldName] = rule.message;
  1370. return false;
  1371. }
  1372. if (rule.pattern && value && !rule.pattern.test(value)) {
  1373. this.formErrors[fieldName] = rule.message;
  1374. return false;
  1375. }
  1376. return true;
  1377. },
  1378. validateExpectedSalary(e) {
  1379. const value = e.detail.value;
  1380. console.log(value);
  1381. if (value === "") {
  1382. this.formData.expectedSalary = "";
  1383. this.formErrors.expectedSalary = "";
  1384. return;
  1385. }
  1386. let num = parseFloat(value);
  1387. if (isNaN(num)) {
  1388. this.formErrors.expectedSalary = "请输入有效的数字";
  1389. return;
  1390. }
  1391. if (num < 0) {
  1392. num = 0;
  1393. this.formErrors.expectedSalary = "薪资不能小于0";
  1394. } else if (num > 1e5) {
  1395. num = 1e5;
  1396. this.formErrors.expectedSalary = "薪资不能超过100000";
  1397. }
  1398. this.formData.expectedSalary = num.toString();
  1399. },
  1400. validateEmployeeCount(e) {
  1401. const value = e.detail.value;
  1402. if (value === "") {
  1403. this.workForm.employeeCount = "";
  1404. this.workErrors.employeeCount = "";
  1405. return;
  1406. }
  1407. let num = parseInt(value);
  1408. if (isNaN(num)) {
  1409. this.workErrors.employeeCount = "请输入有效的数字";
  1410. return;
  1411. }
  1412. if (num < 0) {
  1413. num = 0;
  1414. this.workErrors.employeeCount = "人数不能小于0";
  1415. } else if (num > 1e4) {
  1416. num = 1e4;
  1417. this.workErrors.employeeCount = "人数不能超过10000";
  1418. }
  1419. this.workForm.employeeCount = num.toString();
  1420. },
  1421. validateMonthlySalary(e) {
  1422. const value = e.detail.value;
  1423. if (value === "") {
  1424. this.workForm.monthlySalary = "";
  1425. this.workErrors.monthlySalary = "";
  1426. return;
  1427. }
  1428. let num = parseInt(value);
  1429. if (isNaN(num)) {
  1430. this.workErrors.monthlySalary = "请输入有效的数字";
  1431. return;
  1432. }
  1433. if (num < 0) {
  1434. num = 0;
  1435. this.workErrors.monthlySalary = "月总收入不能小于0";
  1436. } else if (num > 1e5) {
  1437. num = 1e5;
  1438. this.workErrors.monthlySalary = "月总收入不能超过100000";
  1439. } else {
  1440. this.workErrors.monthlySalary = "";
  1441. }
  1442. this.workForm.monthlySalary = num.toString();
  1443. },
  1444. // 添加手机号验证方法
  1445. validatePhone(e) {
  1446. const value = e.detail.value;
  1447. if (value.length > 11) {
  1448. this.formData.phone = value.slice(0, 11);
  1449. }
  1450. if (value && !/^1[3-9]\d{0,9}$/.test(value)) {
  1451. this.formErrors.phone = "请输入正确的手机号码";
  1452. } else {
  1453. this.formErrors.phone = "";
  1454. }
  1455. }
  1456. },
  1457. // 添加监听器来清除错误信息
  1458. watch: {
  1459. "formData.name": function(newVal) {
  1460. if (newVal && this.formErrors.name) {
  1461. this.formErrors.name = "";
  1462. }
  1463. },
  1464. "formData.idCard": function(newVal) {
  1465. if (newVal && this.formErrors.idCard) {
  1466. this.formErrors.idCard = "";
  1467. }
  1468. },
  1469. "formData.phone": function(newVal) {
  1470. if (newVal && this.formErrors.phone) {
  1471. this.formErrors.phone = "";
  1472. }
  1473. },
  1474. "formData.gender": function(newVal) {
  1475. if (newVal && this.formErrors.gender) {
  1476. this.formErrors.gender = "";
  1477. }
  1478. },
  1479. "formData.ethnic": function(newVal) {
  1480. if (newVal && this.formErrors.ethnic) {
  1481. this.formErrors.ethnic = "";
  1482. }
  1483. },
  1484. "formData.currentAddress": function(newVal) {
  1485. if (newVal && this.formErrors.currentAddress) {
  1486. this.formErrors.currentAddress = "";
  1487. }
  1488. },
  1489. "formData.height": function(newVal) {
  1490. if (newVal && this.formErrors.height) {
  1491. this.formErrors.height = "";
  1492. }
  1493. },
  1494. "formData.weight": function(newVal) {
  1495. if (newVal && this.formErrors.weight) {
  1496. this.formErrors.weight = "";
  1497. }
  1498. },
  1499. "formData.expectedSalary": function(newVal) {
  1500. if (newVal && this.formErrors.expectedSalary) {
  1501. this.formErrors.expectedSalary = "";
  1502. }
  1503. },
  1504. "familyMemberForm.relation": function(newVal) {
  1505. if (newVal)
  1506. this.familyMemberErrors.relation = "";
  1507. },
  1508. "familyMemberForm.name": function(newVal) {
  1509. if (newVal)
  1510. this.familyMemberErrors.name = "";
  1511. },
  1512. "familyMemberForm.phone": function(newVal) {
  1513. if (newVal)
  1514. this.familyMemberErrors.phone = "";
  1515. },
  1516. /* 'familyMemberForm.workplaceOrAddress': function(newVal) {
  1517. if (newVal) this.familyMemberErrors.workplaceOrAddress = '';
  1518. },
  1519. 'familyMemberForm.position': function(newVal) {
  1520. if (newVal) this.familyMemberErrors.position = '';
  1521. }, */
  1522. "workForm.companyName": function(newVal) {
  1523. if (newVal && this.workErrors.companyName) {
  1524. this.workErrors.companyName = "";
  1525. }
  1526. },
  1527. "workForm.department": function(newVal) {
  1528. if (newVal && this.workErrors.department) {
  1529. this.workErrors.department = "";
  1530. }
  1531. },
  1532. "workForm.position": function(newVal) {
  1533. if (newVal && this.workErrors.position) {
  1534. this.workErrors.position = "";
  1535. }
  1536. },
  1537. "workForm.employeeCount": function(newVal) {
  1538. if (newVal && this.workErrors.employeeCount) {
  1539. this.workErrors.employeeCount = "";
  1540. }
  1541. },
  1542. "workForm.monthlySalary": function(newVal) {
  1543. if (newVal && this.workErrors.monthlySalary) {
  1544. this.workErrors.monthlySalary = "";
  1545. }
  1546. },
  1547. "workForm.supervisor": function(newVal) {
  1548. if (newVal && this.workErrors.supervisor) {
  1549. this.workErrors.supervisor = "";
  1550. }
  1551. },
  1552. // 'workForm.supervisorPhone': function(newVal) {
  1553. // if (newVal && this.workErrors.supervisorPhone) {
  1554. // this.workErrors.supervisorPhone = '';
  1555. // }
  1556. // },
  1557. "formData.training": function(newVal) {
  1558. if (newVal && this.formErrors.training) {
  1559. this.formErrors.training = "";
  1560. }
  1561. },
  1562. "educationForm.startTime": function(newVal) {
  1563. if (newVal)
  1564. this.educationErrors.startTime = "";
  1565. },
  1566. "educationForm.endTime": function(newVal) {
  1567. if (newVal)
  1568. this.educationErrors.endTime = "";
  1569. },
  1570. "educationForm.schoolName": function(newVal) {
  1571. if (newVal)
  1572. this.educationErrors.schoolName = "";
  1573. },
  1574. "educationForm.major": function(newVal) {
  1575. if (newVal)
  1576. this.educationErrors.major = "";
  1577. },
  1578. "educationForm.degree": function(newVal) {
  1579. if (newVal)
  1580. this.educationErrors.degree = "";
  1581. },
  1582. // 添加对表单字段的实时验证
  1583. "formData": {
  1584. handler(newVal) {
  1585. const currentStepFields = {
  1586. 1: ["name", "gender", "phone", "idCard", "ethnic", "currentAddress", "height", "weight", "expectedSalary"],
  1587. 6: ["skills", "training"]
  1588. }[this.currentStep];
  1589. if (currentStepFields) {
  1590. currentStepFields.forEach((field) => {
  1591. if (newVal[field] !== void 0 && this.shouldValidateField(field)) {
  1592. this.validateField(field, newVal[field]);
  1593. }
  1594. });
  1595. }
  1596. },
  1597. deep: true
  1598. }
  1599. }
  1600. };
  1601. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  1602. return common_vendor.e({
  1603. a: $data.isLoading
  1604. }, $data.isLoading ? {} : {}, {
  1605. b: $data.showPromiseModal
  1606. }, $data.showPromiseModal ? {
  1607. c: $data.promiseChecked,
  1608. d: common_vendor.o((...args) => $options.togglePromiseChecked && $options.togglePromiseChecked(...args)),
  1609. e: !$data.promiseChecked,
  1610. f: common_vendor.o((...args) => $options.confirmPromise && $options.confirmPromise(...args))
  1611. } : {}, {
  1612. g: $data.currentStep === 1
  1613. }, $data.currentStep === 1 ? common_vendor.e({
  1614. h: $options.showNameField
  1615. }, $options.showNameField ? common_vendor.e({
  1616. i: $data.formErrors.name ? 1 : "",
  1617. j: $data.formData.name,
  1618. k: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
  1619. l: $data.formErrors.name
  1620. }, $data.formErrors.name ? {
  1621. m: common_vendor.t($data.formErrors.name)
  1622. } : {}) : {}, {
  1623. n: $options.showGenderField
  1624. }, $options.showGenderField ? common_vendor.e({
  1625. o: common_vendor.t($data.genderOptions[$data.genderIndex] || "请选择性别"),
  1626. p: $data.formErrors.gender ? 1 : "",
  1627. q: common_vendor.o((...args) => $options.bindGenderChange && $options.bindGenderChange(...args)),
  1628. r: $data.genderIndex,
  1629. s: $data.genderOptions,
  1630. t: $data.formErrors.gender
  1631. }, $data.formErrors.gender ? {
  1632. v: common_vendor.t($data.formErrors.gender)
  1633. } : {}) : {}, {
  1634. w: $data.formData.gender === "女"
  1635. }, $data.formData.gender === "女" ? common_vendor.e({
  1636. x: common_vendor.t($data.threePeriodOptions[$data.threePeriodIndex] || "请选择"),
  1637. y: common_vendor.o((...args) => $options.bindThreePeriodChange && $options.bindThreePeriodChange(...args)),
  1638. z: $data.threePeriodIndex,
  1639. A: $data.threePeriodOptions,
  1640. B: $data.formErrors.threePeriod ? 1 : "",
  1641. C: $data.formErrors.threePeriod
  1642. }, $data.formErrors.threePeriod ? {
  1643. D: common_vendor.t($data.formErrors.threePeriod)
  1644. } : {}) : {}, {
  1645. E: $options.showPhoneField
  1646. }, $options.showPhoneField ? common_vendor.e({
  1647. F: $data.formErrors.phone ? 1 : "",
  1648. G: common_vendor.o([($event) => $data.formData.phone = $event.detail.value, (...args) => $options.validatePhone && $options.validatePhone(...args)]),
  1649. H: $data.formData.phone,
  1650. I: $data.formErrors.phone
  1651. }, $data.formErrors.phone ? {
  1652. J: common_vendor.t($data.formErrors.phone)
  1653. } : {}) : {}, {
  1654. K: $options.showIdCardField
  1655. }, $options.showIdCardField ? common_vendor.e({
  1656. L: $data.formErrors.idCard ? 1 : "",
  1657. M: $data.formData.idCard,
  1658. N: common_vendor.o(($event) => $data.formData.idCard = $event.detail.value),
  1659. O: $data.formErrors.idCard
  1660. }, $data.formErrors.idCard ? {
  1661. P: common_vendor.t($data.formErrors.idCard)
  1662. } : {}) : {}, {
  1663. Q: $options.showEthnicField
  1664. }, $options.showEthnicField ? common_vendor.e({
  1665. R: common_vendor.t($data.ethnicOptions[$data.ethnicIndex] || "请选择民族"),
  1666. S: $data.formErrors.ethnic ? 1 : "",
  1667. T: common_vendor.o((...args) => $options.bindEthnicChange && $options.bindEthnicChange(...args)),
  1668. U: $data.ethnicIndex,
  1669. V: $data.ethnicOptions,
  1670. W: $data.formErrors.ethnic
  1671. }, $data.formErrors.ethnic ? {
  1672. X: common_vendor.t($data.formErrors.ethnic)
  1673. } : {}) : {}, {
  1674. Y: $options.showHeightField
  1675. }, $options.showHeightField ? {
  1676. Z: $data.formData.height,
  1677. aa: common_vendor.o(($event) => $data.formData.height = $event.detail.value)
  1678. } : {}, {
  1679. ab: $options.showWeightField
  1680. }, $options.showWeightField ? {
  1681. ac: $data.formData.weight,
  1682. ad: common_vendor.o(($event) => $data.formData.weight = $event.detail.value)
  1683. } : {}, {
  1684. ae: $data.formErrors.currentAddress ? 1 : "",
  1685. af: $data.formData.currentAddress,
  1686. ag: common_vendor.o(($event) => $data.formData.currentAddress = $event.detail.value),
  1687. ah: $data.formErrors.currentAddress
  1688. }, $data.formErrors.currentAddress ? {
  1689. ai: common_vendor.t($data.formErrors.currentAddress)
  1690. } : {}, {
  1691. aj: $data.formData.residence,
  1692. ak: common_vendor.o(($event) => $data.formData.residence = $event.detail.value),
  1693. al: common_vendor.t($data.marriageOptions[$data.marriageIndex] || "请选择婚育状况"),
  1694. am: common_vendor.o((...args) => $options.bindMarriageChange && $options.bindMarriageChange(...args)),
  1695. an: $data.marriageIndex,
  1696. ao: $data.marriageOptions,
  1697. ap: common_vendor.o((...args) => $options.validateExpectedSalary && $options.validateExpectedSalary(...args)),
  1698. aq: $data.formErrors.expectedSalary ? 1 : "",
  1699. ar: $data.formData.expectedSalary,
  1700. as: common_vendor.o(($event) => $data.formData.expectedSalary = $event.detail.value),
  1701. at: $data.formErrors.expectedSalary
  1702. }, $data.formErrors.expectedSalary ? {
  1703. av: common_vendor.t($data.formErrors.expectedSalary)
  1704. } : {}) : {}, {
  1705. aw: $data.currentStep === 3
  1706. }, $data.currentStep === 3 ? common_vendor.e({
  1707. ax: $data.familyMembers.length > 0
  1708. }, $data.familyMembers.length > 0 ? {
  1709. ay: common_vendor.f($data.familyMembers, (member, index, i0) => {
  1710. return common_vendor.e({
  1711. a: common_vendor.t(index + 1),
  1712. b: common_vendor.o(($event) => $options.editFamilyMember(index), index),
  1713. c: common_vendor.o(($event) => $options.deleteFamilyMember(index), index)
  1714. }, $options.showFamilyRelationField ? {
  1715. d: common_vendor.t(member.relation)
  1716. } : {}, $options.showFamilyNameField ? {
  1717. e: common_vendor.t(member.name)
  1718. } : {}, $options.showFamilyWorkplaceField ? {
  1719. f: common_vendor.t(member.workplaceOrAddress)
  1720. } : {}, $options.showFamilyPositionField ? {
  1721. g: common_vendor.t(member.position)
  1722. } : {}, $options.showFamilyPhoneField ? {
  1723. h: common_vendor.t(member.phone)
  1724. } : {}, {
  1725. i: common_vendor.t(member.isEmergencyContact ? "是" : "否"),
  1726. j: index
  1727. });
  1728. }),
  1729. az: $options.showFamilyRelationField,
  1730. aA: $options.showFamilyNameField,
  1731. aB: $options.showFamilyWorkplaceField,
  1732. aC: $options.showFamilyPositionField,
  1733. aD: $options.showFamilyPhoneField
  1734. } : {}, {
  1735. aE: common_vendor.t($data.isEditing ? "编辑家庭成员" : "添加家庭成员"),
  1736. aF: $data.isEditing
  1737. }, $data.isEditing ? {
  1738. aG: common_vendor.o((...args) => $options.cancelEdit && $options.cancelEdit(...args))
  1739. } : {}, {
  1740. aH: $options.showFamilyRelationField
  1741. }, $options.showFamilyRelationField ? common_vendor.e({
  1742. aI: $data.familyMemberErrors.relation ? 1 : "",
  1743. aJ: $data.familyMemberForm.relation,
  1744. aK: common_vendor.o(($event) => $data.familyMemberForm.relation = $event.detail.value),
  1745. aL: $data.familyMemberErrors.relation
  1746. }, $data.familyMemberErrors.relation ? {
  1747. aM: common_vendor.t($data.familyMemberErrors.relation)
  1748. } : {}) : {}, {
  1749. aN: $options.showFamilyNameField
  1750. }, $options.showFamilyNameField ? common_vendor.e({
  1751. aO: $data.familyMemberErrors.name ? 1 : "",
  1752. aP: $data.familyMemberForm.name,
  1753. aQ: common_vendor.o(($event) => $data.familyMemberForm.name = $event.detail.value),
  1754. aR: $data.familyMemberErrors.name
  1755. }, $data.familyMemberErrors.name ? {
  1756. aS: common_vendor.t($data.familyMemberErrors.name)
  1757. } : {}) : {}, {
  1758. aT: $options.showFamilyWorkplaceField
  1759. }, $options.showFamilyWorkplaceField ? {
  1760. aU: $data.familyMemberForm.workplaceOrAddress,
  1761. aV: common_vendor.o(($event) => $data.familyMemberForm.workplaceOrAddress = $event.detail.value)
  1762. } : {}, {
  1763. aW: $options.showFamilyPositionField
  1764. }, $options.showFamilyPositionField ? {
  1765. aX: $data.familyMemberForm.position,
  1766. aY: common_vendor.o(($event) => $data.familyMemberForm.position = $event.detail.value)
  1767. } : {}, {
  1768. aZ: $options.showFamilyPhoneField
  1769. }, $options.showFamilyPhoneField ? common_vendor.e({
  1770. ba: common_vendor.o([($event) => $data.familyMemberForm.phone = $event.detail.value, (...args) => $options.validatePhone && $options.validatePhone(...args)]),
  1771. bb: $data.familyMemberErrors.phone ? 1 : "",
  1772. bc: $data.familyMemberForm.phone,
  1773. bd: $data.familyMemberErrors.phone
  1774. }, $data.familyMemberErrors.phone ? {
  1775. be: common_vendor.t($data.familyMemberErrors.phone)
  1776. } : {}) : {}, {
  1777. bf: $data.familyMemberForm.isEmergencyContact,
  1778. bg: common_vendor.o((...args) => $options.handleEmergencyContactChange && $options.handleEmergencyContactChange(...args)),
  1779. bh: common_vendor.t($data.isEditing ? "✓" : "+"),
  1780. bi: common_vendor.o((...args) => $options.saveFamilyMember && $options.saveFamilyMember(...args)),
  1781. bj: common_vendor.t($data.isEditing ? "保存修改" : "添加成员")
  1782. }) : {}, {
  1783. bk: $data.currentStep === 5
  1784. }, $data.currentStep === 5 ? common_vendor.e({
  1785. bl: $data.educationList.length > 0
  1786. }, $data.educationList.length > 0 ? {
  1787. bm: common_vendor.f($data.educationList, (edu, index, i0) => {
  1788. return common_vendor.e({
  1789. a: common_vendor.t(index === 0 ? "第一学历" : "最高学历"),
  1790. b: common_vendor.o(($event) => $options.editEducation(index), index),
  1791. c: common_vendor.o(($event) => $options.deleteEducation(index), index)
  1792. }, $options.showEducationTimeField ? {
  1793. d: common_vendor.t(edu.startTime),
  1794. e: common_vendor.t(edu.endTime)
  1795. } : {}, $options.showEducationSchoolField ? {
  1796. f: common_vendor.t(edu.schoolName)
  1797. } : {}, $options.showEducationMajorField ? {
  1798. g: common_vendor.t(edu.major)
  1799. } : {}, $options.showEducationDegreeField ? {
  1800. h: common_vendor.t(edu.degree)
  1801. } : {}, {
  1802. i: index
  1803. });
  1804. }),
  1805. bn: $options.showEducationTimeField,
  1806. bo: $options.showEducationSchoolField,
  1807. bp: $options.showEducationMajorField,
  1808. bq: $options.showEducationDegreeField
  1809. } : {}, {
  1810. br: $data.educationList.length < 2 || $data.isEditingEducation
  1811. }, $data.educationList.length < 2 || $data.isEditingEducation ? common_vendor.e({
  1812. bs: common_vendor.t($data.isEditingEducation ? "编辑教育经历" : $data.educationList.length === 0 ? "添加第一学历" : "添加最高学历"),
  1813. bt: $data.isEditingEducation
  1814. }, $data.isEditingEducation ? {
  1815. bv: common_vendor.o((...args) => $options.cancelEditEducation && $options.cancelEditEducation(...args))
  1816. } : {}, {
  1817. bw: $options.showEducationTimeField
  1818. }, $options.showEducationTimeField ? common_vendor.e({
  1819. bx: common_vendor.t($data.educationForm.startTime || "开始时间"),
  1820. by: $data.educationForm.startTime,
  1821. bz: common_vendor.o((...args) => $options.bindStartTimeChange && $options.bindStartTimeChange(...args)),
  1822. bA: $data.educationErrors.startTime ? 1 : "",
  1823. bB: common_vendor.t($data.educationForm.endTime || "结束时间"),
  1824. bC: $data.educationForm.endTime,
  1825. bD: common_vendor.o((...args) => $options.bindEndTimeChange && $options.bindEndTimeChange(...args)),
  1826. bE: $data.educationErrors.endTime ? 1 : "",
  1827. bF: $data.educationErrors.startTime
  1828. }, $data.educationErrors.startTime ? {
  1829. bG: common_vendor.t($data.educationErrors.startTime)
  1830. } : {}, {
  1831. bH: $data.educationErrors.endTime
  1832. }, $data.educationErrors.endTime ? {
  1833. bI: common_vendor.t($data.educationErrors.endTime)
  1834. } : {}) : {}, {
  1835. bJ: $options.showEducationSchoolField
  1836. }, $options.showEducationSchoolField ? common_vendor.e({
  1837. bK: $data.educationErrors.schoolName ? 1 : "",
  1838. bL: $data.educationForm.schoolName,
  1839. bM: common_vendor.o(($event) => $data.educationForm.schoolName = $event.detail.value),
  1840. bN: $data.educationErrors.schoolName
  1841. }, $data.educationErrors.schoolName ? {
  1842. bO: common_vendor.t($data.educationErrors.schoolName)
  1843. } : {}) : {}, {
  1844. bP: $options.showEducationMajorField
  1845. }, $options.showEducationMajorField ? common_vendor.e({
  1846. bQ: $data.educationErrors.major ? 1 : "",
  1847. bR: $data.educationForm.major,
  1848. bS: common_vendor.o(($event) => $data.educationForm.major = $event.detail.value),
  1849. bT: $data.educationErrors.major
  1850. }, $data.educationErrors.major ? {
  1851. bU: common_vendor.t($data.educationErrors.major)
  1852. } : {}) : {}, {
  1853. bV: $options.showEducationDegreeField
  1854. }, $options.showEducationDegreeField ? common_vendor.e({
  1855. bW: common_vendor.t($data.degreeOptions[$data.degreeIndex] || "请选择学历"),
  1856. bX: common_vendor.o((...args) => $options.bindDegreeChange && $options.bindDegreeChange(...args)),
  1857. bY: $data.degreeIndex,
  1858. bZ: $data.degreeOptions,
  1859. ca: $data.educationErrors.degree ? 1 : "",
  1860. cb: $data.educationErrors.degree
  1861. }, $data.educationErrors.degree ? {
  1862. cc: common_vendor.t($data.educationErrors.degree)
  1863. } : {}) : {}, {
  1864. cd: common_vendor.t($data.isEditingEducation ? "✓" : "+"),
  1865. ce: common_vendor.o((...args) => $options.saveEducation && $options.saveEducation(...args)),
  1866. cf: common_vendor.t($data.isEditingEducation ? "保存修改" : "添加学历")
  1867. }) : {}) : {}, {
  1868. cg: $data.currentStep === 6 && ($options.showRequireTrainingInfoField || $options.showRequireProfessionalSkillsField)
  1869. }, $data.currentStep === 6 && ($options.showRequireTrainingInfoField || $options.showRequireProfessionalSkillsField) ? common_vendor.e({
  1870. ch: $options.showRequireTrainingInfoField
  1871. }, $options.showRequireTrainingInfoField ? {} : {}, {
  1872. ci: $options.showRequireTrainingInfoField
  1873. }, $options.showRequireTrainingInfoField ? common_vendor.e({
  1874. cj: $data.formErrors.skills ? 1 : "",
  1875. ck: $data.formData.skills,
  1876. cl: common_vendor.o(($event) => $data.formData.skills = $event.detail.value),
  1877. cm: $data.formErrors.skills
  1878. }, $data.formErrors.skills ? {
  1879. cn: common_vendor.t($data.formErrors.skills)
  1880. } : {}) : {}, {
  1881. co: $options.showRequireProfessionalSkillsField
  1882. }, $options.showRequireProfessionalSkillsField ? {} : {}, {
  1883. cp: $options.showRequireProfessionalSkillsField
  1884. }, $options.showRequireProfessionalSkillsField ? common_vendor.e({
  1885. cq: $data.formErrors.training ? 1 : "",
  1886. cr: $data.formData.training,
  1887. cs: common_vendor.o(($event) => $data.formData.training = $event.detail.value),
  1888. ct: $data.formErrors.training
  1889. }, $data.formErrors.training ? {
  1890. cv: common_vendor.t($data.formErrors.training)
  1891. } : {}) : {}) : {}, {
  1892. cw: $data.currentStep === 8
  1893. }, $data.currentStep === 8 ? common_vendor.e({
  1894. cx: $data.workList.length > 0
  1895. }, $data.workList.length > 0 ? {
  1896. cy: common_vendor.f($data.workList, (work, index, i0) => {
  1897. return common_vendor.e({
  1898. a: common_vendor.t(index + 1),
  1899. b: common_vendor.o(($event) => $options.editWork(index), index),
  1900. c: common_vendor.o(($event) => $options.deleteWork(index), index)
  1901. }, $options.showWorkTimeField ? {
  1902. d: common_vendor.t(work.startTime),
  1903. e: common_vendor.t(work.endTime)
  1904. } : {}, $options.showWorkCompanyField ? {
  1905. f: common_vendor.t(work.companyName)
  1906. } : {}, $options.showWorkDepartmentField ? {
  1907. g: common_vendor.t(work.department)
  1908. } : {}, $options.showWorkEmployeeCountField ? {
  1909. h: common_vendor.t(work.employeeCount)
  1910. } : {}, $options.showWorkPositionField ? {
  1911. i: common_vendor.t(work.position)
  1912. } : {}, {
  1913. j: common_vendor.t(work.monthlySalary),
  1914. k: common_vendor.t(work.supervisor),
  1915. l: common_vendor.t(work.supervisorPhone),
  1916. m: index
  1917. });
  1918. }),
  1919. cz: $options.showWorkTimeField,
  1920. cA: $options.showWorkCompanyField,
  1921. cB: $options.showWorkDepartmentField,
  1922. cC: $options.showWorkEmployeeCountField,
  1923. cD: $options.showWorkPositionField
  1924. } : {}, {
  1925. cE: $data.workList.length < 2 || $data.isEditingWork
  1926. }, $data.workList.length < 2 || $data.isEditingWork ? common_vendor.e({
  1927. cF: common_vendor.t($data.isEditingWork ? "编辑工作经历" : "添加工作经历"),
  1928. cG: $data.isEditingWork
  1929. }, $data.isEditingWork ? {
  1930. cH: common_vendor.o((...args) => $options.cancelEditWork && $options.cancelEditWork(...args))
  1931. } : {}, {
  1932. cI: $options.showWorkTimeField
  1933. }, $options.showWorkTimeField ? common_vendor.e({
  1934. cJ: common_vendor.t($data.workForm.startTime || "开始时间"),
  1935. cK: $data.workForm.startTime,
  1936. cL: common_vendor.o((...args) => $options.bindWorkStartTimeChange && $options.bindWorkStartTimeChange(...args)),
  1937. cM: $data.workErrors.startTime ? 1 : "",
  1938. cN: common_vendor.t($data.workForm.endTime || "结束时间"),
  1939. cO: $data.workForm.endTime,
  1940. cP: common_vendor.o((...args) => $options.bindWorkEndTimeChange && $options.bindWorkEndTimeChange(...args)),
  1941. cQ: $data.workErrors.endTime ? 1 : "",
  1942. cR: $data.workErrors.startTime
  1943. }, $data.workErrors.startTime ? {
  1944. cS: common_vendor.t($data.workErrors.startTime)
  1945. } : {}, {
  1946. cT: $data.workErrors.endTime
  1947. }, $data.workErrors.endTime ? {
  1948. cU: common_vendor.t($data.workErrors.endTime)
  1949. } : {}) : {}, {
  1950. cV: $options.showWorkCompanyField
  1951. }, $options.showWorkCompanyField ? common_vendor.e({
  1952. cW: $data.workErrors.companyName ? 1 : "",
  1953. cX: $data.workForm.companyName,
  1954. cY: common_vendor.o(($event) => $data.workForm.companyName = $event.detail.value),
  1955. cZ: $data.workErrors.companyName
  1956. }, $data.workErrors.companyName ? {
  1957. da: common_vendor.t($data.workErrors.companyName)
  1958. } : {}) : {}, {
  1959. db: $options.showWorkEmployeeCountField
  1960. }, $options.showWorkEmployeeCountField ? common_vendor.e({
  1961. dc: $data.workErrors.employeeCount ? 1 : "",
  1962. dd: common_vendor.o((...args) => $options.validateEmployeeCount && $options.validateEmployeeCount(...args)),
  1963. de: $data.workForm.employeeCount,
  1964. df: common_vendor.o(($event) => $data.workForm.employeeCount = $event.detail.value),
  1965. dg: $data.workErrors.employeeCount
  1966. }, $data.workErrors.employeeCount ? {
  1967. dh: common_vendor.t($data.workErrors.employeeCount)
  1968. } : {}) : {}, {
  1969. di: $options.showWorkDepartmentField
  1970. }, $options.showWorkDepartmentField ? common_vendor.e({
  1971. dj: $data.workErrors.department ? 1 : "",
  1972. dk: $data.workForm.department,
  1973. dl: common_vendor.o(($event) => $data.workForm.department = $event.detail.value),
  1974. dm: $data.workErrors.department
  1975. }, $data.workErrors.department ? {
  1976. dn: common_vendor.t($data.workErrors.department)
  1977. } : {}) : {}, {
  1978. dp: $options.showWorkPositionField
  1979. }, $options.showWorkPositionField ? common_vendor.e({
  1980. dq: $data.workErrors.position ? 1 : "",
  1981. dr: $data.workForm.position,
  1982. ds: common_vendor.o(($event) => $data.workForm.position = $event.detail.value),
  1983. dt: $data.workErrors.position
  1984. }, $data.workErrors.position ? {
  1985. dv: common_vendor.t($data.workErrors.position)
  1986. } : {}) : {}, {
  1987. dw: $data.workErrors.monthlySalary ? 1 : "",
  1988. dx: common_vendor.o([($event) => $data.workForm.monthlySalary = $event.detail.value, (...args) => $options.validateMonthlySalary && $options.validateMonthlySalary(...args)]),
  1989. dy: $data.workForm.monthlySalary,
  1990. dz: $data.workErrors.monthlySalary
  1991. }, $data.workErrors.monthlySalary ? {
  1992. dA: common_vendor.t($data.workErrors.monthlySalary)
  1993. } : {}, {
  1994. dB: $data.workForm.supervisor,
  1995. dC: common_vendor.o(($event) => $data.workForm.supervisor = $event.detail.value),
  1996. dD: $data.workErrors.supervisor
  1997. }, $data.workErrors.supervisor ? {
  1998. dE: common_vendor.t($data.workErrors.supervisor)
  1999. } : {}, {
  2000. dF: common_vendor.o([($event) => $data.workForm.supervisorPhone = $event.detail.value, (...args) => $options.validatePhone && $options.validatePhone(...args)]),
  2001. dG: $data.workForm.supervisorPhone,
  2002. dH: $data.workErrors.supervisorPhone
  2003. }, $data.workErrors.supervisorPhone ? {
  2004. dI: common_vendor.t($data.workErrors.supervisorPhone)
  2005. } : {}, {
  2006. dJ: common_vendor.t($data.isEditingWork ? "✓" : "+"),
  2007. dK: common_vendor.o((...args) => $options.saveWork && $options.saveWork(...args)),
  2008. dL: common_vendor.t($data.isEditingWork ? "保存修改" : "添加工作经历")
  2009. }) : {}) : {}, {
  2010. dM: $options.showPrevButton
  2011. }, $options.showPrevButton ? {
  2012. dN: common_vendor.o((...args) => $options.prevStep && $options.prevStep(...args))
  2013. } : {}, {
  2014. dO: $options.showNextButton
  2015. }, $options.showNextButton ? {
  2016. dP: common_vendor.o((...args) => $options.nextStep && $options.nextStep(...args))
  2017. } : {}, {
  2018. dQ: $options.showSubmitButton
  2019. }, $options.showSubmitButton ? {
  2020. dR: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args))
  2021. } : {});
  2022. }
  2023. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  2024. wx.createPage(MiniProgramPage);