search.vue 4.1 KB

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