search.vue 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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="6">
  11. <el-input v-model="searchKey.shop" placeholder="请选择店铺" clearbale readonly :style="{width:'100%'}" @click="selectStore">
  12. <template #append>
  13. <el-tooltip effect="dark" content="点这里,清除选择" placement="top-start">
  14. <div class="remove-a" @click="clearStore">清除</div>
  15. </el-tooltip>
  16. </template>
  17. <template #prepend>选择店铺</template>
  18. </el-input>
  19. </el-col>
  20. <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
  21. <el-input v-model="searchKey.name" placeholder="订单编号" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
  22. <template #prepend>订单编号</template>
  23. </el-input>
  24. </el-col>
  25. <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
  26. <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
  27. </el-col>
  28. </el-row>
  29. </div>
  30. <div class="form-line"></div>
  31. <div class="form-right">
  32. <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
  33. </div>
  34. </div>
  35. </el-form>
  36. </fieldset>
  37. <storeData ref="storeData" :multiple="false" @success="handleStore"></storeData>
  38. </template>
  39. <script>
  40. import storeData from '@/views/manage/components/store';
  41. export default {
  42. components: {
  43. storeData
  44. },
  45. data(){
  46. return {
  47. searchKey:{}
  48. }
  49. },
  50. methods: {
  51. selectStore(){
  52. this.$nextTick(()=>{
  53. this.$refs.storeData.open()
  54. })
  55. },
  56. handleStore(data){
  57. this.searchKey.shop = data.shop_id;
  58. this.$emit("success",this.searchKey);
  59. },
  60. clearStore(){
  61. this.searchKey.shop = "";
  62. this.$emit("success",this.searchKey);
  63. },
  64. searchForm(){
  65. this.$emit("success",this.searchKey);
  66. }
  67. }
  68. }
  69. </script>