Personal.js 84 KB

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