index.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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.companyName"
  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.experience}}|{{ item.degree }}|{{item.exceptedSalary}}</div>
  42. <!-- 岗位 -->
  43. <div>{{item.lastPosition}}</div>
  44. <!-- 专业技能 -->
  45. <van-tag class="public-margin-t-10" type="primary" size="large">{{
  46. item.keyWords
  47. }}</van-tag>
  48. <!-- 工作履历 -->
  49. <p>{{item.resumeWork}}</p>
  50. </div>
  51. </van-list>
  52. </van-pull-refresh>
  53. <div v-if="noDate" class="noDateWrapper">
  54. <div>没有相关数据</div>
  55. <div>您可以尝试以下操作</div>
  56. <van-button type="info" round v-preventReClick @click="onClickRight"
  57. >新建重点客户</van-button
  58. >
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. import { listResume, getResume, delResume, addResume, updateResume } from "@/api/system/resume";
  65. export default {
  66. name: "MobileResumeIndex",
  67. data() {
  68. return {
  69. list: [],
  70. refreshing: false,
  71. loading: false,
  72. finished: false,
  73. noDate: false,
  74. // 查询参数
  75. queryParams: {
  76. pageNum: 1,
  77. pageSize: 10,
  78. },
  79. };
  80. },
  81. created() {},
  82. mounted() {},
  83. methods: {
  84. toDetail(id) {
  85. this.$router.push({ path: "/mobile/resume/detail", query: { id } });
  86. },
  87. onRefresh() {
  88. // 清空列表数据
  89. this.finished = false;
  90. // 将 loading 设置为 true,表示处于加载状态
  91. this.loading = true;
  92. this.onLoad();
  93. },
  94. onClickRight() {
  95. this.$router.push({ name: "MobileResumeForm", query: { type: 1 } });
  96. },
  97. onSearch() {
  98. this.getList();
  99. },
  100. onLoad() {
  101. this.getList();
  102. },
  103. getList() {
  104. let that = this;
  105. if (this.refreshing) {
  106. this.list = [];
  107. this.refreshing = false;
  108. }
  109. that.$toast.loading({
  110. duration: 0,
  111. forbidClick: true,
  112. message: "加载中...",
  113. });
  114. listResume(that.queryParams)
  115. .then((response) => {
  116. if (response.code == 200) {
  117. that.$toast.clear();
  118. let data = response.rows,
  119. total = response.total;
  120. that.finished = true;
  121. that.noDate = false;
  122. if (total == 0) {
  123. that.list = [];
  124. that.noDate = true;
  125. } else if (total < 10) {
  126. that.list = data;
  127. } else {
  128. that.finished = false;
  129. that.list.push(...data);
  130. that.queryParams.page += 1;
  131. }
  132. that.loading = false;
  133. }
  134. })
  135. .catch((err) => {
  136. that.$toast(err.msg);
  137. });
  138. },
  139. },
  140. };
  141. </script>
  142. <style lang="scss">
  143. .fixedTop{
  144. width:100%;
  145. position: fixed;
  146. top:0;
  147. left:0;
  148. z-index: 99;
  149. }
  150. .listWrapper {
  151. margin-top:100px;
  152. background: #f4f4f4;
  153. // padding-bottom:100px;
  154. }
  155. .searchBar {
  156. text-align: center;
  157. background: #fff;
  158. padding: 10px 0;
  159. }
  160. .list {
  161. width: 100%;
  162. .item {
  163. margin: 10px 0;
  164. padding: 10px 3%;
  165. background: #fff;
  166. color: #aaa;
  167. font-size: 14px;
  168. // border: 1px solid #ccc;
  169. > div:first-child {
  170. font-weight: bold;
  171. font-size: 18px;
  172. line-height: 30px;
  173. color: #333;
  174. }
  175. }
  176. }
  177. .noDateWrapper {
  178. width: 100%;
  179. text-align: center;
  180. position: absolute;
  181. top: 50%;
  182. left: 50%;
  183. transform: translate(-50%, -50%);
  184. > div {
  185. color: #8a8989;
  186. }
  187. button {
  188. margin-top: 10px;
  189. }
  190. }
  191. </style>