yiqing-fanninglist.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="page">
  3. <!-- 日期选择 -->
  4. <!-- <div class="time" v-if="List.length != 0">
  5. <div class="title">{{List[6].date.split("-")[0] + "年" + List[6].date.split("-")[1] + "月"}}</div>
  6. <div class="box">
  7. <div class="item" v-for="(item,index) in List" @click="change_day(item,index)" :key="index">
  8. <div class="text">周{{item.week.substring(item.week.length - 1)}}</div>
  9. <div class="num" :style="index==active?'backgroundColor:#00A1E6;':''">{{item.date.split("-")[2]}}</div>
  10. </div>
  11. </div>
  12. </div> -->
  13. <div class="time_box">
  14. <div class="icon" @click="icon_left()">
  15. <van-icon name="arrow-left" />
  16. </div>
  17. <div class="title">{{year}}年{{ ('0' + month).substr(-2) }}月</div>
  18. <div class="icon" @click="icon_right()">
  19. <van-icon name="arrow" />
  20. </div>
  21. </div>
  22. <!-- 近期填写人员列表 -->
  23. <div class="content">
  24. <div class="title">
  25. <div class="name">姓名</div>
  26. <div class="full">工作单位</div>
  27. <div class="icon"></div>
  28. </div>
  29. <div class="list" v-if="List.length != 0">
  30. <div
  31. class="item"
  32. v-for="(item, index) in List"
  33. @click="go_detail(item.id)"
  34. :key="index"
  35. >
  36. <div class="name">{{ item.name }}</div>
  37. <div class="full">{{ item.work_unit }}</div>
  38. <div class="icon">
  39. <van-icon name="arrow" />
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. List: [],
  51. active: 6,
  52. title: "",
  53. year: 0,
  54. month: 0,
  55. };
  56. },
  57. mounted() {
  58. document.body.style.backgroundColor = "#00A1E9"; //背景色
  59. this.year = new Date().getFullYear();
  60. this.month = new Date().getMonth() + 1;
  61. console.log(this.year + '-' + ('0' + this.month).substr(-2))
  62. this.get_list(this.year,this.month);
  63. },
  64. methods: {
  65. get_list(year,month) {
  66. this.$http
  67. .post(
  68. "http://zaoquan.nxjiewei.com:8011/api/workbench/person_register/get_nearly_a_week_list",
  69. {
  70. year:year,
  71. month:month
  72. }
  73. )
  74. .then((res) => {
  75. console.log(res.data.data)
  76. this.List = res.data.data;
  77. });
  78. },
  79. change_day(item, index) {
  80. this.active = index;
  81. // console.log(item.date)
  82. },
  83. go_detail(id) {
  84. this.$router.push(`/zaoquan/yiqing/yiqing-fanningdetail?id=` + id);
  85. },
  86. icon_left() {
  87. //判断month
  88. if (this.month == 1) {
  89. this.year = this.year - 1;
  90. this.month = 12;
  91. } else {
  92. this.month = this.month - 1;
  93. }
  94. console.log(this.year,this.month)
  95. this.get_list(this.year,this.month)
  96. },
  97. icon_right() {
  98. //判断month
  99. if (this.month == 12) {
  100. this.year = this.year + 1;
  101. this.month = 1;
  102. } else {
  103. this.month = this.month + 1;
  104. }
  105. // console.log(this.year+'-'+('0' + this.month).substr(-2))
  106. console.log(this.year,this.month)
  107. this.get_list(this.year,this.month)
  108. },
  109. },
  110. };
  111. </script>
  112. <style scoped>
  113. .page {
  114. box-sizing: border-box;
  115. padding: 15px 5px;
  116. }
  117. .time {
  118. width: 350px;
  119. background-color: #fff;
  120. border-radius: 10px;
  121. box-sizing: border-box;
  122. padding: 20px 0;
  123. }
  124. .time .title {
  125. text-align: center;
  126. line-height: 40px;
  127. margin-bottom: 5px;
  128. }
  129. .time .box {
  130. display: flex;
  131. justify-content: space-around;
  132. }
  133. .time .box .item {
  134. text-align: center;
  135. font-size: 12px;
  136. }
  137. .time .box .item .text {
  138. color: #999999;
  139. margin-bottom: 5px;
  140. }
  141. .time .box .item .num {
  142. padding: 5px;
  143. border-radius: 50%;
  144. background-color: #cdeefd;
  145. }
  146. .content {
  147. margin-top: 15px;
  148. box-sizing: border-box;
  149. padding: 10px;
  150. width: 350px;
  151. background-color: #fff;
  152. border-radius: 10px;
  153. }
  154. .content .title {
  155. display: flex;
  156. justify-content: space-between;
  157. color: #009de7;
  158. font-size: 16px;
  159. text-align: center;
  160. padding: 10px 0;
  161. border-bottom: 1px solid #e7e7e7;
  162. }
  163. .content .title .name {
  164. width: 60px;
  165. }
  166. .content .title .full {
  167. width: 220px;
  168. }
  169. .content .title .icon {
  170. width: 20px;
  171. }
  172. .content .list {
  173. }
  174. .content .list .item {
  175. display: flex;
  176. justify-content: space-between;
  177. align-items: center;
  178. font-size: 14px;
  179. text-align: center;
  180. padding: 10px 0;
  181. border-bottom: 1px solid #e7e7e7;
  182. }
  183. .content .list .item .name {
  184. width: 60px;
  185. }
  186. .content .list .item .full {
  187. width: 220px;
  188. }
  189. .content .list .item .icon {
  190. width: 20px;
  191. text-align: right;
  192. padding-top: 5px;
  193. }
  194. .time_box {
  195. display: flex;
  196. justify-content: space-around;
  197. align-items: center;
  198. box-sizing: border-box;
  199. padding: 0 10px;
  200. width: 350px;
  201. background-color: #fff;
  202. border-radius: 10px;
  203. height: 50px;
  204. background-color: #fff;
  205. }
  206. .time_box .icon {
  207. padding-top: 5px;
  208. width: 50px;
  209. text-align: center;
  210. color: #00a1e9;
  211. }
  212. .time_box .title {
  213. }
  214. </style>