search.vue 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <fieldset>
  3. <legend>
  4. <el-tag type="info">条件筛选</el-tag>
  5. </legend>
  6. <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
  7. <div class="search-form">
  8. <div class="form-left">
  9. <el-row :gutter="10">
  10. <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
  11. <el-input v-model="searchKey.name" placeholder="产品标题" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
  12. <template #prepend>产品标题</template>
  13. </el-input>
  14. </el-col>
  15. <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
  16. <el-select v-model="searchKey.status" clearable placeholder="请选择状态" @change="searchForm" :style="{width: '100%'}" class="diy-select">
  17. <el-option value="1" label="进行中"></el-option>
  18. <el-option value="2" label="已下架"></el-option>
  19. <template #prefix>状态</template>
  20. </el-select>
  21. </el-col>
  22. <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
  23. <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
  24. </el-col>
  25. </el-row>
  26. </div>
  27. <div class="form-line"></div>
  28. <div class="form-right">
  29. <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
  30. </div>
  31. </div>
  32. </el-form>
  33. </fieldset>
  34. <storeData ref="storeData" :multiple="false" @success="handleStore"></storeData>
  35. </template>
  36. <script>
  37. export default {
  38. data(){
  39. return {
  40. searchKey:{}
  41. }
  42. },
  43. methods: {
  44. selectStore(){
  45. this.$nextTick(()=>{
  46. this.$refs.storeData.open()
  47. })
  48. },
  49. handleStore(data){
  50. this.searchKey.poi_id = data.poi_id;
  51. this.searchKey.poi_name = data.poi_name;
  52. this.$emit("success",this.searchKey);
  53. },
  54. clearStore(){
  55. this.searchKey.poi_id = "";
  56. this.searchKey.poi_name = "";
  57. this.$emit("success",this.searchKey);
  58. },
  59. searchForm(){
  60. this.$emit("success",this.searchKey);
  61. }
  62. }
  63. }
  64. </script>