store-search.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <style>
  2. .store-search .tabs {
  3. margin-top: 20px;
  4. }
  5. .store-search .label {
  6. margin-right: 10px;
  7. }
  8. .store-search .item-box {
  9. margin-bottom: 10px;
  10. margin-right: 15px;
  11. }
  12. .store-search .clear-where {
  13. color: #419EFB;
  14. cursor: pointer;
  15. }
  16. </style>
  17. <template id="store-search">
  18. <div class="store-search">
  19. <div flex="wrap:wrap cross:center">
  20. <div style="height: 32px;">查询条件:</div>
  21. <div class="item-box" class="label">
  22. <el-input style="width: 350px" size="small" v-model="search.keyword" placeholder="请输入搜索内容" clearable>
  23. <el-select style="width: 120px" slot="prepend" v-model="search.type">
  24. <el-option v-for="item in typeList" :key="item.value"
  25. :label="item.name"
  26. :value="item.value">
  27. </el-option>
  28. </el-select>
  29. </el-input>
  30. </div>
  31. <div class="item-box" flex="dir:left cross:center">
  32. <div class="label">门店分类</div>
  33. <el-select size="small" style="width: 120px" v-model="search.categoryId" placeholder="门店分类">
  34. <el-option v-for="item in categoryList" :key="item.value" :label="item.name"
  35. :value="item.value">
  36. </el-option>
  37. </el-select>
  38. </div>
  39. <div class="item-box" flex="dir:left cross:center">
  40. <div class="label">入驻状态</div>
  41. <el-select size="small" style="width: 120px" v-model="search.status" placeholder="入驻状态">
  42. <el-option v-for="item in storeStatus" :key="item.value" :label="item.name"
  43. :value="item.value">
  44. </el-option>
  45. </el-select>
  46. </div>
  47. <el-button
  48. style="float: right; margin-left: 5px; margin-top: -10px"
  49. @click="toSearch"
  50. type="primary"
  51. size="small">查询
  52. </el-button>
  53. <el-button
  54. style="float: right; margin-left: 5px; margin-top: -10px"
  55. @click="clearWhere"
  56. type="primary"
  57. size="small">清空
  58. </el-button>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. Vue.component('store-search', {
  64. template: '#store-search',
  65. props: {
  66. typeList: {
  67. type: Array,
  68. default: function () {
  69. return [
  70. {value: '1', name: '门店ID'},
  71. {value: '2', name: '门店名称'},
  72. {value: '3', name: '店长姓名'},
  73. {value: '4', name: '联系电话'},
  74. ]
  75. }
  76. },
  77. categoryList: {
  78. type: Array,
  79. default: function () {
  80. return [
  81. {value: '0', name: '全部'},
  82. ];
  83. }
  84. },
  85. storeStatus: {
  86. type: Array,
  87. default: function () {
  88. return [
  89. {value: '1', name: '入驻中'},
  90. {value: '-2', name: '已过期'},
  91. ];
  92. }
  93. },
  94. newSearch: {
  95. type: Object,
  96. default: function () {
  97. return {
  98. type: '',
  99. keyword: '',
  100. categoryId: '',
  101. status: '',
  102. }
  103. }
  104. },
  105. },
  106. methods: {
  107. toSearch() {
  108. this.search.page = 1;
  109. this.$emit('search', this.search);
  110. },
  111. clearWhere() {
  112. this.search.type = '';
  113. this.search.keyword = '';
  114. this.search.categoryId = '';
  115. this.search.status = '';
  116. this.toSearch();
  117. },
  118. },
  119. created() {
  120. this.search = this.newSearch;
  121. this.newActiveName = this.activeName;
  122. }
  123. })
  124. </script>