user-search.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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: 5, md: 12 } : { span: 6 }">
  11. <el-form-item label="工步编码:">
  12. <el-input clearable v-model.trim="where.code" placeholder="请输入" />
  13. </el-form-item>
  14. </el-col>
  15. <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
  16. <el-form-item label="工步名称:">
  17. <el-input clearable v-model.trim="where.name" placeholder="请输入" />
  18. </el-form-item>
  19. </el-col>
  20. <!-- <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
  21. <el-form-item label="组织机构:">
  22. <auth-selection v-model.trim="where.deptIds" style="width: 100%"></auth-selection>
  23. </el-form-item>
  24. </el-col> -->
  25. <!-- <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 6 }">
  26. <el-form-item label="控制码:" prop="controlId">
  27. <el-select v-model.trim="where.controlId" >
  28. <el-option
  29. v-for="item in controlList"
  30. :key="item.id"
  31. :label="item.name"
  32. :value="item.id"
  33. >
  34. </el-option>
  35. </el-select>
  36. </el-form-item>
  37. </el-col> -->
  38. <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
  39. <div class="ele-form-actions">
  40. <el-button
  41. type="primary"
  42. icon="el-icon-search"
  43. class="ele-btn-icon"
  44. @click="search"
  45. >
  46. 查询
  47. </el-button>
  48. <el-button @click="reset">重置</el-button>
  49. </div>
  50. </el-col>
  51. </el-row>
  52. </el-form>
  53. </template>
  54. import control from '@/api/technology/control';
  55. <script>
  56. import control from '@/api/technology/control';
  57. export default {
  58. data() {
  59. // 默认表单数据
  60. const defaultWhere = {
  61. code: '',
  62. name: '',
  63. controlId: null
  64. };
  65. return {
  66. // 表单数据
  67. where: { ...defaultWhere },
  68. controlList: []
  69. };
  70. },
  71. computed: {
  72. // 是否开启响应式布局
  73. styleResponsive() {
  74. return this.$store.state.theme.styleResponsive;
  75. }
  76. },
  77. created() {
  78. this.getControlList();
  79. },
  80. methods: {
  81. /* 搜索 */
  82. search() {
  83. this.$emit('search', this.where);
  84. },
  85. /* 重置 */
  86. reset() {
  87. this.where = { ...this.defaultWhere };
  88. this.search();
  89. },
  90. getControlList() {
  91. const params = {
  92. pageNum: 1,
  93. size: -1
  94. };
  95. control.list().then((res) => {
  96. this.controlList = res.list;
  97. });
  98. }
  99. }
  100. };
  101. </script>