page-search.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <!-- 搜索表单 -->
  2. <template>
  3. <ele-card :body-style="{ paddingBottom: '8px' }">
  4. <ProSearch
  5. :items="formItems"
  6. ref="searchRef"
  7. @search="search"
  8. :initKeys="initKeys"
  9. />
  10. </ele-card>
  11. </template>
  12. <script setup>
  13. import { reactive, ref, defineEmits } from 'vue';
  14. import ProSearch from '@/components/CommonPage/ProSearch2.vue';
  15. const emit = defineEmits(['search']);
  16. const formItems = reactive([
  17. { type: 'input', label: '订单编号', prop: 'orderId' },
  18. { type: 'input', label: '投诉编号', prop: 'id' },
  19. {
  20. type: 'datetimerange',
  21. label: '投诉时间',
  22. prop: 'time',
  23. props: {
  24. format: 'YYYY-MM-DD HH:mm:ss',
  25. valueFormat: 'YYYY-MM-DD HH:mm:ss',
  26. onChange: (value) => {
  27. searchRef.value?.setData({
  28. createTimeStart: value ? value[0] : '',
  29. createTimeEnd: value ? value[1] : ''
  30. });
  31. }
  32. },
  33. colProps: { span: 6 }
  34. },
  35. {
  36. type: 'dictSelect',
  37. label: '投诉原因',
  38. prop: 'reason',
  39. props: { code: 'optimization_content' },
  40. colProps: { span: 3 }
  41. },
  42. {
  43. type: 'dictSelect',
  44. label: '投诉状态',
  45. prop: 'status',
  46. props: { code: 'complain_status' },
  47. colProps: { span: 3 }
  48. }
  49. ]);
  50. const initKeys = reactive({
  51. id: '',
  52. orderId: '',
  53. reason: '',
  54. time: [],
  55. createTimeStart: '',
  56. createTimeEnd: '',
  57. status: ''
  58. });
  59. const searchRef = ref(null);
  60. /** 搜索 */
  61. const search = (data) => {
  62. emit('search', { ...data });
  63. };
  64. </script>