index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <div class="mobileWrapper">
  3. <div class="fixedTop">
  4. <van-nav-bar
  5. title="简历系统"
  6. right-text="新增"
  7. v-preventReClick
  8. @click-right="onClickRight"
  9. />
  10. <van-search
  11. v-model="queryParams.userName"
  12. show-action
  13. label="候选人姓名"
  14. placeholder="请输入姓名"
  15. @search="onSearch"
  16. >
  17. <template #action>
  18. <div @click="onSearch" v-preventReClick>搜索</div>
  19. </template>
  20. </van-search>
  21. </div>
  22. <div class="listWrapper">
  23. <!-- 内容 -->
  24. <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
  25. <van-list
  26. v-model="loading"
  27. :finished="finished"
  28. finished-text=""
  29. @load="onLoad"
  30. class="list"
  31. >
  32. <div
  33. class="item"
  34. v-for="(item, index) in list"
  35. :key="index"
  36. v-preventReClick
  37. @click="toDetail(item.resumeId)"
  38. >
  39. <div>{{ item.userName }}</div>
  40. <!-- 性别|年龄|工作年限|学历|期望薪资 -->
  41. <div>{{item.gender}} | 年龄:{{item.age}} | 工龄:{{item.experience}} | {{ item.degree }} | {{item.exceptedSalary}}</div>
  42. <!-- 岗位 -->
  43. <div>求职岗位:{{item.position}}</div>
  44. <!-- 专业技能 -->
  45. <van-tag v-if="item.certificate" class="public-margin-t-10" type="primary" size="large">{{
  46. item.certificate
  47. }}</van-tag>
  48. <van-tag v-if="item.languageAbility" class="public-margin-t-10 public-margin-l-10" type="primary" size="large">{{
  49. item.languageAbility
  50. }}</van-tag>
  51. <!-- 自我评价 -->
  52. <p>{{item.selfEvaluation}}</p>
  53. </div>
  54. </van-list>
  55. </van-pull-refresh>
  56. <div v-if="noDate" class="noDateWrapper">
  57. <div>没有相关数据</div>
  58. <div>您可以尝试以下操作</div>
  59. <van-button type="info" round v-preventReClick @click="onClickRight"
  60. >新建重点客户</van-button
  61. >
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import { listResume, getResume, delResume, addResume, updateResume } from "@/api/system/resume";
  68. export default {
  69. name: "MobileResumeIndex",
  70. data() {
  71. return {
  72. list: [],
  73. refreshing: false,
  74. loading: false,
  75. finished: false,
  76. noDate: false,
  77. // 查询参数
  78. queryParams: {
  79. pageNum: 1,
  80. pageSize: 10,
  81. userName:''
  82. },
  83. };
  84. },
  85. created() {},
  86. mounted() {},
  87. methods: {
  88. toDetail(id) {
  89. this.$router.push({ path: "/mobile/resume/detail", query: { id } });
  90. },
  91. onRefresh() {
  92. // 清空列表数据
  93. this.finished = false;
  94. // 将 loading 设置为 true,表示处于加载状态
  95. this.loading = true;
  96. this.onLoad();
  97. },
  98. onClickRight() {
  99. this.$router.push({ name: "MobileResumeForm", query: { type: 1 } });
  100. },
  101. onSearch() {
  102. this.getList();
  103. },
  104. onLoad() {
  105. this.getList();
  106. },
  107. getList() {
  108. let that = this;
  109. if (this.refreshing) {
  110. this.list = [];
  111. this.refreshing = false;
  112. }
  113. that.$toast.loading({
  114. duration: 0,
  115. forbidClick: true,
  116. message: "加载中...",
  117. });
  118. listResume(that.queryParams)
  119. .then((response) => {
  120. if (response.code == 200) {
  121. that.$toast.clear();
  122. let data = response.rows,
  123. total = response.total;
  124. that.finished = true;
  125. that.noDate = false;
  126. if (total == 0) {
  127. that.list = [];
  128. that.noDate = true;
  129. } else if (total < 10) {
  130. that.list = data;
  131. } else {
  132. that.finished = false;
  133. that.list.push(...data);
  134. that.queryParams.page += 1;
  135. }
  136. that.loading = false;
  137. }
  138. })
  139. .catch((err) => {
  140. that.$toast(err.msg);
  141. });
  142. },
  143. },
  144. };
  145. </script>
  146. <style lang="scss">
  147. .fixedTop{
  148. width:100%;
  149. position: fixed;
  150. top:0;
  151. left:0;
  152. z-index: 99;
  153. }
  154. .listWrapper {
  155. margin-top:100px;
  156. background: #f4f4f4;
  157. // padding-bottom:100px;
  158. }
  159. .searchBar {
  160. text-align: center;
  161. background: #fff;
  162. padding: 10px 0;
  163. }
  164. .list {
  165. width: 100%;
  166. .item {
  167. margin: 10px 0;
  168. padding: 10px 3%;
  169. background: #fff;
  170. color: #aaa;
  171. font-size: 14px;
  172. // border: 1px solid #ccc;
  173. > div:first-child {
  174. font-weight: bold;
  175. font-size: 18px;
  176. line-height: 30px;
  177. color: #333;
  178. }
  179. }
  180. }
  181. .noDateWrapper {
  182. width: 100%;
  183. text-align: center;
  184. position: absolute;
  185. top: 50%;
  186. left: 50%;
  187. transform: translate(-50%, -50%);
  188. > div {
  189. color: #8a8989;
  190. }
  191. button {
  192. margin-top: 10px;
  193. }
  194. }
  195. </style>