Personal.js 69 KB

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