addResume.vue 134 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742
  1. <template>
  2. <div class="addResume" style="padding-bottom: 20px">
  3. <div class="info flex align-center justify-center">
  4. <div class="info-box">
  5. <div class="info-boxs flex justify-between">
  6. <div class="info-box-l" style="width:calc(100% - 640px)">
  7. <div class="info-box-l-box">
  8. <div class="info-box-l-title">
  9. 个人中心
  10. <div class="info-box-l-line"></div>
  11. </div>
  12. <div class="info-box-l-info-hover">
  13. <!---------------------------- 查看个人信息 ---------------------------------->
  14. <div class="info-box-l-info-hovers" v-if="userInfoEdit == false">
  15. <div class="info-box-l-info flex align-center justify-between">
  16. <div class="info-box-l-info-l flex align-center">
  17. <div class="info-box-l-info-avatar" style="flex-shrink: 0;">
  18. <el-upload class="avatar-uploader flex align-center justify-center"
  19. :action="action" :show-file-list="false" :on-success="handleAvatarSuccess
  20. ">
  21. <img v-if="avatar" :src="avatar" style="
  22. width: 100%;
  23. height: 100%;
  24. " class="avatar" />
  25. <el-icon color="#00DD9A" v-else class="avatar-uploader-icon">
  26. <Plus />
  27. </el-icon>
  28. </el-upload>
  29. </div>
  30. <div class="info-box-l-info-info">
  31. <div class="info-box-l-info-info-t flex align-center">
  32. <div>
  33. {{ nickName }}
  34. </div>
  35. <!-- <div v-if="isVip==false">
  36. 升级VIP
  37. </div> -->
  38. <!-- <div v-if="isVip" style="
  39. background-color: #00dd9a;
  40. color: #ffffff;
  41. ">
  42. 会员用户
  43. </div> -->
  44. </div>
  45. <div class="info-box-l-info-info-b flex align-center">
  46. <!-- 工作经验·年龄·学历·性别 -->
  47. {{
  48. resumeInfo.workExpTimes ||
  49. 0
  50. }}年经验·
  51. {{
  52. userEntity &&
  53. userEntity.age
  54. ? userEntity.age
  55. : 18
  56. }}岁·
  57. {{ this.getHighestEducation().degree || ''}}·
  58. {{
  59. userEntity &&
  60. userEntity.sex == 1
  61. ? '男'
  62. : userEntity &&
  63. userEntity.sex ==
  64. 2
  65. ? '女'
  66. : ''
  67. }}
  68. </div>
  69. </div>
  70. </div>
  71. <div class="info-box-l-info-r flex align-center">
  72. <div class="info-box-l-info-r-item" @click="goInterview(0)">
  73. <div class="info-box-l-info-r-item-t">
  74. {{ deliveryCount }}
  75. </div>
  76. <div class="info-box-l-info-r-item-b">
  77. 投递记录
  78. </div>
  79. </div>
  80. <div class="info-box-l-info-r-item" @click="goInterview(4)">
  81. <div class="info-box-l-info-r-item-t">
  82. {{ browseCount }}
  83. </div>
  84. <div class="info-box-l-info-r-item-b">
  85. 浏览记录
  86. </div>
  87. </div>
  88. <div class="info-box-l-info-r-item" @click="goInterview(3)">
  89. <div class="info-box-l-info-r-item-t">
  90. {{ collectionCount }}
  91. </div>
  92. <div class="info-box-l-info-r-item-b">
  93. 我的收藏
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <!-- 求职状态 -->
  99. <div class="info-box-l-btm flex align-center justify-between">
  100. <div class="info-box-l-status">
  101. {{
  102. resumesStatus == 0
  103. ? '离职-随时到岗'
  104. : resumesStatus == 1
  105. ? '在职-月内到岗'
  106. : resumesStatus == 2
  107. ? '在职-考虑机会'
  108. : '在职-暂不考虑'
  109. }}
  110. </div>
  111. <div @click="hideFrom('userInfoEdit')"
  112. class="info-box-l-seid flex align-center">
  113. <el-icon class="info-box-l-seid-icon" style="cursor: pointer"
  114. color="#00DD9A" size="20">
  115. <Edit />
  116. </el-icon>
  117. 编辑
  118. </div>
  119. </div>
  120. </div>
  121. <!---------------------------- 编辑个人信息 ---------------------------------->
  122. <div v-else class="info-box-l-edit">
  123. <view class="info-box-l-edit-title">
  124. 编辑个人信息
  125. </view>
  126. <el-form ref="formResume" v-loading="loading" size="large" style="margin-top: 20px"
  127. class="flex align-center justify-between" label-position="top" :inline="true"
  128. :model="form" label-width="120px">
  129. <el-form-item prop="resumesName" :rules="[
  130. {
  131. required: true,
  132. message: '请输入姓名',
  133. trigger: 'blur'
  134. }
  135. ]" class="row45" label="姓名">
  136. <el-input placeholder="请输入姓名" class="inputClass"
  137. v-model="form.resumesName" />
  138. </el-form-item>
  139. <el-form-item class="row45" label="性别">
  140. <div class="info-box-l-edit-sex flex align-center justify-between">
  141. <div @click="
  142. current = item.id;
  143. form.resumesSex =
  144. item.id;
  145. " :class="current == item.id
  146. ? 'activeSex'
  147. : ''
  148. "
  149. class="info-box-l-edit-sex-item flex align-center justify-center"
  150. v-for="(item, index) in sexList" :key="index">
  151. {{ item.name }}
  152. </div>
  153. </div>
  154. </el-form-item>
  155. <el-form-item prop="resumesPhone" :rules="[
  156. {
  157. required: true,
  158. message: '请输入手机号',
  159. trigger: 'blur'
  160. }
  161. ]" class="row45" label="手机号">
  162. <el-input v-model="form.resumesPhone" maxlength="11" placeholder="请输入手机号" />
  163. </el-form-item>
  164. <el-form-item class="row45" label="年龄">
  165. <el-input-number style="width: 100%" v-model="form.resumesAge" :min="1"
  166. :max="100" controls-position="right" />
  167. </el-form-item>
  168. <el-form-item prop="resumesEmail" :rules="[
  169. {
  170. required: true,
  171. message: '请输入电子邮箱',
  172. trigger: 'blur'
  173. }
  174. ]" class="row45" label="电子邮箱">
  175. <el-input v-model="form.resumesEmail" type="email" placeholder="请输入电子邮箱" />
  176. </el-form-item>
  177. <el-form-item prop="resumesStatus" :rules="[
  178. {
  179. required: true,
  180. message: '请选择求职状态',
  181. trigger: 'blur'
  182. }
  183. ]" class="row45" label="当前求职状态">
  184. <el-select style="width: 100%" v-model="form.resumesStatus"
  185. placeholder="请选择求职状态">
  186. <el-option v-for="item in qiuzhiStatus" :key="item.value"
  187. :label="item.label" :value="item.value" />
  188. </el-select>
  189. </el-form-item>
  190. <el-form-item class="row45"></el-form-item>
  191. <el-form-item class="row45">
  192. <div class="info-box-l-edit-btn flex align-center justify-end">
  193. <el-button @click="
  194. userInfoEdit = false
  195. " style="width: 100px" type="Info">取消</el-button>
  196. <el-button @click="saveResumesInfo()" style="
  197. width: 100px;
  198. margin-left: 30px;
  199. " type="primary">保存</el-button>
  200. </div>
  201. </el-form-item>
  202. </el-form>
  203. </div>
  204. </div>
  205. </div>
  206. <div class="info-box-l-lines"></div>
  207. <div class="info-box-l-gw">
  208. <!---------------------------- 查看求职意向 ---------------------------------->
  209. <div v-if="!gangweiEdit" class="info-box-l-gw-box info-box-l-gw-boxs">
  210. <div class="info-box-l-gw-title flex align-center justify-between">
  211. 求职意向
  212. <div @click="addIntentionJob()" class="info-box-l-gw-box-edit flex align-center">
  213. <el-icon class="info-box-l-gw-box-edit-icon" style="cursor: pointer"
  214. color="#00DD9A" size="20">
  215. <CirclePlus />
  216. </el-icon>
  217. 添加
  218. </div>
  219. </div>
  220. <div v-if="jobTypeList.length == 0" style="margin-top: 20px">
  221. 暂无求职意向
  222. </div>
  223. <div style="margin-top: 20px"
  224. class="info-box-l-gw-box flex align-center flex-wrap justify-between">
  225. <div style="width: 90%" class="flex align-center flex-wrap">
  226. <div @click="getInteJob(item)" class="info-box-l-gw-box-item flex align-center" style="margin-bottom: 20px;"
  227. v-for="(item, index) in jobTypeList" :key="index">
  228. {{ item.ruleClassifyName }}
  229. <div class="fontCOlor" style="margin-left: 10px">
  230. |
  231. <span class="font333" style="margin-left: 10px">
  232. {{ item.salaryRange }}
  233. </span>
  234. </div>
  235. <div class="fontCOlor" style="margin-left: 10px">
  236. |
  237. <span style="margin-left: 10px">
  238. {{ item.citys }}
  239. </span>
  240. </div>
  241. <el-icon class="info-box-l-gw-box-item-edit" color="#00DD9A">
  242. <EditPen />
  243. </el-icon>
  244. <img v-if="item.isDefault == 1" class="info-box-l-gw-box-item-biaoji"
  245. src="../../../public/images/index/biaoji.png" />
  246. </div>
  247. </div>
  248. </div>
  249. </div>
  250. <!---------------------------- 添加求职意向 ---------------------------------->
  251. <div v-else class="info-box-l-gw-box" style="padding: 0 40px">
  252. <div class="info-box-l-gw-title">
  253. 添加求职意向
  254. </div>
  255. <el-form ref="formRef" v-loading="loading" size="large" style="margin-top: 20px"
  256. class="flex align-center justify-between" label-position="top" :inline="true"
  257. :model="intentionJob" label-width="120px">
  258. <el-form-item prop="ruleClassifyName" :rules="[
  259. {
  260. required: true,
  261. message: '请选择工作职位',
  262. trigger: 'blur'
  263. }
  264. ]" class="row45" label="工作职位">
  265. <el-input @click="openDialog()" :readonly="true" placeholder="请选择工作职位"
  266. suffix-icon="ArrowRight" class="inputClass" v-model="intentionJob.ruleClassifyName
  267. ">
  268. </el-input>
  269. </el-form-item>
  270. <el-form-item prop="citys" :rules="[
  271. {
  272. required: true,
  273. message: '请选择期望工作地点',
  274. trigger: 'blur'
  275. }
  276. ]" class="row45" label="期望地点">
  277. <el-input @click="openCityDialog()" :readonly="true" placeholder="请选择期望工作地点"
  278. suffix-icon="ArrowRight" class="inputClass" v-model="intentionJob.citys">
  279. </el-input>
  280. </el-form-item>
  281. <el-form-item prop="industry" :rules="[
  282. {
  283. required: true,
  284. message: '请选择从事方向',
  285. trigger: 'blur'
  286. }
  287. ]" class="row45" label="从事方向">
  288. <el-input @click="openIndustry()" :readonly="true" placeholder="请选择从事方向"
  289. suffix-icon="ArrowRight" class="inputClass" v-model="intentionJob.industry">
  290. </el-input>
  291. </el-form-item>
  292. <el-form-item prop="salaryRange" :rules="[
  293. {
  294. required: true,
  295. message: '请选择期望薪资',
  296. trigger: 'blur'
  297. }
  298. ]" class="row45" label="期望薪资">
  299. <div style="display: flex; gap: 10px; align-items: center; width: 100%">
  300. <!-- 最低薪资 -->
  301. <el-select v-model="intentionJob.minSalary" placeholder="最低薪资"
  302. style="flex: 1">
  303. <el-option v-for="item in desireSalary" :key="item.value"
  304. :label="item.label" :value="item.value" />
  305. </el-select>
  306. <span>-</span>
  307. <!-- 最高薪资 -->
  308. <el-select v-model="intentionJob.maxSalary" placeholder="最高薪资"
  309. style="flex: 1">
  310. <el-option
  311. v-for="item in desireSalary.filter(i => Number(i.value) >= Number(intentionJob.minSalary))"
  312. :key="item.value" :label="item.label" :value="item.value" />
  313. </el-select>
  314. </div>
  315. </el-form-item>
  316. <el-form-item prop="postType" :rules="[
  317. {
  318. required: true,
  319. message: '请选择工作性质',
  320. trigger: 'blur'
  321. }
  322. ]" class="row45" label="工作性质">
  323. <el-select style="width: 100%" v-model="intentionJob.postType"
  324. placeholder="请选择工作性质">
  325. <el-option v-for="item in workStatus" :key="item.value" :label="item.label"
  326. :value="item.value" />
  327. </el-select>
  328. </el-form-item>
  329. <el-form-item class="row45"></el-form-item>
  330. <el-form-item class="row45"></el-form-item>
  331. <el-form-item class="row45">
  332. <div class="info-box-l-edit-btn flex align-center justify-end">
  333. <el-button @click="gangweiEdit = false" style="width: 100px"
  334. type="Info">取消</el-button>
  335. <el-button v-if="intentionId" @click="deleteInteJob()" style="
  336. width: 100px;
  337. margin-left: 30px;
  338. " type="danger">删除</el-button>
  339. <el-button @click="editInteJob()" style="
  340. width: 100px;
  341. margin-left: 30px;
  342. " type="primary">保存</el-button>
  343. </div>
  344. </el-form-item>
  345. </el-form>
  346. </div>
  347. </div>
  348. </div>
  349. <!---------------------------- 右边简历预览 ---------------------------------->
  350. <div class="info-box-r flex justify-center flex-wrap" style="width: 350px;">
  351. <div class="info-box-r-t">
  352. <div>
  353. <el-card class="box-card" shadow="hover" style="
  354. cursor: pointer;
  355. border: none;
  356. border-radius: 15px;
  357. ">
  358. <template #header>
  359. <div class="card-header" style="padding: 2px">
  360. <span style="font-weight: 500">简历预览</span>
  361. </div>
  362. </template>
  363. <div class="box-card-i flex align-center">
  364. <el-icon style="margin-right: 10px">
  365. <User />
  366. </el-icon>姓名:{{ form.resumesName ? form.resumesName : '暂无'}}
  367. </div>
  368. <div class="box-card-i flex align-center">
  369. <el-icon style="margin-right: 10px">
  370. <Message />
  371. </el-icon>邮箱:{{
  372. form.resumesEmail
  373. ? form.resumesEmail
  374. : '暂无'
  375. }}
  376. </div>
  377. <div class="box-card-i flex align-center">
  378. <el-icon style="margin-right: 10px">
  379. <Finished />
  380. </el-icon>岗位:<template v-if="jobTypeList.length > 0">
  381. <template v-for="(item, index) in jobTypeList" :key="index">
  382. {{ item.ruleClassifyName }}
  383. </template>
  384. </template>
  385. <template v-else>暂无岗位</template>
  386. </div>
  387. <div class="box-card-i flex align-center">
  388. <el-icon style="margin-right: 10px">
  389. <Discount />
  390. </el-icon>学校:{{
  391. form.school ? form.school : '暂无'
  392. }}
  393. </div>
  394. <div class="box-card-i flex align-center">
  395. <el-icon style="margin-right: 10px">
  396. <Operation />
  397. </el-icon>专业:{{
  398. form.major ? form.major : '暂无'
  399. }}
  400. </div>
  401. </el-card>
  402. </div>
  403. </div>
  404. <div class="info-box-r-b flex align-center justify-around" style="margin-top: 20px;padding-bottom: 10px;">
  405. <div class="info-box-r-b-item" @click="goInterview(0)">
  406. <div class="info-box-r-b-item-t flex align-center justify-center">
  407. <img src="/images/resume/lljl.png" alt="" srcset="" />
  408. </div>
  409. <div class="info-box-r-b-item-b">投递记录</div>
  410. </div>
  411. <div class="info-box-r-b-item" @click="goInterview(1)">
  412. <div class="info-box-r-b-item-t flex align-center justify-center">
  413. <img src="/images/resume/myLove.png" alt="" srcset="" />
  414. </div>
  415. <div class="info-box-r-b-item-b">沟通记录</div>
  416. </div>
  417. <div class="info-box-r-b-item" @click="goInterview(2)">
  418. <div class="info-box-r-b-item-t flex align-center justify-center">
  419. <img src="/images/resume/ms.png" alt="" srcset="" />
  420. </div>
  421. <div class="info-box-r-b-item-b">我的面试</div>
  422. </div>
  423. <div class="info-box-r-b-item" @click="goInterview(3)">
  424. <div class="info-box-r-b-item-t flex align-center justify-center">
  425. <img src="/images/resume/sx.png" alt="" srcset="" />
  426. </div>
  427. <div class="info-box-r-b-item-b">我的收藏</div>
  428. </div>
  429. </div>
  430. </div>
  431. <!-- 附件简历 -->
  432. <upload-resume v-model="resumeFiles" :limit="3" @change="handleChange" />
  433. </div>
  434. <!---------------------------- 工作经历 ---------------------------------->
  435. <div class="info-boxsWork flex align-center justify-center">
  436. <div class="info-boxsWorks">
  437. <div class="info-boxsWorks-title flex align-center justify-between">
  438. 工作经历
  439. <div @click="workIndex = -1;hideFrom('workExperience')"
  440. class="info-boxsWorks-title-add flex align-center">
  441. <el-icon class="info-boxsWorks-title-adds" style="cursor: pointer" color="#00DD9A"
  442. size="20">
  443. <CirclePlus />
  444. </el-icon>
  445. 添加
  446. </div>
  447. </div>
  448. <div class="info-boxsWorks-content" v-if="
  449. workExps.length == 0 &&
  450. !workExperience
  451. ">
  452. 暂无工作经历
  453. </div>
  454. <div v-if="!workExperience" class="info-boxsWorks-content" v-for="(item, index) in workExps"
  455. :key="index">
  456. <div class="info-boxsWorks-content-title flex align-center justify-between">
  457. {{ item.companyName || '未填写公司名称' }}
  458. <div class="info-boxsWorks-content-title-cz flex align-center">
  459. <div @click="editWorkHis(item, index)"
  460. class="info-boxsWorks-content-title-cz-i flex align-center">
  461. <el-icon class="info-boxsWorks-content-title-cz-is" style="cursor: pointer"
  462. color="#00DD9A" size="14">
  463. <Edit />
  464. </el-icon>
  465. 编辑
  466. </div>
  467. <div @click="deleteWorkHis(item, index)"
  468. class="info-boxsWorks-content-title-cz-i flex align-center">
  469. <el-icon class="info-boxsWorks-content-title-cz-is" style="cursor: pointer"
  470. color="#00DD9A" size="14">
  471. <Delete />
  472. </el-icon>
  473. 删除
  474. </div>
  475. </div>
  476. </div>
  477. <!-- 显示该公司下的所有职位信息 -->
  478. <div v-for="(detail, detailIndex) in workExpList.filter(exp => exp.workExpId === item.workExpId)"
  479. :key="detailIndex" class="info-boxsWorks-content-position">
  480. <div class="info-boxsWorks-content-job">
  481. <span>担任岗位:</span>
  482. {{ detail.position || '未填写岗位' }}
  483. <span v-if="detail.department" class="info-boxsWorks-content-department">
  484. ({{ detail.department }})
  485. </span>
  486. </div>
  487. <div class="info-boxsWorks-content-time flex align-center">
  488. <span>在职时间:</span>
  489. {{
  490. detail.startTime
  491. ? this.getFormDate(detail.startTime)
  492. : '未填写开始时间'
  493. }}
  494. <div class="info-boxsWorks-content-timez">
  495. </div>
  496. {{
  497. detail.endTime
  498. ? this.getFormDate(detail.endTime)
  499. : '至今'
  500. }}
  501. </div>
  502. <div class="info-boxsWorks-content-con" style="white-space: pre-wrap;">
  503. <span>工作内容:</span>
  504. <div>
  505. {{ detail.workContent || '未填写工作内容' }}
  506. </div>
  507. </div>
  508. <!-- 显示技能标签 -->
  509. <div v-if="detail.skills && detail.skills.length > 0"
  510. class="info-boxsWorks-content-time flex align-center">
  511. <span>专业技能:</span>
  512. <div class="info-boxsWorks-content-skills-tags">
  513. <span v-for="(skill, skillIndex) in detail.skills" :key="skillIndex"
  514. class="info-boxsWorks-content-skill-tag">
  515. {{ skill }}
  516. </span>
  517. </div>
  518. </div>
  519. <div v-if="detailIndex < workExpList.filter(exp => exp.workExpId === item.workExpId).length - 1"
  520. class="info-boxsWorks-content-divider"></div>
  521. </div>
  522. <!-- 是否屏蔽该公司 -->
  523. <div class="flex align-center" style="margin-top: 10px;">
  524. <div style="color: #999;font-size: 14px;margin-right: 10px;">不对该公司展示</div>
  525. <el-switch :active-value="1" :inactive-value="0" v-model="item.isShield" @change="changeIsDisplay(item)" />
  526. </div>
  527. </div>
  528. <!-- 添加/编辑工作经历 -->
  529. <div v-else class="info-boxsWorks-edit flex align-center justify-center">
  530. <div class="info-boxsWorks-edits">
  531. <el-form ref="formRefWork" v-loading="loading" size="large" style="margin-top: 20px"
  532. class="flex align-center justify-between" label-position="top" :inline="true"
  533. :model="workObj" label-width="120px">
  534. <el-form-item prop="resumesTitle" :rules="[
  535. {
  536. required: true,
  537. message: '请输入公司名称',
  538. trigger: 'blur'
  539. }
  540. ]" class="row45" label="公司名称">
  541. <el-input placeholder="请输入公司名称" suffix-icon="ArrowRight" class="inputClass"
  542. v-model="workObj.resumesTitle">
  543. </el-input>
  544. </el-form-item>
  545. <el-form-item prop="businessType" :rules="[
  546. {
  547. required: true,
  548. message: '请选择公司业务类型',
  549. trigger: 'change'
  550. }
  551. ]" class="row45" label="公司业务类型">
  552. <el-checkbox-group v-model="workObj.businessType">
  553. <el-checkbox v-for="item in businessTypeOptions" :key="item.value"
  554. :label="item.label">
  555. </el-checkbox>
  556. </el-checkbox-group>
  557. </el-form-item>
  558. <el-form-item prop="department" :rules="[
  559. {
  560. required: true,
  561. message: '请选择所在部门',
  562. trigger: 'change'
  563. }
  564. ]" class="row45" label="所在部门">
  565. <el-select placeholder="请选择所在部门" v-model="workObj.departmentId"
  566. @change="handleDepartmentChange">
  567. <el-option v-for="item in departments" :key="item.departmentId"
  568. :label="item.departmentName" :value="item.departmentId">
  569. </el-option>
  570. </el-select>
  571. </el-form-item>
  572. <el-form-item prop="resumesTime" :rules="[
  573. {
  574. required: true,
  575. message: '请选择在职时间',
  576. trigger: 'blur'
  577. }
  578. ]" class="row45" label="在职时间">
  579. <el-date-picker v-model="workObj.resumesTime" type="daterange"
  580. range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" />
  581. </el-form-item>
  582. <el-form-item prop="selectedJobPost" :rules="[
  583. {
  584. required: true,
  585. message: '请选择工作职位',
  586. trigger: 'blur'
  587. }
  588. ]" class="row45" label="工作职位">
  589. <el-input @click="openDialogForWorkExp()" :readonly="true" placeholder="请选择工作职位"
  590. v-model="workObj.selectedJobPost" suffix-icon="ArrowRight"
  591. class="inputClass">
  592. </el-input>
  593. </el-form-item>
  594. <el-form-item prop="positionSkills" :rules="[
  595. {
  596. required: true,
  597. message: '请选择岗位职业技能',
  598. trigger: 'blur'
  599. }
  600. ]" class="row45" label="岗位职业技能">
  601. <el-input @click="openIndustryForWorkExp()" :readonly="true"
  602. placeholder="请选择岗位职业技能" v-model="workObj.positionSkills"
  603. suffix-icon="ArrowRight" class="inputClass">
  604. </el-input>
  605. </el-form-item>
  606. <el-form-item prop="resumesContent" :rules="[
  607. {
  608. required: true,
  609. message: '请输入工作内容',
  610. trigger: 'blur'
  611. }
  612. ]" class="row45" label="工作内容">
  613. <el-input v-model="workObj.resumesContent" :autosize="{
  614. minRows: 4,
  615. maxRows: 6
  616. }" type="textarea" placeholder="请输入工作内容" />
  617. </el-form-item>
  618. <el-form-item prop="workPerformance" class="row45" label="工作业绩">
  619. <el-input v-model="workObj.workPerformance" :autosize="{
  620. minRows: 4,
  621. maxRows: 6
  622. }" type="textarea" placeholder="请输入工作业绩" />
  623. </el-form-item>
  624. <el-form-item class="row45"> </el-form-item>
  625. <el-form-item class="row45">
  626. <div class="info-box-l-edit-btn flex align-center justify-end">
  627. <el-button @click="workExperience = false" style="width: 100px"
  628. type="Info">取消</el-button>
  629. <el-button @click="editInteWork()" style="
  630. width: 100px;
  631. margin-left: 30px;
  632. " type="primary">保存</el-button>
  633. </div>
  634. </el-form-item>
  635. </el-form>
  636. </div>
  637. </div>
  638. </div>
  639. </div>
  640. <!---------------------------- 教育经历 ---------------------------------->
  641. <div class="info-boxsWork flex align-center justify-center">
  642. <div class="info-boxsWorks">
  643. <div class="info-boxsWorks-title flex align-center justify-between">
  644. <div>教育经历<text style="font-size: 12px; color: #999;font-weight: 400;">(请填写最高学历)</text></div>
  645. <div @click="workIndex = -1; hideFrom('perExperience')"
  646. class="info-boxsWorks-title-add flex align-center">
  647. <el-icon class="info-boxsWorks-title-adds" style="cursor: pointer" color="#00DD9A"
  648. size="20">
  649. <CirclePlus />
  650. </el-icon>
  651. 添加
  652. </div>
  653. </div>
  654. <div class="info-boxsWorks-content" v-if="eduList.length == 0 && !perExperience">
  655. 暂无教育经历
  656. </div>
  657. <div v-if="!perExperience" class="info-boxsWorks-content" v-for="(item, index) in eduList"
  658. :key="index">
  659. <div class="info-boxsWorks-content-title flex align-center justify-between">
  660. {{ item.school || '未填写学校' }}
  661. <div class="info-boxsWorks-content-title-cz flex align-center">
  662. <div @click="editPerHis(item, index)"
  663. class="info-boxsWorks-content-title-cz-i flex align-center">
  664. <el-icon class="info-boxsWorks-content-title-cz-is" style="cursor: pointer"
  665. color="#00DD9A" size="14">
  666. <Edit />
  667. </el-icon>
  668. 编辑
  669. </div>
  670. <div @click="deletePerHis(item, index)"
  671. class="info-boxsWorks-content-title-cz-i flex align-center">
  672. <el-icon class="info-boxsWorks-content-title-cz-is" style="cursor: pointer"
  673. color="#00DD9A" size="14">
  674. <Delete />
  675. </el-icon>
  676. 删除
  677. </div>
  678. </div>
  679. </div>
  680. <div class="info-boxsWorks-content-job">
  681. <span>专业:</span>
  682. {{ item.profession || '未填写专业' }}
  683. </div>
  684. <div class="info-boxsWorks-content-job">
  685. <span>学历:</span>
  686. {{ item.degree || '未填写学历' }}
  687. </div>
  688. <div class="info-boxsWorks-content-time flex align-center">
  689. <span>就读时间:</span>
  690. {{
  691. item.startTime
  692. ? this.getFormDate(item.startTime)
  693. : '未填写开始时间'
  694. }}
  695. <div class="info-boxsWorks-content-timez">
  696. </div>
  697. {{
  698. item.endTime
  699. ? this.getFormDate(item.endTime)
  700. : '至今'
  701. }}
  702. </div>
  703. <div class="info-boxsWorks-content-con" style="white-space: pre-wrap;">
  704. <span>详细描述:</span>
  705. <div>{{ item.detail || '未填写详细描述' }}</div>
  706. </div>
  707. </div>
  708. <!-- 添加/编辑教育经历 -->
  709. <div v-else class="info-boxsWorks-edit flex align-center justify-center">
  710. <div class="info-boxsWorks-edits">
  711. <el-form ref="formRefperject" v-loading="loading" size="large" style="margin-top: 20px"
  712. class="flex align-center justify-between" label-position="top" :inline="true"
  713. :model="perjectObj" label-width="120px">
  714. <el-form-item prop="resumesTitle" :rules="[
  715. {
  716. required: true,
  717. message: '请输入学校名称',
  718. trigger: 'blur'
  719. }
  720. ]" class="row45" label="学校名称">
  721. <el-input placeholder="请输入学校名称" suffix-icon="ArrowRight" class="inputClass"
  722. v-model="perjectObj.resumesTitle">
  723. </el-input>
  724. </el-form-item>
  725. <el-form-item prop="resumesPost" :rules="[
  726. {
  727. required: true,
  728. message: '请输入专业',
  729. trigger: 'blur'
  730. }
  731. ]" class="row45" label="专业">
  732. <el-input placeholder="请输入专业" suffix-icon="ArrowRight" class="inputClass"
  733. v-model="perjectObj.resumesPost">
  734. </el-input>
  735. </el-form-item>
  736. <el-form-item prop="degree" :rules="[
  737. {
  738. required: true,
  739. message: '请选择学历',
  740. trigger: 'change'
  741. }
  742. ]" class="row45" label="学历">
  743. <el-select placeholder="请选择学历" v-model="perjectObj.degree" class="inputClass">
  744. <el-option v-for="(item, index) in degreeOptions" :key="index" :label="item"
  745. :value="item"></el-option>
  746. </el-select>
  747. </el-form-item>
  748. <el-form-item prop="resumesTime" :rules="[
  749. {
  750. required: true,
  751. message: '请选择在校时间',
  752. trigger: 'blur'
  753. }
  754. ]" class="row45" label="在校时间">
  755. <el-date-picker v-model="perjectObj.resumesTime" type="daterange"
  756. range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" />
  757. </el-form-item>
  758. <el-form-item prop="resumesContent" class="row45" label="在校经历(选填)">
  759. <el-input v-model="perjectObj.resumesContent" :autosize="{
  760. minRows: 6,
  761. maxRows: 8
  762. }" maxlength="300" show-word-limit type="textarea" placeholder="1.在校担任职务...
  763. 2.获得荣誉...
  764. 3.所学主要课程..." />
  765. </el-form-item>
  766. <el-form-item class="row45"> </el-form-item>
  767. <el-form-item class="row45"> </el-form-item>
  768. <el-form-item class="row45">
  769. <div class="info-box-l-edit-btn flex align-center justify-end">
  770. <el-button @click="perExperience = false" style="width: 100px"
  771. type="Info">取消</el-button>
  772. <el-button @click="editIntePer()" style="
  773. width: 100px;
  774. margin-left: 30px;
  775. " type="primary">保存</el-button>
  776. </div>
  777. </el-form-item>
  778. </el-form>
  779. </div>
  780. </div>
  781. </div>
  782. </div>
  783. </div>
  784. </div>
  785. <!-- 求职岗位选择 -->
  786. <el-dialog @close="type = false" class="workDialog" :draggable="true" destroy-on-close align-center center
  787. v-model="workDialog" title="工作地址">
  788. <template #header>
  789. <div class="my-header flex align-center">
  790. <div class="my-header-title" style="font-weight: bold">
  791. 求职岗位
  792. </div>
  793. <div class="my-header-title" style="margin-left: 40px">
  794. <el-autocomplete style="width: 300px" prefix-icon="Search" v-model="workSearch"
  795. :fetch-suggestions="querySearchAsync" placeholder="请输入岗位名称" @select="handleSelect" />
  796. </div>
  797. </div>
  798. </template>
  799. <div class="work flex align-center">
  800. <div class="work-left flex align-center justify-center">
  801. <div class="work-left-box">
  802. <ul class="work-left-box-list" style="overflow: auto">
  803. <li @click="workCurrent = index" :class="workCurrent == index ? 'workActive' : ''
  804. " v-for="(item, index) in workTypeList" :key="index"
  805. class="work-left-box-list-item flex align-center justify-center">
  806. <div class="work-left-box-list-items">
  807. {{ item.ruleClassifyName }}
  808. </div>
  809. </li>
  810. </ul>
  811. </div>
  812. </div>
  813. <div class="work-right flex align-center justify-center">
  814. <div class="work-right-box">
  815. <div class="work-right-box-item" v-for="(item, index) in rightList" :key="index">
  816. <div class="work-right-box-item-title">
  817. {{ item.title }}
  818. </div>
  819. <div class="work-right-box-item-name flex align-center flex-wrap">
  820. <div @click="selectJob(ite)" class="work-right-box-item-names"
  821. v-for="(ite, ind) in item.childrens">
  822. {{ ite.ruleClassifyName }}
  823. </div>
  824. </div>
  825. </div>
  826. <el-empty v-if="rightList.length == 0" description="暂无岗位" />
  827. </div>
  828. </div>
  829. </div>
  830. </el-dialog>
  831. <!-- 城市选择 -->
  832. <el-dialog @close="type = false" :draggable="true" destroy-on-close align-center center v-model="cityDialog"
  833. title="工作地址">
  834. <template #header>
  835. <div class="my-header flex align-center">
  836. <div class="my-header-title" style="font-weight: bold">
  837. 工作地址
  838. </div>
  839. <div class="my-header-title flex" style="margin-left: 40px; width: 300px">
  840. <el-input v-model="search" prefix-icon="Search" size="default" placeholder="请输入城市名称"
  841. class="input-with-select" @input="handleSearch" />
  842. <el-button @click="handleSearch" style="margin-left: 10px" type="primary">搜索</el-button>
  843. </div>
  844. </div>
  845. </template>
  846. <div class="city flex align-center justify-center">
  847. <div class="city-box">
  848. <div class="city-box-city">
  849. <div class="city-box-cityt flex align-center justify-between">
  850. 定位城市
  851. <div @click="getLocation()" class="city-box-cityt-r flex align-center">
  852. <el-icon size="18">
  853. <Location />
  854. </el-icon>
  855. 重新定位
  856. </div>
  857. </div>
  858. <div @click="selectCity(city)" class="city-box-citys">
  859. {{ city }}
  860. </div>
  861. </div>
  862. <div class="city-box-list">
  863. <ul class="city-box-lists" style="overflow: auto">
  864. <li class="city-box-lists-title">热门城市</li>
  865. <li class="city-box-lists-title-cs flex align-center flex-wrap">
  866. <div @click="selectCity(item)" class="city-box-lists-title-css"
  867. v-for="(item, index) in rmCity" :key="index">
  868. {{ item }}
  869. </div>
  870. </li>
  871. <li v-for="(item, index) in cityList" :key="index" class="city-box-lists-item">
  872. <div v-if="item.city.length > 0">
  873. <div class="city-box-lists-item-title">
  874. {{ item.letter.toUpperCase() }}
  875. </div>
  876. <div class="flex align-center flex-wrap">
  877. <div class="city-box-lists-item-titles flex align-center"
  878. v-for="(ite, ind) in item.city" :key="ind">
  879. <div @click="selectCity(ite)">
  880. {{ ite }}
  881. </div>
  882. </div>
  883. </div>
  884. </div>
  885. </li>
  886. </ul>
  887. </div>
  888. <el-empty v-if="cityList.length == 0" description="暂无城市" />
  889. </div>
  890. </div>
  891. </el-dialog>
  892. <!-- 从事方向选择 -->
  893. <el-dialog class="workDialog" @close="type = false" :draggable="true" destroy-on-close align-center center
  894. v-model="industryDialog" title="选择从事方向">
  895. <template #header>
  896. <div class="my-header flex align-center">
  897. <div class="my-header-title" style="font-weight: bold">
  898. 选择从事方向
  899. </div>
  900. <div class="my-header-title flex align-center" style="margin-left: 40px; width: 600px">
  901. <el-select @remove-tag="removeTag" :collapse-tags="true" :max-collapse-tags="2"
  902. class="my-header-title-se" multiple-limit="5" v-model="industryArr" multiple
  903. placeholder="请选择从事方向">
  904. <el-option v-for="item in industryArrList" :key="item.postSkillName"
  905. :label="item.postSkillName" :value="item.postSkillName" />
  906. </el-select>
  907. <span style="
  908. margin-left: 10px;
  909. font-size: 13px;
  910. color: #999999;
  911. ">{{ industryArr.length }}</span>
  912. <el-button @click="addHangye()" style="margin-left: 10px" type="primary">确定</el-button>
  913. </div>
  914. </div>
  915. </template>
  916. <div class="preference-grid">
  917. <div v-for="(parent, pIndex) in industryList" :key="pIndex" class="preference-group">
  918. <!-- 一级标题 -->
  919. <div class="preference-title">
  920. <span>{{ parent.postSkillName }}</span>
  921. </div>
  922. <!-- 二级可选项 -->
  923. <div class="preference-children">
  924. <div v-for="(child, cIndex) in parent.childrenList" :key="cIndex" class="preference-tag"
  925. :class="{ active: industryArr.includes(child.postSkillName) }"
  926. @click="togglePreference(pIndex,child.postSkillName)">
  927. <span>{{ child.postSkillName }}</span>
  928. </div>
  929. </div>
  930. </div>
  931. <el-empty v-if="industryList.length == 0" description="暂无从事方向" />
  932. </div>
  933. </el-dialog>
  934. </div>
  935. </template>
  936. <script>
  937. import axios from 'axios';
  938. import jsonp from 'axios-jsonp';
  939. import cityJs from '../../publicJs/city.js';
  940. import citySelect from '../../publicJs/citySelect.js';
  941. import { ElMessageBox, ElMessage } from 'element-plus';
  942. import { ROOTPATH } from '../../../comment/httpUrl.js';
  943. import UploadResume from "../../components/UploadResume/UploadResume.vue";
  944. export default {
  945. components: { UploadResume },
  946. data() {
  947. return {
  948. resumeFiles: [],
  949. cityAll: cityJs, //城市数据
  950. action: ROOTPATH + '/alioss/upload', //上传图片地址
  951. industryDialog: false, //是否打开行业选择
  952. workDialog: false, //是否打开岗位选择
  953. cityDialog: false, //是否打开城市选择弹窗
  954. loading: false, //设置加载中
  955. isWork: false, // 防止重复提交
  956. gangweiEdit: false,
  957. current: 1,
  958. sexList: [
  959. {
  960. name: '男',
  961. id: 1
  962. },
  963. {
  964. name: '女',
  965. id: 2
  966. }
  967. ],
  968. userInfoEdit: false,
  969. form: {
  970. resumesName: '', //姓名
  971. resumesSex: 1, //性别
  972. graduationTime: '', //毕业时间
  973. resumesAge: 18, //年龄
  974. resumesPhone: '', //手机号
  975. resumesEducation: '', //学历
  976. resumesMarriage: '', //婚姻状态
  977. major: '', //专业
  978. school: '', //学校
  979. resumesWorkExperience: '', //工作经验
  980. resumesEmail: '', //电子邮箱
  981. resumesCompensation: '', //期望薪资
  982. industryName: '', //行业
  983. city: '', //意向城市
  984. resumesPost: '', //求职岗位
  985. ruleClassifyId: '', //岗位id
  986. resumesWorkList: [], //项目经验
  987. resumesCompanyList: [] //工作经历
  988. },
  989. workObj: {
  990. //工作经历
  991. resumesTitle: '', //公司名称
  992. resumesTime: [], //时间
  993. resumesContent: '', //工作内容
  994. resumesClassify: 1, //状态
  995. // 添加新的字段以支持新的数据结构
  996. workExpId: '',
  997. workExpDetailId: '',
  998. companyName: '', // 公司名称
  999. position: '', // 岗位
  1000. positionId: 0,
  1001. startTime: '', // 开始时间
  1002. endTime: '', // 结束时间
  1003. department: '',
  1004. departmentId: 0,
  1005. positionLevel: '初级', // 默认初级
  1006. workPerformance: '', // 工作业绩
  1007. skills: '[]', // 技能,格式为JSON字符串
  1008. businessType: [], // 公司业务类型
  1009. positionSkills: [], // 岗位职业技能,格式为数组
  1010. selectedJobPost: '' // 选择的工作职位
  1011. },
  1012. // 与app端一致的业务类型选项
  1013. businessTypeOptions: [
  1014. { label: '跨境电商', value: '0' },
  1015. { label: '国内电商', value: '1' },
  1016. { label: '外贸', value: '2' },
  1017. { label: '其他', value: '3' }
  1018. ],
  1019. // 与app端一致的岗位职级选项
  1020. positionLevels: ['初级', '资深'],
  1021. // 学历选项
  1022. degreeOptions: ['初中', '高中', '中专', '大专', '本科', '硕士', '博士', '博士后'],
  1023. forWorkExp: false, // 是否为工作经历选择数据
  1024. perjectObj: {
  1025. //项目经验
  1026. resumesTitle: '', //公司名称
  1027. resumesTime: [], //时间
  1028. resumesPost: '', //岗位
  1029. resumesContent: '', //工作内容
  1030. resumesClassify: 2 //状态
  1031. },
  1032. qiuzhiStatus: [
  1033. {
  1034. value: 0,
  1035. label: '离职-随时到岗'
  1036. },
  1037. {
  1038. value: 1,
  1039. label: '在职-月内到岗'
  1040. },
  1041. {
  1042. value: 2,
  1043. label: '在职-考虑机会'
  1044. },
  1045. {
  1046. value: 3,
  1047. label: '在职-暂不考虑'
  1048. }
  1049. ], //求职状态
  1050. workStatus: [], //工作性质
  1051. deliveryCount: 0, //投递记录
  1052. browseCount: 0, //浏览记录
  1053. collectionCount: 0, //我的收藏
  1054. nickName: '',
  1055. avatar: '',
  1056. userType: 1, // 1:用户 2:企业
  1057. resumesStatus: 1, //求职状态
  1058. resumeInfo: {}, //简历信息
  1059. userEntity: {}, //用户实体信息
  1060. resumesId: '', //简历id
  1061. screenHeight: 0, //屏幕高度
  1062. jobTypeList: [], //求职意向
  1063. cityList: [], //城市列表
  1064. departments: [], // 部门列表
  1065. intentionJob: {
  1066. ruleClassifyId: '', //岗位id
  1067. ruleClassifyName: '', //岗位名称
  1068. citys: '', //工作城市
  1069. salaryRange: '', //薪资范围
  1070. industry: '', //行业
  1071. postType: '', //工作性质
  1072. isDefault: 0,//是否是第一意向
  1073. minSalary: '',
  1074. maxSalary: ''
  1075. }, //求职意向
  1076. desireSalary: [], //期望薪资
  1077. intentionId: '', //求职意向id
  1078. search: '', //城市搜索内容
  1079. latitude: '',
  1080. longitude: '',
  1081. city: '', //定位城市
  1082. rmCity: [], //热门城市列表
  1083. workTypeList: [], //岗位类型
  1084. workCurrent: 0,
  1085. workSearch: '', //岗位搜索
  1086. industryArr: [], //选择的行业数组
  1087. industryArrList: [], //可选择的行业列表
  1088. industryList: [], //行业列表
  1089. type: false, //简历还是求职意向的 true:简历 false:求职意向
  1090. workExperience: false, //是否显示工作经历添加或者修改
  1091. perExperience: false, //是否显示项目经验添加或者修改
  1092. workIndex: -1, //记录修改工作经历/工作经验的index值
  1093. userInfoEdit: false, //个人信息编辑状态
  1094. // 工作经历相关数据,定义为响应式属性
  1095. workExps: [], // 工作经历列表
  1096. workExpList: [],// 工作经历详细信息列表
  1097. eduList: [], // 教育经历列表
  1098. };
  1099. },
  1100. created() {
  1101. for (let i = 5000; i <= 50000; i += 1000) {
  1102. this.desireSalary.push({ value: i.toString(), label: i.toString() })
  1103. }
  1104. },
  1105. computed: {
  1106. rightList() {
  1107. return this.workTypeList.length > 0
  1108. ? this.workTypeList[this.workCurrent].childrens
  1109. : [];
  1110. },
  1111. isVip() {
  1112. return this.$store.state.isVip;
  1113. }
  1114. },
  1115. mounted() {
  1116. if (this.$route.query.isExpand === '1') {
  1117. this.gangweiEdit = true
  1118. }
  1119. this.screenHeight = window.innerHeight;
  1120. this.token = localStorage.getItem('token');
  1121. if (this.token) {
  1122. this.getUserData();
  1123. this.getUserInfo();
  1124. this.getJlInfo();
  1125. this.getJobType();
  1126. this.getPostType();
  1127. this.getDepartment(); // 获取部门列表
  1128. this.getJobList();
  1129. }
  1130. },
  1131. watch: {
  1132. //监听行业选择变化
  1133. industryArr: {
  1134. handler(newItems) {
  1135. this.industryArr.map(item => {
  1136. this.industryList.map(ite => {
  1137. ite.childrenList.map(it => {
  1138. if (item == it.industryName) {
  1139. it.select = true;
  1140. }
  1141. });
  1142. });
  1143. });
  1144. },
  1145. deep: true
  1146. },
  1147. // 监听教育经历变化,自动更新最高学历信息
  1148. eduList: {
  1149. handler(newList) {
  1150. // 获取最高学历的学校和专业
  1151. const highestEdu = this.getHighestEducation();
  1152. this.form.school = highestEdu.school;
  1153. this.form.major = highestEdu.major;
  1154. this.form.resumesEducation = highestEdu.degree;
  1155. },
  1156. deep: true
  1157. },
  1158. 'intentionJob.minSalary'(val) {
  1159. this.updateSalaryRange()
  1160. },
  1161. 'intentionJob.maxSalary'(val) {
  1162. this.updateSalaryRange()
  1163. }
  1164. },
  1165. methods: {
  1166. // 是否屏蔽该公司
  1167. changeIsDisplay(item) {
  1168. console.log(item)
  1169. let data = {
  1170. workExp: {
  1171. isShield: item.isShield,
  1172. workExpId: item.workExpId
  1173. }
  1174. }
  1175. this.$Request.post("/app/userFirst/addWorkExp", data, { type: 'json' }).then((res) => {
  1176. if (res.code == 0) {
  1177. ElMessage({
  1178. message: '修改成功',
  1179. type: 'success',
  1180. duration: 1500,
  1181. offset: this.screenHeight / 2
  1182. });
  1183. }
  1184. });
  1185. },
  1186. updateSalaryRange() {
  1187. const { minSalary, maxSalary } = this.intentionJob
  1188. if (minSalary && maxSalary && Number(maxSalary) > Number(minSalary)) {
  1189. this.intentionJob.salaryRange = `${minSalary}-${maxSalary}`
  1190. } else {
  1191. this.intentionJob.salaryRange = ''
  1192. }
  1193. },
  1194. handleChange(list) {
  1195. console.log("当前上传的简历文件列表:", list);
  1196. },
  1197. querySearch(queryString, cb) {
  1198. const results = queryString
  1199. ? this.cityAll.filter(city =>
  1200. city.label
  1201. .toLowerCase()
  1202. .includes(queryString.toLowerCase())
  1203. )
  1204. : '';
  1205. // call callback function to return suggestions
  1206. cb(results);
  1207. },
  1208. //去面试记录页面
  1209. goInterview(index) {
  1210. this.$router.push({
  1211. name: 'interview',
  1212. query: { index }
  1213. });
  1214. },
  1215. //上传头像成功后的回调
  1216. handleAvatarSuccess(res) {
  1217. this.avatar = res.data;
  1218. let that = this;
  1219. that.$Request
  1220. .post(
  1221. '/app/user/updateUser',
  1222. { avatar: that.avatar },
  1223. { type: 'json' }
  1224. )
  1225. .then(res => {
  1226. if (res.code === 0) {
  1227. ElMessage({
  1228. message: '上传成功',
  1229. type: 'success',
  1230. duration: 1500,
  1231. offset: this.screenHeight / 2
  1232. });
  1233. that.getUserInfo();
  1234. } else {
  1235. this.avatar = '';
  1236. ElMessage({
  1237. message: res.msg,
  1238. type: 'info',
  1239. duration: 1500,
  1240. offset: this.screenHeight / 2
  1241. });
  1242. }
  1243. });
  1244. },
  1245. //隐藏表单
  1246. hideFrom(name) {
  1247. //传递哪个哪个就打开,剩下的全部关闭
  1248. let arr = [
  1249. 'gangweiEdit',
  1250. 'userInfoEdit',
  1251. 'workExperience',
  1252. 'perExperience'
  1253. ];
  1254. arr.map(item => {
  1255. if (item == name) {
  1256. this[item] = true;
  1257. // 如果是添加教育经历,初始化教育经历编辑表单
  1258. if (item == 'perExperience' && this.workIndex == -1) {
  1259. this.perjectObj = {
  1260. //教育经历
  1261. resumesTitle: '', //学校名称
  1262. resumesTime: [], //时间
  1263. resumesPost: '', //专业
  1264. resumesContent: '', //详细描述
  1265. degree: '', //学历
  1266. resumesClassify: 2, //状态
  1267. // 添加新的字段以支持新的数据结构
  1268. eduId: '',
  1269. school: '', // 学校名称
  1270. profession: '', // 专业
  1271. startTime: '', // 开始时间
  1272. endTime: '', // 结束时间
  1273. detail: '', // 详细描述
  1274. isUse: 1
  1275. };
  1276. }
  1277. // 如果是添加工作经历,初始化工作经历编辑表单
  1278. if (item == 'workExperience' && this.workIndex == -1) {
  1279. this.workObj = {
  1280. //工作经历
  1281. resumesTitle: '', //公司名称
  1282. resumesTime: [], //时间
  1283. resumesPost: '', //岗位
  1284. resumesContent: '', //工作内容
  1285. resumesClassify: 1, //状态
  1286. // 添加新的字段以支持新的数据结构
  1287. workExpId: '',
  1288. workExpDetailId: '',
  1289. companyName: '', // 公司名称
  1290. position: '', // 岗位
  1291. positionId: 0,
  1292. startTime: '', // 开始时间
  1293. endTime: '', // 结束时间
  1294. department: '',
  1295. departmentId: '',
  1296. positionLevel: '初级', // 默认初级
  1297. workPerformance: '', // 工作业绩
  1298. skills: '[]', // 技能,格式为JSON字符串
  1299. businessType: [], // 公司业务类型
  1300. positionSkills: [], // 岗位职业技能,格式为数组
  1301. selectedJobPost: '', // 选择的工作职位
  1302. ruleClassifyId: 0 // 工作职位ID
  1303. };
  1304. }
  1305. // 如果是个人信息编辑模式,从新的数据结构中同步简历信息到form
  1306. if (item == 'userInfoEdit') {
  1307. // 首先从userEntity中获取基本用户信息
  1308. if (this.userEntity) {
  1309. this.form.resumesName =
  1310. this.userEntity.userName || '';
  1311. this.form.resumesAge = this.userEntity.age || '';
  1312. this.form.resumesSex = this.userEntity.sex || 1;
  1313. this.form.resumesPhone =
  1314. this.userEntity.phone || '';
  1315. // 更新性别选择的当前值
  1316. this.current = this.userEntity.sex || 1;
  1317. }
  1318. // 然后从resumeList中获取其他简历信息
  1319. if (this.resumeInfo && this.resumeInfo.resumeList) {
  1320. const resumeData = this.resumeInfo.resumeList;
  1321. this.form.resumesMarriage =
  1322. resumeData.resumesMarriage || '';
  1323. this.form.address = resumeData.address || '';
  1324. this.form.graduationTime =
  1325. resumeData.graduationTime || '';
  1326. this.form.school = resumeData.school || '';
  1327. this.form.major = resumeData.major || '';
  1328. this.form.resumesWorkExperience =
  1329. resumeData.resumesWorkExperience || '';
  1330. this.form.resumesEmail =
  1331. resumeData.resumesEmail || '';
  1332. this.form.resumesStatus =
  1333. resumeData.resumesStatus || 0;
  1334. this.form.resumesCompensation =
  1335. resumeData.resumesCompensation || '';
  1336. this.form.city = resumeData.city || '';
  1337. // this.form.birthday = resumeData.birthday || '';
  1338. // this.form.resumesAttachment =
  1339. // resumeData.resumesAttachment || '';
  1340. // this.form.resumesImage =
  1341. // resumeData.resumesImage || '';
  1342. // this.form.resumesImageName =
  1343. // resumeData.resumesImageName || '';
  1344. this.resumesStatus = resumeData.resumesStatus;
  1345. this.resumesId = resumeData.resumesId;
  1346. }
  1347. }
  1348. } else {
  1349. this[item] = false;
  1350. }
  1351. });
  1352. },
  1353. //保存教育经历
  1354. editIntePer() {
  1355. let formRef = this.$refs.formRefperject;
  1356. formRef.validate(valid => {
  1357. if (valid) {
  1358. this.loading = true;
  1359. // 构建新的数据结构用于保存
  1360. let eduData = {
  1361. eduId: this.perjectObj.eduId || '',
  1362. school: this.perjectObj.resumesTitle || '', // 学校名称
  1363. profession: this.perjectObj.resumesPost || '', // 专业
  1364. degree: this.perjectObj.degree || '', // 学历
  1365. startTime: this.getFormDate(
  1366. this.perjectObj.resumesTime[0]
  1367. ), // 开始时间
  1368. endTime: this.getFormDate(
  1369. this.perjectObj.resumesTime[1]
  1370. ), // 结束时间
  1371. detail: this.perjectObj.resumesContent || '', // 详细描述
  1372. };
  1373. // 调用保存API
  1374. let apiUrl = '/app/userFirst/addEdu';
  1375. this.$Request.post(apiUrl, eduData,{type:'json'}).then(res => {
  1376. if (res.code == 0) {
  1377. ElMessage({
  1378. message: '保存成功',
  1379. type: 'success',
  1380. duration: 1500,
  1381. offset: this.screenHeight / 2
  1382. });
  1383. // 重置表单
  1384. this.perjectObj = {
  1385. //教育经历
  1386. resumesTitle: '', //学校名称
  1387. resumesTime: [], //时间
  1388. resumesPost: '', //专业
  1389. resumesContent: '', //详细描述
  1390. degree: '', //学历
  1391. resumesClassify: 2 //状态
  1392. };
  1393. // 重新获取最新的数据
  1394. this.getUserInfo();
  1395. this.getJlInfo();
  1396. this.loading = false;
  1397. this.perExperience = false;
  1398. } else {
  1399. this.loading = false;
  1400. ElMessageBox.alert(res.msg, '提示', {
  1401. confirmButtonText: '确认'
  1402. });
  1403. }
  1404. });
  1405. this.workIndex = -1;
  1406. } else {
  1407. console.log('error submit!');
  1408. return false;
  1409. }
  1410. });
  1411. },
  1412. //编辑教育经历
  1413. editPerHis(item, index) {
  1414. this.workIndex = index;
  1415. // 从eduList数组获取数据并转换为编辑表单需要的格式
  1416. let edu = JSON.parse(JSON.stringify(item));
  1417. // 构建编辑表单需要的数据结构
  1418. this.perjectObj = {
  1419. // 保留原有的resumesTitle字段用于向后兼容,这里存储学校名称
  1420. resumesTitle: edu.school || '',
  1421. // 保留原有的resumesPost字段用于向后兼容,这里存储专业和学历
  1422. resumesPost: edu.profession || '',
  1423. // 保留原有的resumesContent字段用于向后兼容,这里存储详细描述
  1424. resumesContent: edu.detail || '',
  1425. // 设置时间范围
  1426. resumesTime: [
  1427. edu.startTime ? new Date(edu.startTime) : '',
  1428. edu.endTime ? new Date(edu.endTime) : ''
  1429. ],
  1430. // 保存实际的eduId用于更新
  1431. eduId: edu.eduId,
  1432. // 保存学历信息
  1433. degree: edu.degree || ''
  1434. };
  1435. this.hideFrom('perExperience');
  1436. },
  1437. //删除教育经历
  1438. deletePerHis(item, index) {
  1439. ElMessageBox.alert('确认删除此段教育经历吗?', '提示', {
  1440. confirmButtonText: '确认',
  1441. showCancelButton: true,
  1442. callback: res => {
  1443. if (res == 'confirm') {
  1444. //确认
  1445. this.loading = true;
  1446. let eduId = item.eduId;
  1447. // 调用删除API
  1448. this.$Request
  1449. .post('/app/userFirst/deleteEdu', {eduId: eduId},{type:'json'})
  1450. .then(res => {
  1451. if (res.code == 0) {
  1452. ElMessage({
  1453. message: '已删除',
  1454. type: 'success',
  1455. duration: 1500,
  1456. offset: this.screenHeight / 2
  1457. });
  1458. // 重新获取最新的数据
  1459. this.getUserInfo();
  1460. this.getJlInfo();
  1461. this.loading = false;
  1462. } else {
  1463. this.loading = false;
  1464. ElMessageBox.alert(res.msg, '提示', {
  1465. confirmButtonText: '确认'
  1466. });
  1467. }
  1468. });
  1469. }
  1470. }
  1471. });
  1472. },
  1473. //编辑工作经历
  1474. editWorkHis(item, index) {
  1475. this.workIndex = index;
  1476. // 从workExps数组获取数据
  1477. let workExp = JSON.parse(JSON.stringify(item));
  1478. // 先设置基本的workObj,主要是workExpId
  1479. this.workObj = {
  1480. workExpId: workExp.workExpId,
  1481. businessType: workExp.businessType || []
  1482. };
  1483. // 调用getDepartment获取部门列表,在获取成功后会自动调用getData获取详细数据
  1484. this.getDepartment();
  1485. this.hideFrom('workExperience');
  1486. },
  1487. //删除工作经历
  1488. deleteWorkHis(item, index) {
  1489. ElMessageBox.confirm('确认删除该条内容么?', '提示', {
  1490. confirmButtonText: '确认',
  1491. cancelButtonText: '取消',
  1492. type: 'warning'
  1493. }).then(() => {
  1494. // 确认删除
  1495. this.loading = true;
  1496. let action = 'userFirst/deleteWorkExp';
  1497. let params = {
  1498. workExpId: item.workExpId
  1499. };
  1500. this.$Request.post("/app/" + action, params,{type:'json'}).then((res) => {
  1501. this.loading = false;
  1502. if (res.code == 0) {
  1503. ElMessage({
  1504. message: '已删除',
  1505. type: 'success',
  1506. duration: 1500,
  1507. offset: this.screenHeight / 2
  1508. });
  1509. // 直接在本地数组中过滤掉删除的项,与app端逻辑一致
  1510. this.workExps = this.workExps.filter(function(workItem) {
  1511. return workItem.workExpId != item.workExpId;
  1512. });
  1513. // 同时过滤workExpList数组中对应的详细信息,确保页面正确渲染
  1514. this.workExpList = this.workExpList.filter(function(detailItem) {
  1515. return detailItem.workExpId != item.workExpId;
  1516. });
  1517. } else {
  1518. ElMessage({
  1519. message: res.msg,
  1520. type: 'error',
  1521. duration: 1500,
  1522. offset: this.screenHeight / 2
  1523. });
  1524. }
  1525. }).catch(() => {
  1526. this.loading = false;
  1527. // 用户取消删除
  1528. });
  1529. });
  1530. },
  1531. //时间对象转:2023-11-21格式
  1532. getFormDate(formData) {
  1533. let time = new Date(formData);
  1534. return (
  1535. time.getFullYear() +
  1536. '-' +
  1537. (time.getMonth() + 1 < 10
  1538. ? '0' + (time.getMonth() + 1)
  1539. : time.getMonth() + 1) +
  1540. '-' +
  1541. (time.getDate() < 10 ? '0' + time.getDate() : time.getDate())
  1542. );
  1543. },
  1544. //修改/添加工作经验
  1545. editInteWork() {
  1546. // 防止重复提交
  1547. if (this.isWork) {
  1548. return;
  1549. }
  1550. let formRef = this.$refs.formRefWork;
  1551. formRef.validate(valid => {
  1552. if (valid) {
  1553. this.isWork = true;
  1554. this.loading = true;
  1555. console.log(this.workObj)
  1556. // 构建与app端一致的数据结构用于保存
  1557. let workExpDetailData = {
  1558. workExpDetailId: this.workObj.workExpDetailId || '',
  1559. workExpId: this.workObj.workExpId || '',
  1560. department: this.workObj.department || '',
  1561. departmentId: this.workObj.departmentId || 0,
  1562. positionLevel: this.workObj.positionLevel || '',
  1563. position: this.workObj.selectedJobPost || '',
  1564. positionId: this.workObj.ruleClassifyId || 0,
  1565. workContent: this.workObj.resumesContent || '', // 工作内容
  1566. workPerformance: this.workObj.workPerformance || '', // 工作业绩
  1567. skills: typeof this.workObj.positionSkills === 'string' ? this.workObj.positionSkills : JSON.stringify(this.workObj.positionSkills), // 技能,格式为JSON字符串,使用positionSkills字段的值
  1568. startTime: this.getFormDate(this.workObj.resumesTime[0]), // 开始时间
  1569. endTime: this.getFormDate(this.workObj.resumesTime[1]), // 结束时间
  1570. };
  1571. let workExpData = {
  1572. workExp: {
  1573. workExpId: this.workObj.workExpId || '',
  1574. companyName: this.workObj.resumesTitle || '', // 公司名称
  1575. type: JSON.stringify(this.workObj.businessType || []), // 公司业务类型
  1576. },
  1577. workExpDetails: [workExpDetailData]
  1578. };
  1579. console.log(workExpDetailData)
  1580. let apiUrl = '/app/userFirst/addWorkExp';
  1581. this.$Request.post(apiUrl, workExpData,{type:'json'}).then(res => {
  1582. this.isWork = false;
  1583. this.loading = false;
  1584. if (res.code == 0) {
  1585. ElMessage({
  1586. message: '保存成功',
  1587. type: 'success',
  1588. duration: 1500,
  1589. offset: this.screenHeight / 2
  1590. });
  1591. // 重置表单
  1592. this.workObj = {
  1593. //工作经历
  1594. resumesTitle: '', //公司名称
  1595. resumesTime: [], //时间
  1596. resumesPost: '', //岗位
  1597. resumesContent: '', //工作内容
  1598. resumesClassify: 1, //状态
  1599. // 添加新的字段以支持新的数据结构
  1600. workExpId: '',
  1601. workExpDetailId: '',
  1602. companyName: '', // 公司名称
  1603. position: '', // 岗位
  1604. positionId: 0,
  1605. startTime: '', // 开始时间
  1606. endTime: '', // 结束时间
  1607. department: '',
  1608. departmentId: 0,
  1609. positionLevel: '初级',
  1610. workPerformance: '', // 工作业绩
  1611. skills: '[]', // 技能,格式为JSON字符串
  1612. businessType: [], // 公司业务类型
  1613. positionSkills: [], // 岗位职业技能,格式为数组
  1614. selectedJobPost: '', // 选择的工作职位
  1615. ruleClassifyId: 0 // 工作职位ID
  1616. };
  1617. // 重新获取最新的数据
  1618. this.getUserInfo();
  1619. this.getJlInfo();
  1620. this.workExperience = false;
  1621. } else {
  1622. ElMessage({
  1623. message: res.msg || '保存失败',
  1624. type: 'error',
  1625. duration: 1500,
  1626. offset: this.screenHeight / 2
  1627. });
  1628. }
  1629. }).catch(() => {
  1630. this.isWork = false;
  1631. this.loading = false;
  1632. });
  1633. this.workIndex = -1;
  1634. } else {
  1635. console.log('error submit!');
  1636. return false;
  1637. }
  1638. });
  1639. },
  1640. removeTag(e) {
  1641. console.log(e, '2222222');
  1642. this.industryList.map(item => {
  1643. if (item.childrenList.length > 0) {
  1644. item.childrenList.map(ite => {
  1645. if (ite.industryName == e) {
  1646. ite.select = false;
  1647. }
  1648. });
  1649. }
  1650. });
  1651. console.log(this.industryList, '111111111');
  1652. console.log(this.industryArr, '已出tag');
  1653. },
  1654. // 分割时间
  1655. splitTime(time) {
  1656. // 使用字符串的 split() 方法将时间分割为数组
  1657. return time ? time.split(/ - /) : [];
  1658. },
  1659. //确认行业/岗位职业技能
  1660. addHangye() {
  1661. if (this.forWorkExp) {
  1662. // 为工作经历设置岗位职业技能
  1663. this.workObj.positionSkills = this.industryArr;
  1664. } else if (this.type) {
  1665. // 为表单设置行业
  1666. this.form.industryName = this.industryArr.join('/');
  1667. } else {
  1668. // 为求职意向设置行业
  1669. this.intentionJob.industry = this.industryArr.join('/');
  1670. }
  1671. this.industryDialog = false;
  1672. },
  1673. //打开行业选择弹框(用于求职意向)
  1674. openIndustry(type) {
  1675. this.type = type;
  1676. this.forWorkExp = false; // 标志是求职意向使用
  1677. // 检查是否已选择工作职位
  1678. let ruleClassifyId = this.type ? this.form.ruleClassifyId : this.intentionJob.ruleClassifyId;
  1679. if (!ruleClassifyId) {
  1680. ElMessage({
  1681. message: '请先选择工作职位',
  1682. type: 'warning',
  1683. duration: 1500,
  1684. offset: this.screenHeight / 2
  1685. });
  1686. return;
  1687. }
  1688. this.industryArr = [];
  1689. this.getIndustryList();
  1690. },
  1691. // 为工作经历打开工作职位选择
  1692. openDialogForWorkExp() {
  1693. this.forWorkExp = true;
  1694. this.workDialog = true;
  1695. },
  1696. // 为工作经历打开岗位职业技能选择
  1697. openIndustryForWorkExp() {
  1698. this.forWorkExp = true;
  1699. // 检查是否已选择工作职位
  1700. if (!this.workObj.selectedJobPost || !this.workObj.ruleClassifyId) {
  1701. ElMessage({
  1702. message: '请先选择工作职位',
  1703. type: 'warning',
  1704. duration: 1500,
  1705. offset: this.screenHeight / 2
  1706. });
  1707. return;
  1708. }
  1709. this.industryArr = [];
  1710. this.getIndustryListForWorkExp();
  1711. },
  1712. /**
  1713. * 获取工作经历的岗位职业技能数据
  1714. */
  1715. getIndustryListForWorkExp() {
  1716. let data = {
  1717. ruleClassifyId: this.workObj.ruleClassifyId
  1718. };
  1719. this.$Request.get('/app/userFirst/getPostSkill', { params: data }).then(res => {
  1720. if (res.code == 0) {
  1721. // 处理返回的层级数据
  1722. this.industryList = res.data;
  1723. // 构建可选择的行业列表(扁平化)
  1724. let flatList = [];
  1725. this.industryList.forEach(parent => {
  1726. parent.childrenList.forEach(child => {
  1727. flatList.push(child);
  1728. });
  1729. });
  1730. this.industryArrList = flatList;
  1731. this.industryDialog = true;
  1732. } else {
  1733. ElMessage({
  1734. message: res.msg,
  1735. type: 'error',
  1736. duration: 1500,
  1737. offset: this.screenHeight / 2
  1738. });
  1739. }
  1740. });
  1741. },
  1742. // 切换从事方向选择状态
  1743. // togglePreference(a,skillName) {
  1744. // // 查找索引
  1745. // const index = this.industryArr.indexOf(skillName);
  1746. // if (index > -1) {
  1747. // // 如果已选择,则取消选择
  1748. // this.industryArr.splice(index, 1);
  1749. // } else {
  1750. // // 如果未选择,检查是否达到选择上限
  1751. // if (this.industryArr.length >= 5) {
  1752. // ElMessage({
  1753. // message: '最多添加五条',
  1754. // type: 'info',
  1755. // duration: 1500,
  1756. // offset: this.screenHeight / 2
  1757. // });
  1758. // return;
  1759. // }
  1760. // // 添加选择
  1761. // this.industryArr.push(skillName);
  1762. // }
  1763. // },
  1764. // 切换从事方向选择状态
  1765. togglePreference(pIndex, skillName) {
  1766. const parent = this.industryList[pIndex]; // 当前分类
  1767. console.log(parent)
  1768. console.log(this.industryArr)
  1769. const selectedInGroup = parent.childrenList.filter(item =>
  1770. this.industryArr.includes(item.postSkillName)
  1771. );
  1772. const index = this.industryArr.indexOf(skillName);
  1773. if (index > -1) {
  1774. // 取消选择
  1775. this.industryArr.splice(index, 1);
  1776. } else {
  1777. // 检查当前分类是否已选满 5 个
  1778. if (selectedInGroup.length >= 5) {
  1779. ElMessage({
  1780. message: '每个分类最多选择五个',
  1781. type: 'info',
  1782. duration: 1500,
  1783. offset: this.screenHeight / 2
  1784. });
  1785. return;
  1786. }
  1787. // 添加选择
  1788. this.industryArr.push(skillName);
  1789. }
  1790. },
  1791. // 添加行业
  1792. addIndustry(ite) {
  1793. if (ite.select == false) {
  1794. if (this.industryArr.length == 5) {
  1795. ElMessage({
  1796. message: '最多添加五条',
  1797. type: 'info',
  1798. duration: 1500,
  1799. offset: this.screenHeight / 2
  1800. });
  1801. return;
  1802. }
  1803. this.industryArr.push(ite.industryName);
  1804. } else {
  1805. console.log('ccccccccccc');
  1806. this.industryArr.splice(
  1807. this.industryArr.indexOf(ite.industryName),
  1808. 1
  1809. );
  1810. }
  1811. ite.select = !ite.select;
  1812. },
  1813. /**
  1814. * 获取行业数据(从事方向)
  1815. */
  1816. getIndustryList() {
  1817. // 获取当前选择的工作职位ID
  1818. let ruleClassifyId = this.type ? this.form.ruleClassifyId : this.intentionJob.ruleClassifyId;
  1819. let data = {
  1820. ruleClassifyId: ruleClassifyId
  1821. };
  1822. this.$Request.get('/app/userFirst/getPostSkill', { params: data }).then(res => {
  1823. if (res.code == 0) {
  1824. // 处理返回的层级数据
  1825. this.industryList = res.data;
  1826. // 构建可选择的行业列表(扁平化)
  1827. let flatList = [];
  1828. this.industryList.forEach(parent => {
  1829. parent.childrenList.forEach(child => {
  1830. flatList.push(child);
  1831. });
  1832. });
  1833. this.industryArrList = flatList;
  1834. this.industryDialog = true;
  1835. } else {
  1836. ElMessage({
  1837. message: res.msg,
  1838. type: 'error',
  1839. duration: 1500,
  1840. offset: this.screenHeight / 2
  1841. });
  1842. }
  1843. });
  1844. },
  1845. //选择岗位
  1846. handleSelect(item) {
  1847. if (this.forWorkExp) {
  1848. // 为工作经历选择
  1849. this.workObj.ruleClassifyId = item.ruleClassifyId; //岗位分类id
  1850. this.workObj.selectedJobPost = item.ruleClassifyName; //岗位分类名称
  1851. } else if (this.type) {
  1852. // 为表单选择
  1853. this.form.ruleClassifyId = item.ruleClassifyId; //岗位分类id
  1854. this.form.resumesPost = item.ruleClassifyName; //岗位分类名称
  1855. } else {
  1856. // 为求职意向选择
  1857. this.intentionJob.ruleClassifyId = item.ruleClassifyId; //岗位分类id
  1858. this.intentionJob.ruleClassifyName = item.ruleClassifyName; //岗位分类名称
  1859. }
  1860. this.workDialog = false;
  1861. },
  1862. // 岗位的搜索
  1863. querySearchAsync(queryString, cd) {
  1864. if (!queryString) {
  1865. cd([]);
  1866. return;
  1867. }
  1868. let data = {
  1869. ruleClassifyName: queryString
  1870. };
  1871. this.$Request
  1872. .get('/app/rule/userGetClassify', { params: data })
  1873. .then(res => {
  1874. if (res.code == 0) {
  1875. let arr = res.data;
  1876. arr.map(item => {
  1877. item.value = item.ruleClassifyName;
  1878. });
  1879. cd(arr);
  1880. }
  1881. });
  1882. },
  1883. //打开岗位选择
  1884. openDialog(type) {
  1885. this.type = type;
  1886. this.workSearch = '';
  1887. this.workDialog = true;
  1888. },
  1889. /**
  1890. * @param {Object} info
  1891. * 选择岗位并返回
  1892. */
  1893. selectJob(info) {
  1894. if (this.forWorkExp) {
  1895. // 工作经历模块
  1896. this.workObj.ruleClassifyId = info.ruleClassifyId; //岗位分类id
  1897. this.workObj.selectedJobPost = info.ruleClassifyName; //岗位分类名称
  1898. } else if (this.type) {
  1899. // 表单模块
  1900. this.form.ruleClassifyId = info.ruleClassifyId; //岗位分类id
  1901. this.form.resumesPost = info.ruleClassifyName; //岗位分类名称
  1902. } else {
  1903. // 求职意向模块
  1904. this.intentionJob.ruleClassifyId = info.ruleClassifyId; //岗位分类id
  1905. this.intentionJob.ruleClassifyName = info.ruleClassifyName; //岗位分类名称
  1906. }
  1907. this.workDialog = false;
  1908. this.forWorkExp = false; // 重置标志位
  1909. },
  1910. /**
  1911. * 获取岗位列表
  1912. */
  1913. getJobList() {
  1914. this.$Request.get('/app/rule/getClassifyList').then(res => {
  1915. if (res.code == 0) {
  1916. if (res.data) {
  1917. this.workTypeList = res.data;
  1918. }
  1919. }
  1920. });
  1921. },
  1922. //打开城市选择
  1923. openCityDialog(type) {
  1924. this.type = type;
  1925. this.search = '';
  1926. this.getCitysList();
  1927. this.getLocation();
  1928. this.getRmCityList();
  1929. this.cityDialog = true;
  1930. },
  1931. //选择城市
  1932. selectCity(city) {
  1933. if (this.type) {
  1934. this.form.city = city;
  1935. } else {
  1936. this.intentionJob.citys = city;
  1937. }
  1938. this.cityDialog = false;
  1939. },
  1940. /**
  1941. * 热门城市列表
  1942. */
  1943. getRmCityList() {
  1944. let data = {
  1945. limitCount: 10
  1946. };
  1947. this.$Request
  1948. .get('/app/postPush/getHotCity', { params: data })
  1949. .then(res => {
  1950. if (res.code == 0) {
  1951. this.rmCity = res.data;
  1952. }
  1953. });
  1954. },
  1955. /**
  1956. * @param {Object} longitude
  1957. * @param {Object} latitude
  1958. * 使用经纬度获取城市
  1959. */
  1960. getSelectCity(longitude, latitude) {
  1961. let data = {
  1962. lat: latitude,
  1963. lng: longitude
  1964. };
  1965. this.$Request
  1966. .get('/app/Login/selectCity', { params: data })
  1967. .then(res => {
  1968. if (res.code == 0) {
  1969. this.city = res.data.city ? res.data.city : '未知';
  1970. }
  1971. });
  1972. },
  1973. //使用jsonp请求从腾讯地图获取经纬度
  1974. getLocation() {
  1975. let data = {
  1976. key: 'ZBABZ-ZWECU-UQTVV-4LYDR-COK3F-5SF75', //申请的密钥
  1977. output: 'jsonp'
  1978. };
  1979. let url = 'https://apis.map.qq.com/ws/location/v1/ip';
  1980. axios
  1981. .get(url, {
  1982. params: data,
  1983. adapter: jsonp
  1984. })
  1985. .then(res => {
  1986. this.longitude = res.data.result.location.lng;
  1987. this.latitude = res.data.result.location.lat;
  1988. this.getSelectCity(this.longitude, this.latitude);
  1989. })
  1990. .catch(err => {
  1991. console.log(err);
  1992. });
  1993. },
  1994. //删除求职意向
  1995. deleteInteJob() {
  1996. ElMessageBox.alert('确认删除此求职意向吗?', '提示', {
  1997. confirmButtonText: '确认',
  1998. showCancelButton: true,
  1999. callback: res => {
  2000. if (res == 'confirm') {
  2001. //确认
  2002. this.loading = true;
  2003. this.$Request
  2004. .post(
  2005. '/app/intention/deleteIntention',
  2006. { intentionId: this.intentionId },
  2007. { type: 'json' }
  2008. )
  2009. .then(res => {
  2010. if (res.code == 0) {
  2011. ElMessage({
  2012. message: '删除成功',
  2013. type: 'success',
  2014. duration: 1500,
  2015. offset: this.screenHeight / 2
  2016. });
  2017. this.loading = false;
  2018. this.gangweiEdit = false;
  2019. this.getJobType();
  2020. } else {
  2021. this.loading = false;
  2022. ElMessageBox.alert(res.msg, '提示', {
  2023. confirmButtonText: '确认'
  2024. });
  2025. }
  2026. });
  2027. }
  2028. }
  2029. });
  2030. },
  2031. //修改求职意向
  2032. editInteJob() {
  2033. let formRef = this.$refs.formRef;
  2034. formRef.validate(valid => {
  2035. if (valid) {
  2036. // 防止重复提交
  2037. if (this.isWork) return;
  2038. this.isWork = true;
  2039. this.loading = true;
  2040. // 构建与app端一致的数据结构
  2041. let data = {
  2042. intentionId: this.intentionId || '',
  2043. ruleClassifyId: this.intentionJob.ruleClassifyId,
  2044. ruleClassifyName: this.intentionJob.ruleClassifyName,
  2045. citys: this.intentionJob.citys,
  2046. salaryRange: this.intentionJob.salaryRange,
  2047. postType: this.intentionJob.postType,
  2048. industry: this.intentionJob.industry,
  2049. createTime: "",
  2050. industryId: 201,
  2051. industryOneId: 200,
  2052. classifyOneId: 0,
  2053. classifyTwoId: 0,
  2054. isDefault: 1
  2055. };
  2056. this.$Request.post("/app/intention/saveUpdate", data,{type:'json'}).then((res) => {
  2057. this.isWork = false;
  2058. this.loading = false;
  2059. if (res.code == 0) {
  2060. ElMessage({
  2061. message: '保存成功',
  2062. type: 'success',
  2063. duration: 1500,
  2064. offset: this.screenHeight / 2
  2065. });
  2066. // 关闭编辑弹窗
  2067. this.gangweiEdit = false;
  2068. // 更新求职意向列表
  2069. this.getJobType();
  2070. }
  2071. // else {
  2072. // ElMessage({
  2073. // message: res.msg,
  2074. // type: 'error',
  2075. // duration: 1500,
  2076. // offset: this.screenHeight / 2
  2077. // });
  2078. // }
  2079. });
  2080. } else {
  2081. console.log('error submit!');
  2082. return false;
  2083. }
  2084. });
  2085. },
  2086. //新增求职意向
  2087. addIntentionJob() {
  2088. //关闭之前的表单
  2089. this.intentionId = '';
  2090. this.intentionJob = {
  2091. ruleClassifyId: '', //岗位id
  2092. ruleClassifyName: '', //岗位名称
  2093. citys: '', //工作城市
  2094. salaryRange: '', //薪资范围
  2095. industry: '', //行业
  2096. postType: '', //工作性质
  2097. minSalary: '', //最小薪资
  2098. maxSalary: '' //最大薪资
  2099. };
  2100. this.hideFrom('gangweiEdit');
  2101. },
  2102. //查询求职意向
  2103. getInteJob(item) {
  2104. this.intentionId = item.intentionId;
  2105. let data = {
  2106. intentionId: item.intentionId
  2107. };
  2108. console.log(data, '1111111');
  2109. this.$Request
  2110. .get('/app/intention/getIntentionInfo', { params: data })
  2111. .then(res => {
  2112. if (res.code == 0) {
  2113. this.intentionJob.ruleClassifyId =
  2114. res.data.ruleClassifyId; //岗位id
  2115. this.intentionJob.ruleClassifyName =
  2116. res.data.ruleClassifyName; //岗位名称
  2117. this.intentionJob.citys = res.data.citys; //工作城市
  2118. // 设置薪资范围,确保与desireSalary中的选项匹配
  2119. // this.intentionJob.salaryRange = res.data.salaryRange; //薪资范围(数值格式)
  2120. this.intentionJob.minSalary = res.data.minSalary; //最小薪资
  2121. this.intentionJob.maxSalary = res.data.maxSalary; //最大薪资
  2122. this.intentionJob.industry = res.data.industry; //行业
  2123. this.intentionJob.postType = res.data.postType; //工作性质
  2124. this.intentionJob.isDefault = res.data.isDefault; //是否第一求职意向
  2125. //关闭之前的表单
  2126. this.hideFrom('gangweiEdit');
  2127. }
  2128. });
  2129. },
  2130. /**
  2131. * 获取城市列表
  2132. */
  2133. getCitysList(keyword = '') {
  2134. const grouped = {};
  2135. // 过滤:如果有关键字,就按城市名模糊匹配
  2136. const filtered = keyword
  2137. ? cityJs.filter(item => item.label.includes(keyword))
  2138. : cityJs;
  2139. filtered.forEach(item => {
  2140. const letterObj = citySelect.getFirstLetter(item.label);
  2141. const letter = letterObj.firstletter.toUpperCase();
  2142. if (!grouped[letter]) grouped[letter] = [];
  2143. grouped[letter].push(item.label);
  2144. });
  2145. const sortedLetters = Object.keys(grouped).sort();
  2146. this.cityList = sortedLetters.map(letter => ({
  2147. letter,
  2148. city: grouped[letter]
  2149. }));
  2150. },
  2151. // 搜索事件
  2152. handleSearch() {
  2153. this.getCitysList(this.search.trim());
  2154. },
  2155. //获取求职意向
  2156. getJobType() {
  2157. this.$Request.get('/app/intention/getIntentionList').then(res => {
  2158. if (res.code == 0 && res.data.length > 0) {
  2159. this.jobTypeList = res.data;
  2160. }
  2161. });
  2162. },
  2163. //保存个人信息
  2164. saveResumesInfo() {
  2165. let formResume = this.$refs.formResume;
  2166. formResume.validate(valid => {
  2167. if (valid) {
  2168. // 额外的字段验证
  2169. // if (!this.form.resumesName) {
  2170. // ElMessage({
  2171. // message: '用户名不能为空',
  2172. // type: 'warning',
  2173. // duration: 1500,
  2174. // offset: this.screenHeight / 2
  2175. // });
  2176. // return;
  2177. // } else if (!this.form.resumesPhone) {
  2178. // ElMessage({
  2179. // message: '联系电话不能为空',
  2180. // type: 'warning',
  2181. // duration: 1500,
  2182. // offset: this.screenHeight / 2
  2183. // });
  2184. // return;
  2185. // }
  2186. if (!this.form.resumesAge) {
  2187. ElMessage({
  2188. message: '年龄不能为空',
  2189. type: 'warning',
  2190. duration: 1500,
  2191. offset: this.screenHeight / 2
  2192. });
  2193. return;
  2194. }
  2195. // else if (!this.form.resumesEmail) {
  2196. // ElMessage({
  2197. // message: '邮箱不能为空',
  2198. // type: 'warning',
  2199. // duration: 1500,
  2200. // offset: this.screenHeight / 2
  2201. // });
  2202. // return;
  2203. // }
  2204. // 计算年龄
  2205. // this.form.resumesAge = this.calculateAgeFromBirthday(this.form.birthday) || 0;
  2206. let that = this;
  2207. ElMessageBox.confirm('确定保存信息', '温馨提示', {
  2208. confirmButtonText: '确定',
  2209. cancelButtonText: '取消',
  2210. type: 'warning'
  2211. }).then(() => {
  2212. that.loading = true;
  2213. // 先更新用户信息
  2214. that.$Request.post("/app/user/updateUser", {
  2215. userName: that.form.resumesName,
  2216. avatar: that.userEntity.avatar || '',
  2217. sex: that.form.resumesSex,
  2218. age: that.form.resumesAge,
  2219. phone: this.form.resumesPhone
  2220. // weChatNum: that.form.weChatNum || ''
  2221. },{type:'json'}).then(res => {
  2222. if (res.code === 0) {
  2223. // 用户信息更新成功后,更新简历信息
  2224. that.setResume();
  2225. } else {
  2226. that.loading = false;
  2227. ElMessage({
  2228. message: res.msg,
  2229. type: 'error',
  2230. duration: 1500,
  2231. offset: that.screenHeight / 2
  2232. });
  2233. }
  2234. });
  2235. }).catch(() => {
  2236. // 取消保存
  2237. });
  2238. }
  2239. });
  2240. },
  2241. // 设置简历信息
  2242. setResume() {
  2243. let data = {
  2244. resumesStatus: this.form.resumesStatus,
  2245. // resumesPhone: this.form.resumesPhone,
  2246. // resumesAge: this.form.resumesAge,
  2247. birthday: this.getBirthDateByAge(this.form.resumesAge),
  2248. resumesEmail: this.form.resumesEmail,
  2249. ifExp: this.form.resumesWorkExperience ? 1 : 0
  2250. };
  2251. this.$Request.post("/app/userFirst/regist", data,{type:'json'}).then((res) => {
  2252. this.loading = false;
  2253. if (res.code == 0) {
  2254. ElMessage({
  2255. message: '保存成功',
  2256. type: 'success',
  2257. duration: 1500,
  2258. offset: this.screenHeight / 2
  2259. });
  2260. // 更新用户信息和简历信息
  2261. this.getUserInfo();
  2262. this.getJlInfo();
  2263. this.userInfoEdit = false;
  2264. // 可以在这里添加跳转逻辑
  2265. setTimeout(function() {
  2266. // 实际开发中可以根据需要添加跳转
  2267. }, 1000);
  2268. } else {
  2269. ElMessage({
  2270. message: res.msg,
  2271. type: 'error',
  2272. duration: 1500,
  2273. offset: this.screenHeight / 2
  2274. });
  2275. }
  2276. });
  2277. },
  2278. getBirthDateByAge(age) {
  2279. const today = new Date()
  2280. const birth = new Date(today.getFullYear() - age, today.getMonth(), today.getDate())
  2281. const y = birth.getFullYear()
  2282. const m = String(birth.getMonth() + 1).padStart(2, '0')
  2283. const d = String(birth.getDate()).padStart(2, '0')
  2284. return `${y}-${m}-${d}`
  2285. },
  2286. // 计算年龄
  2287. // calculateAgeFromBirthday(birthday) {
  2288. // if (!birthday) return 0;
  2289. // let birthDate = new Date(birthday);
  2290. // let nowDate = new Date();
  2291. // let age = nowDate.getFullYear() - birthDate.getFullYear();
  2292. // if (nowDate.getMonth() < birthDate.getMonth() || (nowDate.getMonth() === birthDate.getMonth() && nowDate.getDate() < birthDate.getDate())) {
  2293. // age--;
  2294. // }
  2295. // return age;
  2296. // },
  2297. // 获取最高学历的学校和专业
  2298. getHighestEducation() {
  2299. if (!this.eduList || this.eduList.length === 0) {
  2300. return { school: '', major: '', degree: '' };
  2301. }
  2302. // 学历排序优先级(从高到低)
  2303. const degreePriority = {
  2304. '博士': 6,
  2305. '硕士': 5,
  2306. '本科': 4,
  2307. '大专': 3,
  2308. '高中': 2,
  2309. '初中': 1,
  2310. '其他': 0
  2311. };
  2312. // 对学历列表进行排序
  2313. const sortedEduList = [...this.eduList].sort((a, b) => {
  2314. const priorityA = degreePriority[a.degree] || 0;
  2315. const priorityB = degreePriority[b.degree] || 0;
  2316. // 优先按学历等级排序
  2317. if (priorityA !== priorityB) {
  2318. return priorityB - priorityA;
  2319. }
  2320. // 学历等级相同时,按结束时间排序(最新的在前)
  2321. const endTimeA = new Date(a.endTime || 0).getTime();
  2322. const endTimeB = new Date(b.endTime || 0).getTime();
  2323. return endTimeB - endTimeA;
  2324. });
  2325. // 返回最高学历的信息
  2326. const highestEdu = sortedEduList[0];
  2327. return {
  2328. school: highestEdu.school || '',
  2329. major: highestEdu.profession || '',
  2330. degree: highestEdu.degree || ''
  2331. };
  2332. },
  2333. //查询简历信息
  2334. getJlInfo() {
  2335. this.$Request.get('/app/userFirst/getUserResumes').then(res => {
  2336. if (res.code == 0) {
  2337. if (res.data) {
  2338. console.log(res.data);
  2339. // 保存完整数据
  2340. this.resumeInfo = res.data;
  2341. // 同步新结构的各个字段
  2342. this.eduList = res.data.eduList || []; // 学历列表
  2343. this.intentions = res.data.intentions || []; // 意向列表
  2344. this.skills = res.data.skills || []; // 技能列表
  2345. this.userEntity = res.data.userEntity || {}; // 用户信息
  2346. // 工作经验详细列表,处理skills字段将JSON字符串转换为数组
  2347. this.workExpList = (res.data.workExpList || []).map(workExp => {
  2348. if (workExp.skills && typeof workExp.skills === 'string') {
  2349. try {
  2350. workExp.skills = JSON.parse(workExp.skills);
  2351. } catch (e) {
  2352. workExp.skills = [];
  2353. }
  2354. } else if (!Array.isArray(workExp.skills)) {
  2355. workExp.skills = [];
  2356. }
  2357. return workExp;
  2358. });
  2359. this.workExpTimes = res.data.workExpTimes || 0; // 工作经历中的技能经历数量
  2360. this.workExps = res.data.workExps || []; // 工作经历列表
  2361. // 从resumeList中提取简历基本信息并同步到form中
  2362. if (res.data.resumeList) {
  2363. const resumeData = res.data.resumeList;
  2364. // 同步基本信息到form中
  2365. this.form.resumesName =
  2366. res.data.userEntity.userName || '';
  2367. this.form.resumesAge = resumeData.resumesAge || '';
  2368. this.form.resumesSex = resumeData.resumesSex || 1;
  2369. this.form.resumesPhone =
  2370. resumeData.resumesPhone || '';
  2371. this.form.resumesMarriage =
  2372. resumeData.resumesMarriage || '';
  2373. this.form.address = resumeData.address || '';
  2374. this.form.resumesEducation =
  2375. resumeData.resumesEducation || '';
  2376. this.form.graduationTime =
  2377. resumeData.graduationTime || '';
  2378. // 获取最高学历的学校和专业
  2379. const highestEdu = this.getHighestEducation();
  2380. this.form.school = highestEdu.school;
  2381. this.form.major = highestEdu.major;
  2382. this.form.resumesEducation = highestEdu.degree;
  2383. this.form.resumesWorkExperience =
  2384. resumeData.resumesWorkExperience || '';
  2385. this.form.resumesEmail =
  2386. resumeData.resumesEmail || '';
  2387. this.form.resumesStatus =
  2388. resumeData.resumesStatus || 0;
  2389. this.form.resumesCompensation =
  2390. resumeData.resumesCompensation || '';
  2391. this.form.city = resumeData.city || '';
  2392. // 同步其他需要的字段
  2393. // this.form.birthday = resumeData.birthday || '';
  2394. // this.form.resumesAttachment =
  2395. // resumeData.resumesAttachment || '';
  2396. // this.form.resumesImage =
  2397. // resumeData.resumesImage || '';
  2398. // this.form.resumesImageName =
  2399. // resumeData.resumesImageName || '';
  2400. // 更新性别选择的当前值
  2401. this.current = resumeData.resumesSex || 1;
  2402. this.resumesStatus = resumeData.resumesStatus;
  2403. this.resumesId = resumeData.resumesId;
  2404. }
  2405. // 从userEntity中提取用户信息
  2406. if (res.data.userEntity) {
  2407. this.nickName = res.data.userEntity.userName || '';
  2408. this.avatar = res.data.userEntity.avatar || '';
  2409. // 更新store中的头像
  2410. this.$store.commit(
  2411. 'SET_AVATAR',
  2412. res.data.userEntity.avatar || ''
  2413. );
  2414. }
  2415. } else {
  2416. ElMessageBox.alert('暂无简历,请添加简历', '提示', {
  2417. confirmButtonText: '确认'
  2418. });
  2419. }
  2420. } else {
  2421. ElMessageBox.alert(res.msg, '提示', {
  2422. confirmButtonText: '确认'
  2423. });
  2424. }
  2425. });
  2426. },
  2427. //获取个人信息
  2428. getUserInfo() {
  2429. this.$Request.get('/app/user/selectUserById').then(res => {
  2430. if (res.code == 0) {
  2431. this.$store.commit('SET_AVATAR', res.data.avatar);
  2432. this.nickName = res.data.userName;
  2433. this.avatar = res.data.avatar;
  2434. if (res.data.userType == 1 || res.data.userType == null) {
  2435. this.userType = 1;
  2436. localStorage.setItem('userType', 1);
  2437. } else {
  2438. this.userType = 2;
  2439. localStorage.setItem('userType', 2);
  2440. }
  2441. }
  2442. });
  2443. },
  2444. /**
  2445. * 获取投递记录、收藏记录、浏览记录
  2446. */
  2447. getUserData() {
  2448. this.$Request.get('/app/user/userData').then(res => {
  2449. if (res.code == 0) {
  2450. this.browseCount = res.data.browseCount;
  2451. this.collectionCount = res.data.collectionCount;
  2452. this.deliveryCount = res.data.deliveryCount;
  2453. }
  2454. });
  2455. },
  2456. //工作性质
  2457. getPostType() {
  2458. let data = {
  2459. type: '工作性质'
  2460. };
  2461. this.$Request.get('/app/dict/list', { params: data }).then(res => {
  2462. if (res.code == 0) {
  2463. res.data.map(item => {
  2464. item.label = item.value;
  2465. });
  2466. this.workStatus = res.data;
  2467. }
  2468. });
  2469. },
  2470. // 获取部门列表
  2471. getDepartment() {
  2472. this.$Request.post('/app/userFirst/getDepartment', {},{type:'json'}).then((res) => {
  2473. if (res.code == 0) {
  2474. this.departments = res.data;
  2475. // 如果是编辑状态且有workExpId,获取工作经历详情
  2476. if (this.workObj.workExpId && this.workObj.workExpId != '') {
  2477. this.getData();
  2478. }
  2479. } else {
  2480. ElMessage({
  2481. message: res.msg || '获取部门列表失败',
  2482. type: 'error',
  2483. duration: 1500,
  2484. offset: this.screenHeight / 2
  2485. });
  2486. }
  2487. });
  2488. },
  2489. // 获取工作经历详情
  2490. getData() {
  2491. this.$Request.get('/app/userFirst/getWorkExpDetailOne', {
  2492. params: {
  2493. workExpId: this.workObj.workExpId
  2494. }
  2495. }).then((res) => {
  2496. if (res.code == 0) {
  2497. const data = res.data;
  2498. // 更新公司信息
  2499. this.workObj.resumesTitle = data.workExp.companyName || '';
  2500. this.workObj.businessType = JSON.parse(data.workExp.type) || [];
  2501. // 更新工作经历详情
  2502. if (data.workExpDetails && data.workExpDetails.length > 0) {
  2503. const detail = data.workExpDetails[0];
  2504. // 时间处理
  2505. this.workObj.resumesTime = [
  2506. new Date(detail.startTime),
  2507. new Date(detail.endTime)
  2508. ];
  2509. // 工作内容
  2510. this.workObj.resumesContent = detail.workContent || '';
  2511. // 部门信息
  2512. this.workObj.departmentId = detail.departmentId || 0;
  2513. this.workObj.department = detail.department || '';
  2514. // 岗位职级
  2515. this.workObj.positionLevel = detail.positionLevel || '初级';
  2516. // 工作业绩
  2517. this.workObj.workPerformance = detail.workPerformance || '';
  2518. // 技能处理
  2519. this.workObj.skills = detail.skills ? JSON.parse(detail.skills) : [];
  2520. // 岗位职业技能相关字段 - 修正字段映射关系
  2521. this.workObj.selectedJobPost = detail.position || '';
  2522. this.workObj.ruleClassifyId = detail.positionId || 0;
  2523. this.workObj.positionSkills = detail.skills ? JSON.parse(detail.skills) : [];
  2524. this.workObj.workExpDetailId = detail.workExpDetailId || '';
  2525. }
  2526. } else {
  2527. ElMessage({
  2528. message: res.msg || '获取工作经历详情失败',
  2529. type: 'error',
  2530. duration: 1500,
  2531. offset: this.screenHeight / 2
  2532. });
  2533. }
  2534. });
  2535. },
  2536. // 处理部门选择变化
  2537. handleDepartmentChange(value) {
  2538. // 根据部门ID获取部门名称
  2539. const selectedDepartment = this.departments.find(item => item.departmentId === value);
  2540. if (selectedDepartment) {
  2541. this.workObj.department = selectedDepartment.departmentName;
  2542. } else {
  2543. this.workObj.department = '';
  2544. }
  2545. },
  2546. //返回
  2547. goBack() {
  2548. this.$router.back();
  2549. },
  2550. //获取最高学历
  2551. getHighestEducation() {
  2552. // 定义学历等级映射(从低到高)
  2553. const educationLevels = {
  2554. '小学': 1,
  2555. '初中': 2,
  2556. '高中': 3,
  2557. '中专': 4,
  2558. '大专': 5,
  2559. '本科': 6,
  2560. '硕士': 7,
  2561. '博士': 8,
  2562. '博士后': 9
  2563. };
  2564. let highestEdu = null;
  2565. let highestLevel = -1;
  2566. // 检查eduList是否存在且是数组
  2567. if (Array.isArray(this.eduList)) {
  2568. this.eduList.forEach(edu => {
  2569. const level = educationLevels[edu.degree] || 0;
  2570. if (level > highestLevel) {
  2571. highestLevel = level;
  2572. highestEdu = edu;
  2573. } else if (level === highestLevel) {
  2574. // 如果学历等级相同,选择结束时间较晚的
  2575. const currentEndTime = highestEdu.endTime ? new Date(highestEdu.endTime).getTime() : 0;
  2576. const newEndTime = edu.endTime ? new Date(edu.endTime).getTime() : 0;
  2577. if (newEndTime > currentEndTime) {
  2578. highestEdu = edu;
  2579. }
  2580. }
  2581. });
  2582. }
  2583. // 返回完整的最高学历信息
  2584. return highestEdu ? {
  2585. school: highestEdu.school,
  2586. major: highestEdu.profession,
  2587. degree: highestEdu.degree
  2588. } : {
  2589. school: '',
  2590. major: '',
  2591. degree: ''
  2592. };
  2593. }
  2594. }
  2595. };
  2596. </script>
  2597. <style lang="scss" scoped>
  2598. @import url('index.scss');
  2599. .workDialog {
  2600. width: 70% !important;
  2601. }
  2602. /* 从事方向选择样式 */
  2603. .preference-grid {
  2604. padding: 20px;
  2605. max-height: 400px;
  2606. overflow-y: auto;
  2607. }
  2608. .preference-group {
  2609. margin-bottom: 20px;
  2610. }
  2611. .preference-title {
  2612. font-size: 16px;
  2613. font-weight: bold;
  2614. margin-bottom: 10px;
  2615. color: #333;
  2616. }
  2617. .preference-children {
  2618. display: flex;
  2619. flex-wrap: wrap;
  2620. gap: 10px;
  2621. }
  2622. .preference-tag {
  2623. padding: 8px 16px;
  2624. border: 1px solid #dcdfe6;
  2625. border-radius: 20px;
  2626. cursor: pointer;
  2627. transition: all 0.3s ease;
  2628. background-color: #fff;
  2629. font-size: 14px;
  2630. color: #606266;
  2631. }
  2632. .preference-tag:hover {
  2633. border-color: #00DD9A;
  2634. color: #00DD9A;
  2635. }
  2636. .preference-tag.active {
  2637. background-color: #00DD9A;
  2638. border-color: #00DD9A;
  2639. color: #fff;
  2640. }
  2641. /* 技能标签样式 */
  2642. .info-boxsWorks-content-skills {
  2643. display: flex;
  2644. align-items: center;
  2645. margin-top: 10px;
  2646. }
  2647. .info-boxsWorks-content-skills-title {
  2648. margin-right: 10px;
  2649. font-weight: bold;
  2650. color: #333;
  2651. }
  2652. .info-boxsWorks-content-skills-tags {
  2653. display: flex;
  2654. flex-wrap: wrap;
  2655. gap: 8px;
  2656. }
  2657. .info-boxsWorks-content-skill-tag {
  2658. padding: 4px 12px;
  2659. background-color: #f0f0f0;
  2660. border-radius: 12px;
  2661. font-size: 14px;
  2662. color: #999999;
  2663. white-space: nowrap;
  2664. }
  2665. </style>