search.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
  1. <template>
  2. <div id="newsList">
  3. <!-- 页面头部 -->
  4. <HomePageHead></HomePageHead>
  5. <!-- 导航栏 -->
  6. <HomePageNavigation></HomePageNavigation>
  7. <!-- 列表页广告一 -->
  8. <HomeAdvertising :imgurl="adImg1" v-if="adImg1"></HomeAdvertising>
  9. <!-- 二级标题-->
  10. <HomeListSecondaryHeadingZgzp v-if="parent_name != ''" :name="parent_name" :nav="secondNav"
  11. :pinyin="parent_pinyin">
  12. </HomeListSecondaryHeadingZgzp>
  13. <main class="index_main">
  14. <!-- 三农资讯网-招工招聘-社会招聘 snzx_society -->
  15. <section class="index_2">
  16. <!-- 职位搜索 -->
  17. <div class="recruit_head_box clearfix">
  18. <div class="cruit_head_left">
  19. <span class="cruit_head_a cruit_head_only">职位搜索</span>
  20. </div>
  21. <div class="cruit_head_right clearfix">
  22. <span class="cruit_head_right_a" @click="createResume"
  23. v-if="job_search == 1 && type_id == 1">创建个人简历</span>
  24. <!-- <span class="cruit_head_right_a" @click="createJob"
  25. v-if="job_search == 1 && type_id == 3">发布招聘信息</span> -->
  26. </div>
  27. </div>
  28. <form class="cruit_form clearfix" action=" " method=" ">
  29. <div class="society_form_tip clearfix">
  30. <label class="society_form_label">行业类别:</label>
  31. <div class="society_form_right_a_box clearfix">
  32. <a class="society_form_right_a"
  33. :class="{ society_form_right_a_only: hyid == '' || !hyid || hyid == 0 }" title="全部"
  34. @click="hyChange(0)">
  35. 全部
  36. </a>
  37. <NuxtLink v-for="(item, index) in industry_categoryList" :key="item">
  38. <span class="society_form_right_a"
  39. :class="{ society_form_right_a_only: item.hyid == hyid }" :title="item.hyname"
  40. @click="hyChange(item.hyid)" v-if="index < 20 && hyIndex == 1">{{ item.hyname
  41. }}</span>
  42. <span class="society_form_right_a" v-if="hyIndex == 2" @click="hyChange(item.hyid)"
  43. :class="{ society_form_right_a_only: item.hyid == hyid }" :title="item.hyname">
  44. {{ item.hyname }}
  45. </span>
  46. </NuxtLink>
  47. <span class="society_form_right_btn" @click="hyIndex = 2" v-if="hyIndex == 1">展开</span>
  48. <span class="society_form_right_btn" @click="hyIndex = 1" v-if="hyIndex == 2">收起</span>
  49. </div>
  50. </div>
  51. <div class="society_form_tip clearfix">
  52. <label class="society_form_label">职位类别:</label>
  53. <div class="society_form_right_a_box clearfix">
  54. <a class="society_form_right_a"
  55. :class="{ society_form_right_a_only: zwid == '' || !zwid || zwid == 0 }" title=""
  56. @click="zwChange(0)">全部</a>
  57. <span v-for="(item, index) in position_categoryList" :key="item">
  58. <span class="society_form_right_a" v-if="index < 20 && zwIndex == 1"
  59. @click="zwChange(item.zwid)"
  60. :class="{ society_form_right_a_only: item.zwid == zwid }" :title="item.zwname">
  61. {{ item.zwname }}
  62. </span>
  63. <span class="society_form_right_a" v-if="zwIndex == 2" @click="zwChange(item.zwid)"
  64. :class="{ society_form_right_a_only: item.zwid == zwid }" :title="item.zwname">
  65. {{ item.zwname }}
  66. </span>
  67. </span>
  68. <span class="society_form_right_btn society_form_right_btn_up" @click="zwIndex = 2"
  69. v-if="zwIndex == 1">展开</span>
  70. <span class="society_form_right_btn society_form_right_btn_up" @click="zwIndex = 1"
  71. v-if="zwIndex == 2">收起</span>
  72. </div>
  73. </div>
  74. <div class="society_form_tip clearfix">
  75. <label class="society_form_label">具体职位:</label>
  76. <div class="society_form_right_a_box clearfix">
  77. <a class="society_form_right_a" @click="jtzwChange(0)"
  78. :class="{ society_form_right_a_only: jtzwid == '' || !jtzwid || jtzwid == 0 }"
  79. title="">全部</a>
  80. <span v-for="(item, index) in positionList" :key="item">
  81. <span class="society_form_right_a" v-if="index < 20 && jtzwIndex == 1"
  82. @click="jtzwChange(item.zwid)"
  83. :class="{ society_form_right_a_only: item.zwid == jtzwid }" :title="item.zwname">
  84. {{ item.zwname }}
  85. </span>
  86. <span class="society_form_right_a" v-if="jtzwIndex == 2" @click="jtzwChange(item.zwid)"
  87. :class="{ society_form_right_a_only: item.zwid == jtzwid }" :title="item.zwname">
  88. {{ item.zwname }}
  89. </span>
  90. </span>
  91. <!-- <span class="society_form_right_btn">展开</span> -->
  92. <span class="society_form_right_btn" @click="jtzwIndex = 2" v-if="jtzwIndex == 1">展开</span>
  93. <span class="society_form_right_btn" @click="jtzwIndex = 1" v-if="jtzwIndex == 2">收起</span>
  94. </div>
  95. </div>
  96. <div class="cruit_form_tip clearfix">
  97. <div class="cruit_form_per">
  98. <label class="cruit_form_label">地区选择:</label>
  99. <div class="cruit_form_label_right clearfix">
  100. <el-select v-model="province" placeholder="请选择省" style="width: 140px" clearable
  101. @change="provinceChange">
  102. <el-option v-for="item in provinceList" :key="item.id" :label="item.name"
  103. :value="item.id" />
  104. </el-select>
  105. <el-select v-model="city" placeholder="请选择市" style="width: 140px" no-data-text="请先选择省"
  106. clearable>
  107. <el-option v-for="item in cityList" :key="item.id" :label="item.name"
  108. :value="item.id" />
  109. </el-select>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="cruit_form_tip clearfix">
  114. <div class="cruit_form_per">
  115. <label class="cruit_form_label">关键词:</label>
  116. <div class="cruit_form_label_right clearfix">
  117. <el-input v-model="keywords" style="width: 300px" placeholder="请输入搜索关键词" clearable />
  118. <el-button type="success" @click="goSearch">搜索</el-button>
  119. </div>
  120. </div>
  121. </div>
  122. </form>
  123. <!-- 职位搜索 -->
  124. </section>
  125. </main>
  126. <main class="color_main">
  127. <main class="index_main">
  128. <!-- 选项卡头 -->
  129. <section class="index_3 clearfix">
  130. <div class="recruit_head_box clearfix">
  131. <div class="cruit_head_left">
  132. <a class="cruit_head_a" :class="{ cruit_head_only: job_search == 1 }"
  133. @mouseover="job_search = 1" title="">找工作</a>
  134. <!-- <a class="cruit_head_a" :class="{ cruit_head_only: job_search == 2 }"
  135. @mouseover="job_search = 2" title="">招人才</a> -->
  136. </div>
  137. <div class="society_head_right clearfix">
  138. <div class="society_head_checkbox_box" v-if="job_search == 1 && type_id == 1">
  139. <el-checkbox v-model="allJob" label="" @change="toggleAllJob" />
  140. </div>
  141. <div class="society_head_right_all_box" v-if="job_search == 1 && type_id == 1">
  142. 全选
  143. </div>
  144. <!-- <div class="society_head_checkbox_box" v-if="job_search == 2 && type_id == 3">
  145. <el-checkbox v-model="allResume" label="" @change="toggleAllResume" />
  146. </div>
  147. <div class="society_head_right_all_box" v-if="job_search == 2 && type_id == 3">
  148. 全选
  149. </div> -->
  150. <div class="society_head_right_a" title="" v-if="job_search == 1 && type_id == 1"
  151. @click="getjob">申请职位</div>
  152. <!-- <div class="society_head_right_a" v-if="job_search == 2 && type_id == 3"
  153. @click="talkResume">
  154. 沟通简历</div> -->
  155. <!-- resumeBoo = true -->
  156. </div>
  157. </div>
  158. <!-- 选项卡头 -->
  159. <!-- 选项卡 -->
  160. <div class=" clearfix">
  161. <!-- 找工作 -->
  162. <div class=" clearfix" v-show="job_search == 1">
  163. <div class="cruit_ul_2 clearfix" v-if="job_vacancy">
  164. <div class="cruit_li_2 clearfix" v-for="(item, index) in job_vacancy" :key="item.id">
  165. <div class="society_inp_checkbox_box_li_1 hand" v-if="type_id == 1">
  166. <el-checkbox v-model="selectedJobs" :value="item.id" @change="jobChange" />
  167. </div>
  168. <NuxtLink class="cruit_li_2_a" :href="`/${item.pinyin}/${item.id}.html`" title="">
  169. <div class="cruit_li_2_head_box clearfix">
  170. <div class="cruit_li_2_head clearfix dot1">{{ item.title }}</div>
  171. <div class="cruit_li_2_head_name clearfix dot1">
  172. {{ item.business_name }}
  173. </div>
  174. </div>
  175. <div class="cruit_li_2_foot_title_box clearfix">
  176. <span class="cruit_li_2_foot_title">{{ item.jtzw_name }}</span>
  177. </div>
  178. <div class="cruit_li_2_foot clearfix">
  179. <span class="cruit_li_2_foot_tag cruit_li_2_foot_addres">
  180. {{ item.city_name }}
  181. </span>
  182. <span class="cruit_li_2_foot_tag cruit_li_2_foot_exper"
  183. v-if="item.experience_name || item.education_name">
  184. <span class="cruit_li_2_foot_tag_in">{{ item.experience_name }}</span>
  185. <span class="cruit_li_2_foot_tag_in">{{ item.education_name }}</span>
  186. </span>
  187. <span class="cruit_li_2_foot_tag cruit_li_2_foot_time">
  188. {{ getTime(item.updated_at, 'year', 1) }}
  189. </span>
  190. </div>
  191. </NuxtLink>
  192. </div>
  193. </div>
  194. <div class="pagination" v-if="zptotal">
  195. <el-pagination size="small" background layout="prev, pager, next" :total="zptotal"
  196. class="mt-4" prev-text="上一页" next-text="下一页" @change="changePage" />
  197. </div>
  198. <div class="empty" v-if="job_vacancy == false">
  199. <img src="@/public/topic/empty.png" alt="" class="empty_img">
  200. <span class="empty_text">当前暂无数据</span>
  201. </div>
  202. </div>
  203. <!-- 找工作 -->
  204. <!-- 招人才 -->
  205. <!-- <div class=" clearfix" v-show="job_search == 2">
  206. <div class="society_ul_3 clearfix" v-if="job_resume">
  207. <div class="society_li_3 clearfix" v-for="(item, index) in job_resume" :key="item">
  208. <div class="society_inp_checkbox_box_li_3 hand" v-if="type_id == 3">
  209. <el-checkbox v-model="selectedResume" :value="item.id" @change="jobChange" />
  210. </div>
  211. <NuxtLink class="society_li_3_a" :href="`/${item.pinyin}/${item.id}.html`" title="">
  212. <div class="society_li_3_head_box clearfix">
  213. <div class="society_li_3_head clearfix dot1">
  214. {{ item.name }}
  215. </div>
  216. <div class="society_li_3_head_name clearfix dot1">
  217. {{ item.jtzw_name }}
  218. </div>
  219. </div>
  220. <div class="society_li_3_text_box clearfix">
  221. <div class="society_li_3_text">
  222. {{ item.sexy == 1 ? '男' : '女' }}
  223. <em class="point">·</em>
  224. </div>
  225. <div class="society_li_3_text" v-if="item.experience">
  226. {{ item.experience }}年
  227. <em class="point">·</em>
  228. </div>
  229. <div class="society_li_3_text">
  230. {{ item.origin }}
  231. <em class="point">·</em>
  232. </div>
  233. <div class="society_li_3_text">{{ item.hy_name }}</div>
  234. </div>
  235. <div class="society_li_3_tag_box clearfix">
  236. <span class="society_li_3_tag">{{ item.city_name }}</span>
  237. <span class="society_li_3_tag">
  238. {{ getTime(item.updated_at, 'year', 1) }}
  239. </span>
  240. </div>
  241. </NuxtLink>
  242. </div>
  243. </div>
  244. <div class="pagination" v-if="qztotal">
  245. <el-pagination size="small" background layout="prev, pager, next" :total="qztotal"
  246. class="mt-4" prev-text="上一页" next-text="下一页" @change="changePage" />
  247. </div>
  248. <div class="empty" v-if="job_resume == false">
  249. <img src="@/public/topic/empty.png" alt="" class="empty_img">
  250. <span class="empty_text">当前暂无数据</span>
  251. </div>
  252. </div> -->
  253. <!-- 招人才 -->
  254. </div>
  255. <!-- 选项卡 -->
  256. </section>
  257. <!-- 招聘职位 -->
  258. <!-- <div class="cruit_alert_box">投递成功</div> -->
  259. </main>
  260. <!-- 弹框 -->
  261. <section class="cruit_alert_rgb clearfix" v-if="resumeBoo">
  262. <!-- 请选择要沟通的职位1 -->
  263. <!-- <div class="cruit_alert_rgb_box">
  264. <div class="cruit_alert_rgb_head_box">
  265. <div class="cruit_alert_rgb_close hand back100"></div>
  266. <div class="cruit_alert_rgb_head">请选择要沟通的职位</div>
  267. </div>
  268. <form class="cruit_alert_rgb_form clearfix" action=" " method=" ">
  269. <div class="cruit_alert_rgb_form_in clearfix">
  270. <div class="cruit_alert_rgb_li clearfix" v-for="(item, index) in 17" :key="item.id">
  271. <input name="type" type="checkbox" value="" class="cruit_alert_rgb_checkbox hand" />
  272. <label
  273. class="cruit_alert_rgb_label dot1">高级PHP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程HP工程师</label>
  274. </div>
  275. </div>
  276. <div class="cruit_alert_rgb_foot clearfix">
  277. <input class="cruit_alert_rgb_foot_sub hand" name="" type="submit" value="沟通职位">
  278. </div>
  279. </form>
  280. </div> -->
  281. <!-- 请选择要沟通的职位2 -->
  282. <!-- 请选择要投递的简历1 -->
  283. <div class="cruit_alert_rgb_box">
  284. <div class="cruit_alert_rgb_head_box">
  285. <div class="cruit_alert_rgb_close hand back100"></div>
  286. <div class="cruit_alert_rgb_head">请选择要沟通的岗位
  287. <span class="close" @click="resumeBoo = false">x</span>
  288. </div>
  289. </div>
  290. <form class="cruit_alert_rgb_form clearfix" action=" " method=" ">
  291. <div class="cruit_alert_rgb_form_in clearfix">
  292. <div class="cruit_alert_rgb_li clearfix" v-for="(item, index) in companyJobList"
  293. :key="item.id">
  294. <!-- <el-checkbox v-model="company_job" :value="item.id" @change="jobChange" /> -->
  295. <el-radio :value="item.id" v-model="company_job" @change="jobChange">
  296. <div class="cruit_alert_rgb_label dot1">
  297. {{ item.title }}
  298. </div>
  299. </el-radio>
  300. </div>
  301. </div>
  302. <div class="cruit_alert_rgb_foot clearfix">
  303. <div class="cruit_alert_rgb_foot_sub hand" @click="getresume">沟通岗位</div>
  304. </div>
  305. </form>
  306. </div>
  307. <!-- 请选择要投递的简历2 -->
  308. </section>
  309. </main>
  310. <!-- 页面底部 -->
  311. <HomeFoot1></HomeFoot1>
  312. </div>
  313. </template>
  314. <script setup>
  315. //1.页面必备依赖 start ---------------------------------------->
  316. import { ElSelect, ElOption, ElInput, ElButton, ElPagination, ElCheckbox, ElRadio, ElMessage } from 'element-plus';
  317. import { ref, onMounted } from 'vue';
  318. import { useRoute } from 'vue-router'
  319. const nuxtApp = useNuxtApp();
  320. const axios = nuxtApp.$axios;
  321. //当前列表名称
  322. const name = ref('')
  323. const selectedJobs = ref([])
  324. const selectedResume = ref([])
  325. const company_job = ref('')
  326. const allJob = ref(false)
  327. const allResume = ref(false)
  328. const cruit_ul_1_a_only_num = ref(0)
  329. const job_search = ref(1) // 选项卡
  330. const { $webUrl, $CwebUrl, $BwebUrl } = useNuxtApp()
  331. //获取用户信息
  332. let type_id = ref('')
  333. let website_id = ref('')
  334. let getUserInfo = () => {
  335. axios.get("/user/getUserInfo").then(response => {
  336. console.log("gettypeid", response.data);
  337. type_id.value = response.data.type_id
  338. website_id.value = response.data.website_id
  339. })
  340. }
  341. onMounted(() => {
  342. getUserInfo()
  343. })
  344. //1.页面必备依赖 end ---------------------------------------->
  345. //1.获得路由id start ---------------------------------------->
  346. const route = useRoute();
  347. const hyid = ref(route.query.hyid);
  348. const zwid = ref(route.query.zwid);
  349. const jtzwid = ref(route.query.jtzwid);
  350. const provinceid = ref(route.query.provinceid);
  351. const cityid = ref(route.query.cityid);
  352. const keyword = route.query.keywords;
  353. let articleId = 0;//路由id
  354. let pageNum = ref(2);
  355. let total = ref(0);
  356. let zptotal = ref(0);
  357. let qztotal = ref(0);
  358. const page = ref(1)
  359. const pageSize = ref(10);
  360. let hyIndex = ref(1);
  361. let zwIndex = ref(1);
  362. let jtzwIndex = ref(1);
  363. //获得当前的完整路径
  364. const fullPath = route.path;
  365. //拆分,取出来中间这一段,然后提取数字部分
  366. const segments = fullPath.split('/');
  367. const targetSegment = segments[2];
  368. const targetRoute = segments[1];
  369. // console.log('111222', targetRoute);
  370. //const numberPart = targetSegment.match(/\d+$/)?.[0];
  371. //let routeId = 20 //排除路径错误可以打开这个
  372. //articleId = numberPart;
  373. //通过导航路径反向查询导航id
  374. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  375. method: 'GET',
  376. query: {
  377. 'pinyin': targetRoute,
  378. },
  379. });
  380. // console.log("111222333", getRouteId);
  381. if (getRouteId.code == 200) {
  382. articleId = getRouteId.data.category_id
  383. } else {
  384. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  385. console.log("错误位置:通过url路径查询导航池id")
  386. console.log("后端错误反馈:", getRouteId.message)
  387. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  388. }
  389. //获得html前的数字
  390. // const pageUrl = segments[3];
  391. // const pageNumber = pageUrl.split('.')[0];
  392. // console.log("当前URL中的页码:")
  393. // console.log(pageNumber)//2
  394. // pageNum.value = parseInt(pageNumber);
  395. pageNum.value = parseInt(route.params.id);
  396. // 创建个人简历
  397. let createResume = () => {
  398. window.open($BwebUrl + '/#/addJobHunting', '_blank');
  399. }
  400. // 发布招聘信息
  401. let createJob = () => {
  402. window.open($BwebUrl + '/#/creatJob', '_blank');
  403. }
  404. //1.获得路由id end ---------------------------------------->
  405. //2.页面数据 start ---------------------------------------->
  406. // 2.1.1 获取省份
  407. const province = ref('') //省
  408. const city = ref('') //市
  409. const provinceList = ref([]) //省列表
  410. const cityList = ref([]) //市列表
  411. const getArea = await requestDataPromise('/web/selectWebsiteArea', {
  412. method: 'GET',
  413. query: {},
  414. });
  415. if (getArea.code == 200) {
  416. provinceList.value = getArea.data;
  417. }
  418. // 2.1.2
  419. // 获取省份和城市
  420. const provinceChange = (val) => {
  421. provinceid.value = val;
  422. city.value = '';
  423. console.log('获取到的省份id', val);
  424. getCity(val)
  425. }
  426. const getCity = async (value) => {
  427. const getCity = await requestDataPromise('/web/selectWebsiteArea', {
  428. method: 'GET',
  429. query: {
  430. 'pid': value,
  431. },
  432. });
  433. if (getCity.code == 200) {
  434. cityList.value = getCity.data;
  435. }
  436. }
  437. // 带参数跳转 省份和城市的回显问题
  438. if (provinceid.value) {
  439. for (let i = 0; i < provinceList.value.length; i++) {
  440. if (provinceList.value[i].id == provinceid.value) {
  441. province.value = provinceList.value[i].id;
  442. }
  443. }
  444. const getCity = await requestDataPromise('/web/selectWebsiteArea', {
  445. method: 'GET',
  446. query: {
  447. 'pid': provinceid.value,
  448. },
  449. });
  450. if (getCity.code == 200) {
  451. cityList.value = getCity.data;
  452. }
  453. if (cityid.value) {
  454. for (let i = 0; i < cityList.value.length; i++) {
  455. if (cityList.value[i].id == cityid.value) {
  456. city.value = cityList.value[i].id;
  457. }
  458. }
  459. }
  460. }
  461. // 2.2.1 行业和职位
  462. const keywords = ref('') //关键词
  463. const industry_categoryList = ref([]) //行业类别列表
  464. const position_categoryList = ref([]) //职位类别列表
  465. const positionList = ref([]) //具体职位列表
  466. const getData = async () => {
  467. const getData = await requestDataPromise('/web/getWebsiteJobSelect', {
  468. method: 'GET',
  469. query: {},
  470. });
  471. if (getData.code == 200) {
  472. // console.log("获取到的分类数据:", getData.data);
  473. industry_categoryList.value = getData.data.hy; //行业
  474. position_categoryList.value = getData.data.zw; //职位
  475. if (zwid.value == 0 || zwid.value == '' || zwid.value == undefined || zwid.value == null) {
  476. positionList.value = getData.data.jtzw; //具体职位
  477. }
  478. }
  479. }
  480. getData()
  481. const job_vacancy = ref('') // 招聘岗位
  482. const job_resume = ref('') // 简历
  483. if (keyword) {
  484. keywords.value = keyword
  485. }
  486. const getJob = async () => {
  487. const getJob = await requestDataPromise('/web/getWebsiteJobList', {
  488. method: 'GET',
  489. query: {
  490. 'catid': articleId,
  491. 'city_id': provinceid.value,
  492. 'hy_id': hyid.value,
  493. 'zw_id': zwid.value,
  494. 'jtzw_id': jtzwid.value,
  495. 'page': page.value,
  496. 'pageSize': pageSize.value,
  497. 'keyword': keywords.value,
  498. },
  499. });
  500. if (getJob.code == 200) {
  501. // console.log("获取到的岗位和简历:", getJob.data);
  502. job_vacancy.value = getJob.data.JobRecruiting; // 招聘岗位
  503. job_resume.value = getJob.data.JobHunting; // 简历
  504. zptotal.value = getJob.data.recruit_count;
  505. qztotal.value = getJob.data.hunt_count;
  506. }
  507. }
  508. getJob()
  509. let hyChange = (val) => {
  510. console.log('hyChange', val)
  511. hyid.value = val;
  512. getJob()
  513. }
  514. let zwChange = async (val) => {
  515. console.log('zwChange', val)
  516. zwid.value = val;
  517. const getPosition = await requestDataPromise('/web/getPositionList', {
  518. method: 'GET',
  519. query: {
  520. 'zwpid': val,
  521. },
  522. })
  523. console.log("11112222", getPosition);
  524. if (getPosition.code == 200) {
  525. positionList.value = getPosition.data; //具体职位
  526. } else {
  527. positionList.value = []; //具体职位
  528. jtzwid.value = 0; //职位id
  529. }
  530. getJob()
  531. }
  532. let jtzwChange = (val) => {
  533. console.log('jtzwChange', val)
  534. jtzwid.value = val;
  535. getJob()
  536. }
  537. // 搜索
  538. const goSearch = async () => {
  539. const getJob = await requestDataPromise('/web/getWebsiteJobList', {
  540. method: 'GET',
  541. query: {
  542. 'catid': articleId,
  543. 'city_id': provinceid.value,
  544. 'hy_id': hyid.value,
  545. 'zw_id': zwid.value,
  546. 'jtzw_id': jtzwid.value,
  547. 'page': page.value,
  548. 'pageSize': pageSize.value,
  549. 'keyword': keywords.value,
  550. },
  551. });
  552. console.log("111获取到的岗位和简历:", getJob.data);
  553. if (getJob.code == 200) {
  554. job_vacancy.value = getJob.data.JobRecruiting; // 招聘岗位
  555. job_resume.value = getJob.data.JobHunting; // 简历
  556. zptotal.value = getJob.data.recruit_count;
  557. qztotal.value = getJob.data.hunt_count;
  558. }
  559. }
  560. //2.2change事件
  561. let jobChange = (val) => {
  562. console.log('jobChange', val)
  563. console.log('jobChange111', selectedJobs.value)
  564. console.log('jobChange111', selectedResume.value)
  565. console.log('jobChange11122', company_job.value) //企业会员的职位
  566. if (selectedJobs.value.length == job_vacancy.value.length) {
  567. allJob.value = true;
  568. } else {
  569. allJob.value = false;
  570. }
  571. if (selectedResume.value.length == job_resume.value.length) {
  572. allResume.value = true;
  573. } else {
  574. allResume.value = false;
  575. }
  576. }
  577. let toggleAllJob = () => {
  578. if (allJob.value) {
  579. selectedJobs.value = job_vacancy.value.map(item => item.id);
  580. } else {
  581. selectedJobs.value = [];
  582. }
  583. }
  584. let toggleAllResume = () => {
  585. if (allResume.value) {
  586. selectedResume.value = job_resume.value.map(item => item.id);
  587. } else {
  588. selectedResume.value = [];
  589. }
  590. }
  591. //分页事件
  592. let changePage = (value) => {
  593. console.log("当前页码", value);
  594. navigateTo(`/${targetSegment}/${value}.html`)
  595. }
  596. //申请职位
  597. let getjob = () => {
  598. if (selectedJobs.value.length == 0) {
  599. ElMessage({
  600. message: '请选择要申请的职位',
  601. type: 'warning',
  602. });
  603. } else {
  604. console.log("获取到的11111_sel:", selectedJobs.value);
  605. console.log("获取到的1111_website_id:", website_id.value);
  606. axios.post('/web/getWebsiteJobApply', {
  607. 'website_id': website_id.value,
  608. 'recruit_id': selectedJobs.value,
  609. }).then(response => {
  610. console.log("获取到的申请结果:", response.data);
  611. if (response.code == 200) {
  612. ElMessage({
  613. message: '投递成功',
  614. type: 'success',
  615. });
  616. } else {
  617. ElMessage({
  618. message: response.message,
  619. type: 'error',
  620. });
  621. }
  622. allJob.value = false;
  623. selectedJobs.value = [];
  624. })
  625. }
  626. }
  627. //沟通简历
  628. let talkResume = () => {
  629. if (selectedResume.value.length == 0) {
  630. ElMessage({
  631. message: '请选择要沟通的简历',
  632. type: 'warning',
  633. });
  634. return false;
  635. } else {
  636. resumeBoo.value = true;
  637. }
  638. // resumeBoo.value = true;
  639. }
  640. //获取当前企业会员的职位
  641. const companyJobList = ref([])
  642. let companyJOb = async () => {
  643. const companyJOb = await requestDataPromise('/web/getWebsiteJobRecruiting', {
  644. method: 'POST',
  645. body: {
  646. 'pageSize': pageSize.value,
  647. 'website_id': website_id.value,
  648. }
  649. })
  650. // console.log("获取到的企业会员的职位11:", companyJOb.data);
  651. if (companyJOb.code == 200) {
  652. // console.log("获取到的企业会员的职位:", companyJOb.data);
  653. companyJobList.value = companyJOb.data
  654. }
  655. }
  656. companyJOb()
  657. // 沟通简历
  658. let resumeBoo = ref(false)
  659. let getresume = async () => {
  660. const resumelist = await requestDataPromise('/web/getWebsiteJobResume', {
  661. method: 'POST',
  662. body: {
  663. 'website_id': website_id.value,
  664. 'recruit_id': company_job.value,
  665. 'hunt_id': selectedResume.value,
  666. },
  667. });
  668. // console.log("沟通简历00", resumelist);
  669. // console.log("沟通简历11", website_id.value);
  670. // console.log("沟通简历22", company_job.value);
  671. // console.log("沟通简历33", selectedResume.value);
  672. if (resumelist.code == 200) {
  673. ElMessage({
  674. message: '投递成功',
  675. type: 'sussess',
  676. });
  677. resumeBoo.value = false;
  678. } else {
  679. ElMessage({
  680. message: resumelist.message,
  681. type: 'error',
  682. });
  683. resumeBoo.value = false;
  684. }
  685. company_job.value = '';
  686. selectedResume.value = [];
  687. job_search.value = 2
  688. }
  689. // //2.3获得页面名称
  690. // let getPageName = async () => {
  691. // const pageName = await requestDataPromise('/web/getOneWebsiteCategory', {
  692. // method: 'GET',
  693. // query: {
  694. // 'catid': articleId
  695. // },
  696. // });
  697. // console.log('11122233344',pageName);
  698. // if (pageName.code == 200) {
  699. // name.value = pageName.data.alias
  700. // } else {
  701. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  702. // console.log("错误位置:设置页面标题")
  703. // console.log("后端错误反馈:", pageName.message)
  704. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  705. // }
  706. // }
  707. // //获得列表
  708. // getPageName();
  709. //2.页面数据 end ---------------------------------------->
  710. //3.二级栏目 start ---------------------------------------->
  711. //3.1通过id获取一级栏目
  712. const parent_name = ref([]);
  713. const parent_id = ref([]);
  714. const parent_pinyin = ref("");
  715. let getParentNav = async () => {
  716. const listData = await requestDataPromise('/web/getOneWebsiteCategory', {
  717. method: 'GET',
  718. query: {
  719. 'catid': articleId
  720. },
  721. });
  722. // console.log("1112223334455", listData.data);
  723. if (listData.code == 200) {
  724. // console.log(111999)
  725. console.log(listData.data);
  726. parent_name.value = listData.data.alias;
  727. parent_id.value = listData.data.category_id;
  728. parent_pinyin.value = listData.data.aLIas_pinyin;
  729. } else {
  730. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  731. console.log("错误位置:获取新闻列表")
  732. console.log("后端错误反馈:", listData.message)
  733. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  734. }
  735. getSecondNav();
  736. }
  737. //获得父级栏目详情
  738. getParentNav();
  739. // 3.2获取二级栏目
  740. const secondNav = ref([]);
  741. let getSecondNav = async () => {
  742. const listData = await requestDataPromise('/web/getWebsiteModelCategory', {
  743. method: 'GET',
  744. query: {
  745. 'placeid': 1,
  746. 'pid': parent_id.value,
  747. 'num': 8,
  748. },
  749. });
  750. console.log('listData', listData);
  751. if (listData.code == 200) {
  752. secondNav.value = listData.data;
  753. } else {
  754. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  755. console.log("错误位置:获取新闻列表")
  756. console.log("后端错误反馈:", listData.message)
  757. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  758. }
  759. }
  760. //3.二级栏目 end ---------------------------------------->
  761. //4.设置seo信息 start---------------------------------------->
  762. //4.1 设置seo信息
  763. const setData = await requestDataPromise('/web/getWebsiteCategoryHead', {
  764. method: 'GET',
  765. query: {
  766. 'catid': articleId
  767. },
  768. });
  769. if (setData.code == 200) {
  770. let seoTitle = setData.data.seo_title;
  771. let seoDescription = setData.data.seo_description;
  772. let seoKeywords = setData.data.seo_keywords;
  773. let seoSuffix = setData.data.suffix;
  774. let seoName = setData.data.website_name;
  775. useSeoMeta({
  776. title: seoTitle + "_" + seoName + "_" + seoSuffix,
  777. meta: [
  778. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  779. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  780. { name: 'viewport', content: 'width=device-width,initial-scale=1,user-scalable=no',tagPriority: 10 }
  781. ]
  782. });
  783. } else {
  784. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  785. console.log("错误位置:设置列表页面SEO数据")
  786. console.log("后端错误反馈:", setData.message)
  787. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  788. }
  789. //4.设置seo信息 end---------------------------------------->
  790. //5.广告 start---------------------------------------->
  791. let adImg1 = ref({});
  792. let adImg2 = ref({});
  793. onMounted(async () => {
  794. //从客户端获取行政职能部门 加快打开速度
  795. const { $webUrl, $CwebUrl } = useNuxtApp();
  796. //广告1
  797. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_search_0001`
  798. const responseAd1 = await fetch(url, {
  799. headers: {
  800. 'Content-Type': 'application/json',
  801. 'Userurl': $CwebUrl,
  802. 'Origin': $CwebUrl
  803. }
  804. });
  805. const resultAd1 = await responseAd1.json();
  806. adImg1.value = resultAd1.data[0];
  807. //广告2
  808. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=nmgw_list_0002`
  809. const responseAd2 = await fetch(url2, {
  810. headers: {
  811. 'Content-Type': 'application/json',
  812. 'Userurl': $CwebUrl,
  813. 'Origin': $CwebUrl
  814. }
  815. });
  816. const resultAd2 = await responseAd2.json();
  817. adImg2.value = resultAd2.data[0];
  818. })
  819. //5.广告 end---------------------------------------->
  820. </script>
  821. <style lang="less" scoped>
  822. @import url('@/assets/css/zgzpsearch.less');
  823. .empty {
  824. width: 100%;
  825. height: 150px;
  826. line-height: 150px;
  827. text-align: center;
  828. }
  829. .empty_img {
  830. vertical-align: -30px;
  831. margin-right: 20px;
  832. }
  833. .empty_text {
  834. font-size: 26px;
  835. color: #999;
  836. }
  837. </style>