consumption.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <view>
  3. <!-- 搜索 -->
  4. <view class="search">
  5. <u-search :clearabled="false" placeholder="输入姓名或手机号搜索" v-model="keyword"></u-search>
  6. </view>
  7. <!-- 筛选 -->
  8. <view class="options">
  9. <view class="date-option" @click="show = true">
  10. {{date}}<u-icon name="arrow-down" size="24"></u-icon>
  11. <!-- <view class="date-box" v-if="dateShow">
  12. <view class="options-item">
  13. 2023年4月
  14. </view>
  15. </view> -->
  16. </view>
  17. <view class="department-option" @click="changeDepartmentShow">
  18. 全部部门<u-icon name="arrow-down" size="24"></u-icon>
  19. <view class="department-box" v-if="departmentShow">
  20. <view class="options-item">
  21. 全部部门
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <u-picker mode="time" v-model="show" :params="params" :defaultTime="defaultTime" @confirm="confirm">
  27. </u-picker>
  28. <!-- 明细 -->
  29. <view class="details">
  30. <view class="detail-item" v-for="item in 8">
  31. <view class="head">
  32. <view class="name">
  33. 李四
  34. </view>
  35. <view class="tel">
  36. 197****2849
  37. </view>
  38. <view class="money">
  39. 15.00
  40. </view>
  41. </view>
  42. <view class="content">
  43. <view class="department">
  44. 荆州地方铁路 机务段
  45. </view>
  46. <view class="date">
  47. 4月1日 12:00
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <canteenTabbar ref="mytabbar"
  53. current="1"></canteenTabbar>
  54. </view>
  55. </template>
  56. <script>
  57. import canteenTabbar from "../../../components/canteenTabbar.vue"
  58. export default {
  59. components: {
  60. canteenTabbar
  61. },
  62. data() {
  63. return {
  64. keyword: '',
  65. dateShow:false,
  66. departmentShow:false,
  67. defaultTime: '',
  68. params: {
  69. year: true,
  70. month: true,
  71. day: true,
  72. hour: false,
  73. minute: false,
  74. second: false,
  75. timestamp: true
  76. },
  77. show: false,
  78. date: ''
  79. }
  80. },
  81. onReady() {
  82. var date = new Date();
  83. var year = date.getFullYear();
  84. var month = date.getMonth() + 1;
  85. var day = date.getDate();
  86. this.date = year + '年' + month + '月' + day + '日';
  87. if (month >= 1 && month <= 9) {
  88. month = '0' + month;
  89. }
  90. if (day >= 1 && day <= 9) {
  91. day = '0' + day;
  92. }
  93. this.defaultTime = year + '-' + month + '-' + day;
  94. },
  95. methods: {
  96. confirm(params) {
  97. this.date = params.year + '年' + parseInt(params.month) + '月' + parseInt(params.day) + '日';
  98. },
  99. changeDateShow() {
  100. this.dateShow = !this.dateShow
  101. },
  102. changeDepartmentShow() {
  103. this.departmentShow = !this.departmentShow
  104. },
  105. }
  106. }
  107. </script>
  108. <style lang="scss" scoped>
  109. page{
  110. padding-bottom: 100px;
  111. }
  112. // 搜索
  113. .search{
  114. padding: 16rpx 32rpx;
  115. background-color: #fff;
  116. /deep/.u-search{
  117. position: relative;
  118. }
  119. /deep/.u-action{
  120. position: absolute;
  121. right: 16rpx;
  122. color: rgba(31, 74, 153, 1);
  123. }
  124. }
  125. // 筛选
  126. .options{
  127. background-color: #fff;
  128. padding: 0 92rpx;
  129. line-height: 88rpx;
  130. display: flex;
  131. justify-content: space-between;
  132. color: #7D7D7D;
  133. border-bottom: 1px solid rgba(232, 232, 232, 1);
  134. .date-option,.department-option{
  135. position: relative;
  136. }
  137. /deep/.uicon-arrow-down{
  138. margin-left: 8rpx;
  139. }
  140. .date-box{
  141. background-color: #fff;
  142. z-index: 999;
  143. width: 180rpx;
  144. box-shadow: 0px 0px 2px #999999;
  145. position: absolute;
  146. top: 70rpx;
  147. right: 0px;
  148. .options-item {
  149. line-height: 60rpx;
  150. padding-left: 8rpx;
  151. background-color: #2A8EFB ;
  152. color: #fff;
  153. }
  154. }
  155. .department-box{
  156. background-color: #fff;
  157. z-index: 999;
  158. width: 180rpx;
  159. box-shadow: 0px 0px 2px #999999;
  160. position: absolute;
  161. top: 70rpx;
  162. left: 0px;
  163. .options-item {
  164. line-height: 60rpx;
  165. padding-left: 8rpx;
  166. background-color: #2A8EFB ;
  167. color: #fff;
  168. }
  169. }
  170. }
  171. // 明细
  172. .details{
  173. background-color: #fff;
  174. .detail-item{
  175. padding: 32rpx;
  176. border-bottom: 1px solid rgba(232, 232, 232, 1);
  177. .head{
  178. display: flex;
  179. align-items: center;
  180. .name{
  181. color: rgba(51, 51, 51, 1);
  182. font-size: 32rpx;
  183. font-family: 'PingFang Regular';
  184. font-weight: bold;
  185. }
  186. .tel{
  187. color: rgba(16, 16, 16, 1);
  188. font-size: 32rpx;
  189. margin-left: 16rpx;
  190. }
  191. .money{
  192. color: rgba(31, 74, 153, 1);
  193. font-size: 40rpx;
  194. font-weight: bold;
  195. margin-left: auto;
  196. }
  197. }
  198. .content{
  199. display: flex;
  200. justify-content: space-between;
  201. align-items: center;
  202. font-family: 'Alibaba-PuHuiTi-Regular';
  203. color: rgba(119, 119, 119, 1);
  204. margin-top:12rpx;
  205. }
  206. }
  207. }
  208. </style>