yiqing-fanninglist.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. <!-- 近期填写人员列表 -->
  14. <div class="content">
  15. <div class="title">
  16. <div class="name">姓名</div>
  17. <div class="full">工作单位</div>
  18. <div class="icon"></div>
  19. </div>
  20. <div class="list" v-if="List.length != 0">
  21. <div class="item" v-for="(item,index) in List[active].data" @click="go_detail(item.id)" :key="index">
  22. <div class="name">{{item.name}}</div>
  23. <div class="full">{{item.work_unit}}</div>
  24. <div class="icon">
  25. <van-icon name="arrow" />
  26. </div>
  27. </div>
  28. </div>
  29. </div>
  30. </div>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. List:[],
  37. active:6,
  38. };
  39. },
  40. mounted() {
  41. this.get_list()
  42. document.body.style.backgroundColor = "#00A1E9"; //背景色
  43. },
  44. methods: {
  45. get_list(){
  46. this.$http.post("http://zaoquan.nxjiewei.com:8011/api/workbench/person_register/get_nearly_a_week_list",{
  47. }).then(res=>{
  48. this.List = res.data.data.reverse()
  49. console.log(this.List);
  50. })
  51. },
  52. change_day(item,index){
  53. this.active = index
  54. console.log(item.date)
  55. },
  56. go_detail(id){
  57. this.$router.push(
  58. `/zaoquan/yiqing/yiqing-fanningdetail?id=` + id
  59. );
  60. },
  61. },
  62. };
  63. </script>
  64. <style scoped>
  65. .page {
  66. box-sizing: border-box;
  67. padding: 15px 12px;
  68. }
  69. .time {
  70. width: 350px;
  71. background-color: #fff;
  72. border-radius: 10px;
  73. box-sizing: border-box;
  74. padding: 20px 0;
  75. }
  76. .time .title {
  77. text-align: center;
  78. line-height: 40px;
  79. margin-bottom: 5px;
  80. }
  81. .time .box {
  82. display: flex;
  83. justify-content: space-around;
  84. }
  85. .time .box .item {
  86. text-align: center;
  87. font-size: 12px;
  88. }
  89. .time .box .item .text {
  90. color: #999999;
  91. margin-bottom: 5px;
  92. }
  93. .time .box .item .num {
  94. padding: 5px;
  95. border-radius: 50%;
  96. background-color: #cdeefd;
  97. }
  98. .content{
  99. margin-top: 15px;
  100. box-sizing: border-box;
  101. padding: 10px;
  102. width: 350px;
  103. background-color: #fff;
  104. border-radius: 10px;
  105. }
  106. .content .title{
  107. display: flex;
  108. justify-content: space-between;
  109. color: #009DE7;
  110. font-size: 16px;
  111. text-align: center;
  112. padding: 10px 0;
  113. border-bottom: 1px solid #E7E7E7;
  114. }
  115. .content .title .name{
  116. width: 60px;
  117. }
  118. .content .title .full{
  119. width: 220px;
  120. }
  121. .content .title .icon{
  122. width: 20px;
  123. }
  124. .content .list{
  125. }
  126. .content .list .item{
  127. display: flex;
  128. justify-content: space-between;
  129. align-items: center;
  130. font-size: 14px;
  131. text-align: center;
  132. padding: 10px 0;
  133. border-bottom: 1px solid #E7E7E7;
  134. }
  135. .content .list .item .name{
  136. width: 60px;
  137. }
  138. .content .list .item .full{
  139. width: 220px;
  140. }
  141. .content .list .item .icon{
  142. width: 20px;
  143. text-align: right;
  144. padding-top: 5px;
  145. }
  146. </style>