user-search.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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: 5 }">
  11. <el-form-item label="工序编码:">
  12. <el-input clearable v-model="where.code" placeholder="请输入" />
  13. </el-form-item>
  14. </el-col>
  15. <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
  16. <el-form-item label="工序名称:">
  17. <el-input clearable v-model="where.name" placeholder="请输入" />
  18. </el-form-item>
  19. </el-col>
  20. <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
  21. <el-form-item label="控制码:" prop="controlId">
  22. <el-select v-model="where.controlId" style="width: 100%">
  23. <el-option
  24. v-for="item in controlList"
  25. :key="item.id"
  26. :label="item.name"
  27. :value="item.id"
  28. >
  29. </el-option>
  30. </el-select>
  31. </el-form-item>
  32. </el-col>
  33. <el-col v-bind="styleResponsive ? { lg: 5, md: 12 } : { span: 5 }">
  34. <el-form-item label="组织机构:">
  35. <auth-selection v-model="where.deptIds" style="width: 100%"></auth-selection>
  36. </el-form-item>
  37. </el-col>
  38. <el-col v-bind="styleResponsive ? { lg: 4, md: 12 } : { span: 4 }">
  39. <div>
  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, size: -1
  93. }
  94. control.list().then(res=>{
  95. this.controlList = res.list
  96. })
  97. },
  98. }
  99. };
  100. </script>