Home.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <template>
  2. <div class="home">
  3. <Header />
  4. <Mainmenu />
  5. <section class="company-card">
  6. <div class="company wrap">
  7. <img v-if="companyLogo" class="logo" :src="companyLogo" alt="" />
  8. <img
  9. v-else
  10. class="logo"
  11. src="../../static/images/default-logo.png"
  12. alt=""
  13. />
  14. <div class="content">
  15. <div class="name">{{ companyInfo.companyName }}</div>
  16. <div class="addr">
  17. <i class="el-icon-location"></i>
  18. {{ companyInfo.companyAddress }}
  19. </div>
  20. <div class="company-bottom">
  21. <div class="left">
  22. <div class="data-cell">
  23. <div class="up">
  24. <span>{{ companyTotal.recruitWorkNum || 0 }}</span
  25. >个
  26. </div>
  27. <div class="down">
  28. 招聘职位
  29. <el-tooltip
  30. class="item"
  31. effect="dark"
  32. content="该公司的在招职位数量"
  33. placement="top-start"
  34. >
  35. <i class="el-icon-question"></i>
  36. </el-tooltip>
  37. </div>
  38. </div>
  39. <div class="data-cell">
  40. <div class="up">
  41. <span>{{ companyTotal.viewNum || 0 }}</span
  42. >个
  43. </div>
  44. <div class="down">
  45. 进行应聘
  46. <el-tooltip
  47. class="item"
  48. effect="dark"
  49. content="进行中的应聘数量"
  50. placement="top-start"
  51. >
  52. <i class="el-icon-question"></i>
  53. </el-tooltip>
  54. </div>
  55. </div>
  56. <div class="data-cell">
  57. <div class="up">
  58. <span>{{ companyTotal.receivedResumeNum || 0 }}</span
  59. >个
  60. </div>
  61. <div class="down">
  62. 收到简历
  63. <el-tooltip
  64. class="item"
  65. effect="dark"
  66. content="收到的简历数量"
  67. placement="top-start"
  68. >
  69. <i class="el-icon-question"></i>
  70. </el-tooltip>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="right">
  75. <div class="time">{{ companyInfo.recentLoginDate }}</div>
  76. <el-tooltip
  77. class="item"
  78. effect="dark"
  79. content="该公司管理者最近一次登录时间"
  80. placement="bottom"
  81. >
  82. <div class="tip">
  83. 企业最近登录<i class="el-icon-question"></i>
  84. </div>
  85. </el-tooltip>
  86. </div>
  87. </div>
  88. <!-- <div class="edit-btn"><i class="icon el-icon-edit"></i>编辑</div> -->
  89. </div>
  90. </div>
  91. </section>
  92. <!-- company-card end -->
  93. <section class="companymenu-wrap">
  94. <div class="companymenu wrap">
  95. <el-menu
  96. :default-active="companymenuIndex"
  97. class="el-menu-demo"
  98. mode="horizontal"
  99. @select="companymenuSelect"
  100. >
  101. <el-menu-item index="1">公司主页</el-menu-item>
  102. <el-menu-item index="2"
  103. >招聘职位({{ companyTotal.recruitWorkNum || 0 }})</el-menu-item
  104. >
  105. <el-menu-item index="3"
  106. >应聘信息({{ companyTotal.receivedResumeNum || 0 }})</el-menu-item
  107. >
  108. </el-menu>
  109. </div>
  110. </section>
  111. <!-- companymenu end -->
  112. <section class="page-con wrap">
  113. <div class="left-content">
  114. <div v-if="companymenuIndex == '1'" class="company-details">
  115. <!-- <ul class="company-label">
  116. <li>个人能力</li>
  117. <li>执行力</li>
  118. <li>团队精神</li>
  119. </ul> -->
  120. <div class="intro">
  121. <div class="company-details-til">公司介绍</div>
  122. {{ companyInfo.detatil }}
  123. </div>
  124. <div class="contact">
  125. <div class="company-details-til">联系方式</div>
  126. <p>地址: {{ companyInfo.companyAddress }}</p>
  127. <p>电话:{{ companyInfo.phonenumber }}</p>
  128. </div>
  129. <div class="environment" v-if="companyImg.length > 0">
  130. <div class="company-details-til">工作环境</div>
  131. <div class="img-wrap">
  132. <el-image
  133. v-for="item in companyImg"
  134. :key="item.id"
  135. class="img"
  136. :src="item.filesUrl"
  137. fit="cover"
  138. ></el-image>
  139. </div>
  140. </div>
  141. </div>
  142. <!-- company-details end -->
  143. <Jobs
  144. v-if="companymenuIndex == '2'"
  145. @getTotal="getCompanyInfo"
  146. :lastSecondNum="companyTotal.lastSecondNum"
  147. />
  148. <Applys
  149. v-if="companymenuIndex == '3'"
  150. :lastMonthRecruitNum="companyTotal.lastMonthRecruitNum"
  151. @getTotal="getCompanyInfo"
  152. />
  153. </div>
  154. <div class="base-info">
  155. <div class="name">公司基本信息</div>
  156. <div class="base-info-item">
  157. <i class="el-icon-s-marketing"></i
  158. >{{ filterTradeStatus(companyInfo.trade) }}
  159. </div>
  160. <div class="base-info-item">
  161. <i class="el-icon-s-custom"></i
  162. >{{ filterScopeStatus(companyInfo.scope) }}
  163. </div>
  164. <div class="base-info-item">
  165. <i class="el-icon-location"></i>{{ companyInfo.companyAddress }}
  166. </div>
  167. </div>
  168. </section>
  169. </div>
  170. </template>
  171. <style lang="scss" scoped>
  172. @import "./home.scss";
  173. </style>
  174. <script>
  175. // @ is an alias to /src
  176. import Header from "@/components/header.vue";
  177. import Mainmenu from "@/components/mainmenu.vue";
  178. import Jobs from "@/components/jobs.vue";
  179. import Applys from "@/components/applys.vue";
  180. import {
  181. getCompanyInfo,
  182. getTrade,
  183. getScope,
  184. getCompanyTotalInfo,
  185. } from "@/utils/api";
  186. export default {
  187. name: "Home",
  188. components: {
  189. Header,
  190. Mainmenu,
  191. Jobs,
  192. Applys,
  193. },
  194. data() {
  195. return {
  196. companyLogo: "",
  197. activeName: "second",
  198. companymenuIndex: "1",
  199. companyInfo: {},
  200. companyImg: [],
  201. companyTotal: {},
  202. trade: [],
  203. scope: [],
  204. };
  205. },
  206. computed: {
  207. filterTradeStatus() {
  208. return function (value) {
  209. let v = "";
  210. for (let i = 0; i < this.trade.length; i++) {
  211. let item = this.trade[i];
  212. if (value == item.value) {
  213. v = item.label;
  214. break;
  215. }
  216. }
  217. return v;
  218. };
  219. },
  220. filterScopeStatus() {
  221. return function (value) {
  222. let v = "";
  223. for (let i = 0; i < this.scope.length; i++) {
  224. let item = this.scope[i];
  225. if (value == item.value) {
  226. v = item.label;
  227. break;
  228. }
  229. }
  230. return v;
  231. };
  232. },
  233. },
  234. created() {
  235. // console.log("localStorage.getItem", localStorage.getItem("lifeData"));
  236. // console.log("this.$router", this.$router);
  237. this.getinfo();
  238. this.handelGetTrade();
  239. this.handelGetScope();
  240. this.getCompanyInfo();
  241. },
  242. mounted() {
  243. let _this = this;
  244. if (_this.fromPage == "/applicant") {
  245. this.companymenuIndex = "3";
  246. } else if (_this.fromPage == "/jobdetails") {
  247. this.companymenuIndex = "2";
  248. }
  249. },
  250. beforeRouteEnter(to, from, next) {
  251. // console.log(from, "beforeRouteEnter");
  252. next((vm) => {
  253. // vm相当于上面的this
  254. vm.fromPage = from.path;
  255. });
  256. },
  257. methods: {
  258. companymenuSelect(key) {
  259. this.companymenuIndex = key;
  260. },
  261. getinfo() {
  262. getCompanyInfo()
  263. .then((res) => {
  264. this.companyInfo = res.data;
  265. console.log("getCompanyInfo", res);
  266. this.$mc.vuex("vuex_name", res.data.userName);
  267. this.$mc.vuex("vuex_company_id", res.data.id);
  268. this.$mc.vuex("vuex_user", res.data);
  269. this.companyLogo = res.data.logoFileList[0]?.filesUrl;
  270. this.companyImg = res.data.companyfileList;
  271. })
  272. .catch((err) => {
  273. console.log("fetchList err", err);
  274. });
  275. },
  276. getCompanyInfo() {
  277. getCompanyTotalInfo()
  278. .then((res) => {
  279. this.companyTotal = res.data;
  280. })
  281. .catch((err) => {});
  282. },
  283. handelGetTrade() {
  284. let that = this;
  285. getTrade()
  286. .then((res) => {
  287. console.log("getTrade", res);
  288. if (res.code == 200) {
  289. res.data.map(function (currentValue) {
  290. that.trade.push({
  291. value: currentValue.dictValue,
  292. label: currentValue.dictLabel,
  293. });
  294. });
  295. }
  296. })
  297. .catch((err) => {
  298. console.log("getTrade err", err);
  299. });
  300. },
  301. handelGetScope() {
  302. let that = this;
  303. getScope()
  304. .then((res) => {
  305. console.log("getScope", res);
  306. if (res.code == 200) {
  307. res.data.map(function (currentValue) {
  308. that.scope.push({
  309. value: currentValue.dictValue,
  310. label: currentValue.dictLabel,
  311. });
  312. });
  313. }
  314. })
  315. .catch((err) => {
  316. console.log("getScope err", err);
  317. });
  318. },
  319. },
  320. };
  321. </script>