index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <script setup lang="ts">
  2. import { ref } from "vue";
  3. import { PageSearch, usePageSearch } from "/@/components/PageSearch";
  4. import { PageContent } from "/@/components/PageContent";
  5. import searchFormConfig from "./config/search.config";
  6. import contentConfig from "./config/content.config";
  7. import CreateTicketDialog from "./components/create-ticket-dialog/index.vue";
  8. import { useRouter } from "vue-router";
  9. defineOptions({
  10. name: "ticketReturn"
  11. });
  12. const TicketDialog = ref<InstanceType<typeof CreateTicketDialog>>(null);
  13. const { push } = useRouter();
  14. function searchCallback({ timer }: any) {
  15. const [start, end] = timer;
  16. return {
  17. result: { start, end },
  18. deleteProps: ["timer"]
  19. };
  20. }
  21. const { pageContentRef, handleResetClick, handleSearchClick } =
  22. usePageSearch(searchCallback);
  23. function handleCreate() {
  24. TicketDialog.value.onDisplay();
  25. }
  26. function toDetail({ hpNo }) {
  27. push({
  28. path: "/purchase/ticketReturnDetail",
  29. query: {
  30. id: hpNo
  31. }
  32. });
  33. }
  34. </script>
  35. <template>
  36. <div class="main role">
  37. <PageSearch
  38. :form-config="searchFormConfig"
  39. @search-btn-click="handleSearchClick"
  40. @reset-btn-click="handleResetClick"
  41. />
  42. <PageContent
  43. ref="pageContentRef"
  44. @preview-btn-click="toDetail"
  45. :content-config="contentConfig"
  46. >
  47. <template #create>
  48. <el-button type="primary" @click="handleCreate">新建</el-button>
  49. </template>
  50. </PageContent>
  51. <!-- 展示对账列表数据 根据对账列表payNo创建采购回单数据 -->
  52. <CreateTicketDialog ref="TicketDialog" />
  53. </div>
  54. </template>
  55. <style scoped lang="scss">
  56. :deep(.el-dropdown-menu__item i) {
  57. margin: 0;
  58. }
  59. </style>