search.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!-- 搜索表单 -->
  2. <template>
  3. <el-form label-width="100px" class="ele-form-search" @keyup.enter.native="search" @submit.native.prevent>
  4. <el-row :gutter="15">
  5. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  6. <el-form-item label="关联单据编码:">
  7. <el-input clearable v-model="where.workOrderCode" placeholder="请输入" />
  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 clearable v-model="where.warehouseName" placeholder="请输入" />
  13. </el-form-item>
  14. </el-col>
  15. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  16. <el-form-item label="物品名称:">
  17. <el-input clearable v-model="where.categoryName" placeholder="请输入" />
  18. </el-form-item>
  19. </el-col>
  20. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  21. <el-form-item label-width="0px">
  22. <el-button type="primary" icon="el-icon-search" class="ele-btn-icon" @click="search">
  23. 查询
  24. </el-button>
  25. <el-button @click="reset" icon="el-icon-refresh-left" type="primary">重置</el-button>
  26. </el-form-item>
  27. </el-col>
  28. </el-row>
  29. </el-form>
  30. </template>
  31. <script>
  32. export default {
  33. props: [],
  34. data() {
  35. // 默认表单数据
  36. const defaultWhere = {
  37. workOrderCode: '',
  38. warehouseName: '',
  39. categoryName: ''
  40. };
  41. return {
  42. // 表单数据
  43. where: { ...defaultWhere },
  44. };
  45. },
  46. computed: {
  47. // 是否开启响应式布局
  48. styleResponsive() {
  49. return this.$store.state.theme.styleResponsive;
  50. }
  51. },
  52. watch: {},
  53. created() {
  54. },
  55. methods: {
  56. /* 搜索 */
  57. search() {
  58. this.$emit('search', this.where);
  59. },
  60. /* 重置 */
  61. reset() {
  62. this.where = { ...this.defaultWhere };
  63. this.search();
  64. },
  65. }
  66. };
  67. </script>
  68. <style lang="scss" scoped>
  69. .ele-form-actions {
  70. display: flex;
  71. align-items: center;
  72. justify-content: flex-end;
  73. }
  74. </style>