WarehouseManagement.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!--库房管理-->
  2. <template>
  3. <div>
  4. <div v-show="!addWarehouseState.show && !outboundDetailsState.show" class="app-container">
  5. <div>
  6. <transition name="fade">
  7. <el-row :gutter="30" style="height: 50px">
  8. <el-col :span="10">
  9. <el-button type="primary" @click="handleAdd">新增</el-button>
  10. <el-button type="primary" @click="handleAdd">数据导入</el-button>
  11. </el-col>
  12. </el-row>
  13. </transition>
  14. <el-table ref="multipleTable" v-loading="loading" :data="tableData" border :max-height="maxHeight" style="width: 96%">
  15. <el-table-column label="库房名称" align="center" prop="warehouse_name" width="120" show-overflow-tooltip/>
  16. <el-table-column label="所在仓库" align="center" prop="warehouse_location" width="120" show-overflow-tooltip/>
  17. <el-table-column label="库房面积(平方米)" align="center" prop="warehouse_area_square_meters" width="120" show-overflow-tooltip/>
  18. <el-table-column label="可用仓储面积(平方米)" align="center" prop="available_warehouse_area_square_meters" width="120" show-overflow-tooltip/>
  19. <el-table-column label="高度(米)" align="center" prop="height_meters" width="120" show-overflow-tooltip/>
  20. <el-table-column label="库房容积(立方米)" align="center" prop="warehouse_volume_cubic_meters" width="120" show-overflow-tooltip/>
  21. <el-table-column label="可用库房容积(立方米)" align="center" prop="available_warehouse_volume_cubic_meters" width="120" show-overflow-tooltip/>
  22. <el-table-column label="保管类型" align="center" prop="storage_type" width="120" show-overflow-tooltip/>
  23. <el-table-column label="等级" align="center" prop="grade" width="120" show-overflow-tooltip/>
  24. <el-table-column label="存放类型" align="center" prop="storage_placement_type" width="120" show-overflow-tooltip/>
  25. <el-table-column label="库存确认最新时间" align="center" prop="inventory_confirmation_latest_time" width="120" show-overflow-tooltip/>
  26. <el-table-column label="操作" align="center" fixed="right" width="88" class-name="small-padding fixed-width">
  27. <template #default="scope">
  28. <el-button type="text" class="common-btn-text-primary" @click="handleWrite">查看</el-button>
  29. <el-button type="text" class="common-btn-text-primary" @click="handleView">明细</el-button>
  30. </template>
  31. </el-table-column>
  32. </el-table>
  33. <pagination
  34. v-show="total > 0"
  35. v-model:page="queryParams.page"
  36. v-model:limit="queryParams.pageSize"
  37. :total="total"
  38. @change-page="handlePaginationChange"
  39. />
  40. </div>
  41. </div>
  42. <addWarehouse v-if="addWarehouseState.show" @close="handleCancel" />
  43. <outboundDetails v-if="outboundDetailsState.show" @close="handleCancel" />
  44. </div>
  45. </template>
  46. <script setup lang="ts">
  47. import addWarehouse from "./addWarehouse.vue";
  48. import outboundDetails from "./outboundDetails.vue";
  49. import { ref,reactive, onMounted, onBeforeUnmount } from "vue";
  50. // 定义响应式变量
  51. const loading = ref(false);
  52. const maxHeight = ref(window.innerHeight * 0.8);
  53. const total = ref();
  54. // 处理窗口大小变化
  55. const handleResize = () => {
  56. maxHeight.value = window.innerHeight * 0.8;
  57. };
  58. const queryParams = reactive({
  59. page: '1',
  60. pageSize: '10',
  61. });
  62. const tableData = [
  63. {
  64. warehouse_name: "一号库房",
  65. warehouse_location: "北京市海淀区",
  66. warehouse_area_square_meters: 5000,
  67. available_warehouse_area_square_meters: 4000,
  68. height_meters: 10,
  69. warehouse_volume_cubic_meters: 50000,
  70. available_warehouse_volume_cubic_meters: 40000,
  71. storage_type: "常温保管",
  72. grade: "A级",
  73. storage_placement_type: "地面堆放",
  74. inventory_confirmation_latest_time: "2023-10-01 14:30:00"
  75. },
  76. {
  77. warehouse_name: "二号库房",
  78. warehouse_location: "上海市浦东新区",
  79. warehouse_area_square_meters: 3000,
  80. available_warehouse_area_square_meters: 2500,
  81. height_meters: 8,
  82. warehouse_volume_cubic_meters: 24000,
  83. available_warehouse_volume_cubic_meters: 20000,
  84. storage_type: "冷藏保管",
  85. grade: "B级",
  86. storage_placement_type: "货架存放",
  87. inventory_confirmation_latest_time: "2023-09-25 10:15:00"
  88. },
  89. {
  90. warehouse_name: "三号库房",
  91. warehouse_location: "广州市天河区",
  92. warehouse_area_square_meters: 2000,
  93. available_warehouse_area_square_meters: 1800,
  94. height_meters: 6,
  95. warehouse_volume_cubic_meters: 12000,
  96. available_warehouse_volume_cubic_meters: 10800,
  97. storage_type: "特殊保管",
  98. grade: "C级",
  99. storage_placement_type: "托盘存放",
  100. inventory_confirmation_latest_time: "2023-09-20 08:45:00"
  101. },
  102. // 可以继续添加更多测试数据...
  103. ];
  104. const addWarehouseState = reactive({
  105. show: false, // 初始化show为false
  106. });
  107. const outboundDetailsState = reactive({
  108. show: false, // 初始化show为false
  109. });
  110. const handleAdd = () => {
  111. addWarehouseState.show = true;
  112. };
  113. const upload = () => {
  114. // 这里可能需要实现上传逻辑,暂时只是显示WriteForm作为示例
  115. addGodownState.show = true;
  116. };
  117. const handleCancel = () => {
  118. addWarehouseState.show = false;
  119. };
  120. const handleWrite = () => {
  121. outboundDetailsState.show=true;
  122. };
  123. const handleView = () => {
  124. outboundDetailsState.show=true;
  125. };
  126. const handlePaginationChange = (page: number) => {
  127. queryParams.page = page;
  128. // fetchTableData(); //
  129. };
  130. onMounted(() => {
  131. window.addEventListener('resize', handleResize);
  132. });
  133. // 在组件卸载前移除窗口大小变化监听器
  134. onBeforeUnmount(() => {
  135. window.removeEventListener('resize', handleResize);
  136. });
  137. </script>
  138. <style lang="scss" scoped></style>