searchModal.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <!-- 待办单查询 -->
  3. <div class="modal-content">
  4. <u-popup v-model="isShow" class="search-popup" mode="right" @close="handleClose" length="85%">
  5. <view class="search-title">筛选</view>
  6. <u-form class="form-content" :model="form" ref="uForm" label-width="150">
  7. <u-form-item label="网点名称:" prop="bundleName" class="form-item"><u-input v-model="form.bundleName" :maxlength="30" placeholder="请输入网点名称" /></u-form-item>
  8. <u-form-item label="排序方式:" prop="custMobile" class="form-item">
  9. <view @tap="openSort=true" :style="{color: form.custMobile?null:'#c0c4cc'}">{{custMobileName}}</view>
  10. </u-form-item>
  11. </u-form>
  12. <view class="uni-list-btns">
  13. <u-button class="handle-btn search-btn" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
  14. <u-button class="handle-btn" size="medium" hover-class="none" @click="resetForm">重置</u-button>
  15. </view>
  16. </u-popup>
  17. <u-picker mode="selector" v-model="openSort" :default-selector="selectDefault" :range="list" range-key="label" @confirm="confirm"></u-picker>
  18. </div>
  19. </template>
  20. <script>
  21. export default {
  22. props: {
  23. visible: {
  24. type: Boolean,
  25. default: false
  26. },
  27. defaultParams: { // 默认筛选条件
  28. type: Object,
  29. default: () => {
  30. return {}
  31. }
  32. }
  33. },
  34. watch: {
  35. visible(newValue, oldValue) {
  36. if (newValue) {
  37. this.isShow = newValue
  38. }
  39. },
  40. isShow(newValue, oldValue) {
  41. if (newValue) {
  42. } else {
  43. this.init()
  44. this.$emit('close')
  45. }
  46. }
  47. },
  48. data() {
  49. return {
  50. customBtnStyle: { // 自定义按钮样式
  51. borderColor: '#07c160',
  52. backgroundColor: '#07c160',
  53. color: '#fff'
  54. },
  55. isShow: this.visible, // 显示隐藏
  56. form: {
  57. bundleName: '', // 套餐名称
  58. custMobile: '', // 客户手机
  59. },
  60. list: [
  61. { label: '按内置单箱体最大投放量降序', value: '11' },
  62. { label: '按网点可回收物投放总量降序', value: '22' }
  63. ],
  64. openSort: false, // 选择
  65. custMobileName: '请选择',
  66. selectDefault: [0], // 下拉默认选中项
  67. };
  68. },
  69. mounted() {
  70. this.init()
  71. },
  72. methods: {
  73. // 初始化数据
  74. init(){
  75. this.form.bundleName = this.defaultParams.bundleName ? this.defaultParams.bundleName : ''
  76. this.form.custMobile = this.defaultParams.custMobile ? this.defaultParams.custMobile : ''
  77. },
  78. // 关闭弹窗
  79. handleClose() {
  80. this.isShow = false
  81. },
  82. // 查询
  83. handleSearch() {
  84. let params = {
  85. bundleName: this.form.bundleName,
  86. custMobile: this.form.custMobile,
  87. };
  88. this.$emit('refresh', params)
  89. this.isShow = false
  90. },
  91. // 重置
  92. resetForm() {
  93. this.$refs.uForm.resetFields()
  94. this.$emit('refresh', {})
  95. this.isShow = false
  96. },
  97. // 确定
  98. confirm(v){
  99. this.selectDefault = v
  100. this.form.custMobile = this.list[v[0]].value
  101. this.custMobileName = this.list[v[0]].label
  102. }
  103. }
  104. };
  105. </script>
  106. <style lang="scss" scoped>
  107. .modal-content {
  108. position: relative;
  109. }
  110. .search-popup {
  111. .search-title {
  112. text-align: center;
  113. padding: 18rpx 22rpx;
  114. color: #333;
  115. border-bottom: 1px solid #eee;
  116. }
  117. .form-content {
  118. display: block;
  119. padding: 0 20rpx;
  120. box-sizing: content-box;
  121. .status-item {
  122. width: 30%;
  123. text-align: center;
  124. line-height: 60rpx;
  125. background-color: #F8F8F8;
  126. color: #333;
  127. border-radius: 6rpx;
  128. font-size: 24rpx;
  129. margin: 0 10rpx;
  130. }
  131. .active {
  132. background-color: #ffaa00;
  133. color: #fff;
  134. }
  135. .form-item-inp{
  136. display: inline-block;
  137. width: 88%;
  138. vertical-align: top;
  139. }
  140. }
  141. .uni-list {
  142. margin: 20rpx;
  143. .uni-list-cell {
  144. display: flex;
  145. align-items: center;
  146. border-bottom: 1px dashed #eeeeee;
  147. .uni-list-cell-db {
  148. flex: 1;
  149. }
  150. .uni-input {
  151. height: 2.5em;
  152. line-height: 2.5em;
  153. }
  154. }
  155. }
  156. .uni-list-btns {
  157. display: flex;
  158. padding: 20rpx;
  159. margin-top: 200rpx;
  160. .handle-btn {
  161. font-size: 28rpx;
  162. margin: 0 30rpx;
  163. width: 100%;
  164. flex: 1;
  165. }
  166. }
  167. }
  168. .date-picker {
  169. }
  170. </style>