saleOrder-search.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!-- 搜索表单 -->
  2. <template>
  3. <el-form
  4. label-width="120px"
  5. class="ele-form-search"
  6. @keyup.enter.native="search"
  7. @submit.native.prevent
  8. >
  9. <el-row :gutter="24">
  10. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  11. <el-form-item label="销售订单号:">
  12. <el-input v-model="where.code" placeholder="请输入"></el-input>
  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 v-model="where.productCode" placeholder="请输入"></el-input>
  18. </el-form-item>
  19. </el-col>
  20. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  21. <el-form-item label="订单类型:">
  22. <DictSelection
  23. dictName="订单类型"
  24. clearable
  25. v-model="where.orderType"
  26. >
  27. </DictSelection>
  28. </el-form-item>
  29. </el-col>
  30. <el-col v-bind="styleResponsive ? { sm: 4 } : { span: 4 }">
  31. <div class="ele-form-actions">
  32. <el-button
  33. type="primary"
  34. icon="el-icon-search"
  35. class="ele-btn-icon"
  36. @click="search"
  37. >
  38. 查询
  39. </el-button>
  40. <el-button @click="reset">重置</el-button>
  41. </div>
  42. </el-col>
  43. </el-row>
  44. </el-form>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. // 默认表单数据
  50. const defaultWhere = {
  51. code: '',
  52. productCode: ''
  53. };
  54. return {
  55. // 表单数据
  56. where: { ...defaultWhere }
  57. };
  58. },
  59. props: {},
  60. computed: {
  61. // 是否开启响应式布局
  62. styleResponsive() {
  63. return this.$store.state.theme.styleResponsive;
  64. }
  65. },
  66. methods: {
  67. /* 搜索 */
  68. search() {
  69. this.$emit('search', this.where);
  70. },
  71. /* 重置 */
  72. reset() {
  73. this.where = { ...this.defaultWhere };
  74. this.search();
  75. }
  76. }
  77. };
  78. </script>