search.vue 3.6 KB

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