search.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view>
  3. <u-popup :show="show" closeOnClickOverlay mode="right" @close="closePopup">
  4. <view class="popupBox">
  5. <view class="popupCent">
  6. <view class="tit">筛选</view>
  7. <view class="itemBox">
  8. <view class="tit">创建时间</view>
  9. <uni-datetime-picker start-placeholder="开始时间" end-placeholder="结束时间" class="datetimeBox"
  10. v-model="popupInfo.range" type="daterange" :clear-icon="false" @maskClick="maskClick" />
  11. </view>
  12. <view class="itemBox">
  13. <view class="tit">单据编码</view>
  14. <view class="putBox"><input v-model="popupInfo.code" placeholder="请输入单据编码" /></view>
  15. </view>
  16. </view>
  17. <view class="footerBtn" @click="getFilter">确定</view>
  18. </view>
  19. </u-popup>
  20. </view>
  21. </template>
  22. <script>
  23. import {getDate} from '@/utils/utils.js';
  24. export default {
  25. name: "getsearch",
  26. props: {
  27. show:{
  28. type: Boolean,
  29. default: false
  30. }
  31. },
  32. data() {
  33. return {
  34. popupInfo: {
  35. range: ['', ''], //日期范围
  36. code: '', //单号
  37. },
  38. }
  39. },
  40. onShow(){
  41. },
  42. methods: {
  43. //验证
  44. getFilter(){
  45. /*
  46. //必填验证
  47. if(!this.popupInfo.code){
  48. uni.showToast({
  49. icon:"none",
  50. title: '请输入单据编码'
  51. });
  52. return;
  53. }
  54. */
  55. this.$emit("openPopup");
  56. this.$emit("getPopupInfo",this.popupInfo);
  57. },
  58. //关闭窗口
  59. closePopup() {
  60. this.$emit("openPopup");
  61. },
  62. //时间点击
  63. maskClick(e) {
  64. console.log('maskClick事件:', e);
  65. },
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. /*右弹层*/
  71. .popupBox {
  72. width: calc(100vw - 20vw);
  73. position: relative;
  74. .popupCent {
  75. padding: 20rpx 40rpx 120rpx 40rpx;
  76. height: calc(100vh - 100rpx);
  77. overflow-y: auto;
  78. }
  79. .tit {
  80. font-weight: bold;
  81. }
  82. .itemBox {
  83. margin: 40rpx 0;
  84. .tit {
  85. font-size: 28rpx;
  86. }
  87. .datetimeBox {
  88. margin-top: 20rpx;
  89. }
  90. /deep/ .uni-date-x--border {
  91. border: none !important;
  92. .uni-date-range {
  93. background: #f2f2f2 !important;
  94. border-radius: 60rpx;
  95. }
  96. }
  97. .putBox {
  98. margin-top: 20rpx;
  99. input {
  100. height: 74rpx;
  101. line-height: 74rpx;
  102. border-radius: 60rpx;
  103. background: #f2f2f2 !important;
  104. padding: 0 40rpx;
  105. font-size: 28rpx;
  106. }
  107. }
  108. .tagsBox {
  109. margin-top: 20rpx;
  110. display: flex;
  111. flex-wrap: wrap;
  112. justify-content: space-between;
  113. view {
  114. width: 30%;
  115. height: 60rpx;
  116. line-height: 60rpx;
  117. margin-bottom: 20rpx;
  118. background: #f2f2f2;
  119. text-align: center;
  120. border-radius: 60rpx;
  121. font-size: 28rpx;
  122. overflow: hidden;
  123. white-space: nowrap;
  124. text-overflow: ellipsis;
  125. -o-text-overflow: ellipsis;
  126. }
  127. view.on {
  128. background: $u-success-dark;
  129. color: #fff;
  130. }
  131. view.col2 {
  132. width: 47.5% !important;
  133. }
  134. }
  135. }
  136. .footerBtn {
  137. position: absolute;
  138. bottom: 40rpx;
  139. left: 0;
  140. width: 100%;
  141. height: 80rpx;
  142. line-height: 80rpx;
  143. text-align: center;
  144. color: #fff;
  145. background: $u-success-dark;
  146. }
  147. }
  148. </style>