InventoryPage3.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <div style="position: relative;">
  3. <InventorySelect class="select-inventory" :class="{ 'hide': !isHave }" :size="'small'" @get-plan-id="getPlanInfo" />
  4. <component :is="dynamicComponent" v-bind="dynamicComponentParam" />
  5. </div>
  6. <a-card v-if="!isHave" style="width: 100%;position: absolute; top: 4rem;display: flex;justify-content: center;">
  7. <a-empty>
  8. <template #description>
  9. <span>
  10. 暂无盘点数据
  11. </span>
  12. </template>
  13. </a-empty>
  14. </a-card>
  15. </template>
  16. <script setup>
  17. import { ref, defineAsyncComponent } from 'vue';
  18. import InventorySelect from './InventorySelect.vue';
  19. const isHave = ref(false);
  20. const dynamicComponent = ref(null);
  21. const dynamicComponentParam = ref(null);
  22. // 获取盘点计划ID
  23. const getPlanInfo = id => {
  24. if (id) isHave.value = true;
  25. const asyncComponent = defineAsyncComponent({
  26. // 加载函数
  27. loader: () => import('pc-component-v3').then(module => module.InfoWindow),
  28. delay: 200,
  29. timeout: 10000,
  30. });
  31. dynamicComponentParam.value = {
  32. infoWindowNo: '20241017_165022',
  33. whereClauseSource: { customWhere: 'ai.assetInventoryPlanId = ' + id + ' and ail.needInventory = 1 and (ail.inventoryDate IS NOT NULL OR ail.isConfirmed = 1)' },
  34. };
  35. dynamicComponent.value = asyncComponent;
  36. };
  37. </script>
  38. <style scoped>
  39. :deep(.ant-page-header-heading) {
  40. display: none !important;
  41. }
  42. /* :deep(.m-segmented) {
  43. display: none !important;
  44. } */
  45. :deep(.flex-header) {
  46. flex: 0 0 40px !important;
  47. }
  48. .select-inventory {
  49. position: absolute;
  50. top: 4.2rem;
  51. left: 10rem;
  52. }
  53. @media (max-width: 768px) {
  54. .select-inventory {
  55. position: absolute;
  56. top: 4.2rem;
  57. left: 10rem;
  58. font-size: 10px;
  59. }
  60. }
  61. .hide {
  62. display: none
  63. }
  64. </style>