produceOrder-search.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!-- 搜索表单 -->
  2. <template>
  3. <el-form
  4. label-width="90px"
  5. class="ele-form-search"
  6. @keyup.enter.native="search"
  7. @submit.native.prevent
  8. >
  9. <el-row :gutter="15">
  10. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  11. <el-form-item label="工序名称:">
  12. <el-select
  13. size="mini"
  14. @change="search"
  15. v-model="where.taskId"
  16. filterable
  17. >
  18. <el-option
  19. v-for="(item, index) in produceTaskList"
  20. :key="index"
  21. :label="item.name"
  22. :value="item.id"
  23. ></el-option>
  24. </el-select>
  25. </el-form-item>
  26. </el-col>
  27. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  28. <el-form-item label="产品名称:">
  29. <el-input
  30. clearable
  31. v-model="where.productName"
  32. placeholder="请输入"
  33. />
  34. </el-form-item>
  35. </el-col>
  36. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  37. <el-form-item label="产品编码:">
  38. <el-input
  39. clearable
  40. v-model="where.productCode"
  41. placeholder="请输入"
  42. />
  43. </el-form-item>
  44. </el-col>
  45. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  46. <el-form-item label-width="0px">
  47. <el-button
  48. size="mini"
  49. type="primary"
  50. icon="el-icon-search"
  51. class="ele-btn-icon"
  52. @click="search"
  53. >
  54. 查询
  55. </el-button>
  56. <el-button
  57. size="mini"
  58. @click="reset"
  59. icon="el-icon-refresh-left"
  60. type="primary"
  61. >重置</el-button
  62. >
  63. </el-form-item>
  64. </el-col>
  65. </el-row>
  66. </el-form>
  67. </template>
  68. <script>
  69. import { produceTask } from '@/api/InTheSystem/index';
  70. export default {
  71. props: [],
  72. data() {
  73. // 默认表单数据
  74. const defaultWhere = {
  75. taskId: '',
  76. productCode: '',
  77. productName: ''
  78. };
  79. return {
  80. // 表单数据
  81. where: { ...defaultWhere },
  82. produceTaskList: []
  83. };
  84. },
  85. computed: {
  86. // 是否开启响应式布局
  87. styleResponsive() {
  88. return this.$store.state.theme.styleResponsive;
  89. }
  90. },
  91. watch: {},
  92. created() {
  93. this.getTaskList();
  94. },
  95. methods: {
  96. getTaskList() {
  97. let params = {
  98. pageNum: 1,
  99. size: -1
  100. };
  101. produceTask(params).then((res) => {
  102. this.produceTaskList = res.list;
  103. this.where.taskId = res.list[0].id;
  104. if (this.where.taskId) {
  105. this.$emit('search', this.where);
  106. }
  107. });
  108. },
  109. /* 搜索 */
  110. search() {
  111. this.$emit('search', this.where);
  112. },
  113. /* 重置 */
  114. reset() {
  115. this.where = { ...this.defaultWhere };
  116. this.search();
  117. }
  118. }
  119. };
  120. </script>
  121. <style lang="scss" scoped>
  122. .ele-form-actions {
  123. display: flex;
  124. align-items: center;
  125. justify-content: flex-end;
  126. }
  127. </style>