Personal.js 91 KB

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