search.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!-- 搜索表单 -->
  2. <template>
  3. <seekPage :seekList="seekList" :formLength="3" @search="search"></seekPage>
  4. </template>
  5. <script>
  6. import dictMixins from '@/mixins/dictMixins';
  7. export default {
  8. props: {},
  9. mixins: [dictMixins],
  10. data() {
  11. return {
  12. typeList: [],
  13. reportWorkTypeList: []
  14. };
  15. },
  16. computed: {
  17. // 表格列配置
  18. seekList() {
  19. return [
  20. {
  21. label: '规则编码:',
  22. value: 'code',
  23. type: 'input',
  24. placeholder: '规则编码'
  25. },
  26. {
  27. label: '规则名称:',
  28. value: 'name',
  29. type: 'input',
  30. placeholder: '规则名称'
  31. },
  32. {
  33. label: '记录规则分类',
  34. value: 'classify',
  35. type: 'select',
  36. placeholder: '记录表分类',
  37. planList: this.typeList
  38. },
  39. {
  40. label: '模块分类',
  41. value: 'reportWorkType',
  42. type: 'select',
  43. placeholder: '模块分类',
  44. planList: this.reportWorkTypeList
  45. },
  46. {
  47. label: '状态:',
  48. value: 'publishStatus',
  49. type: 'select',
  50. placeholder: '状态',
  51. // 0-草稿,1-已发布,2-已撤销
  52. planList: [
  53. {
  54. label: '草稿',
  55. value: '0'
  56. },
  57. {
  58. label: '已发布',
  59. value: '1'
  60. },
  61. {
  62. label: '已撤销',
  63. value: '2'
  64. }
  65. ]
  66. },
  67. {
  68. label: '是否启用:',
  69. value: 'enable',
  70. type: 'select',
  71. placeholder: '是否启用',
  72. // 0-草稿,1-已发布,2-已撤销
  73. planList: [
  74. {
  75. label: '启用',
  76. value: '1'
  77. },
  78. {
  79. label: '停用',
  80. value: '0'
  81. }
  82. ]
  83. }
  84. ];
  85. }
  86. },
  87. mounted() {
  88. this.requestDict('记录规则类型').then(() => {
  89. if (this.$store.state.dict['record_sheet']) {
  90. this.typeList = this.$store.state.dict['record_sheet'].map((i) => {
  91. return { label: i.dictValue, value: i.dictCode };
  92. });
  93. }
  94. });
  95. this.requestDict('记录规则报工类型').then(() => {
  96. if (this.$store.state.dict['record_rules_report_work_type']) {
  97. this.reportWorkTypeList = this.$store.state.dict[
  98. 'record_rules_report_work_type'
  99. ].map((i) => {
  100. return { label: i.dictValue, value: i.dictCode };
  101. });
  102. }
  103. });
  104. },
  105. methods: {
  106. /* 搜索 */
  107. search(e) {
  108. this.$emit('search', {
  109. ...e
  110. });
  111. }
  112. }
  113. };
  114. </script>