index.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <script setup lang="ts">
  2. import { ref } from "vue";
  3. import searchConfig from "./config/search.config";
  4. import contentConfig from "./config/content.config";
  5. import PageAuth from "/@/components/PageAuth";
  6. import { PageModal, usePageModal } from "/@/components/PageModal";
  7. import modalConfig from "./config/modal.config";
  8. import { PageContent } from "/@/components/PageContent";
  9. import { PageSearch, usePageSearch } from "/@/components/PageSearch";
  10. import { exportPageContent } from "/@/utils/export";
  11. import ExeclUpload from "./cpns/execl-files-upload/index.vue";
  12. import { httpDetail } from "/@/api/mobile/exchangeOrder";
  13. import { useResponseHandle } from "/@/hooks/useAsync";
  14. const pageName = "order";
  15. const responseHandle = useResponseHandle();
  16. const { pageContentRef, handleResetClick, handleSearchClick, getMergeParams } =
  17. usePageSearch(undefined, undefined, searchConfig);
  18. const { pageModalRef, handlePreviewData, handleConfrim, defaultInfo } =
  19. usePageModal({
  20. pageContentRef
  21. });
  22. const execlUploadRef = ref<InstanceType<typeof ExeclUpload>>(null);
  23. async function handleDetailData(id) {
  24. const { code, data, message } = await httpDetail({ id: id });
  25. responseHandle({
  26. code,
  27. message,
  28. handler: () => {
  29. handlePreviewData(data);
  30. }
  31. });
  32. // actionModalRef.value.onShow("兑换商品库存", type, id);
  33. }
  34. function getParams() {
  35. exportPageContent({
  36. type: "http",
  37. url: "orderExport",
  38. params: getMergeParams(),
  39. name: "订单导出"
  40. });
  41. console.log(pageContentRef);
  42. }
  43. </script>
  44. <template>
  45. <!-- <PageAuth :pageName="pageName"> -->
  46. <PageSearch
  47. :form-config="searchConfig"
  48. @search-btn-click="handleSearchClick"
  49. @reset-btn-click="handleResetClick"
  50. >
  51. <template #action>
  52. <!-- v-if="!isSuperUser" @click="onDownloadTemplate" -->
  53. <el-button @click="getParams">导出订单</el-button>
  54. <!-- v-if="!isSuperUser" -->
  55. <el-button type="primary" @click="() => execlUploadRef.onDisplay()"
  56. >批量发货
  57. </el-button>
  58. </template>
  59. </PageSearch>
  60. <PageContent
  61. ref="pageContentRef"
  62. :content-config="contentConfig"
  63. @preview-btn-click="({ id }) => handleDetailData(id)"
  64. />
  65. <ExeclUpload ref="execlUploadRef" @onSuccess="handleResetClick" />
  66. <PageModal
  67. ref="pageModalRef"
  68. :modal-config="modalConfig"
  69. :default-info="defaultInfo"
  70. @confirm-btn-click="handleConfrim"
  71. />
  72. <!-- </PageAuth> -->
  73. </template>