jobOpportunitiesList.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="mainBox">
  3. <!--搜索功能 start------------------------------------------------------------>
  4. <div class="layerBox_search">
  5. <div class="layerBoxLine">
  6. <el-row>
  7. <el-col :span="6">
  8. <div class="searchBox">
  9. <div class="searchTitle">公司名称</div>
  10. <el-input placeholder="请输入公司名称" autocomplete="off" v-model="getApiData.business_name" />
  11. </div>
  12. </el-col>
  13. <el-col :span="6">
  14. <div class="searchBox">
  15. <div class="searchTitle">工作经验</div>
  16. <el-select v-model="getApiData.experience" placeholder="请选择工作经验" style="width: 100%;">
  17. <el-option v-for="item in experience" :key="item.evalue" :label="item.ename"
  18. :value="item.evalue">
  19. </el-option>
  20. </el-select>
  21. </div>
  22. </el-col>
  23. <el-col :span="6">
  24. <div class="searchBox">
  25. <div class="searchTitle">薪资范围</div>
  26. <el-select v-model="getApiData.salary" placeholder="请选择薪资范围" style="width: 100%;">
  27. <el-option v-for="item in salary" :key="item.evalue" :label="item.ename"
  28. :value="item.evalue">
  29. </el-option>
  30. </el-select>
  31. </div>
  32. </el-col>
  33. </el-row>
  34. </div>
  35. </div>
  36. <div class=" " style="padding:0px 40px 0px 0px; overflow:hidden;">
  37. <div style="float:right;">
  38. <el-button @click="clearSearchList">重置</el-button>
  39. <el-button type="primary" @click="getData">搜索</el-button>
  40. </div>
  41. </div>
  42. <!--搜索功能 end------------------------------------------------------------>
  43. <!--表格内容 start------------------------------------------------------------>
  44. <div class="layerBox">
  45. <tableTitle :name="tableDivTitle" />
  46. <el-row>
  47. <template>
  48. <el-table :data="tableData" style="width: 100%">
  49. <el-table-column fixed prop="id" label="编号" width="50"></el-table-column>
  50. <el-table-column prop="business_name" label="公司名称" width=""></el-table-column>
  51. <el-table-column prop="title" label="招聘职位名称" width=""></el-table-column>
  52. <el-table-column prop="experience_ename" label="工作经验" width=""></el-table-column>
  53. <el-table-column prop="salary_ename" label="薪资范围" width=""></el-table-column>
  54. <el-table-column prop="updated_at" label="更新时间" width=""></el-table-column>
  55. <el-table-column fixed="right" label="操作" width="200" header-align="center">
  56. <template slot-scope="scope">
  57. <div class="listBtnBox">
  58. <div class="listEditBtn" @click="goDetail(scope.row.id, tableData)">
  59. <i class="el-icon-edit-outline"></i>查看
  60. </div>
  61. </div>
  62. </template>
  63. </el-table-column>
  64. </el-table>
  65. </template>
  66. </el-row>
  67. </div>
  68. <!--分页 start------------------------------------------------------------>
  69. <div class="alignBox">
  70. <el-row>
  71. <el-col :span="24">
  72. <el-pagination
  73. @size-change="handleSizeChange"
  74. :current-page="getApiData.page"
  75. @current-change="handleCurrentChange"
  76. :page-size="10"
  77. layout="total, prev, pager, next, jumper"
  78. :total="allCount">
  79. </el-pagination>
  80. </el-col>
  81. </el-row>
  82. </div>
  83. <!--分页 end------------------------------------------------------------>
  84. <!--表格内容 end------------------------------------------------------------>
  85. </div>
  86. </template>
  87. <script>
  88. //表格标题
  89. import tableTitle from './components/tableTitle';
  90. //引入公用样式
  91. import '@/styles/global.less';
  92. export default {
  93. components: {
  94. tableTitle,//表格标题
  95. },
  96. data() {
  97. return {
  98. //1.列表和分页相关 start ------------------------------------------------------------>
  99. tableDivTitle: "求职信息列表",
  100. tableData: [],//内容
  101. experience: [],//工作经验列表
  102. salary: [],//薪资范围列表
  103. getApiData: {
  104. business_name: "",//公司名称
  105. experience: "",//工作经验
  106. salary: "",//薪资
  107. page: 1,//当前是第几页
  108. pageSize: 10,//一共多少条
  109. },
  110. allCount: 0,//总条数
  111. //分页相关 end ------------------------------------------------------------>
  112. }
  113. },
  114. methods: {
  115. //1.列表和分页相关 start ------------------------------------------------------------>
  116. //1.1 开始请求列表信息方法
  117. getData() {
  118. this.$store.dispatch('job/getRecruitingList', this.getApiData).then(res => {
  119. if (res.code == 200) {
  120. this.tableData = res.data.row;//给与内容
  121. this.allCount = res.data.count;//给与总条数
  122. } else {
  123. // this.$message.error(res.message)
  124. this.tableData = "";//给与内容
  125. this.allCount = 0;//给与总条数
  126. }
  127. })
  128. },
  129. //1.2 获得工作经验
  130. getExperience() {
  131. this.$store.dispatch('job/getExperience', {}).then(res => {
  132. if (res.code == 200) {
  133. this.experience = res.data;
  134. }
  135. })
  136. },
  137. //1.3 获得薪资范围
  138. getSalary() {
  139. this.$store.dispatch('job/getSalary', {}).then(res => {
  140. if (res.code == 200) {
  141. this.salary = res.data;
  142. }
  143. })
  144. },
  145. //1.4 列表内容分页
  146. //直接跳转
  147. handleSizeChange(val) {
  148. this.getApiData.page = val;
  149. this.getData();
  150. },
  151. //1.5 点击分页
  152. handleCurrentChange(val) {
  153. this.getApiData.page = val;
  154. this.getData();
  155. },
  156. //1.6 重置按钮
  157. clearSearchList() {
  158. this.tableData = [];
  159. this.getApiData.business_name = "";
  160. this.getApiData.experience = "";
  161. this.getApiData.salary = "";
  162. this.getApiData.page = 1;
  163. this.getApiData.pageSize = 10;
  164. this.getData();
  165. },
  166. //列表和分页相关 end ------------------------------------------------------------>
  167. //2.跳转到详情start ------------------------------------------------------------>
  168. goDetail(id) {
  169. this.$router.push({
  170. path: '/jobOpportunitiesDetails',
  171. query: { id: id }
  172. });
  173. },
  174. //添加求职信息end ------------------------------------------------------------>
  175. },
  176. mounted() {
  177. //1.获得初始数据
  178. this.getData();
  179. //2.获得工作经验
  180. this.getExperience();
  181. //3.获得薪资范围
  182. this.getSalary();
  183. }
  184. }
  185. </script>
  186. <style scoped lang="less"></style>