Personal.js 69 KB

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