planSearch.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!-- 搜索表单 -->
  2. <template>
  3. <el-form label-width="120px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
  4. <el-row :gutter="24">
  5. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  6. <el-form-item label="计划编号:">
  7. <el-input v-model="where.code" placeholder="请输入"></el-input>
  8. </el-form-item>
  9. </el-col>
  10. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  11. <el-form-item label="物料编码:">
  12. <el-input v-model="where.productCode" placeholder="请输入"></el-input>
  13. </el-form-item>
  14. </el-col>
  15. <el-col v-bind="styleResponsive ? { sm: 4 } : { span: 4 }">
  16. <div class="ele-form-actions">
  17. <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
  18. 查询
  19. </el-button>
  20. <el-button @click="reset">重置</el-button>
  21. </div>
  22. </el-col>
  23. </el-row>
  24. </el-form>
  25. </template>
  26. <script>
  27. export default {
  28. data() {
  29. // 默认表单数据
  30. const defaultWhere = {
  31. code: '',
  32. productCode: '',
  33. };
  34. return {
  35. // 表单数据
  36. where: { ...defaultWhere }
  37. };
  38. },
  39. props: {
  40. },
  41. computed: {
  42. // 是否开启响应式布局
  43. styleResponsive() {
  44. return this.$store.state.theme.styleResponsive;
  45. }
  46. },
  47. methods: {
  48. /* 搜索 */
  49. search() {
  50. this.$emit('search', this.where);
  51. },
  52. /* 重置 */
  53. reset() {
  54. this.where = { ...this.defaultWhere };
  55. this.search();
  56. }
  57. }
  58. };
  59. </script>