newPickingListSearch.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <!-- 搜索表单 -->
  2. <template>
  3. <el-form
  4. label-width="77px"
  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="列表维度:" prop="dimension">
  12. <template>
  13. <el-select
  14. style="width: 100%"
  15. clearable
  16. @change="$emit('handledime', $event)"
  17. v-model="dimension"
  18. placeholder="请选择"
  19. >
  20. <el-option label="物品维度" value="1" v-if="type === 'products'">
  21. </el-option>
  22. <el-option label="批次维度" value="2"> </el-option>
  23. </el-select>
  24. </template>
  25. </el-form-item>
  26. </el-col>
  27. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  28. <el-form-item label="仓库:" prop="warehouseId">
  29. <template>
  30. <el-select
  31. clearable
  32. filterable
  33. style="width: 100%"
  34. v-model="where.warehouseId"
  35. placeholder="请选择"
  36. >
  37. <el-option
  38. v-for="item in warehouseList"
  39. :label="item.name"
  40. :value="item.id"
  41. :key="item.id"
  42. >
  43. </el-option>
  44. </el-select>
  45. </template>
  46. </el-form-item>
  47. </el-col>
  48. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  49. <el-form-item label="物品编码:" prop="categoryCode">
  50. <el-input
  51. clearable
  52. placeholder="请输入"
  53. v-model.trim="where.categoryCode"
  54. ></el-input>
  55. </el-form-item>
  56. </el-col>
  57. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  58. <el-form-item label="物品名称:" prop="categoryName">
  59. <el-input
  60. clearable
  61. v-model="where.categoryName"
  62. placeholder="请输入"
  63. ></el-input>
  64. </el-form-item>
  65. </el-col>
  66. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  67. <el-form-item label="批次号:" prop="batchNo">
  68. <el-input
  69. clearable
  70. v-model="where.batchNo"
  71. placeholder="请输入"
  72. ></el-input>
  73. </el-form-item>
  74. </el-col>
  75. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  76. <el-form-item label="型号:" prop="modelType">
  77. <el-input
  78. clearable
  79. v-model="where.modelType"
  80. placeholder="请输入"
  81. ></el-input>
  82. </el-form-item>
  83. </el-col>
  84. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  85. <el-form-item label="规格:" prop="specification">
  86. <el-input
  87. clearable
  88. v-model="where.specification"
  89. placeholder="请输入"
  90. ></el-input>
  91. </el-form-item>
  92. </el-col>
  93. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  94. <div class="ele-form-actions">
  95. <el-button
  96. type="primary"
  97. icon="el-icon-search"
  98. class="ele-btn-icon"
  99. @click="search"
  100. size="small"
  101. >
  102. 查询
  103. </el-button>
  104. <el-button
  105. @click="reset"
  106. icon="el-icon-refresh-left"
  107. size="small"
  108. type="primary"
  109. >重置</el-button
  110. >
  111. </div>
  112. </el-col>
  113. </el-row>
  114. </el-form>
  115. </template>
  116. <script>
  117. import { getWarehouseList } from '@/api/produce/index.js';
  118. export default {
  119. data() {
  120. // 默认表单数据
  121. const defaultWhere = {
  122. batchNo: '',
  123. warehouseId: '',
  124. manualBatchNo: '',
  125. modelType: '',
  126. specification: '',
  127. categoryCode: '',
  128. categoryName: ''
  129. };
  130. return {
  131. defaultWhere,
  132. // 表单数据
  133. where: { ...defaultWhere },
  134. warehouseList: [],
  135. dimension: '2',
  136. type: 'products'
  137. };
  138. },
  139. computed: {
  140. // 是否开启响应式布局
  141. styleResponsive() {
  142. return this.$store.state.theme.styleResponsive;
  143. }
  144. },
  145. created() {
  146. this.getArguInfo();
  147. },
  148. methods: {
  149. /* 搜索 */
  150. search() {
  151. this.$emit('search', this.where);
  152. },
  153. /* 重置 */
  154. reset() {
  155. this.where = { ...this.defaultWhere };
  156. this.search();
  157. },
  158. //搜索数据源
  159. async getArguInfo() {
  160. const { data } = await getWarehouseList();
  161. this.warehouseList = data;
  162. }
  163. }
  164. };
  165. </script>
  166. <style>
  167. .ele-form-actions {
  168. display: inline-block;
  169. transform: translate(0);
  170. transition: all;
  171. }
  172. </style>