search.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 :span="this.$store.state.global.ismobile?12:4">
  11. <el-input v-model="searchKey.agent" placeholder="选择代理" clearable readonly :style="{ width: '100%' }" @click="selectUser">
  12. <template #append>
  13. <el-tooltip
  14. effect="dark"
  15. content="点这里,清除选择"
  16. placement="top-start"
  17. >
  18. <div class="remove-a" @click="clearUser">清除</div>
  19. </el-tooltip>
  20. </template>
  21. <template #prepend>所属代理</template>
  22. </el-input>
  23. </el-col>
  24. <el-col :span="this.$store.state.global.ismobile?12:4">
  25. <el-input v-model="searchKey.truename" placeholder="地址名称" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
  26. <template #prepend>地址名称</template>
  27. </el-input>
  28. </el-col>
  29. <el-col :span="this.$store.state.global.ismobile?12:4">
  30. <el-input v-model="searchKey.contact" placeholder="联系人" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
  31. <template #prepend>联系人</template>
  32. </el-input>
  33. </el-col>
  34. <el-col :span="this.$store.state.global.ismobile?12:4">
  35. <el-input v-model="searchKey.mobile" placeholder="手机号码" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
  36. <template #prepend>手机号码</template>
  37. </el-input>
  38. </el-col>
  39. <el-col :span="this.$store.state.global.ismobile?12:4">
  40. <el-select v-model="searchKey.status" clearable placeholder="请选择状态" @change="searchForm" :style="{width: '100%'}" class="diy-select">
  41. <el-option value="1" label="正常"></el-option>
  42. <el-option value="2" label="已冻结"></el-option>
  43. <template #prefix>状态</template>
  44. </el-select>
  45. </el-col>
  46. <el-col :span="this.$store.state.global.ismobile?12:4">
  47. <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
  48. </el-col>
  49. </el-row>
  50. </div>
  51. <div class="form-line"></div>
  52. <div class="form-right">
  53. <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
  54. </div>
  55. </div>
  56. </el-form>
  57. </fieldset>
  58. <agentData ref="agentData" :multiple="false" @success="handleSuccess"></agentData>
  59. </template>
  60. <script>
  61. import agentData from "@/views/manage/components/agent";
  62. export default {
  63. components: {
  64. agentData
  65. },
  66. data(){
  67. return {
  68. searchKey:{}
  69. }
  70. },
  71. methods: {
  72. handleSuccess(data){
  73. this.searchKey.agent = data.agent_id;
  74. this.$emit("success",this.searchKey);
  75. },
  76. clearUser(){
  77. this.searchKey.agent = "";
  78. },
  79. selectUser(){
  80. this.$nextTick(() => {
  81. this.$refs.agentData.open()
  82. })
  83. },
  84. searchForm(){
  85. this.$emit("success",this.searchKey);
  86. }
  87. }
  88. }
  89. </script>