Personal.js 67 KB

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