Personal.js 91 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539
  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. common_vendor.index.navigateTo({
  1147. url: "/pages/interview-notice/interview-notice"
  1148. });
  1149. } else {
  1150. common_vendor.index.showToast({
  1151. title: res.data.msg || "提交失败",
  1152. icon: "none",
  1153. duration: 2e3
  1154. });
  1155. }
  1156. } else {
  1157. common_vendor.index.showToast({
  1158. title: "服务器响应错误",
  1159. icon: "none",
  1160. duration: 2e3
  1161. });
  1162. }
  1163. },
  1164. fail: (err) => {
  1165. console.error("提交失败:", err);
  1166. common_vendor.index.hideLoading();
  1167. if (err.errMsg.includes("timeout")) {
  1168. common_vendor.index.showToast({
  1169. title: "请求超时,请检查网络后重试",
  1170. icon: "none",
  1171. duration: 2e3
  1172. });
  1173. } else if (err.errMsg.includes("fail")) {
  1174. common_vendor.index.showToast({
  1175. title: "网络连接失败,请检查网络设置",
  1176. icon: "none",
  1177. duration: 2e3
  1178. });
  1179. } else {
  1180. common_vendor.index.showToast({
  1181. title: "提交失败,请稍后重试",
  1182. icon: "none",
  1183. duration: 2e3
  1184. });
  1185. }
  1186. },
  1187. complete: () => {
  1188. }
  1189. });
  1190. },
  1191. // 数据格式化方法
  1192. getFemaleStatus() {
  1193. if (this.formData.gender !== "女")
  1194. return 0;
  1195. const statusMap = { "孕期": 1, "产期": 2, "哺乳期": 3 };
  1196. return statusMap[this.formData.threePeriod] || 0;
  1197. },
  1198. getMaritalStatus() {
  1199. const statusMap = { "未婚": 0, "已婚": 1, "离异": 2, "丧偶": 3 };
  1200. return statusMap[this.formData.marriage] || 0;
  1201. },
  1202. formatEducations() {
  1203. return this.educationList.map((edu, index) => ({
  1204. education_type: index === 0 ? 1 : 2,
  1205. degree: this.mapDegreeToNumber(edu.degree),
  1206. start_date: edu.startTime,
  1207. end_date: edu.endTime,
  1208. school_name: edu.schoolName,
  1209. major: edu.major
  1210. }));
  1211. },
  1212. formatFamilyMembers() {
  1213. return this.familyMembers.map((member) => ({
  1214. relation: member.relation,
  1215. name: member.name,
  1216. workplace: member.workplaceOrAddress,
  1217. position: member.position,
  1218. phone: member.phone
  1219. //is_emergency_contact: member.isEmergencyContact||false // 添加紧急联系人标识
  1220. }));
  1221. },
  1222. formatWorkExperiences() {
  1223. return this.workList.map((work) => ({
  1224. start_date: work.startTime,
  1225. end_date: work.endTime,
  1226. company_name: work.companyName,
  1227. department: work.department,
  1228. company_size: parseInt(work.employeeCount) || 0,
  1229. position: work.position,
  1230. monthly_salary: work.monthlySalary || 0,
  1231. supervisor_name: work.supervisor,
  1232. supervisor_phone: work.supervisorPhone
  1233. }));
  1234. },
  1235. // 学历映射辅助方法
  1236. mapDegreeToNumber(degreeText) {
  1237. const degreeMap = {
  1238. "高中": 1,
  1239. "中专": 1,
  1240. "大专": 2,
  1241. "本科": 3,
  1242. "硕士": 4,
  1243. "博士": 5
  1244. };
  1245. return degreeMap[degreeText] || 6;
  1246. },
  1247. prevStep() {
  1248. const prevIndex = this.currentStepIndex - 1;
  1249. if (prevIndex >= 0) {
  1250. let targetIndex = prevIndex;
  1251. while (targetIndex >= 0) {
  1252. const stepId = this.steps[targetIndex].id;
  1253. if (stepId === 6 && !this.shouldShowSkillsStep) {
  1254. targetIndex--;
  1255. continue;
  1256. }
  1257. if (stepId === 5 && !this.shouldShowEducationStep) {
  1258. targetIndex--;
  1259. continue;
  1260. }
  1261. if (stepId === 3 && !this.shouldShowFamilyStep) {
  1262. targetIndex--;
  1263. continue;
  1264. }
  1265. if (stepId === 8 && !this.shouldShowWorkStep) {
  1266. targetIndex--;
  1267. continue;
  1268. }
  1269. break;
  1270. }
  1271. if (targetIndex >= 0) {
  1272. this.currentStep = this.steps[targetIndex].id;
  1273. }
  1274. common_vendor.index.pageScrollTo({
  1275. scrollTop: 0,
  1276. duration: 300
  1277. });
  1278. }
  1279. },
  1280. nextStep() {
  1281. if (!this.validateCurrentStep()) {
  1282. return;
  1283. }
  1284. if (this.currentStep === 1) {
  1285. this.verifyIdentity();
  1286. return;
  1287. }
  1288. const nextIndex = this.currentStepIndex + 1;
  1289. if (nextIndex < this.steps.length) {
  1290. let targetIndex = nextIndex;
  1291. while (targetIndex < this.steps.length) {
  1292. const stepId = this.steps[targetIndex].id;
  1293. console.log(this.steps[targetIndex].id);
  1294. if (stepId === 3 && !this.shouldShowFamilyStep) {
  1295. targetIndex++;
  1296. continue;
  1297. }
  1298. if (stepId === 5 && !this.shouldShowEducationStep) {
  1299. targetIndex++;
  1300. continue;
  1301. }
  1302. if (stepId === 6 && !this.shouldShowSkillsStep) {
  1303. targetIndex++;
  1304. continue;
  1305. }
  1306. if (stepId === 8 && !this.shouldShowWorkStep) {
  1307. targetIndex++;
  1308. continue;
  1309. }
  1310. break;
  1311. }
  1312. if (targetIndex < this.steps.length) {
  1313. this.currentStep = this.steps[targetIndex].id;
  1314. } else {
  1315. console.log("当前步骤是最后一个需要显示的步骤,显示提交按钮");
  1316. }
  1317. common_vendor.index.pageScrollTo({
  1318. scrollTop: 0,
  1319. duration: 300
  1320. });
  1321. }
  1322. },
  1323. // 身份验证方法
  1324. verifyIdentity() {
  1325. this.formErrors = {
  1326. name: "",
  1327. idCard: "",
  1328. phone: ""
  1329. };
  1330. common_vendor.index.showLoading({
  1331. title: "身份验证中..."
  1332. });
  1333. common_vendor.index.request({
  1334. url: `${common_config.apiBaseUrl}/wechat/identity/verify`,
  1335. method: "POST",
  1336. data: {
  1337. name: this.formData.name,
  1338. id_number: this.formData.idCard,
  1339. mobile: this.formData.phone
  1340. },
  1341. header: {
  1342. "content-type": "application/x-www-form-urlencoded"
  1343. },
  1344. success: (res) => {
  1345. common_vendor.index.hideLoading();
  1346. console.log(res);
  1347. if (res.data.code === 200) {
  1348. let targetIndex = this.currentStepIndex + 1;
  1349. while (targetIndex < this.steps.length) {
  1350. const stepId = this.steps[targetIndex].id;
  1351. if (stepId === 3 && !this.shouldShowFamilyStep) {
  1352. targetIndex++;
  1353. continue;
  1354. }
  1355. if (stepId === 5 && !this.shouldShowEducationStep) {
  1356. targetIndex++;
  1357. continue;
  1358. }
  1359. if (stepId === 6 && !this.shouldShowSkillsStep) {
  1360. targetIndex++;
  1361. continue;
  1362. }
  1363. if (stepId === 8 && !this.shouldShowWorkStep) {
  1364. targetIndex++;
  1365. continue;
  1366. }
  1367. break;
  1368. }
  1369. if (targetIndex < this.steps.length) {
  1370. this.currentStep = this.steps[targetIndex].id;
  1371. common_vendor.index.pageScrollTo({ scrollTop: 0, duration: 300 });
  1372. } else {
  1373. console.log("身份验证通过后,当前步骤是最后一个需要显示的步骤,显示提交按钮");
  1374. }
  1375. this.setUserInfo(this.formData);
  1376. } else {
  1377. this.handleVerificationError(res.data);
  1378. }
  1379. },
  1380. fail: (err) => {
  1381. this.handleRequestError(err);
  1382. }
  1383. });
  1384. },
  1385. setUserInfo(data) {
  1386. common_vendor.index.request({
  1387. url: `${common_config.apiBaseUrl}/wechat/updateUserInfo`,
  1388. method: "POST",
  1389. data: {
  1390. openid: JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid,
  1391. name: data.name,
  1392. id_card: data.idCard,
  1393. purePhoneNumber: data.phone,
  1394. tenant_id: common_vendor.index.getStorageSync("tenant_id") || JSON.parse(common_vendor.index.getStorageSync("userInfo")).tenant_id || 1,
  1395. examine: 0
  1396. },
  1397. header: {
  1398. "content-type": "application/x-www-form-urlencoded"
  1399. },
  1400. success: (res) => {
  1401. console.log(res);
  1402. }
  1403. });
  1404. },
  1405. // 处理验证错误
  1406. handleVerificationError(data) {
  1407. this.formErrors.name = "姓名验证失败,请检查姓名是否正确";
  1408. this.formErrors.idCard = "身份证号验证失败,请检查身份证号是否正确";
  1409. this.formErrors.phone = "手机号验证失败,请检查手机号是否正确";
  1410. common_vendor.index.showToast({
  1411. title: data.msg || "身份验证失败",
  1412. icon: "none"
  1413. });
  1414. },
  1415. // 处理请求错误
  1416. handleRequestError(err) {
  1417. common_vendor.index.hideLoading();
  1418. common_vendor.index.showToast({
  1419. title: "网络错误,请检查网络连接",
  1420. icon: "none",
  1421. duration: 2e3
  1422. });
  1423. console.error("请求失败:", err);
  1424. },
  1425. // 验证当前步骤的必填项
  1426. validateCurrentStep() {
  1427. var _a, _b;
  1428. let isValid = true;
  1429. switch (this.currentStep) {
  1430. case 1:
  1431. const basicFields = ["name", "gender", "phone", "idCard", "ethnic", "currentAddress"];
  1432. basicFields.forEach((field) => {
  1433. if (this.shouldValidateField(field) && !this.validateField(field, this.formData[field])) {
  1434. isValid = false;
  1435. }
  1436. });
  1437. if (this.shouldValidateField("threePeriod") && this.formData.gender === "女" && this.threePeriodIndex === -1) {
  1438. this.formErrors.threePeriod = "请选择三期状态";
  1439. isValid = false;
  1440. }
  1441. if (this.shouldValidateField("height") && this.formData.height) {
  1442. isValid = this.validateField("height", this.formData.height) && isValid;
  1443. }
  1444. if (this.shouldValidateField("weight") && this.formData.weight) {
  1445. isValid = this.validateField("weight", this.formData.weight) && isValid;
  1446. }
  1447. if (this.shouldValidateField("expectedSalary") && this.formData.expectedSalary) {
  1448. isValid = this.validateField("expectedSalary", this.formData.expectedSalary) && isValid;
  1449. }
  1450. break;
  1451. case 3:
  1452. if (this.hasUnsavedFamilyMemberForm()) {
  1453. if (!this.autoSaveFamilyMember()) {
  1454. isValid = false;
  1455. break;
  1456. }
  1457. }
  1458. console.log(this.familyMembers.length);
  1459. if (this.familyMembers.length == 0) {
  1460. common_vendor.index.showToast({
  1461. title: "请至少添加一位家庭成员",
  1462. icon: "none"
  1463. });
  1464. isValid = false;
  1465. }
  1466. break;
  1467. case 5:
  1468. if (this.hasUnsavedEducationForm()) {
  1469. if (!this.autoSaveEducation()) {
  1470. isValid = false;
  1471. break;
  1472. }
  1473. }
  1474. if (this.educationList.length === 0) {
  1475. common_vendor.index.showToast({
  1476. title: "请至少添加一项教育经历",
  1477. icon: "none"
  1478. });
  1479. isValid = false;
  1480. }
  1481. break;
  1482. case 6:
  1483. if (this.shouldValidateField("skills") && !((_a = this.formData.skills) == null ? void 0 : _a.trim())) {
  1484. this.formErrors.skills = "请描述您的专业技能";
  1485. isValid = false;
  1486. }
  1487. if (this.shouldValidateField("training") && !((_b = this.formData.training) == null ? void 0 : _b.trim())) {
  1488. this.formErrors.training = "请描述您的培训经历";
  1489. isValid = false;
  1490. }
  1491. break;
  1492. case 8:
  1493. if (this.hasUnsavedWorkForm()) {
  1494. if (!this.autoSaveWork()) {
  1495. isValid = false;
  1496. break;
  1497. }
  1498. }
  1499. if (this.workList.length === 0) {
  1500. common_vendor.index.showToast({
  1501. title: "请至少添加一项工作经历",
  1502. icon: "none"
  1503. });
  1504. isValid = false;
  1505. }
  1506. break;
  1507. }
  1508. return isValid;
  1509. },
  1510. // Add method to fetch user data
  1511. fetchUserData() {
  1512. this.isLoading = true;
  1513. const userInfo = common_vendor.index.getStorageSync("userInfo") ? JSON.parse(common_vendor.index.getStorageSync("userInfo")) : {};
  1514. const openid = userInfo.openid;
  1515. if (!openid) {
  1516. common_vendor.index.showToast({
  1517. title: "用户信息获取失败,请重新登录",
  1518. icon: "none"
  1519. });
  1520. this.isLoading = false;
  1521. return;
  1522. }
  1523. common_vendor.index.request({
  1524. 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}`,
  1525. method: "GET",
  1526. success: (res) => {
  1527. this.showPromiseModal = true;
  1528. this.populateFormData(res.data.data);
  1529. },
  1530. fail: (err) => {
  1531. },
  1532. complete: () => {
  1533. this.isLoading = false;
  1534. this.$nextTick(() => {
  1535. this.ensureValidStep();
  1536. });
  1537. }
  1538. });
  1539. },
  1540. // Add method to populate form data with fetched data
  1541. populateFormData(data) {
  1542. const { user_info, profile, educations, work_experiences, family_members } = data;
  1543. if (user_info) {
  1544. this.formData.name = user_info.name || "";
  1545. this.formData.gender = user_info.gender_text || "";
  1546. this.genderIndex = this.genderOptions.findIndex((item) => item === this.formData.gender);
  1547. this.formData.idCard = user_info.id_card || "";
  1548. this.formData.phone = user_info.phone || "";
  1549. this.formData.email = user_info.email || "";
  1550. }
  1551. if (profile) {
  1552. this.formData.political = profile.political_status || "";
  1553. this.politicalIndex = this.politicalOptions.findIndex((item) => item === this.formData.political);
  1554. this.formData.ethnic = profile.ethnicity || "";
  1555. this.ethnicIndex = this.ethnicOptions.findIndex((item) => item === this.formData.ethnic);
  1556. this.formData.height = profile.height || "";
  1557. this.formData.weight = profile.weight || "";
  1558. this.formData.nativePlace = profile.native_place || "";
  1559. this.formData.residence = profile.household_location || "";
  1560. this.formData.currentAddress = profile.current_address || "";
  1561. this.formData.marriage = profile.marital_status_text || "";
  1562. this.marriageIndex = this.marriageOptions.findIndex((item) => item === this.formData.marriage);
  1563. if (this.formData.gender === "女" && profile.female_status !== void 0) {
  1564. const femaleStatusMap = { 0: "无", 1: "孕期", 2: "产期", 3: "哺乳期" };
  1565. this.formData.threePeriod = femaleStatusMap[profile.female_status] || "无";
  1566. this.threePeriodIndex = this.threePeriodOptions.findIndex((item) => item === this.formData.threePeriod);
  1567. }
  1568. this.formData.expectedSalary = profile.expected_salary || "";
  1569. this.formData.emergencyContact = profile.emergency_contact || "";
  1570. this.formData.emergencyPhone = profile.emergency_phone || "";
  1571. this.formData.hobby = profile.specialties || "";
  1572. this.formData.motto = profile.life_motto || "";
  1573. const sourceTypeMap = {
  1574. 1: "school",
  1575. 2: "social",
  1576. 3: "social",
  1577. 4: "social",
  1578. 5: "social"
  1579. };
  1580. const socialSourceMap = {
  1581. 2: "BOSS",
  1582. 3: "zhilian",
  1583. 4: "liepin",
  1584. 5: "other"
  1585. };
  1586. this.formData.sourceType = sourceTypeMap[profile.recruitment_source] || "social";
  1587. if (this.formData.sourceType === "social") {
  1588. this.formData.socialSource = socialSourceMap[profile.recruitment_source] || "";
  1589. if (this.formData.socialSource === "other") {
  1590. this.formData.otherSocialSource = profile.recruitment_source_detail || "";
  1591. }
  1592. } else if (this.formData.sourceType === "school") {
  1593. this.formData.otherSchoolSource = profile.recruitment_source_detail || "";
  1594. }
  1595. }
  1596. if (educations && educations.length > 0) {
  1597. this.educationList = educations.map((edu) => {
  1598. const degreeMap = {
  1599. 1: "高中",
  1600. 2: "大专",
  1601. 3: "本科",
  1602. 4: "硕士",
  1603. 5: "博士"
  1604. };
  1605. return {
  1606. startTime: edu.start_date || "",
  1607. endTime: edu.end_date || "",
  1608. schoolName: edu.school_name || "",
  1609. major: edu.major || "",
  1610. degree: degreeMap[edu.degree] || ""
  1611. };
  1612. });
  1613. }
  1614. if (work_experiences && work_experiences.length > 0) {
  1615. this.workList = work_experiences.map((work) => {
  1616. return {
  1617. startTime: work.start_date || "",
  1618. endTime: work.end_date || "",
  1619. companyName: work.company_name || "",
  1620. department: work.department || "",
  1621. employeeCount: work.company_size || "",
  1622. position: work.position || "",
  1623. monthlySalary: work.monthly_salary || "",
  1624. supervisor: work.supervisor_name || "",
  1625. supervisorPhone: work.supervisor_phone || ""
  1626. };
  1627. });
  1628. }
  1629. if (family_members && family_members.length > 0) {
  1630. this.familyMembers = family_members.map((member) => {
  1631. return {
  1632. relation: member.relation || "",
  1633. name: member.name || "",
  1634. workplaceOrAddress: member.workplace || "",
  1635. position: member.position || "",
  1636. phone: member.phone || "",
  1637. isEmergencyContact: member.isEmergencyContact || false
  1638. };
  1639. });
  1640. }
  1641. },
  1642. // 处理紧急联系人开关变化
  1643. handleEmergencyContactChange(e) {
  1644. this.familyMemberForm.isEmergencyContact = e.detail.value;
  1645. if (e.detail.value) {
  1646. this.formData.emergencyContact = this.familyMemberForm.name;
  1647. this.formData.emergencyPhone = this.familyMemberForm.phone;
  1648. }
  1649. },
  1650. // 添加重置教育经历错误信息的方法
  1651. resetEducationErrors() {
  1652. this.educationErrors = {
  1653. startTime: "",
  1654. endTime: "",
  1655. schoolName: "",
  1656. major: "",
  1657. degree: ""
  1658. };
  1659. },
  1660. // 添加通用验证方法
  1661. validateField(fieldName, value) {
  1662. const rule = this.validationRules[fieldName];
  1663. if (!rule)
  1664. return true;
  1665. if (!this.shouldValidateField(fieldName)) {
  1666. return true;
  1667. }
  1668. this.formErrors[fieldName] = "";
  1669. if (rule.required && !value) {
  1670. this.formErrors[fieldName] = rule.message;
  1671. return false;
  1672. }
  1673. if (rule.pattern && value && !rule.pattern.test(value)) {
  1674. this.formErrors[fieldName] = rule.message;
  1675. return false;
  1676. }
  1677. return true;
  1678. },
  1679. validateExpectedSalary(e) {
  1680. const value = e.detail.value;
  1681. console.log(value);
  1682. if (value === "") {
  1683. this.formData.expectedSalary = "";
  1684. this.formErrors.expectedSalary = "";
  1685. return;
  1686. }
  1687. let num = parseFloat(value);
  1688. if (isNaN(num)) {
  1689. this.formErrors.expectedSalary = "请输入有效的数字";
  1690. return;
  1691. }
  1692. if (num < 0) {
  1693. num = 0;
  1694. this.formErrors.expectedSalary = "薪资不能小于0";
  1695. } else if (num > 1e5) {
  1696. num = 1e5;
  1697. this.formErrors.expectedSalary = "薪资不能超过100000";
  1698. }
  1699. this.formData.expectedSalary = num.toString();
  1700. },
  1701. validateEmployeeCount(e) {
  1702. const value = e.detail.value;
  1703. if (value === "") {
  1704. this.workForm.employeeCount = "";
  1705. this.workErrors.employeeCount = "";
  1706. return;
  1707. }
  1708. let num = parseInt(value);
  1709. if (isNaN(num)) {
  1710. this.workErrors.employeeCount = "请输入有效的数字";
  1711. return;
  1712. }
  1713. if (num < 0) {
  1714. num = 0;
  1715. this.workErrors.employeeCount = "人数不能小于0";
  1716. } else if (num > 1e4) {
  1717. num = 1e4;
  1718. this.workErrors.employeeCount = "人数不能超过10000";
  1719. }
  1720. this.workForm.employeeCount = num.toString();
  1721. },
  1722. validateMonthlySalary(e) {
  1723. const value = e.detail.value;
  1724. if (value === "") {
  1725. this.workForm.monthlySalary = "";
  1726. this.workErrors.monthlySalary = "";
  1727. return;
  1728. }
  1729. let num = parseInt(value);
  1730. if (isNaN(num)) {
  1731. this.workErrors.monthlySalary = "请输入有效的数字";
  1732. return;
  1733. }
  1734. if (num < 0) {
  1735. num = 0;
  1736. this.workErrors.monthlySalary = "月总收入不能小于0";
  1737. } else if (num > 1e5) {
  1738. num = 1e5;
  1739. this.workErrors.monthlySalary = "月总收入不能超过100000";
  1740. } else {
  1741. this.workErrors.monthlySalary = "";
  1742. }
  1743. this.workForm.monthlySalary = num.toString();
  1744. },
  1745. // 添加手机号验证方法
  1746. validatePhone(e) {
  1747. const value = e.detail.value;
  1748. if (value.length > 11) {
  1749. this.formData.phone = value.slice(0, 11);
  1750. }
  1751. if (value && !/^1[3-9]\d{0,9}$/.test(value)) {
  1752. this.formErrors.phone = "请输入正确的手机号码";
  1753. } else {
  1754. this.formErrors.phone = "";
  1755. }
  1756. },
  1757. // 检查是否有未保存的家庭成员表单
  1758. hasUnsavedFamilyMemberForm() {
  1759. return this.familyMemberForm.relation || this.familyMemberForm.name || this.familyMemberForm.workplaceOrAddress || this.familyMemberForm.position || this.familyMemberForm.phone;
  1760. },
  1761. // 检查是否有未保存的教育经历表单
  1762. hasUnsavedEducationForm() {
  1763. return this.educationForm.startTime || this.educationForm.endTime || this.educationForm.schoolName || this.educationForm.major || this.educationForm.degree;
  1764. },
  1765. // 检查是否有未保存的工作经历表单
  1766. hasUnsavedWorkForm() {
  1767. 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;
  1768. },
  1769. // 自动保存家庭成员
  1770. autoSaveFamilyMember() {
  1771. this.resetFamilyMemberErrors();
  1772. let isValid = true;
  1773. if (this.shouldValidateField("relation", "family") && !this.familyMemberForm.relation) {
  1774. this.familyMemberErrors.relation = "请输入称谓";
  1775. isValid = false;
  1776. }
  1777. if (this.shouldValidateField("name", "family") && !this.familyMemberForm.name) {
  1778. this.familyMemberErrors.name = "请输入姓名";
  1779. isValid = false;
  1780. }
  1781. if (!isValid) {
  1782. common_vendor.index.showToast({
  1783. title: "请完善家庭成员必填信息",
  1784. icon: "none"
  1785. });
  1786. return false;
  1787. }
  1788. if (this.isEditing) {
  1789. this.familyMembers[this.editingIndex] = { ...this.familyMemberForm };
  1790. this.isEditing = false;
  1791. this.editingIndex = -1;
  1792. } else {
  1793. this.familyMembers.push({ ...this.familyMemberForm });
  1794. }
  1795. this.resetFamilyMemberForm();
  1796. common_vendor.index.showToast({
  1797. title: "已自动保存",
  1798. icon: "success",
  1799. duration: 1500
  1800. });
  1801. return true;
  1802. },
  1803. // 自动保存教育经历
  1804. autoSaveEducation() {
  1805. this.resetEducationErrors();
  1806. let isValid = true;
  1807. if (this.shouldValidateField("startTime", "education") && !this.educationForm.startTime) {
  1808. this.educationErrors.startTime = "请选择开始时间";
  1809. isValid = false;
  1810. }
  1811. if (this.shouldValidateField("endTime", "education") && !this.educationForm.endTime) {
  1812. this.educationErrors.endTime = "请选择结束时间";
  1813. isValid = false;
  1814. }
  1815. if (this.shouldValidateField("schoolName", "education") && !this.educationForm.schoolName) {
  1816. this.educationErrors.schoolName = "请输入学校名称";
  1817. isValid = false;
  1818. }
  1819. if (this.shouldValidateField("major", "education") && !this.educationForm.major) {
  1820. this.educationErrors.major = "请输入专业";
  1821. isValid = false;
  1822. }
  1823. if (this.shouldValidateField("degree", "education") && !this.educationForm.degree) {
  1824. this.educationErrors.degree = "请选择学历";
  1825. isValid = false;
  1826. }
  1827. if (!isValid) {
  1828. common_vendor.index.showToast({
  1829. title: "请完善教育经历必填信息",
  1830. icon: "none"
  1831. });
  1832. return false;
  1833. }
  1834. if (this.isEditingEducation) {
  1835. this.educationList[this.editingEducationIndex] = { ...this.educationForm };
  1836. this.isEditingEducation = false;
  1837. this.editingEducationIndex = -1;
  1838. } else {
  1839. this.educationList.push({ ...this.educationForm });
  1840. }
  1841. this.educationForm = {
  1842. startTime: "",
  1843. endTime: "",
  1844. schoolName: "",
  1845. major: "",
  1846. degree: ""
  1847. };
  1848. this.degreeIndex = -1;
  1849. common_vendor.index.showToast({
  1850. title: "已自动保存",
  1851. icon: "success",
  1852. duration: 1500
  1853. });
  1854. return true;
  1855. },
  1856. // 自动保存工作经历
  1857. autoSaveWork() {
  1858. this.workErrors = {
  1859. startTime: "",
  1860. endTime: "",
  1861. companyName: "",
  1862. department: "",
  1863. position: "",
  1864. employeeCount: "",
  1865. monthlySalary: "",
  1866. supervisor: "",
  1867. supervisorPhone: ""
  1868. };
  1869. let isValid = true;
  1870. if (this.shouldValidateField("startTime", "work") && !this.workForm.startTime) {
  1871. this.workErrors.startTime = "请选择开始时间";
  1872. isValid = false;
  1873. }
  1874. if (this.shouldValidateField("endTime", "work") && !this.workForm.endTime) {
  1875. this.workErrors.endTime = "请选择结束时间";
  1876. isValid = false;
  1877. }
  1878. if (this.shouldValidateField("companyName", "work") && !this.workForm.companyName) {
  1879. this.workErrors.companyName = "请输入单位名称";
  1880. isValid = false;
  1881. }
  1882. if (this.shouldValidateField("employeeCount", "work") && !this.workForm.employeeCount) {
  1883. this.workErrors.employeeCount = "请输入单位人数";
  1884. isValid = false;
  1885. }
  1886. if (this.shouldValidateField("department", "work") && !this.workForm.department) {
  1887. this.workErrors.department = "请输入任职部门";
  1888. isValid = false;
  1889. }
  1890. if (this.shouldValidateField("position", "work") && !this.workForm.position) {
  1891. this.workErrors.position = "请输入担任职务";
  1892. isValid = false;
  1893. }
  1894. if (this.shouldValidateField("employeeCount", "work") && !this.workForm.employeeCount) {
  1895. this.workErrors.employeeCount = "请输入单位人数";
  1896. isValid = false;
  1897. }
  1898. if (this.shouldValidateField("monthlySalary", "work") && !this.workForm.monthlySalary) {
  1899. this.workErrors.monthlySalary = "请输入月总收入";
  1900. isValid = false;
  1901. }
  1902. if (!isValid) {
  1903. common_vendor.index.showToast({
  1904. title: "请完善工作经历必填信息",
  1905. icon: "none"
  1906. });
  1907. return false;
  1908. }
  1909. if (this.isEditingWork) {
  1910. this.workList[this.editingWorkIndex] = { ...this.workForm };
  1911. this.isEditingWork = false;
  1912. this.editingWorkIndex = -1;
  1913. } else {
  1914. this.workList.push({ ...this.workForm });
  1915. }
  1916. this.workForm = {
  1917. startTime: "",
  1918. endTime: "",
  1919. companyName: "",
  1920. department: "",
  1921. employeeCount: "",
  1922. position: "",
  1923. monthlySalary: "",
  1924. supervisor: "",
  1925. supervisorPhone: ""
  1926. };
  1927. common_vendor.index.showToast({
  1928. title: "已自动保存",
  1929. icon: "success",
  1930. duration: 1500
  1931. });
  1932. return true;
  1933. },
  1934. // 自动保存所有未保存的表单
  1935. autoSaveAllUnsavedForms() {
  1936. if (this.hasUnsavedFamilyMemberForm()) {
  1937. this.autoSaveFamilyMember();
  1938. }
  1939. if (this.hasUnsavedEducationForm()) {
  1940. this.autoSaveEducation();
  1941. }
  1942. if (this.hasUnsavedWorkForm()) {
  1943. this.autoSaveWork();
  1944. }
  1945. }
  1946. },
  1947. // 添加监听器来清除错误信息
  1948. watch: {
  1949. "formData.name": function(newVal) {
  1950. if (newVal && this.formErrors.name) {
  1951. this.formErrors.name = "";
  1952. }
  1953. },
  1954. "formData.idCard": function(newVal) {
  1955. if (newVal && this.formErrors.idCard) {
  1956. this.formErrors.idCard = "";
  1957. }
  1958. },
  1959. "formData.phone": function(newVal) {
  1960. if (newVal && this.formErrors.phone) {
  1961. this.formErrors.phone = "";
  1962. }
  1963. },
  1964. "formData.gender": function(newVal) {
  1965. if (newVal && this.formErrors.gender) {
  1966. this.formErrors.gender = "";
  1967. }
  1968. },
  1969. "formData.ethnic": function(newVal) {
  1970. if (newVal && this.formErrors.ethnic) {
  1971. this.formErrors.ethnic = "";
  1972. }
  1973. },
  1974. "formData.currentAddress": function(newVal) {
  1975. if (newVal && this.formErrors.currentAddress) {
  1976. this.formErrors.currentAddress = "";
  1977. }
  1978. },
  1979. "formData.height": function(newVal) {
  1980. if (newVal && this.formErrors.height) {
  1981. this.formErrors.height = "";
  1982. }
  1983. },
  1984. "formData.weight": function(newVal) {
  1985. if (newVal && this.formErrors.weight) {
  1986. this.formErrors.weight = "";
  1987. }
  1988. },
  1989. "formData.expectedSalary": function(newVal) {
  1990. if (newVal && this.formErrors.expectedSalary) {
  1991. this.formErrors.expectedSalary = "";
  1992. }
  1993. },
  1994. "familyMemberForm.relation": function(newVal) {
  1995. if (newVal)
  1996. this.familyMemberErrors.relation = "";
  1997. },
  1998. "familyMemberForm.name": function(newVal) {
  1999. if (newVal)
  2000. this.familyMemberErrors.name = "";
  2001. },
  2002. "familyMemberForm.phone": function(newVal) {
  2003. if (newVal)
  2004. this.familyMemberErrors.phone = "";
  2005. },
  2006. /* 'familyMemberForm.workplaceOrAddress': function(newVal) {
  2007. if (newVal) this.familyMemberErrors.workplaceOrAddress = '';
  2008. },
  2009. 'familyMemberForm.position': function(newVal) {
  2010. if (newVal) this.familyMemberErrors.position = '';
  2011. }, */
  2012. "workForm.companyName": function(newVal) {
  2013. if (newVal && this.workErrors.companyName) {
  2014. this.workErrors.companyName = "";
  2015. }
  2016. },
  2017. "workForm.department": function(newVal) {
  2018. if (newVal && this.workErrors.department) {
  2019. this.workErrors.department = "";
  2020. }
  2021. },
  2022. "workForm.position": function(newVal) {
  2023. if (newVal && this.workErrors.position) {
  2024. this.workErrors.position = "";
  2025. }
  2026. },
  2027. "workForm.employeeCount": function(newVal) {
  2028. if (newVal && this.workErrors.employeeCount) {
  2029. this.workErrors.employeeCount = "";
  2030. }
  2031. },
  2032. "workForm.monthlySalary": function(newVal) {
  2033. if (newVal && this.workErrors.monthlySalary) {
  2034. this.workErrors.monthlySalary = "";
  2035. }
  2036. },
  2037. "workForm.supervisor": function(newVal) {
  2038. if (newVal && this.workErrors.supervisor) {
  2039. this.workErrors.supervisor = "";
  2040. }
  2041. },
  2042. // 'workForm.supervisorPhone': function(newVal) {
  2043. // if (newVal && this.workErrors.supervisorPhone) {
  2044. // this.workErrors.supervisorPhone = '';
  2045. // }
  2046. // },
  2047. "formData.training": function(newVal) {
  2048. if (newVal && this.formErrors.training) {
  2049. this.formErrors.training = "";
  2050. }
  2051. },
  2052. "educationForm.startTime": function(newVal) {
  2053. if (newVal)
  2054. this.educationErrors.startTime = "";
  2055. },
  2056. "educationForm.endTime": function(newVal) {
  2057. if (newVal)
  2058. this.educationErrors.endTime = "";
  2059. },
  2060. "educationForm.schoolName": function(newVal) {
  2061. if (newVal)
  2062. this.educationErrors.schoolName = "";
  2063. },
  2064. "educationForm.major": function(newVal) {
  2065. if (newVal)
  2066. this.educationErrors.major = "";
  2067. },
  2068. "educationForm.degree": function(newVal) {
  2069. if (newVal)
  2070. this.educationErrors.degree = "";
  2071. },
  2072. // 添加对表单字段的实时验证
  2073. "formData": {
  2074. handler(newVal) {
  2075. const currentStepFields = {
  2076. 1: ["name", "gender", "phone", "idCard", "ethnic", "currentAddress", "height", "weight", "expectedSalary"],
  2077. 6: ["skills", "training"]
  2078. }[this.currentStep];
  2079. if (currentStepFields) {
  2080. currentStepFields.forEach((field) => {
  2081. if (newVal[field] !== void 0 && this.shouldValidateField(field)) {
  2082. this.validateField(field, newVal[field]);
  2083. }
  2084. });
  2085. }
  2086. },
  2087. deep: true
  2088. }
  2089. }
  2090. };
  2091. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  2092. return common_vendor.e({
  2093. a: $data.isLoading
  2094. }, $data.isLoading ? {} : {}, {
  2095. b: $data.showPromiseModal
  2096. }, $data.showPromiseModal ? {
  2097. c: $data.promiseChecked,
  2098. d: common_vendor.o((...args) => $options.togglePromiseChecked && $options.togglePromiseChecked(...args)),
  2099. e: !$data.promiseChecked,
  2100. f: common_vendor.o((...args) => $options.confirmPromise && $options.confirmPromise(...args))
  2101. } : {}, {
  2102. g: $data.currentStep === 1
  2103. }, $data.currentStep === 1 ? common_vendor.e({
  2104. h: $options.showNameField
  2105. }, $options.showNameField ? common_vendor.e({
  2106. i: $data.formErrors.name ? 1 : "",
  2107. j: $data.formData.name,
  2108. k: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
  2109. l: $data.formErrors.name
  2110. }, $data.formErrors.name ? {
  2111. m: common_vendor.t($data.formErrors.name)
  2112. } : {}) : {}, {
  2113. n: $options.showGenderField
  2114. }, $options.showGenderField ? common_vendor.e({
  2115. o: common_vendor.t($data.genderOptions[$data.genderIndex] || "请选择性别"),
  2116. p: $data.formErrors.gender ? 1 : "",
  2117. q: common_vendor.o((...args) => $options.bindGenderChange && $options.bindGenderChange(...args)),
  2118. r: $data.genderIndex,
  2119. s: $data.genderOptions,
  2120. t: $data.formErrors.gender
  2121. }, $data.formErrors.gender ? {
  2122. v: common_vendor.t($data.formErrors.gender)
  2123. } : {}) : {}, {
  2124. w: $data.formData.gender === "女"
  2125. }, $data.formData.gender === "女" ? common_vendor.e({
  2126. x: common_vendor.t($data.threePeriodOptions[$data.threePeriodIndex] || "请选择"),
  2127. y: common_vendor.o((...args) => $options.bindThreePeriodChange && $options.bindThreePeriodChange(...args)),
  2128. z: $data.threePeriodIndex,
  2129. A: $data.threePeriodOptions,
  2130. B: $data.formErrors.threePeriod ? 1 : "",
  2131. C: $data.formErrors.threePeriod
  2132. }, $data.formErrors.threePeriod ? {
  2133. D: common_vendor.t($data.formErrors.threePeriod)
  2134. } : {}) : {}, {
  2135. E: $options.showPhoneField
  2136. }, $options.showPhoneField ? common_vendor.e({
  2137. F: $data.formErrors.phone ? 1 : "",
  2138. G: common_vendor.o([($event) => $data.formData.phone = $event.detail.value, (...args) => $options.validatePhone && $options.validatePhone(...args)]),
  2139. H: $data.formData.phone,
  2140. I: $data.formErrors.phone
  2141. }, $data.formErrors.phone ? {
  2142. J: common_vendor.t($data.formErrors.phone)
  2143. } : {}) : {}, {
  2144. K: $options.showIdCardField
  2145. }, $options.showIdCardField ? common_vendor.e({
  2146. L: $data.formErrors.idCard ? 1 : "",
  2147. M: $data.formData.idCard,
  2148. N: common_vendor.o(($event) => $data.formData.idCard = $event.detail.value),
  2149. O: $data.formErrors.idCard
  2150. }, $data.formErrors.idCard ? {
  2151. P: common_vendor.t($data.formErrors.idCard)
  2152. } : {}) : {}, {
  2153. Q: $options.showEthnicField
  2154. }, $options.showEthnicField ? common_vendor.e({
  2155. R: common_vendor.t($data.ethnicOptions[$data.ethnicIndex] || "请选择民族"),
  2156. S: $data.formErrors.ethnic ? 1 : "",
  2157. T: common_vendor.o((...args) => $options.bindEthnicChange && $options.bindEthnicChange(...args)),
  2158. U: $data.ethnicIndex,
  2159. V: $data.ethnicOptions,
  2160. W: $data.formErrors.ethnic
  2161. }, $data.formErrors.ethnic ? {
  2162. X: common_vendor.t($data.formErrors.ethnic)
  2163. } : {}) : {}, {
  2164. Y: $options.showHeightField
  2165. }, $options.showHeightField ? {
  2166. Z: common_vendor.o([($event) => $data.formData.height = $event.detail.value, ($event) => $options.handleInput($event, "height", 2)]),
  2167. aa: common_vendor.o(($event) => $options.handleBlur("height")),
  2168. ab: $data.formData.height
  2169. } : {}, {
  2170. ac: $options.showWeightField
  2171. }, $options.showWeightField ? {
  2172. ad: common_vendor.o([($event) => $data.formData.weight = $event.detail.value, ($event) => $options.handleInput($event, "weight", 2)]),
  2173. ae: common_vendor.o(($event) => $options.handleBlur("weight")),
  2174. af: $data.formData.weight
  2175. } : {}, {
  2176. ag: $options.showCurrentAddress
  2177. }, $options.showCurrentAddress ? common_vendor.e({
  2178. ah: $data.formErrors.currentAddress ? 1 : "",
  2179. ai: $data.formData.currentAddress,
  2180. aj: common_vendor.o(($event) => $data.formData.currentAddress = $event.detail.value),
  2181. ak: $data.formErrors.currentAddress
  2182. }, $data.formErrors.currentAddress ? {
  2183. al: common_vendor.t($data.formErrors.currentAddress)
  2184. } : {}) : {}, {
  2185. am: $options.showResidence
  2186. }, $options.showResidence ? {
  2187. an: $data.formData.residence,
  2188. ao: common_vendor.o(($event) => $data.formData.residence = $event.detail.value)
  2189. } : {}, {
  2190. ap: $options.showMarriageIndex
  2191. }, $options.showMarriageIndex ? {
  2192. aq: common_vendor.t($data.marriageOptions[$data.marriageIndex] || "请选择婚育状况"),
  2193. ar: common_vendor.o((...args) => $options.bindMarriageChange && $options.bindMarriageChange(...args)),
  2194. as: $data.marriageIndex,
  2195. at: $data.marriageOptions
  2196. } : {}, {
  2197. av: $options.showExpectedSalary
  2198. }, $options.showExpectedSalary ? common_vendor.e({
  2199. aw: common_vendor.o((...args) => $options.validateExpectedSalary && $options.validateExpectedSalary(...args)),
  2200. ax: $data.formErrors.expectedSalary ? 1 : "",
  2201. ay: $data.formData.expectedSalary,
  2202. az: common_vendor.o(($event) => $data.formData.expectedSalary = $event.detail.value),
  2203. aA: $data.formErrors.expectedSalary
  2204. }, $data.formErrors.expectedSalary ? {
  2205. aB: common_vendor.t($data.formErrors.expectedSalary)
  2206. } : {}) : {}) : {}, {
  2207. aC: $data.currentStep === 3
  2208. }, $data.currentStep === 3 ? common_vendor.e({
  2209. aD: $data.familyMembers.length > 0
  2210. }, $data.familyMembers.length > 0 ? {
  2211. aE: common_vendor.f($data.familyMembers, (member, index, i0) => {
  2212. return common_vendor.e({
  2213. a: common_vendor.t(index + 1),
  2214. b: common_vendor.o(($event) => $options.editFamilyMember(index), index),
  2215. c: common_vendor.o(($event) => $options.deleteFamilyMember(index), index)
  2216. }, $options.showFamilyRelationField ? {
  2217. d: common_vendor.t(member.relation)
  2218. } : {}, $options.showFamilyNameField ? {
  2219. e: common_vendor.t(member.name)
  2220. } : {}, $options.showFamilyWorkplaceField ? {
  2221. f: common_vendor.t(member.workplaceOrAddress)
  2222. } : {}, $options.showFamilyPositionField ? {
  2223. g: common_vendor.t(member.position)
  2224. } : {}, $options.showFamilyPhoneField ? {
  2225. h: common_vendor.t(member.phone)
  2226. } : {}, {
  2227. i: common_vendor.t(member.isEmergencyContact ? "是" : "否"),
  2228. j: index
  2229. });
  2230. }),
  2231. aF: $options.showFamilyRelationField,
  2232. aG: $options.showFamilyNameField,
  2233. aH: $options.showFamilyWorkplaceField,
  2234. aI: $options.showFamilyPositionField,
  2235. aJ: $options.showFamilyPhoneField
  2236. } : {}, {
  2237. aK: common_vendor.t($data.isEditing ? "编辑家庭成员" : "添加家庭成员"),
  2238. aL: $data.isEditing
  2239. }, $data.isEditing ? {
  2240. aM: common_vendor.o((...args) => $options.cancelEdit && $options.cancelEdit(...args))
  2241. } : {}, {
  2242. aN: $options.showFamilyRelationField
  2243. }, $options.showFamilyRelationField ? common_vendor.e({
  2244. aO: $data.familyMemberErrors.relation ? 1 : "",
  2245. aP: $data.familyMemberForm.relation,
  2246. aQ: common_vendor.o(($event) => $data.familyMemberForm.relation = $event.detail.value),
  2247. aR: $data.familyMemberErrors.relation
  2248. }, $data.familyMemberErrors.relation ? {
  2249. aS: common_vendor.t($data.familyMemberErrors.relation)
  2250. } : {}) : {}, {
  2251. aT: $options.showFamilyNameField
  2252. }, $options.showFamilyNameField ? common_vendor.e({
  2253. aU: $data.familyMemberErrors.name ? 1 : "",
  2254. aV: $data.familyMemberForm.name,
  2255. aW: common_vendor.o(($event) => $data.familyMemberForm.name = $event.detail.value),
  2256. aX: $data.familyMemberErrors.name
  2257. }, $data.familyMemberErrors.name ? {
  2258. aY: common_vendor.t($data.familyMemberErrors.name)
  2259. } : {}) : {}, {
  2260. aZ: $options.showFamilyWorkplaceField
  2261. }, $options.showFamilyWorkplaceField ? {
  2262. ba: $data.familyMemberForm.workplaceOrAddress,
  2263. bb: common_vendor.o(($event) => $data.familyMemberForm.workplaceOrAddress = $event.detail.value)
  2264. } : {}, {
  2265. bc: $options.showFamilyPositionField
  2266. }, $options.showFamilyPositionField ? {
  2267. bd: $data.familyMemberForm.position,
  2268. be: common_vendor.o(($event) => $data.familyMemberForm.position = $event.detail.value)
  2269. } : {}, {
  2270. bf: $options.showFamilyPhoneField
  2271. }, $options.showFamilyPhoneField ? common_vendor.e({
  2272. bg: common_vendor.o([($event) => $data.familyMemberForm.phone = $event.detail.value, (...args) => $options.validatePhone && $options.validatePhone(...args)]),
  2273. bh: $data.familyMemberErrors.phone ? 1 : "",
  2274. bi: $data.familyMemberForm.phone,
  2275. bj: $data.familyMemberErrors.phone
  2276. }, $data.familyMemberErrors.phone ? {
  2277. bk: common_vendor.t($data.familyMemberErrors.phone)
  2278. } : {}) : {}, {
  2279. bl: $options.showFamilyisEmergency
  2280. }, $options.showFamilyisEmergency ? {
  2281. bm: $data.familyMemberForm.isEmergencyContact,
  2282. bn: common_vendor.o((...args) => $options.handleEmergencyContactChange && $options.handleEmergencyContactChange(...args))
  2283. } : {}, {
  2284. bo: common_vendor.t($data.isEditing ? "✓" : "+"),
  2285. bp: common_vendor.o((...args) => $options.saveFamilyMember && $options.saveFamilyMember(...args)),
  2286. bq: common_vendor.t($data.isEditing ? "保存修改" : "添加成员")
  2287. }) : {}, {
  2288. br: $data.currentStep === 5
  2289. }, $data.currentStep === 5 ? common_vendor.e({
  2290. bs: $data.educationList.length > 0
  2291. }, $data.educationList.length > 0 ? {
  2292. bt: common_vendor.f($data.educationList, (edu, index, i0) => {
  2293. return common_vendor.e({
  2294. a: common_vendor.t(index === 0 ? "第一学历" : "最高学历"),
  2295. b: common_vendor.o(($event) => $options.editEducation(index), index),
  2296. c: common_vendor.o(($event) => $options.deleteEducation(index), index)
  2297. }, $options.showEducationTimeField ? {
  2298. d: common_vendor.t(edu.startTime),
  2299. e: common_vendor.t(edu.endTime)
  2300. } : {}, $options.showEducationSchoolField ? {
  2301. f: common_vendor.t(edu.schoolName)
  2302. } : {}, $options.showEducationMajorField ? {
  2303. g: common_vendor.t(edu.major)
  2304. } : {}, $options.showEducationDegreeField ? {
  2305. h: common_vendor.t(edu.degree)
  2306. } : {}, {
  2307. i: index
  2308. });
  2309. }),
  2310. bv: $options.showEducationTimeField,
  2311. bw: $options.showEducationSchoolField,
  2312. bx: $options.showEducationMajorField,
  2313. by: $options.showEducationDegreeField
  2314. } : {}, {
  2315. bz: $data.educationList.length < 2 || $data.isEditingEducation
  2316. }, $data.educationList.length < 2 || $data.isEditingEducation ? common_vendor.e({
  2317. bA: common_vendor.t($data.isEditingEducation ? "编辑教育经历" : $data.educationList.length === 0 ? "添加第一学历" : "添加最高学历"),
  2318. bB: $data.isEditingEducation
  2319. }, $data.isEditingEducation ? {
  2320. bC: common_vendor.o((...args) => $options.cancelEditEducation && $options.cancelEditEducation(...args))
  2321. } : {}, {
  2322. bD: $options.showEducationTimeField
  2323. }, $options.showEducationTimeField ? common_vendor.e({
  2324. bE: common_vendor.t($data.educationForm.startTime || "开始时间"),
  2325. bF: $data.educationForm.startTime,
  2326. bG: common_vendor.o((...args) => $options.bindStartTimeChange && $options.bindStartTimeChange(...args)),
  2327. bH: $data.educationErrors.startTime ? 1 : "",
  2328. bI: common_vendor.t($data.educationForm.endTime || "结束时间"),
  2329. bJ: $data.educationForm.endTime,
  2330. bK: common_vendor.o((...args) => $options.bindEndTimeChange && $options.bindEndTimeChange(...args)),
  2331. bL: $data.educationErrors.endTime ? 1 : "",
  2332. bM: $data.educationErrors.startTime
  2333. }, $data.educationErrors.startTime ? {
  2334. bN: common_vendor.t($data.educationErrors.startTime)
  2335. } : {}, {
  2336. bO: $data.educationErrors.endTime
  2337. }, $data.educationErrors.endTime ? {
  2338. bP: common_vendor.t($data.educationErrors.endTime)
  2339. } : {}) : {}, {
  2340. bQ: $options.showEducationSchoolField
  2341. }, $options.showEducationSchoolField ? common_vendor.e({
  2342. bR: $data.educationErrors.schoolName ? 1 : "",
  2343. bS: $data.educationForm.schoolName,
  2344. bT: common_vendor.o(($event) => $data.educationForm.schoolName = $event.detail.value),
  2345. bU: $data.educationErrors.schoolName
  2346. }, $data.educationErrors.schoolName ? {
  2347. bV: common_vendor.t($data.educationErrors.schoolName)
  2348. } : {}) : {}, {
  2349. bW: $options.showEducationMajorField
  2350. }, $options.showEducationMajorField ? common_vendor.e({
  2351. bX: $data.educationErrors.major ? 1 : "",
  2352. bY: $data.educationForm.major,
  2353. bZ: common_vendor.o(($event) => $data.educationForm.major = $event.detail.value),
  2354. ca: $data.educationErrors.major
  2355. }, $data.educationErrors.major ? {
  2356. cb: common_vendor.t($data.educationErrors.major)
  2357. } : {}) : {}, {
  2358. cc: $options.showEducationDegreeField
  2359. }, $options.showEducationDegreeField ? common_vendor.e({
  2360. cd: common_vendor.t($data.degreeOptions[$data.degreeIndex] || "请选择学历"),
  2361. ce: common_vendor.o((...args) => $options.bindDegreeChange && $options.bindDegreeChange(...args)),
  2362. cf: $data.degreeIndex,
  2363. cg: $data.degreeOptions,
  2364. ch: $data.educationErrors.degree ? 1 : "",
  2365. ci: $data.educationErrors.degree
  2366. }, $data.educationErrors.degree ? {
  2367. cj: common_vendor.t($data.educationErrors.degree)
  2368. } : {}) : {}, {
  2369. ck: common_vendor.t($data.isEditingEducation ? "✓" : "+"),
  2370. cl: common_vendor.o((...args) => $options.saveEducation && $options.saveEducation(...args)),
  2371. cm: common_vendor.t($data.isEditingEducation ? "保存修改" : "添加学历")
  2372. }) : {}) : {}, {
  2373. cn: $data.currentStep === 6 && ($options.showRequireTrainingInfoField || $options.showRequireProfessionalSkillsField)
  2374. }, $data.currentStep === 6 && ($options.showRequireTrainingInfoField || $options.showRequireProfessionalSkillsField) ? common_vendor.e({
  2375. co: $options.showRequireTrainingInfoField
  2376. }, $options.showRequireTrainingInfoField ? {} : {}, {
  2377. cp: $options.showRequireTrainingInfoField
  2378. }, $options.showRequireTrainingInfoField ? common_vendor.e({
  2379. cq: $data.formErrors.skills ? 1 : "",
  2380. cr: $data.formData.skills,
  2381. cs: common_vendor.o(($event) => $data.formData.skills = $event.detail.value),
  2382. ct: $data.formErrors.skills
  2383. }, $data.formErrors.skills ? {
  2384. cv: common_vendor.t($data.formErrors.skills)
  2385. } : {}) : {}, {
  2386. cw: $options.showRequireProfessionalSkillsField
  2387. }, $options.showRequireProfessionalSkillsField ? {} : {}, {
  2388. cx: $options.showRequireProfessionalSkillsField
  2389. }, $options.showRequireProfessionalSkillsField ? common_vendor.e({
  2390. cy: $data.formErrors.training ? 1 : "",
  2391. cz: $data.formData.training,
  2392. cA: common_vendor.o(($event) => $data.formData.training = $event.detail.value),
  2393. cB: $data.formErrors.training
  2394. }, $data.formErrors.training ? {
  2395. cC: common_vendor.t($data.formErrors.training)
  2396. } : {}) : {}) : {}, {
  2397. cD: $data.currentStep === 8
  2398. }, $data.currentStep === 8 ? common_vendor.e({
  2399. cE: $data.workList.length > 0
  2400. }, $data.workList.length > 0 ? {
  2401. cF: common_vendor.f($data.workList, (work, index, i0) => {
  2402. return common_vendor.e({
  2403. a: common_vendor.t(index + 1),
  2404. b: common_vendor.o(($event) => $options.editWork(index), index),
  2405. c: common_vendor.o(($event) => $options.deleteWork(index), index)
  2406. }, $options.showWorkTimeField ? {
  2407. d: common_vendor.t(work.startTime),
  2408. e: common_vendor.t(work.endTime)
  2409. } : {}, $options.showWorkCompanyField ? {
  2410. f: common_vendor.t(work.companyName)
  2411. } : {}, $options.showWorkDepartmentField ? {
  2412. g: common_vendor.t(work.department)
  2413. } : {}, $options.showWorkEmployeeCountField ? {
  2414. h: common_vendor.t(work.employeeCount)
  2415. } : {}, $options.showWorkPositionField ? {
  2416. i: common_vendor.t(work.position)
  2417. } : {}, $options.showWorkMonthlySalary ? {
  2418. j: common_vendor.t(work.monthlySalary)
  2419. } : {}, $options.showWorkSupervisor ? {
  2420. k: common_vendor.t(work.supervisor)
  2421. } : {}, $options.showWorkSupervisorPhone ? {
  2422. l: common_vendor.t(work.supervisorPhone)
  2423. } : {}, {
  2424. m: index
  2425. });
  2426. }),
  2427. cG: $options.showWorkTimeField,
  2428. cH: $options.showWorkCompanyField,
  2429. cI: $options.showWorkDepartmentField,
  2430. cJ: $options.showWorkEmployeeCountField,
  2431. cK: $options.showWorkPositionField,
  2432. cL: $options.showWorkMonthlySalary,
  2433. cM: $options.showWorkSupervisor,
  2434. cN: $options.showWorkSupervisorPhone
  2435. } : {}, {
  2436. cO: $data.workList.length < 2 || $data.isEditingWork
  2437. }, $data.workList.length < 2 || $data.isEditingWork ? common_vendor.e({
  2438. cP: common_vendor.t($data.isEditingWork ? "编辑工作经历" : "添加工作经历"),
  2439. cQ: $data.isEditingWork
  2440. }, $data.isEditingWork ? {
  2441. cR: common_vendor.o((...args) => $options.cancelEditWork && $options.cancelEditWork(...args))
  2442. } : {}, {
  2443. cS: $options.showWorkTimeField
  2444. }, $options.showWorkTimeField ? common_vendor.e({
  2445. cT: common_vendor.t($data.workForm.startTime || "开始时间"),
  2446. cU: $data.workForm.startTime,
  2447. cV: common_vendor.o((...args) => $options.bindWorkStartTimeChange && $options.bindWorkStartTimeChange(...args)),
  2448. cW: $data.workErrors.startTime ? 1 : "",
  2449. cX: common_vendor.t($data.workForm.endTime || "结束时间"),
  2450. cY: $data.workForm.endTime,
  2451. cZ: common_vendor.o((...args) => $options.bindWorkEndTimeChange && $options.bindWorkEndTimeChange(...args)),
  2452. da: $data.workErrors.endTime ? 1 : "",
  2453. db: $data.workErrors.startTime
  2454. }, $data.workErrors.startTime ? {
  2455. dc: common_vendor.t($data.workErrors.startTime)
  2456. } : {}, {
  2457. dd: $data.workErrors.endTime
  2458. }, $data.workErrors.endTime ? {
  2459. de: common_vendor.t($data.workErrors.endTime)
  2460. } : {}) : {}, {
  2461. df: $options.showWorkCompanyField
  2462. }, $options.showWorkCompanyField ? common_vendor.e({
  2463. dg: $data.workErrors.companyName ? 1 : "",
  2464. dh: $data.workForm.companyName,
  2465. di: common_vendor.o(($event) => $data.workForm.companyName = $event.detail.value),
  2466. dj: $data.workErrors.companyName
  2467. }, $data.workErrors.companyName ? {
  2468. dk: common_vendor.t($data.workErrors.companyName)
  2469. } : {}) : {}, {
  2470. dl: $options.showWorkEmployeeCountField
  2471. }, $options.showWorkEmployeeCountField ? common_vendor.e({
  2472. dm: $data.workErrors.employeeCount ? 1 : "",
  2473. dn: common_vendor.o((...args) => $options.validateEmployeeCount && $options.validateEmployeeCount(...args)),
  2474. dp: $data.workForm.employeeCount,
  2475. dq: common_vendor.o(($event) => $data.workForm.employeeCount = $event.detail.value),
  2476. dr: $data.workErrors.employeeCount
  2477. }, $data.workErrors.employeeCount ? {
  2478. ds: common_vendor.t($data.workErrors.employeeCount)
  2479. } : {}) : {}, {
  2480. dt: $options.showWorkDepartmentField
  2481. }, $options.showWorkDepartmentField ? common_vendor.e({
  2482. dv: $data.workErrors.department ? 1 : "",
  2483. dw: $data.workForm.department,
  2484. dx: common_vendor.o(($event) => $data.workForm.department = $event.detail.value),
  2485. dy: $data.workErrors.department
  2486. }, $data.workErrors.department ? {
  2487. dz: common_vendor.t($data.workErrors.department)
  2488. } : {}) : {}, {
  2489. dA: $options.showWorkPositionField
  2490. }, $options.showWorkPositionField ? common_vendor.e({
  2491. dB: $data.workErrors.position ? 1 : "",
  2492. dC: $data.workForm.position,
  2493. dD: common_vendor.o(($event) => $data.workForm.position = $event.detail.value),
  2494. dE: $data.workErrors.position
  2495. }, $data.workErrors.position ? {
  2496. dF: common_vendor.t($data.workErrors.position)
  2497. } : {}) : {}, {
  2498. dG: $options.showWorkMonthlySalary
  2499. }, $options.showWorkMonthlySalary ? common_vendor.e({
  2500. dH: $data.workErrors.monthlySalary ? 1 : "",
  2501. dI: common_vendor.o([($event) => $data.workForm.monthlySalary = $event.detail.value, (...args) => $options.validateMonthlySalary && $options.validateMonthlySalary(...args)]),
  2502. dJ: $data.workForm.monthlySalary,
  2503. dK: $data.workErrors.monthlySalary
  2504. }, $data.workErrors.monthlySalary ? {
  2505. dL: common_vendor.t($data.workErrors.monthlySalary)
  2506. } : {}) : {}, {
  2507. dM: $options.showWorkSupervisor
  2508. }, $options.showWorkSupervisor ? common_vendor.e({
  2509. dN: $data.workForm.supervisor,
  2510. dO: common_vendor.o(($event) => $data.workForm.supervisor = $event.detail.value),
  2511. dP: $data.workErrors.supervisor
  2512. }, $data.workErrors.supervisor ? {
  2513. dQ: common_vendor.t($data.workErrors.supervisor)
  2514. } : {}) : {}, {
  2515. dR: $options.showWorkSupervisorPhone
  2516. }, $options.showWorkSupervisorPhone ? common_vendor.e({
  2517. dS: common_vendor.o([($event) => $data.workForm.supervisorPhone = $event.detail.value, (...args) => $options.validatePhone && $options.validatePhone(...args)]),
  2518. dT: $data.workForm.supervisorPhone,
  2519. dU: $data.workErrors.supervisorPhone
  2520. }, $data.workErrors.supervisorPhone ? {
  2521. dV: common_vendor.t($data.workErrors.supervisorPhone)
  2522. } : {}) : {}, {
  2523. dW: common_vendor.t($data.isEditingWork ? "✓" : "+"),
  2524. dX: common_vendor.o((...args) => $options.saveWork && $options.saveWork(...args)),
  2525. dY: common_vendor.t($data.isEditingWork ? "保存修改" : "添加工作经历")
  2526. }) : {}) : {}, {
  2527. dZ: $options.showPrevButton
  2528. }, $options.showPrevButton ? {
  2529. ea: common_vendor.o((...args) => $options.prevStep && $options.prevStep(...args))
  2530. } : {}, {
  2531. eb: $options.showSubmitButton
  2532. }, $options.showSubmitButton ? {
  2533. ec: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args))
  2534. } : {
  2535. ed: common_vendor.o((...args) => $options.nextStep && $options.nextStep(...args))
  2536. });
  2537. }
  2538. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  2539. wx.createPage(MiniProgramPage);