approval.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <div>
  3. <div class="detailItem">
  4. <div class="imgparent">
  5. <van-nav-bar
  6. title="待审批"
  7. left-text="返回"
  8. left-arrow
  9. @click-left="onClickLeft"
  10. />
  11. </div>
  12. <div class="approva_header">
  13. <van-notice-bar
  14. color="#1989fa"
  15. background="#fff"
  16. left-icon="volume-o"
  17. >
  18. 技术是开发它的人的共同灵魂。
  19. </van-notice-bar>
  20. </div>
  21. <div>
  22. <van-list
  23. v-model="loading"
  24. :finished="finished"
  25. :finished-text="finishedText"
  26. @load="onLoad"
  27. :immediate-check="false"
  28. >
  29. <div
  30. class="approba_nave"
  31. v-for="(item,index) in allHouseDetail"
  32. :key="index"
  33. @click="xiangq(item.id)"
  34. >
  35. <p>
  36. <span class="soei"><i>{{item.leavefrom_user_name}}</i>的请假申请</span>
  37. <span>{{item.leavefrom_start_time}}</span>
  38. </p>
  39. <p>请假类型:{{item.leavefrom_leave_type}}</p>
  40. <p>开始时间:{{item.leavefrom_start_time}}</p>
  41. <p>结束时间:{{item.leavefrom_end_time}}</p>
  42. </div>
  43. </van-list>
  44. </div>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. message: "",
  53. uploader: [{ url: "https://img01.yzcdn.cn/vant/leaf.jpg" }],
  54. allHouseDetail: [],
  55. loading: false,
  56. finished: false,
  57. qurmond: {
  58. table: "leavefrom",
  59. pageNo: 1,
  60. pageSize: 4,
  61. orderBy: "create_time desc",
  62. fixedData: {
  63. condition: {
  64. status: 1
  65. }
  66. },
  67. },
  68. page: 1, // 当前页码
  69. page_size: 100, // 每页多少条
  70. total: 0, // 总条数
  71. error: false, // 错误提示
  72. refreshing: false ,// 下拉刷新
  73. finishedText:''
  74. };
  75. },
  76. props: ["detailitem"],
  77. methods: {
  78. onClickLeft() {
  79. this.$router.go(-1);
  80. },
  81. onConfirm(value) {
  82. this.value = value;
  83. this.showPicker = false;
  84. },
  85. xiangq(index) {
  86. this.$router.push("/details?id=" + index);
  87. },
  88. async appList() {
  89. const res = await this.$http.post(
  90. "/boman-web-core/p/cs/queryList",
  91. this.qurmond
  92. );
  93. console.log(res);
  94. if (res.data.code !== 200) {
  95. this.$msg.fail(res.data.msg);
  96. return false;
  97. }
  98. // this.allHouseDetail = res.data.data.rows;
  99. if (this.qurmond.pageNo == 1) {
  100. this.loading = false
  101. this.allHouseDetail = res.data.data.rows;
  102. this.total = res.total;
  103. } else {
  104. this.loading = false
  105. this.allHouseDetail = this.allHouseDetail.concat(res.data.data.rows)
  106. this.total = res.data.total;
  107. }
  108. if(res.data.data.rows.length < this.qurmond.pageSize){
  109. this.finished = true;
  110. this.finishedText = '没有更多啦';
  111. }
  112. if (res.data.data.rows.length == 0) {
  113. this.finished = true;
  114. this.finishedText = '暂无数据';
  115. console.log(34)
  116. } else if (res.data.data.rows.length < this.qurmond.pageSize) {
  117. console.log(12)
  118. this.finished = true;
  119. this.finishedText = '没有更多啦';
  120. }
  121. console.log(this.allHouseDetail)
  122. },
  123. onLoad() {
  124. // 异步更新数据
  125. // setTimeout 仅做示例,真实场景中一般为 ajax 请求
  126. this.qurmond.pageNo++;
  127. this.appList();
  128. }
  129. },
  130. created() {
  131. this.appList();
  132. }
  133. };
  134. </script>
  135. <style lang="less">
  136. .formtr {
  137. .stru {
  138. .van-field__control {
  139. text-align: right;
  140. }
  141. }
  142. .van-cell:not(:last-child)::after {
  143. border-bottom: 0;
  144. }
  145. .van-field__control--custom {
  146. justify-content: flex-end;
  147. }
  148. .van-cell {
  149. font-weight: 500;
  150. color: #343434;
  151. padding: 5.6vw 4.267vw;
  152. }
  153. }
  154. </style>
  155. <style scoped lang="less">
  156. .detailItem {
  157. background-color: #fff;
  158. // height: 100vh;
  159. p {
  160. font-size: 3.333vw;
  161. padding: 0.833vw 0;
  162. }
  163. .imgparent {
  164. position: relative;
  165. .bottom {
  166. padding: 0 2.778vw;
  167. margin-bottom: 1.389vw;
  168. position: absolute;
  169. bottom: 0.556vw;
  170. background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent);
  171. justify-content: space-between;
  172. color: white;
  173. display: flex;
  174. left: 0;
  175. right: 0;
  176. }
  177. }
  178. .approba_nave {
  179. border-bottom: 0.267vw solid #dadada;
  180. margin: 16px 16px;
  181. padding: 16px 0;
  182. p {
  183. font-size: 2.667vw;
  184. font-family: PingFang SC;
  185. font-weight: 400;
  186. color: #666666;
  187. }
  188. p:nth-child(1) {
  189. display: flex;
  190. justify-content: space-between;
  191. margin-bottom: 2.133vw;
  192. i {
  193. font-style: normal;
  194. font-weight: 700;
  195. }
  196. .soei {
  197. font-size: 3.733vw;
  198. font-family: PingFang SC;
  199. font-weight: 400;
  200. color: #343434;
  201. }
  202. span:nth-child(2) {
  203. color: #aaa;
  204. font-weight: 500;
  205. }
  206. }
  207. }
  208. }
  209. .approva_header {
  210. box-shadow: 0vw 0.8vw 0.533vw 0vw rgba(218, 218, 218, 0.35);
  211. }
  212. </style>