Personal.js 83 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317
  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. ((_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_income) == 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 (!isValid) {
  694. common_vendor.index.showToast({
  695. title: "请完善家庭成员信息",
  696. icon: "none"
  697. });
  698. return;
  699. }
  700. if (this.isEditing) {
  701. this.familyMembers[this.editingIndex] = { ...this.familyMemberForm };
  702. common_vendor.index.showToast({
  703. title: "修改成功",
  704. icon: "success"
  705. });
  706. this.isEditing = false;
  707. this.editingIndex = -1;
  708. } else {
  709. this.familyMembers.push({ ...this.familyMemberForm });
  710. common_vendor.index.showToast({
  711. title: "添加成功",
  712. icon: "success"
  713. });
  714. }
  715. this.resetFamilyMemberForm();
  716. },
  717. // 添加重置错误信息的方法
  718. resetFamilyMemberErrors() {
  719. this.familyMemberErrors = {
  720. relation: "",
  721. name: "",
  722. phone: "",
  723. workplaceOrAddress: "",
  724. position: ""
  725. };
  726. },
  727. // 修改重置表单的方法
  728. resetFamilyMemberForm() {
  729. this.familyMemberForm = {
  730. relation: "",
  731. name: "",
  732. workplaceOrAddress: "",
  733. position: "",
  734. phone: "",
  735. isEmergencyContact: false
  736. };
  737. this.resetFamilyMemberErrors();
  738. },
  739. editFamilyMember(index) {
  740. this.isEditing = true;
  741. this.editingIndex = index;
  742. this.familyMemberForm = { ...this.familyMembers[index] };
  743. common_vendor.index.pageScrollTo({
  744. selector: ".family-member-form",
  745. duration: 300
  746. });
  747. },
  748. cancelEdit() {
  749. this.isEditing = false;
  750. this.editingIndex = -1;
  751. this.familyMemberForm = {
  752. relation: "",
  753. name: "",
  754. workplaceOrAddress: "",
  755. position: "",
  756. phone: "",
  757. isEmergencyContact: false
  758. };
  759. },
  760. deleteFamilyMember(index) {
  761. if (this.isEditing && this.editingIndex === index) {
  762. this.cancelEdit();
  763. }
  764. this.familyMembers.splice(index, 1);
  765. common_vendor.index.showToast({
  766. title: "已删除",
  767. icon: "none"
  768. });
  769. },
  770. // 选择应聘来源类型
  771. selectSourceType(type) {
  772. this.formData.sourceType = type;
  773. if (type === "social") {
  774. this.formData.socialSource = "BOSS";
  775. } else {
  776. this.formData.socialSource = "";
  777. }
  778. },
  779. // 选择社招来源
  780. selectSocialSource(source) {
  781. this.formData.sourceType = "social";
  782. this.formData.socialSource = source;
  783. },
  784. // 教育经历相关方法
  785. bindStartTimeChange(e) {
  786. const startTime = e.detail.value;
  787. if (this.educationForm.endTime && startTime > this.educationForm.endTime) {
  788. common_vendor.index.showToast({
  789. title: "开始时间不能大于结束时间",
  790. icon: "none"
  791. });
  792. return;
  793. }
  794. this.educationForm.startTime = startTime;
  795. this.educationErrors.startTime = false;
  796. },
  797. bindEndTimeChange(e) {
  798. const endTime = e.detail.value;
  799. if (this.educationForm.startTime && endTime < this.educationForm.startTime) {
  800. common_vendor.index.showToast({
  801. title: "结束时间不能小于开始时间",
  802. icon: "none"
  803. });
  804. return;
  805. }
  806. this.educationForm.endTime = endTime;
  807. this.educationErrors.endTime = false;
  808. },
  809. bindDegreeChange(e) {
  810. this.degreeIndex = e.detail.value;
  811. this.educationForm.degree = this.degreeOptions[this.degreeIndex];
  812. },
  813. saveEducation() {
  814. this.resetEducationErrors();
  815. let isValid = true;
  816. if (this.shouldValidateField("startTime", "education") && !this.educationForm.startTime) {
  817. this.educationErrors.startTime = "请选择开始时间";
  818. isValid = false;
  819. }
  820. if (this.shouldValidateField("endTime", "education") && !this.educationForm.endTime) {
  821. this.educationErrors.endTime = "请选择结束时间";
  822. isValid = false;
  823. }
  824. if (this.shouldValidateField("schoolName", "education") && !this.educationForm.schoolName) {
  825. this.educationErrors.schoolName = "请输入学校名称";
  826. isValid = false;
  827. }
  828. if (this.shouldValidateField("major", "education") && !this.educationForm.major) {
  829. this.educationErrors.major = "请输入专业";
  830. isValid = false;
  831. }
  832. if (this.shouldValidateField("degree", "education") && !this.educationForm.degree) {
  833. this.educationErrors.degree = "请选择学历";
  834. isValid = false;
  835. }
  836. if (!isValid) {
  837. common_vendor.index.showToast({
  838. title: "请完善教育经历信息",
  839. icon: "none"
  840. });
  841. return;
  842. }
  843. if (this.isEditingEducation) {
  844. this.educationList[this.editingEducationIndex] = { ...this.educationForm };
  845. common_vendor.index.showToast({
  846. title: "修改成功",
  847. icon: "success"
  848. });
  849. this.isEditingEducation = false;
  850. this.editingEducationIndex = -1;
  851. } else {
  852. this.educationList.push({ ...this.educationForm });
  853. common_vendor.index.showToast({
  854. title: "添加成功",
  855. icon: "success"
  856. });
  857. }
  858. this.educationForm = {
  859. startTime: "",
  860. endTime: "",
  861. schoolName: "",
  862. major: "",
  863. degree: ""
  864. };
  865. this.degreeIndex = -1;
  866. },
  867. editEducation(index) {
  868. this.isEditingEducation = true;
  869. this.editingEducationIndex = index;
  870. this.educationForm = { ...this.educationList[index] };
  871. this.degreeIndex = this.degreeOptions.findIndex((item) => item === this.educationForm.degree);
  872. common_vendor.index.pageScrollTo({
  873. selector: ".education-form",
  874. duration: 300
  875. });
  876. },
  877. cancelEditEducation() {
  878. this.isEditingEducation = false;
  879. this.editingEducationIndex = -1;
  880. this.educationForm = {
  881. startTime: "",
  882. endTime: "",
  883. schoolName: "",
  884. major: "",
  885. degree: ""
  886. };
  887. this.degreeIndex = -1;
  888. },
  889. deleteEducation(index) {
  890. if (this.isEditingEducation && this.editingEducationIndex === index) {
  891. this.cancelEditEducation();
  892. }
  893. this.educationList.splice(index, 1);
  894. common_vendor.index.showToast({
  895. title: "已删除",
  896. icon: "none"
  897. });
  898. },
  899. // 工作经历相关方法
  900. bindWorkStartTimeChange(e) {
  901. const startTime = e.detail.value;
  902. if (this.workForm.endTime && startTime > this.workForm.endTime) {
  903. common_vendor.index.showToast({
  904. title: "开始时间不能大于结束时间",
  905. icon: "none"
  906. });
  907. return;
  908. }
  909. this.workForm.startTime = startTime;
  910. this.workErrors.startTime = false;
  911. },
  912. bindWorkEndTimeChange(e) {
  913. const endTime = e.detail.value;
  914. if (this.workForm.startTime && endTime < this.workForm.startTime) {
  915. common_vendor.index.showToast({
  916. title: "结束时间不能小于开始时间",
  917. icon: "none"
  918. });
  919. return;
  920. }
  921. this.workForm.endTime = endTime;
  922. this.workErrors.endTime = false;
  923. },
  924. saveWork() {
  925. this.workErrors = {
  926. startTime: "",
  927. endTime: "",
  928. companyName: "",
  929. department: "",
  930. position: "",
  931. employeeCount: "",
  932. monthlySalary: "",
  933. supervisor: "",
  934. supervisorPhone: ""
  935. };
  936. let isValid = true;
  937. if (this.shouldValidateField("startTime", "work") && !this.workForm.startTime) {
  938. this.workErrors.startTime = "请选择开始时间";
  939. isValid = false;
  940. }
  941. if (this.shouldValidateField("endTime", "work") && !this.workForm.endTime) {
  942. this.workErrors.endTime = "请选择结束时间";
  943. isValid = false;
  944. }
  945. if (this.shouldValidateField("companyName", "work") && !this.workForm.companyName) {
  946. this.workErrors.companyName = "请输入单位名称";
  947. isValid = false;
  948. }
  949. if (this.shouldValidateField("employeeCount", "work") && !this.workForm.employeeCount) {
  950. this.workErrors.employeeCount = "请输入单位人数";
  951. isValid = false;
  952. }
  953. if (!isValid) {
  954. common_vendor.index.showToast({
  955. title: "请完善工作经历信息",
  956. icon: "none"
  957. });
  958. return;
  959. }
  960. if (this.isEditingWork) {
  961. this.workList[this.editingWorkIndex] = { ...this.workForm };
  962. common_vendor.index.showToast({
  963. title: "修改成功",
  964. icon: "success"
  965. });
  966. this.isEditingWork = false;
  967. this.editingWorkIndex = -1;
  968. } else {
  969. this.workList.push({ ...this.workForm });
  970. common_vendor.index.showToast({
  971. title: "添加成功",
  972. icon: "success"
  973. });
  974. }
  975. this.workForm = {
  976. startTime: "",
  977. endTime: "",
  978. companyName: "",
  979. department: "",
  980. employeeCount: "",
  981. position: "",
  982. monthlySalary: "",
  983. supervisor: "",
  984. supervisorPhone: ""
  985. };
  986. },
  987. editWork(index) {
  988. this.isEditingWork = true;
  989. this.editingWorkIndex = index;
  990. this.workForm = { ...this.workList[index] };
  991. common_vendor.index.pageScrollTo({
  992. selector: ".work-form",
  993. duration: 300
  994. });
  995. },
  996. cancelEditWork() {
  997. this.isEditingWork = false;
  998. this.editingWorkIndex = -1;
  999. this.workForm = {
  1000. startTime: "",
  1001. endTime: "",
  1002. companyName: "",
  1003. department: "",
  1004. employeeCount: "",
  1005. position: "",
  1006. monthlySalary: "",
  1007. supervisor: "",
  1008. supervisorPhone: ""
  1009. };
  1010. },
  1011. deleteWork(index) {
  1012. if (this.isEditingWork && this.editingWorkIndex === index) {
  1013. this.cancelEditWork();
  1014. }
  1015. this.workList.splice(index, 1);
  1016. common_vendor.index.showToast({
  1017. title: "已删除",
  1018. icon: "none"
  1019. });
  1020. },
  1021. submitForm() {
  1022. var _a, _b;
  1023. if (!this.validateCurrentStep()) {
  1024. return;
  1025. }
  1026. const allRequired = [
  1027. "name",
  1028. "gender",
  1029. "phone",
  1030. "idCard",
  1031. "ethnic",
  1032. "currentAddress"
  1033. ];
  1034. let isValid = true;
  1035. allRequired.forEach((field) => {
  1036. if (this.shouldValidateField(field) && !this.validateField(field, this.formData[field])) {
  1037. isValid = false;
  1038. }
  1039. });
  1040. if (this.shouldValidateField("skills") && !((_a = this.formData.skills) == null ? void 0 : _a.trim())) {
  1041. this.formErrors.skills = "请描述您的专业技能";
  1042. isValid = false;
  1043. }
  1044. if (this.shouldValidateField("training") && !((_b = this.formData.training) == null ? void 0 : _b.trim())) {
  1045. this.formErrors.training = "请描述您的培训经历";
  1046. isValid = false;
  1047. }
  1048. if (!isValid) {
  1049. common_vendor.index.showToast({
  1050. title: "请完善所有必填信息",
  1051. icon: "none"
  1052. });
  1053. return;
  1054. }
  1055. const userInfo = common_vendor.index.getStorageSync("userInfo");
  1056. if (!userInfo) {
  1057. common_vendor.index.showToast({
  1058. title: "用户信息获取失败,请重新登录",
  1059. icon: "none",
  1060. duration: 2e3
  1061. });
  1062. return;
  1063. }
  1064. try {
  1065. const userData = JSON.parse(userInfo);
  1066. const submitData = {
  1067. tenant_id: 1,
  1068. user_id: userData.id,
  1069. personal_info: {
  1070. name: this.formData.name,
  1071. gender: this.formData.gender,
  1072. phone: this.formData.phone,
  1073. id_card: this.formData.idCard,
  1074. address: this.formData.currentAddress,
  1075. professional_skills: this.formData.skills ? this.formData.skills.split(",") : []
  1076. },
  1077. profile: {
  1078. female_status: this.getFemaleStatus(),
  1079. marital_status: this.getMaritalStatus(),
  1080. height: parseFloat(this.formData.height) || 0,
  1081. weight: parseFloat(this.formData.weight) || 0,
  1082. ethnicity: this.formData.ethnic,
  1083. current_address: this.formData.currentAddress,
  1084. expected_salary: parseFloat(this.formData.expectedSalary) || 0
  1085. },
  1086. educations: this.formatEducations(),
  1087. family_members: this.formatFamilyMembers(),
  1088. work_experiences: this.formatWorkExperiences()
  1089. };
  1090. if (!submitData.personal_info.name || !submitData.personal_info.gender || !submitData.personal_info.phone) {
  1091. common_vendor.index.showToast({
  1092. title: "基本信息不完整",
  1093. icon: "none",
  1094. duration: 2e3
  1095. });
  1096. return;
  1097. }
  1098. this.sendFormData(submitData);
  1099. } catch (error) {
  1100. console.error("数据处理错误:", error);
  1101. common_vendor.index.showToast({
  1102. title: "数据处理错误,请重试",
  1103. icon: "none",
  1104. duration: 2e3
  1105. });
  1106. }
  1107. },
  1108. // 辅助方法:发送表单数据
  1109. sendFormData(submitData) {
  1110. common_vendor.index.showLoading({ title: "提交中..." });
  1111. const token = common_vendor.index.getStorageSync("token");
  1112. common_vendor.index.request({
  1113. url: `${common_config.apiBaseUrl}/wechat/user/profile/update`,
  1114. method: "POST",
  1115. data: submitData,
  1116. header: {
  1117. "content-type": "application/json",
  1118. "Authorization": token ? `Bearer ${token}` : ""
  1119. },
  1120. success: (res) => {
  1121. common_vendor.index.hideLoading();
  1122. if (res.statusCode === 200) {
  1123. if (res.data.code === 2e3) {
  1124. common_vendor.index.showToast({
  1125. title: "提交成功",
  1126. icon: "success",
  1127. duration: 2e3
  1128. });
  1129. setTimeout(() => {
  1130. common_vendor.index.navigateTo({
  1131. url: "/pages/interview-notice/interview-notice"
  1132. });
  1133. }, 2e3);
  1134. } else {
  1135. common_vendor.index.showToast({
  1136. title: res.data.msg || "提交失败",
  1137. icon: "none",
  1138. duration: 2e3
  1139. });
  1140. }
  1141. } else {
  1142. common_vendor.index.showToast({
  1143. title: "服务器响应错误",
  1144. icon: "none",
  1145. duration: 2e3
  1146. });
  1147. }
  1148. },
  1149. fail: (err) => {
  1150. console.error("提交失败:", err);
  1151. common_vendor.index.hideLoading();
  1152. if (err.errMsg.includes("timeout")) {
  1153. common_vendor.index.showToast({
  1154. title: "请求超时,请检查网络后重试",
  1155. icon: "none",
  1156. duration: 2e3
  1157. });
  1158. } else if (err.errMsg.includes("fail")) {
  1159. common_vendor.index.showToast({
  1160. title: "网络连接失败,请检查网络设置",
  1161. icon: "none",
  1162. duration: 2e3
  1163. });
  1164. } else {
  1165. common_vendor.index.showToast({
  1166. title: "提交失败,请稍后重试",
  1167. icon: "none",
  1168. duration: 2e3
  1169. });
  1170. }
  1171. },
  1172. complete: () => {
  1173. }
  1174. });
  1175. },
  1176. // 数据格式化方法
  1177. getFemaleStatus() {
  1178. if (this.formData.gender !== "女")
  1179. return 0;
  1180. const statusMap = { "孕期": 1, "产期": 2, "哺乳期": 3 };
  1181. return statusMap[this.formData.threePeriod] || 0;
  1182. },
  1183. getMaritalStatus() {
  1184. const statusMap = { "未婚": 0, "已婚": 1, "离异": 2, "丧偶": 3 };
  1185. return statusMap[this.formData.marriage] || 0;
  1186. },
  1187. formatEducations() {
  1188. return this.educationList.map((edu, index) => ({
  1189. education_type: index === 0 ? 1 : 2,
  1190. degree: this.mapDegreeToNumber(edu.degree),
  1191. start_date: edu.startTime,
  1192. end_date: edu.endTime,
  1193. school_name: edu.schoolName,
  1194. major: edu.major
  1195. }));
  1196. },
  1197. formatFamilyMembers() {
  1198. return this.familyMembers.map((member) => ({
  1199. relation: member.relation,
  1200. name: member.name,
  1201. workplace: member.workplaceOrAddress,
  1202. position: member.position,
  1203. phone: member.phone
  1204. //is_emergency_contact: member.isEmergencyContact||false // 添加紧急联系人标识
  1205. }));
  1206. },
  1207. formatWorkExperiences() {
  1208. return this.workList.map((work) => ({
  1209. start_date: work.startTime,
  1210. end_date: work.endTime,
  1211. company_name: work.companyName,
  1212. department: work.department,
  1213. company_size: parseInt(work.employeeCount) || 0,
  1214. position: work.position,
  1215. monthly_salary: work.monthlySalary || 0,
  1216. supervisor_name: work.supervisor,
  1217. supervisor_phone: work.supervisorPhone
  1218. }));
  1219. },
  1220. // 学历映射辅助方法
  1221. mapDegreeToNumber(degreeText) {
  1222. const degreeMap = {
  1223. "高中": 1,
  1224. "中专": 1,
  1225. "大专": 2,
  1226. "本科": 3,
  1227. "硕士": 4,
  1228. "博士": 5
  1229. };
  1230. return degreeMap[degreeText] || 6;
  1231. },
  1232. prevStep() {
  1233. const prevIndex = this.currentStepIndex - 1;
  1234. if (prevIndex >= 0) {
  1235. let targetIndex = prevIndex;
  1236. while (targetIndex >= 0) {
  1237. const stepId = this.steps[targetIndex].id;
  1238. if (stepId === 6 && !this.shouldShowSkillsStep) {
  1239. targetIndex--;
  1240. continue;
  1241. }
  1242. if (stepId === 5 && !this.shouldShowEducationStep) {
  1243. targetIndex--;
  1244. continue;
  1245. }
  1246. if (stepId === 3 && !this.shouldShowFamilyStep) {
  1247. targetIndex--;
  1248. continue;
  1249. }
  1250. if (stepId === 8 && !this.shouldShowWorkStep) {
  1251. targetIndex--;
  1252. continue;
  1253. }
  1254. break;
  1255. }
  1256. if (targetIndex >= 0) {
  1257. this.currentStep = this.steps[targetIndex].id;
  1258. }
  1259. common_vendor.index.pageScrollTo({
  1260. scrollTop: 0,
  1261. duration: 300
  1262. });
  1263. }
  1264. },
  1265. nextStep() {
  1266. if (!this.validateCurrentStep()) {
  1267. return;
  1268. }
  1269. if (this.currentStep === 1) {
  1270. this.verifyIdentity();
  1271. return;
  1272. }
  1273. const nextIndex = this.currentStepIndex + 1;
  1274. if (nextIndex < this.steps.length) {
  1275. let targetIndex = nextIndex;
  1276. while (targetIndex < this.steps.length) {
  1277. const stepId = this.steps[targetIndex].id;
  1278. console.log(this.steps[targetIndex].id);
  1279. if (stepId === 3 && !this.shouldShowFamilyStep) {
  1280. targetIndex++;
  1281. continue;
  1282. }
  1283. if (stepId === 5 && !this.shouldShowEducationStep) {
  1284. targetIndex++;
  1285. continue;
  1286. }
  1287. if (stepId === 6 && !this.shouldShowSkillsStep) {
  1288. targetIndex++;
  1289. continue;
  1290. }
  1291. if (stepId === 8 && !this.shouldShowWorkStep) {
  1292. targetIndex++;
  1293. continue;
  1294. }
  1295. break;
  1296. }
  1297. if (targetIndex < this.steps.length) {
  1298. this.currentStep = this.steps[targetIndex].id;
  1299. } else {
  1300. console.log("当前步骤是最后一个需要显示的步骤,显示提交按钮");
  1301. }
  1302. common_vendor.index.pageScrollTo({
  1303. scrollTop: 0,
  1304. duration: 300
  1305. });
  1306. }
  1307. },
  1308. // 身份验证方法
  1309. verifyIdentity() {
  1310. this.formErrors = {
  1311. name: "",
  1312. idCard: "",
  1313. phone: ""
  1314. };
  1315. common_vendor.index.showLoading({
  1316. title: "身份验证中..."
  1317. });
  1318. common_vendor.index.request({
  1319. url: `${common_config.apiBaseUrl}/wechat/identity/verify`,
  1320. method: "POST",
  1321. data: {
  1322. name: this.formData.name,
  1323. id_number: this.formData.idCard,
  1324. mobile: this.formData.phone
  1325. },
  1326. header: {
  1327. "content-type": "application/x-www-form-urlencoded"
  1328. },
  1329. success: (res) => {
  1330. common_vendor.index.hideLoading();
  1331. console.log(res);
  1332. if (res.data.code === 200) {
  1333. let targetIndex = this.currentStepIndex + 1;
  1334. while (targetIndex < this.steps.length) {
  1335. const stepId = this.steps[targetIndex].id;
  1336. if (stepId === 3 && !this.shouldShowFamilyStep) {
  1337. targetIndex++;
  1338. continue;
  1339. }
  1340. if (stepId === 5 && !this.shouldShowEducationStep) {
  1341. targetIndex++;
  1342. continue;
  1343. }
  1344. if (stepId === 6 && !this.shouldShowSkillsStep) {
  1345. targetIndex++;
  1346. continue;
  1347. }
  1348. if (stepId === 8 && !this.shouldShowWorkStep) {
  1349. targetIndex++;
  1350. continue;
  1351. }
  1352. break;
  1353. }
  1354. if (targetIndex < this.steps.length) {
  1355. this.currentStep = this.steps[targetIndex].id;
  1356. common_vendor.index.pageScrollTo({ scrollTop: 0, duration: 300 });
  1357. } else {
  1358. console.log("身份验证通过后,当前步骤是最后一个需要显示的步骤,显示提交按钮");
  1359. }
  1360. this.setUserInfo(this.formData);
  1361. } else {
  1362. this.handleVerificationError(res.data);
  1363. }
  1364. },
  1365. fail: (err) => {
  1366. this.handleRequestError(err);
  1367. }
  1368. });
  1369. },
  1370. setUserInfo(data) {
  1371. common_vendor.index.request({
  1372. url: `${common_config.apiBaseUrl}/wechat/updateUserInfo`,
  1373. method: "POST",
  1374. data: {
  1375. openid: JSON.parse(common_vendor.index.getStorageSync("userInfo")).openid,
  1376. name: data.name,
  1377. id_card: data.idCard,
  1378. purePhoneNumber: data.phone,
  1379. tenant_id: 1,
  1380. examine: 0
  1381. },
  1382. header: {
  1383. "content-type": "application/x-www-form-urlencoded"
  1384. },
  1385. success: (res) => {
  1386. console.log(res);
  1387. }
  1388. });
  1389. },
  1390. // 处理验证错误
  1391. handleVerificationError(data) {
  1392. this.formErrors.name = "姓名验证失败,请检查姓名是否正确";
  1393. this.formErrors.idCard = "身份证号验证失败,请检查身份证号是否正确";
  1394. this.formErrors.phone = "手机号验证失败,请检查手机号是否正确";
  1395. common_vendor.index.showToast({
  1396. title: data.msg || "身份验证失败",
  1397. icon: "none"
  1398. });
  1399. },
  1400. // 处理请求错误
  1401. handleRequestError(err) {
  1402. common_vendor.index.hideLoading();
  1403. common_vendor.index.showToast({
  1404. title: "网络错误,请检查网络连接",
  1405. icon: "none",
  1406. duration: 2e3
  1407. });
  1408. console.error("请求失败:", err);
  1409. },
  1410. // 验证当前步骤的必填项
  1411. validateCurrentStep() {
  1412. var _a, _b;
  1413. let isValid = true;
  1414. switch (this.currentStep) {
  1415. case 1:
  1416. const basicFields = ["name", "gender", "phone", "idCard", "ethnic", "currentAddress"];
  1417. basicFields.forEach((field) => {
  1418. if (this.shouldValidateField(field) && !this.validateField(field, this.formData[field])) {
  1419. isValid = false;
  1420. }
  1421. });
  1422. if (this.shouldValidateField("threePeriod") && this.formData.gender === "女" && this.threePeriodIndex === -1) {
  1423. this.formErrors.threePeriod = "请选择三期状态";
  1424. isValid = false;
  1425. }
  1426. if (this.shouldValidateField("height") && this.formData.height) {
  1427. isValid = this.validateField("height", this.formData.height) && isValid;
  1428. }
  1429. if (this.shouldValidateField("weight") && this.formData.weight) {
  1430. isValid = this.validateField("weight", this.formData.weight) && isValid;
  1431. }
  1432. if (this.shouldValidateField("expectedSalary") && this.formData.expectedSalary) {
  1433. isValid = this.validateField("expectedSalary", this.formData.expectedSalary) && isValid;
  1434. }
  1435. break;
  1436. case 3:
  1437. console.log(this.familyMembers.length);
  1438. if (this.familyMembers.length == 0) {
  1439. common_vendor.index.showToast({
  1440. title: "请至少添加一位家庭成员",
  1441. icon: "none"
  1442. });
  1443. isValid = false;
  1444. }
  1445. break;
  1446. case 5:
  1447. if (this.educationList.length === 0) {
  1448. common_vendor.index.showToast({
  1449. title: "请至少添加一项教育经历",
  1450. icon: "none"
  1451. });
  1452. isValid = false;
  1453. }
  1454. break;
  1455. case 6:
  1456. if (this.shouldValidateField("skills") && !((_a = this.formData.skills) == null ? void 0 : _a.trim())) {
  1457. this.formErrors.skills = "请描述您的专业技能";
  1458. isValid = false;
  1459. }
  1460. if (this.shouldValidateField("training") && !((_b = this.formData.training) == null ? void 0 : _b.trim())) {
  1461. this.formErrors.training = "请描述您的培训经历";
  1462. isValid = false;
  1463. }
  1464. break;
  1465. case 8:
  1466. if (this.workList.length === 0) {
  1467. common_vendor.index.showToast({
  1468. title: "请至少添加一项工作经历",
  1469. icon: "none"
  1470. });
  1471. isValid = false;
  1472. }
  1473. break;
  1474. }
  1475. return isValid;
  1476. },
  1477. // Add method to fetch user data
  1478. fetchUserData() {
  1479. this.isLoading = true;
  1480. const userInfo = common_vendor.index.getStorageSync("userInfo") ? JSON.parse(common_vendor.index.getStorageSync("userInfo")) : {};
  1481. const openid = userInfo.openid;
  1482. if (!openid) {
  1483. common_vendor.index.showToast({
  1484. title: "用户信息获取失败,请重新登录",
  1485. icon: "none"
  1486. });
  1487. this.isLoading = false;
  1488. return;
  1489. }
  1490. common_vendor.index.request({
  1491. url: `${common_config.apiBaseUrl}/api/wechat/user/get_full_info?tenant_id=1&openid=${openid}`,
  1492. method: "GET",
  1493. success: (res) => {
  1494. this.showPromiseModal = true;
  1495. this.populateFormData(res.data.data);
  1496. },
  1497. fail: (err) => {
  1498. },
  1499. complete: () => {
  1500. this.isLoading = false;
  1501. this.$nextTick(() => {
  1502. this.ensureValidStep();
  1503. });
  1504. }
  1505. });
  1506. },
  1507. // Add method to populate form data with fetched data
  1508. populateFormData(data) {
  1509. const { user_info, profile, educations, work_experiences, family_members } = data;
  1510. if (user_info) {
  1511. this.formData.name = user_info.name || "";
  1512. this.formData.gender = user_info.gender_text || "";
  1513. this.genderIndex = this.genderOptions.findIndex((item) => item === this.formData.gender);
  1514. this.formData.idCard = user_info.id_card || "";
  1515. this.formData.phone = user_info.phone || "";
  1516. this.formData.email = user_info.email || "";
  1517. }
  1518. if (profile) {
  1519. this.formData.political = profile.political_status || "";
  1520. this.politicalIndex = this.politicalOptions.findIndex((item) => item === this.formData.political);
  1521. this.formData.ethnic = profile.ethnicity || "";
  1522. this.ethnicIndex = this.ethnicOptions.findIndex((item) => item === this.formData.ethnic);
  1523. this.formData.height = profile.height || "";
  1524. this.formData.weight = profile.weight || "";
  1525. this.formData.nativePlace = profile.native_place || "";
  1526. this.formData.residence = profile.household_location || "";
  1527. this.formData.currentAddress = profile.current_address || "";
  1528. this.formData.marriage = profile.marital_status_text || "";
  1529. this.marriageIndex = this.marriageOptions.findIndex((item) => item === this.formData.marriage);
  1530. if (this.formData.gender === "女" && profile.female_status !== void 0) {
  1531. const femaleStatusMap = { 0: "无", 1: "孕期", 2: "产期", 3: "哺乳期" };
  1532. this.formData.threePeriod = femaleStatusMap[profile.female_status] || "无";
  1533. this.threePeriodIndex = this.threePeriodOptions.findIndex((item) => item === this.formData.threePeriod);
  1534. }
  1535. this.formData.expectedSalary = profile.expected_salary || "";
  1536. this.formData.emergencyContact = profile.emergency_contact || "";
  1537. this.formData.emergencyPhone = profile.emergency_phone || "";
  1538. this.formData.hobby = profile.specialties || "";
  1539. this.formData.motto = profile.life_motto || "";
  1540. const sourceTypeMap = {
  1541. 1: "school",
  1542. 2: "social",
  1543. 3: "social",
  1544. 4: "social",
  1545. 5: "social"
  1546. };
  1547. const socialSourceMap = {
  1548. 2: "BOSS",
  1549. 3: "zhilian",
  1550. 4: "liepin",
  1551. 5: "other"
  1552. };
  1553. this.formData.sourceType = sourceTypeMap[profile.recruitment_source] || "social";
  1554. if (this.formData.sourceType === "social") {
  1555. this.formData.socialSource = socialSourceMap[profile.recruitment_source] || "";
  1556. if (this.formData.socialSource === "other") {
  1557. this.formData.otherSocialSource = profile.recruitment_source_detail || "";
  1558. }
  1559. } else if (this.formData.sourceType === "school") {
  1560. this.formData.otherSchoolSource = profile.recruitment_source_detail || "";
  1561. }
  1562. }
  1563. if (educations && educations.length > 0) {
  1564. this.educationList = educations.map((edu) => {
  1565. const degreeMap = {
  1566. 1: "高中",
  1567. 2: "大专",
  1568. 3: "本科",
  1569. 4: "硕士",
  1570. 5: "博士"
  1571. };
  1572. return {
  1573. startTime: edu.start_date || "",
  1574. endTime: edu.end_date || "",
  1575. schoolName: edu.school_name || "",
  1576. major: edu.major || "",
  1577. degree: degreeMap[edu.degree] || ""
  1578. };
  1579. });
  1580. }
  1581. if (work_experiences && work_experiences.length > 0) {
  1582. this.workList = work_experiences.map((work) => {
  1583. return {
  1584. startTime: work.start_date || "",
  1585. endTime: work.end_date || "",
  1586. companyName: work.company_name || "",
  1587. department: work.department || "",
  1588. employeeCount: work.company_size || "",
  1589. position: work.position || "",
  1590. monthlySalary: work.monthly_salary || "",
  1591. supervisor: work.supervisor_name || "",
  1592. supervisorPhone: work.supervisor_phone || ""
  1593. };
  1594. });
  1595. }
  1596. if (family_members && family_members.length > 0) {
  1597. this.familyMembers = family_members.map((member) => {
  1598. return {
  1599. relation: member.relation || "",
  1600. name: member.name || "",
  1601. workplaceOrAddress: member.workplace || "",
  1602. position: member.position || "",
  1603. phone: member.phone || "",
  1604. isEmergencyContact: member.isEmergencyContact || false
  1605. };
  1606. });
  1607. }
  1608. },
  1609. // 处理紧急联系人开关变化
  1610. handleEmergencyContactChange(e) {
  1611. this.familyMemberForm.isEmergencyContact = e.detail.value;
  1612. if (e.detail.value) {
  1613. this.formData.emergencyContact = this.familyMemberForm.name;
  1614. this.formData.emergencyPhone = this.familyMemberForm.phone;
  1615. }
  1616. },
  1617. // 添加重置教育经历错误信息的方法
  1618. resetEducationErrors() {
  1619. this.educationErrors = {
  1620. startTime: "",
  1621. endTime: "",
  1622. schoolName: "",
  1623. major: "",
  1624. degree: ""
  1625. };
  1626. },
  1627. // 添加通用验证方法
  1628. validateField(fieldName, value) {
  1629. const rule = this.validationRules[fieldName];
  1630. if (!rule)
  1631. return true;
  1632. if (!this.shouldValidateField(fieldName)) {
  1633. return true;
  1634. }
  1635. this.formErrors[fieldName] = "";
  1636. if (rule.required && !value) {
  1637. this.formErrors[fieldName] = rule.message;
  1638. return false;
  1639. }
  1640. if (rule.pattern && value && !rule.pattern.test(value)) {
  1641. this.formErrors[fieldName] = rule.message;
  1642. return false;
  1643. }
  1644. return true;
  1645. },
  1646. validateExpectedSalary(e) {
  1647. const value = e.detail.value;
  1648. console.log(value);
  1649. if (value === "") {
  1650. this.formData.expectedSalary = "";
  1651. this.formErrors.expectedSalary = "";
  1652. return;
  1653. }
  1654. let num = parseFloat(value);
  1655. if (isNaN(num)) {
  1656. this.formErrors.expectedSalary = "请输入有效的数字";
  1657. return;
  1658. }
  1659. if (num < 0) {
  1660. num = 0;
  1661. this.formErrors.expectedSalary = "薪资不能小于0";
  1662. } else if (num > 1e5) {
  1663. num = 1e5;
  1664. this.formErrors.expectedSalary = "薪资不能超过100000";
  1665. }
  1666. this.formData.expectedSalary = num.toString();
  1667. },
  1668. validateEmployeeCount(e) {
  1669. const value = e.detail.value;
  1670. if (value === "") {
  1671. this.workForm.employeeCount = "";
  1672. this.workErrors.employeeCount = "";
  1673. return;
  1674. }
  1675. let num = parseInt(value);
  1676. if (isNaN(num)) {
  1677. this.workErrors.employeeCount = "请输入有效的数字";
  1678. return;
  1679. }
  1680. if (num < 0) {
  1681. num = 0;
  1682. this.workErrors.employeeCount = "人数不能小于0";
  1683. } else if (num > 1e4) {
  1684. num = 1e4;
  1685. this.workErrors.employeeCount = "人数不能超过10000";
  1686. }
  1687. this.workForm.employeeCount = num.toString();
  1688. },
  1689. validateMonthlySalary(e) {
  1690. const value = e.detail.value;
  1691. if (value === "") {
  1692. this.workForm.monthlySalary = "";
  1693. this.workErrors.monthlySalary = "";
  1694. return;
  1695. }
  1696. let num = parseInt(value);
  1697. if (isNaN(num)) {
  1698. this.workErrors.monthlySalary = "请输入有效的数字";
  1699. return;
  1700. }
  1701. if (num < 0) {
  1702. num = 0;
  1703. this.workErrors.monthlySalary = "月总收入不能小于0";
  1704. } else if (num > 1e5) {
  1705. num = 1e5;
  1706. this.workErrors.monthlySalary = "月总收入不能超过100000";
  1707. } else {
  1708. this.workErrors.monthlySalary = "";
  1709. }
  1710. this.workForm.monthlySalary = num.toString();
  1711. },
  1712. // 添加手机号验证方法
  1713. validatePhone(e) {
  1714. const value = e.detail.value;
  1715. if (value.length > 11) {
  1716. this.formData.phone = value.slice(0, 11);
  1717. }
  1718. if (value && !/^1[3-9]\d{0,9}$/.test(value)) {
  1719. this.formErrors.phone = "请输入正确的手机号码";
  1720. } else {
  1721. this.formErrors.phone = "";
  1722. }
  1723. }
  1724. },
  1725. // 添加监听器来清除错误信息
  1726. watch: {
  1727. "formData.name": function(newVal) {
  1728. if (newVal && this.formErrors.name) {
  1729. this.formErrors.name = "";
  1730. }
  1731. },
  1732. "formData.idCard": function(newVal) {
  1733. if (newVal && this.formErrors.idCard) {
  1734. this.formErrors.idCard = "";
  1735. }
  1736. },
  1737. "formData.phone": function(newVal) {
  1738. if (newVal && this.formErrors.phone) {
  1739. this.formErrors.phone = "";
  1740. }
  1741. },
  1742. "formData.gender": function(newVal) {
  1743. if (newVal && this.formErrors.gender) {
  1744. this.formErrors.gender = "";
  1745. }
  1746. },
  1747. "formData.ethnic": function(newVal) {
  1748. if (newVal && this.formErrors.ethnic) {
  1749. this.formErrors.ethnic = "";
  1750. }
  1751. },
  1752. "formData.currentAddress": function(newVal) {
  1753. if (newVal && this.formErrors.currentAddress) {
  1754. this.formErrors.currentAddress = "";
  1755. }
  1756. },
  1757. "formData.height": function(newVal) {
  1758. if (newVal && this.formErrors.height) {
  1759. this.formErrors.height = "";
  1760. }
  1761. },
  1762. "formData.weight": function(newVal) {
  1763. if (newVal && this.formErrors.weight) {
  1764. this.formErrors.weight = "";
  1765. }
  1766. },
  1767. "formData.expectedSalary": function(newVal) {
  1768. if (newVal && this.formErrors.expectedSalary) {
  1769. this.formErrors.expectedSalary = "";
  1770. }
  1771. },
  1772. "familyMemberForm.relation": function(newVal) {
  1773. if (newVal)
  1774. this.familyMemberErrors.relation = "";
  1775. },
  1776. "familyMemberForm.name": function(newVal) {
  1777. if (newVal)
  1778. this.familyMemberErrors.name = "";
  1779. },
  1780. "familyMemberForm.phone": function(newVal) {
  1781. if (newVal)
  1782. this.familyMemberErrors.phone = "";
  1783. },
  1784. /* 'familyMemberForm.workplaceOrAddress': function(newVal) {
  1785. if (newVal) this.familyMemberErrors.workplaceOrAddress = '';
  1786. },
  1787. 'familyMemberForm.position': function(newVal) {
  1788. if (newVal) this.familyMemberErrors.position = '';
  1789. }, */
  1790. "workForm.companyName": function(newVal) {
  1791. if (newVal && this.workErrors.companyName) {
  1792. this.workErrors.companyName = "";
  1793. }
  1794. },
  1795. "workForm.department": function(newVal) {
  1796. if (newVal && this.workErrors.department) {
  1797. this.workErrors.department = "";
  1798. }
  1799. },
  1800. "workForm.position": function(newVal) {
  1801. if (newVal && this.workErrors.position) {
  1802. this.workErrors.position = "";
  1803. }
  1804. },
  1805. "workForm.employeeCount": function(newVal) {
  1806. if (newVal && this.workErrors.employeeCount) {
  1807. this.workErrors.employeeCount = "";
  1808. }
  1809. },
  1810. "workForm.monthlySalary": function(newVal) {
  1811. if (newVal && this.workErrors.monthlySalary) {
  1812. this.workErrors.monthlySalary = "";
  1813. }
  1814. },
  1815. "workForm.supervisor": function(newVal) {
  1816. if (newVal && this.workErrors.supervisor) {
  1817. this.workErrors.supervisor = "";
  1818. }
  1819. },
  1820. // 'workForm.supervisorPhone': function(newVal) {
  1821. // if (newVal && this.workErrors.supervisorPhone) {
  1822. // this.workErrors.supervisorPhone = '';
  1823. // }
  1824. // },
  1825. "formData.training": function(newVal) {
  1826. if (newVal && this.formErrors.training) {
  1827. this.formErrors.training = "";
  1828. }
  1829. },
  1830. "educationForm.startTime": function(newVal) {
  1831. if (newVal)
  1832. this.educationErrors.startTime = "";
  1833. },
  1834. "educationForm.endTime": function(newVal) {
  1835. if (newVal)
  1836. this.educationErrors.endTime = "";
  1837. },
  1838. "educationForm.schoolName": function(newVal) {
  1839. if (newVal)
  1840. this.educationErrors.schoolName = "";
  1841. },
  1842. "educationForm.major": function(newVal) {
  1843. if (newVal)
  1844. this.educationErrors.major = "";
  1845. },
  1846. "educationForm.degree": function(newVal) {
  1847. if (newVal)
  1848. this.educationErrors.degree = "";
  1849. },
  1850. // 添加对表单字段的实时验证
  1851. "formData": {
  1852. handler(newVal) {
  1853. const currentStepFields = {
  1854. 1: ["name", "gender", "phone", "idCard", "ethnic", "currentAddress", "height", "weight", "expectedSalary"],
  1855. 6: ["skills", "training"]
  1856. }[this.currentStep];
  1857. if (currentStepFields) {
  1858. currentStepFields.forEach((field) => {
  1859. if (newVal[field] !== void 0 && this.shouldValidateField(field)) {
  1860. this.validateField(field, newVal[field]);
  1861. }
  1862. });
  1863. }
  1864. },
  1865. deep: true
  1866. }
  1867. }
  1868. };
  1869. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  1870. return common_vendor.e({
  1871. a: $data.isLoading
  1872. }, $data.isLoading ? {} : {}, {
  1873. b: $data.showPromiseModal
  1874. }, $data.showPromiseModal ? {
  1875. c: $data.promiseChecked,
  1876. d: common_vendor.o((...args) => $options.togglePromiseChecked && $options.togglePromiseChecked(...args)),
  1877. e: !$data.promiseChecked,
  1878. f: common_vendor.o((...args) => $options.confirmPromise && $options.confirmPromise(...args))
  1879. } : {}, {
  1880. g: $data.currentStep === 1
  1881. }, $data.currentStep === 1 ? common_vendor.e({
  1882. h: $options.showNameField
  1883. }, $options.showNameField ? common_vendor.e({
  1884. i: $data.formErrors.name ? 1 : "",
  1885. j: $data.formData.name,
  1886. k: common_vendor.o(($event) => $data.formData.name = $event.detail.value),
  1887. l: $data.formErrors.name
  1888. }, $data.formErrors.name ? {
  1889. m: common_vendor.t($data.formErrors.name)
  1890. } : {}) : {}, {
  1891. n: $options.showGenderField
  1892. }, $options.showGenderField ? common_vendor.e({
  1893. o: common_vendor.t($data.genderOptions[$data.genderIndex] || "请选择性别"),
  1894. p: $data.formErrors.gender ? 1 : "",
  1895. q: common_vendor.o((...args) => $options.bindGenderChange && $options.bindGenderChange(...args)),
  1896. r: $data.genderIndex,
  1897. s: $data.genderOptions,
  1898. t: $data.formErrors.gender
  1899. }, $data.formErrors.gender ? {
  1900. v: common_vendor.t($data.formErrors.gender)
  1901. } : {}) : {}, {
  1902. w: $data.formData.gender === "女"
  1903. }, $data.formData.gender === "女" ? common_vendor.e({
  1904. x: common_vendor.t($data.threePeriodOptions[$data.threePeriodIndex] || "请选择"),
  1905. y: common_vendor.o((...args) => $options.bindThreePeriodChange && $options.bindThreePeriodChange(...args)),
  1906. z: $data.threePeriodIndex,
  1907. A: $data.threePeriodOptions,
  1908. B: $data.formErrors.threePeriod ? 1 : "",
  1909. C: $data.formErrors.threePeriod
  1910. }, $data.formErrors.threePeriod ? {
  1911. D: common_vendor.t($data.formErrors.threePeriod)
  1912. } : {}) : {}, {
  1913. E: $options.showPhoneField
  1914. }, $options.showPhoneField ? common_vendor.e({
  1915. F: $data.formErrors.phone ? 1 : "",
  1916. G: common_vendor.o([($event) => $data.formData.phone = $event.detail.value, (...args) => $options.validatePhone && $options.validatePhone(...args)]),
  1917. H: $data.formData.phone,
  1918. I: $data.formErrors.phone
  1919. }, $data.formErrors.phone ? {
  1920. J: common_vendor.t($data.formErrors.phone)
  1921. } : {}) : {}, {
  1922. K: $options.showIdCardField
  1923. }, $options.showIdCardField ? common_vendor.e({
  1924. L: $data.formErrors.idCard ? 1 : "",
  1925. M: $data.formData.idCard,
  1926. N: common_vendor.o(($event) => $data.formData.idCard = $event.detail.value),
  1927. O: $data.formErrors.idCard
  1928. }, $data.formErrors.idCard ? {
  1929. P: common_vendor.t($data.formErrors.idCard)
  1930. } : {}) : {}, {
  1931. Q: $options.showEthnicField
  1932. }, $options.showEthnicField ? common_vendor.e({
  1933. R: common_vendor.t($data.ethnicOptions[$data.ethnicIndex] || "请选择民族"),
  1934. S: $data.formErrors.ethnic ? 1 : "",
  1935. T: common_vendor.o((...args) => $options.bindEthnicChange && $options.bindEthnicChange(...args)),
  1936. U: $data.ethnicIndex,
  1937. V: $data.ethnicOptions,
  1938. W: $data.formErrors.ethnic
  1939. }, $data.formErrors.ethnic ? {
  1940. X: common_vendor.t($data.formErrors.ethnic)
  1941. } : {}) : {}, {
  1942. Y: $options.showHeightField
  1943. }, $options.showHeightField ? {
  1944. Z: common_vendor.o([($event) => $data.formData.height = $event.detail.value, ($event) => $options.handleInput($event, "height", 2)]),
  1945. aa: common_vendor.o(($event) => $options.handleBlur("height")),
  1946. ab: $data.formData.height
  1947. } : {}, {
  1948. ac: $options.showWeightField
  1949. }, $options.showWeightField ? {
  1950. ad: common_vendor.o([($event) => $data.formData.weight = $event.detail.value, ($event) => $options.handleInput($event, "weight", 2)]),
  1951. ae: common_vendor.o(($event) => $options.handleBlur("weight")),
  1952. af: $data.formData.weight
  1953. } : {}, {
  1954. ag: $options.showCurrentAddress
  1955. }, $options.showCurrentAddress ? common_vendor.e({
  1956. ah: $data.formErrors.currentAddress ? 1 : "",
  1957. ai: $data.formData.currentAddress,
  1958. aj: common_vendor.o(($event) => $data.formData.currentAddress = $event.detail.value),
  1959. ak: $data.formErrors.currentAddress
  1960. }, $data.formErrors.currentAddress ? {
  1961. al: common_vendor.t($data.formErrors.currentAddress)
  1962. } : {}) : {}, {
  1963. am: $options.showResidence
  1964. }, $options.showResidence ? {
  1965. an: $data.formData.residence,
  1966. ao: common_vendor.o(($event) => $data.formData.residence = $event.detail.value)
  1967. } : {}, {
  1968. ap: $options.showMarriageIndex
  1969. }, $options.showMarriageIndex ? {
  1970. aq: common_vendor.t($data.marriageOptions[$data.marriageIndex] || "请选择婚育状况"),
  1971. ar: common_vendor.o((...args) => $options.bindMarriageChange && $options.bindMarriageChange(...args)),
  1972. as: $data.marriageIndex,
  1973. at: $data.marriageOptions
  1974. } : {}, {
  1975. av: $options.showExpectedSalary
  1976. }, $options.showExpectedSalary ? common_vendor.e({
  1977. aw: common_vendor.o((...args) => $options.validateExpectedSalary && $options.validateExpectedSalary(...args)),
  1978. ax: $data.formErrors.expectedSalary ? 1 : "",
  1979. ay: $data.formData.expectedSalary,
  1980. az: common_vendor.o(($event) => $data.formData.expectedSalary = $event.detail.value),
  1981. aA: $data.formErrors.expectedSalary
  1982. }, $data.formErrors.expectedSalary ? {
  1983. aB: common_vendor.t($data.formErrors.expectedSalary)
  1984. } : {}) : {}) : {}, {
  1985. aC: $data.currentStep === 3
  1986. }, $data.currentStep === 3 ? common_vendor.e({
  1987. aD: $data.familyMembers.length > 0
  1988. }, $data.familyMembers.length > 0 ? {
  1989. aE: common_vendor.f($data.familyMembers, (member, index, i0) => {
  1990. return common_vendor.e({
  1991. a: common_vendor.t(index + 1),
  1992. b: common_vendor.o(($event) => $options.editFamilyMember(index), index),
  1993. c: common_vendor.o(($event) => $options.deleteFamilyMember(index), index)
  1994. }, $options.showFamilyRelationField ? {
  1995. d: common_vendor.t(member.relation)
  1996. } : {}, $options.showFamilyNameField ? {
  1997. e: common_vendor.t(member.name)
  1998. } : {}, $options.showFamilyWorkplaceField ? {
  1999. f: common_vendor.t(member.workplaceOrAddress)
  2000. } : {}, $options.showFamilyPositionField ? {
  2001. g: common_vendor.t(member.position)
  2002. } : {}, $options.showFamilyPhoneField ? {
  2003. h: common_vendor.t(member.phone)
  2004. } : {}, {
  2005. i: common_vendor.t(member.isEmergencyContact ? "是" : "否"),
  2006. j: index
  2007. });
  2008. }),
  2009. aF: $options.showFamilyRelationField,
  2010. aG: $options.showFamilyNameField,
  2011. aH: $options.showFamilyWorkplaceField,
  2012. aI: $options.showFamilyPositionField,
  2013. aJ: $options.showFamilyPhoneField
  2014. } : {}, {
  2015. aK: common_vendor.t($data.isEditing ? "编辑家庭成员" : "添加家庭成员"),
  2016. aL: $data.isEditing
  2017. }, $data.isEditing ? {
  2018. aM: common_vendor.o((...args) => $options.cancelEdit && $options.cancelEdit(...args))
  2019. } : {}, {
  2020. aN: $options.showFamilyRelationField
  2021. }, $options.showFamilyRelationField ? common_vendor.e({
  2022. aO: $data.familyMemberErrors.relation ? 1 : "",
  2023. aP: $data.familyMemberForm.relation,
  2024. aQ: common_vendor.o(($event) => $data.familyMemberForm.relation = $event.detail.value),
  2025. aR: $data.familyMemberErrors.relation
  2026. }, $data.familyMemberErrors.relation ? {
  2027. aS: common_vendor.t($data.familyMemberErrors.relation)
  2028. } : {}) : {}, {
  2029. aT: $options.showFamilyNameField
  2030. }, $options.showFamilyNameField ? common_vendor.e({
  2031. aU: $data.familyMemberErrors.name ? 1 : "",
  2032. aV: $data.familyMemberForm.name,
  2033. aW: common_vendor.o(($event) => $data.familyMemberForm.name = $event.detail.value),
  2034. aX: $data.familyMemberErrors.name
  2035. }, $data.familyMemberErrors.name ? {
  2036. aY: common_vendor.t($data.familyMemberErrors.name)
  2037. } : {}) : {}, {
  2038. aZ: $options.showFamilyWorkplaceField
  2039. }, $options.showFamilyWorkplaceField ? {
  2040. ba: $data.familyMemberForm.workplaceOrAddress,
  2041. bb: common_vendor.o(($event) => $data.familyMemberForm.workplaceOrAddress = $event.detail.value)
  2042. } : {}, {
  2043. bc: $options.showFamilyPositionField
  2044. }, $options.showFamilyPositionField ? {
  2045. bd: $data.familyMemberForm.position,
  2046. be: common_vendor.o(($event) => $data.familyMemberForm.position = $event.detail.value)
  2047. } : {}, {
  2048. bf: $options.showFamilyPhoneField
  2049. }, $options.showFamilyPhoneField ? common_vendor.e({
  2050. bg: common_vendor.o([($event) => $data.familyMemberForm.phone = $event.detail.value, (...args) => $options.validatePhone && $options.validatePhone(...args)]),
  2051. bh: $data.familyMemberErrors.phone ? 1 : "",
  2052. bi: $data.familyMemberForm.phone,
  2053. bj: $data.familyMemberErrors.phone
  2054. }, $data.familyMemberErrors.phone ? {
  2055. bk: common_vendor.t($data.familyMemberErrors.phone)
  2056. } : {}) : {}, {
  2057. bl: $options.showFamilyisEmergency
  2058. }, $options.showFamilyisEmergency ? {
  2059. bm: $data.familyMemberForm.isEmergencyContact,
  2060. bn: common_vendor.o((...args) => $options.handleEmergencyContactChange && $options.handleEmergencyContactChange(...args))
  2061. } : {}, {
  2062. bo: common_vendor.t($data.isEditing ? "✓" : "+"),
  2063. bp: common_vendor.o((...args) => $options.saveFamilyMember && $options.saveFamilyMember(...args)),
  2064. bq: common_vendor.t($data.isEditing ? "保存修改" : "添加成员")
  2065. }) : {}, {
  2066. br: $data.currentStep === 5
  2067. }, $data.currentStep === 5 ? common_vendor.e({
  2068. bs: $data.educationList.length > 0
  2069. }, $data.educationList.length > 0 ? {
  2070. bt: common_vendor.f($data.educationList, (edu, index, i0) => {
  2071. return common_vendor.e({
  2072. a: common_vendor.t(index === 0 ? "第一学历" : "最高学历"),
  2073. b: common_vendor.o(($event) => $options.editEducation(index), index),
  2074. c: common_vendor.o(($event) => $options.deleteEducation(index), index)
  2075. }, $options.showEducationTimeField ? {
  2076. d: common_vendor.t(edu.startTime),
  2077. e: common_vendor.t(edu.endTime)
  2078. } : {}, $options.showEducationSchoolField ? {
  2079. f: common_vendor.t(edu.schoolName)
  2080. } : {}, $options.showEducationMajorField ? {
  2081. g: common_vendor.t(edu.major)
  2082. } : {}, $options.showEducationDegreeField ? {
  2083. h: common_vendor.t(edu.degree)
  2084. } : {}, {
  2085. i: index
  2086. });
  2087. }),
  2088. bv: $options.showEducationTimeField,
  2089. bw: $options.showEducationSchoolField,
  2090. bx: $options.showEducationMajorField,
  2091. by: $options.showEducationDegreeField
  2092. } : {}, {
  2093. bz: $data.educationList.length < 2 || $data.isEditingEducation
  2094. }, $data.educationList.length < 2 || $data.isEditingEducation ? common_vendor.e({
  2095. bA: common_vendor.t($data.isEditingEducation ? "编辑教育经历" : $data.educationList.length === 0 ? "添加第一学历" : "添加最高学历"),
  2096. bB: $data.isEditingEducation
  2097. }, $data.isEditingEducation ? {
  2098. bC: common_vendor.o((...args) => $options.cancelEditEducation && $options.cancelEditEducation(...args))
  2099. } : {}, {
  2100. bD: $options.showEducationTimeField
  2101. }, $options.showEducationTimeField ? common_vendor.e({
  2102. bE: common_vendor.t($data.educationForm.startTime || "开始时间"),
  2103. bF: $data.educationForm.startTime,
  2104. bG: common_vendor.o((...args) => $options.bindStartTimeChange && $options.bindStartTimeChange(...args)),
  2105. bH: $data.educationErrors.startTime ? 1 : "",
  2106. bI: common_vendor.t($data.educationForm.endTime || "结束时间"),
  2107. bJ: $data.educationForm.endTime,
  2108. bK: common_vendor.o((...args) => $options.bindEndTimeChange && $options.bindEndTimeChange(...args)),
  2109. bL: $data.educationErrors.endTime ? 1 : "",
  2110. bM: $data.educationErrors.startTime
  2111. }, $data.educationErrors.startTime ? {
  2112. bN: common_vendor.t($data.educationErrors.startTime)
  2113. } : {}, {
  2114. bO: $data.educationErrors.endTime
  2115. }, $data.educationErrors.endTime ? {
  2116. bP: common_vendor.t($data.educationErrors.endTime)
  2117. } : {}) : {}, {
  2118. bQ: $options.showEducationSchoolField
  2119. }, $options.showEducationSchoolField ? common_vendor.e({
  2120. bR: $data.educationErrors.schoolName ? 1 : "",
  2121. bS: $data.educationForm.schoolName,
  2122. bT: common_vendor.o(($event) => $data.educationForm.schoolName = $event.detail.value),
  2123. bU: $data.educationErrors.schoolName
  2124. }, $data.educationErrors.schoolName ? {
  2125. bV: common_vendor.t($data.educationErrors.schoolName)
  2126. } : {}) : {}, {
  2127. bW: $options.showEducationMajorField
  2128. }, $options.showEducationMajorField ? common_vendor.e({
  2129. bX: $data.educationErrors.major ? 1 : "",
  2130. bY: $data.educationForm.major,
  2131. bZ: common_vendor.o(($event) => $data.educationForm.major = $event.detail.value),
  2132. ca: $data.educationErrors.major
  2133. }, $data.educationErrors.major ? {
  2134. cb: common_vendor.t($data.educationErrors.major)
  2135. } : {}) : {}, {
  2136. cc: $options.showEducationDegreeField
  2137. }, $options.showEducationDegreeField ? common_vendor.e({
  2138. cd: common_vendor.t($data.degreeOptions[$data.degreeIndex] || "请选择学历"),
  2139. ce: common_vendor.o((...args) => $options.bindDegreeChange && $options.bindDegreeChange(...args)),
  2140. cf: $data.degreeIndex,
  2141. cg: $data.degreeOptions,
  2142. ch: $data.educationErrors.degree ? 1 : "",
  2143. ci: $data.educationErrors.degree
  2144. }, $data.educationErrors.degree ? {
  2145. cj: common_vendor.t($data.educationErrors.degree)
  2146. } : {}) : {}, {
  2147. ck: common_vendor.t($data.isEditingEducation ? "✓" : "+"),
  2148. cl: common_vendor.o((...args) => $options.saveEducation && $options.saveEducation(...args)),
  2149. cm: common_vendor.t($data.isEditingEducation ? "保存修改" : "添加学历")
  2150. }) : {}) : {}, {
  2151. cn: $data.currentStep === 6 && ($options.showRequireTrainingInfoField || $options.showRequireProfessionalSkillsField)
  2152. }, $data.currentStep === 6 && ($options.showRequireTrainingInfoField || $options.showRequireProfessionalSkillsField) ? common_vendor.e({
  2153. co: $options.showRequireTrainingInfoField
  2154. }, $options.showRequireTrainingInfoField ? {} : {}, {
  2155. cp: $options.showRequireTrainingInfoField
  2156. }, $options.showRequireTrainingInfoField ? common_vendor.e({
  2157. cq: $data.formErrors.skills ? 1 : "",
  2158. cr: $data.formData.skills,
  2159. cs: common_vendor.o(($event) => $data.formData.skills = $event.detail.value),
  2160. ct: $data.formErrors.skills
  2161. }, $data.formErrors.skills ? {
  2162. cv: common_vendor.t($data.formErrors.skills)
  2163. } : {}) : {}, {
  2164. cw: $options.showRequireProfessionalSkillsField
  2165. }, $options.showRequireProfessionalSkillsField ? {} : {}, {
  2166. cx: $options.showRequireProfessionalSkillsField
  2167. }, $options.showRequireProfessionalSkillsField ? common_vendor.e({
  2168. cy: $data.formErrors.training ? 1 : "",
  2169. cz: $data.formData.training,
  2170. cA: common_vendor.o(($event) => $data.formData.training = $event.detail.value),
  2171. cB: $data.formErrors.training
  2172. }, $data.formErrors.training ? {
  2173. cC: common_vendor.t($data.formErrors.training)
  2174. } : {}) : {}) : {}, {
  2175. cD: $data.currentStep === 8
  2176. }, $data.currentStep === 8 ? common_vendor.e({
  2177. cE: $data.workList.length > 0
  2178. }, $data.workList.length > 0 ? {
  2179. cF: common_vendor.f($data.workList, (work, index, i0) => {
  2180. return common_vendor.e({
  2181. a: common_vendor.t(index + 1),
  2182. b: common_vendor.o(($event) => $options.editWork(index), index),
  2183. c: common_vendor.o(($event) => $options.deleteWork(index), index)
  2184. }, $options.showWorkTimeField ? {
  2185. d: common_vendor.t(work.startTime),
  2186. e: common_vendor.t(work.endTime)
  2187. } : {}, $options.showWorkCompanyField ? {
  2188. f: common_vendor.t(work.companyName)
  2189. } : {}, $options.showWorkDepartmentField ? {
  2190. g: common_vendor.t(work.department)
  2191. } : {}, $options.showWorkEmployeeCountField ? {
  2192. h: common_vendor.t(work.employeeCount)
  2193. } : {}, $options.showWorkPositionField ? {
  2194. i: common_vendor.t(work.position)
  2195. } : {}, $options.showWorkMonthlySalary ? {
  2196. j: common_vendor.t(work.monthlySalary)
  2197. } : {}, $options.showWorkSupervisor ? {
  2198. k: common_vendor.t(work.supervisor)
  2199. } : {}, $options.showWorkSupervisorPhone ? {
  2200. l: common_vendor.t(work.supervisorPhone)
  2201. } : {}, {
  2202. m: index
  2203. });
  2204. }),
  2205. cG: $options.showWorkTimeField,
  2206. cH: $options.showWorkCompanyField,
  2207. cI: $options.showWorkDepartmentField,
  2208. cJ: $options.showWorkEmployeeCountField,
  2209. cK: $options.showWorkPositionField,
  2210. cL: $options.showWorkMonthlySalary,
  2211. cM: $options.showWorkSupervisor,
  2212. cN: $options.showWorkSupervisorPhone
  2213. } : {}, {
  2214. cO: $data.workList.length < 2 || $data.isEditingWork
  2215. }, $data.workList.length < 2 || $data.isEditingWork ? common_vendor.e({
  2216. cP: common_vendor.t($data.isEditingWork ? "编辑工作经历" : "添加工作经历"),
  2217. cQ: $data.isEditingWork
  2218. }, $data.isEditingWork ? {
  2219. cR: common_vendor.o((...args) => $options.cancelEditWork && $options.cancelEditWork(...args))
  2220. } : {}, {
  2221. cS: $options.showWorkTimeField
  2222. }, $options.showWorkTimeField ? common_vendor.e({
  2223. cT: common_vendor.t($data.workForm.startTime || "开始时间"),
  2224. cU: $data.workForm.startTime,
  2225. cV: common_vendor.o((...args) => $options.bindWorkStartTimeChange && $options.bindWorkStartTimeChange(...args)),
  2226. cW: $data.workErrors.startTime ? 1 : "",
  2227. cX: common_vendor.t($data.workForm.endTime || "结束时间"),
  2228. cY: $data.workForm.endTime,
  2229. cZ: common_vendor.o((...args) => $options.bindWorkEndTimeChange && $options.bindWorkEndTimeChange(...args)),
  2230. da: $data.workErrors.endTime ? 1 : "",
  2231. db: $data.workErrors.startTime
  2232. }, $data.workErrors.startTime ? {
  2233. dc: common_vendor.t($data.workErrors.startTime)
  2234. } : {}, {
  2235. dd: $data.workErrors.endTime
  2236. }, $data.workErrors.endTime ? {
  2237. de: common_vendor.t($data.workErrors.endTime)
  2238. } : {}) : {}, {
  2239. df: $options.showWorkCompanyField
  2240. }, $options.showWorkCompanyField ? common_vendor.e({
  2241. dg: $data.workErrors.companyName ? 1 : "",
  2242. dh: $data.workForm.companyName,
  2243. di: common_vendor.o(($event) => $data.workForm.companyName = $event.detail.value),
  2244. dj: $data.workErrors.companyName
  2245. }, $data.workErrors.companyName ? {
  2246. dk: common_vendor.t($data.workErrors.companyName)
  2247. } : {}) : {}, {
  2248. dl: $options.showWorkEmployeeCountField
  2249. }, $options.showWorkEmployeeCountField ? common_vendor.e({
  2250. dm: $data.workErrors.employeeCount ? 1 : "",
  2251. dn: common_vendor.o((...args) => $options.validateEmployeeCount && $options.validateEmployeeCount(...args)),
  2252. dp: $data.workForm.employeeCount,
  2253. dq: common_vendor.o(($event) => $data.workForm.employeeCount = $event.detail.value),
  2254. dr: $data.workErrors.employeeCount
  2255. }, $data.workErrors.employeeCount ? {
  2256. ds: common_vendor.t($data.workErrors.employeeCount)
  2257. } : {}) : {}, {
  2258. dt: $options.showWorkDepartmentField
  2259. }, $options.showWorkDepartmentField ? common_vendor.e({
  2260. dv: $data.workErrors.department ? 1 : "",
  2261. dw: $data.workForm.department,
  2262. dx: common_vendor.o(($event) => $data.workForm.department = $event.detail.value),
  2263. dy: $data.workErrors.department
  2264. }, $data.workErrors.department ? {
  2265. dz: common_vendor.t($data.workErrors.department)
  2266. } : {}) : {}, {
  2267. dA: $options.showWorkPositionField
  2268. }, $options.showWorkPositionField ? common_vendor.e({
  2269. dB: $data.workErrors.position ? 1 : "",
  2270. dC: $data.workForm.position,
  2271. dD: common_vendor.o(($event) => $data.workForm.position = $event.detail.value),
  2272. dE: $data.workErrors.position
  2273. }, $data.workErrors.position ? {
  2274. dF: common_vendor.t($data.workErrors.position)
  2275. } : {}) : {}, {
  2276. dG: $options.showWorkMonthlySalary
  2277. }, $options.showWorkMonthlySalary ? common_vendor.e({
  2278. dH: $data.workErrors.monthlySalary ? 1 : "",
  2279. dI: common_vendor.o([($event) => $data.workForm.monthlySalary = $event.detail.value, (...args) => $options.validateMonthlySalary && $options.validateMonthlySalary(...args)]),
  2280. dJ: $data.workForm.monthlySalary,
  2281. dK: $data.workErrors.monthlySalary
  2282. }, $data.workErrors.monthlySalary ? {
  2283. dL: common_vendor.t($data.workErrors.monthlySalary)
  2284. } : {}) : {}, {
  2285. dM: $options.showWorkSupervisor
  2286. }, $options.showWorkSupervisor ? common_vendor.e({
  2287. dN: $data.workForm.supervisor,
  2288. dO: common_vendor.o(($event) => $data.workForm.supervisor = $event.detail.value),
  2289. dP: $data.workErrors.supervisor
  2290. }, $data.workErrors.supervisor ? {
  2291. dQ: common_vendor.t($data.workErrors.supervisor)
  2292. } : {}) : {}, {
  2293. dR: $options.showWorkSupervisorPhone
  2294. }, $options.showWorkSupervisorPhone ? common_vendor.e({
  2295. dS: common_vendor.o([($event) => $data.workForm.supervisorPhone = $event.detail.value, (...args) => $options.validatePhone && $options.validatePhone(...args)]),
  2296. dT: $data.workForm.supervisorPhone,
  2297. dU: $data.workErrors.supervisorPhone
  2298. }, $data.workErrors.supervisorPhone ? {
  2299. dV: common_vendor.t($data.workErrors.supervisorPhone)
  2300. } : {}) : {}, {
  2301. dW: common_vendor.t($data.isEditingWork ? "✓" : "+"),
  2302. dX: common_vendor.o((...args) => $options.saveWork && $options.saveWork(...args)),
  2303. dY: common_vendor.t($data.isEditingWork ? "保存修改" : "添加工作经历")
  2304. }) : {}) : {}, {
  2305. dZ: $options.showPrevButton
  2306. }, $options.showPrevButton ? {
  2307. ea: common_vendor.o((...args) => $options.prevStep && $options.prevStep(...args))
  2308. } : {}, {
  2309. eb: $options.showSubmitButton
  2310. }, $options.showSubmitButton ? {
  2311. ec: common_vendor.o((...args) => $options.submitForm && $options.submitForm(...args))
  2312. } : {
  2313. ed: common_vendor.o((...args) => $options.nextStep && $options.nextStep(...args))
  2314. });
  2315. }
  2316. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  2317. wx.createPage(MiniProgramPage);