From 2bd09e2cf4bca727229c6b82342522935c807fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Wed, 17 Sep 2025 15:59:03 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E4=BB=93=E5=BA=93=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gear-ui3/src/api/{wms => oms}/customer.js | 0 gear-ui3/src/api/{wms => oms}/order.js | 0 gear-ui3/src/api/{wms => oms}/orderDetail.js | 0 gear-ui3/src/api/wms/stock.js | 55 ++ gear-ui3/src/api/wms/stockIo.js | 134 ++++ gear-ui3/src/api/wms/stockIoDetail.js | 44 ++ gear-ui3/src/api/wms/stockLog.js | 44 ++ gear-ui3/src/api/wms/warehouse.js | 44 ++ .../src/components/ChartWrapper/index.vue | 207 ++++++ .../src/components/CustomerSelect/index.vue | 2 +- gear-ui3/src/components/FileUpload/index.vue | 2 +- gear-ui3/src/components/GearTable/index.vue | 4 +- .../src/components/ImagePreview/index.vue | 4 +- .../ProductSelect/BomPanel/index.vue | 2 +- .../src/components/WarehouseSelect/index.vue | 119 ++++ .../src/components/WarehouseTree/index.vue | 75 +++ gear-ui3/src/utils/enums.js | 36 +- gear-ui3/src/views/dashboard/home.vue | 6 +- .../report/components/ProjectReportDetail.vue | 2 +- gear-ui3/src/views/info/report/dashboard.vue | 2 +- gear-ui3/src/views/oms/customer/index.vue | 6 +- gear-ui3/src/views/oms/dashboard/index.vue | 6 +- .../src/views/oms/order/panels/detail.vue | 6 +- .../src/views/oms/order/panels/orderPage.vue | 6 +- .../src/views/product/components/BomPanel.vue | 2 +- gear-ui3/src/views/wms/ledger/index.vue | 287 +++++++++ gear-ui3/src/views/wms/stock/box.vue | 167 +++++ gear-ui3/src/views/wms/stock/index.vue | 410 ++++++++++++ gear-ui3/src/views/wms/stock/panels/bar.vue | 214 ++++++ .../src/views/wms/stock/panels/reattree.vue | 269 ++++++++ gear-ui3/src/views/wms/stock/panels/resize.js | 85 +++ .../src/views/wms/stock/panels/stockIo.vue | 104 +++ .../src/views/wms/stock/panels/trendChart.vue | 406 ++++++++++++ gear-ui3/src/views/wms/stockIo/in.vue | 13 + gear-ui3/src/views/wms/stockIo/index.vue | 488 ++++++++++++++ gear-ui3/src/views/wms/stockIo/move.vue | 13 + gear-ui3/src/views/wms/stockIo/out.vue | 13 + .../src/views/wms/stockIo/panels/barcode.vue | 424 ++++++++++++ .../src/views/wms/stockIo/panels/detail.vue | 609 ++++++++++++++++++ .../views/wms/stockIo/panels/returnCreate.vue | 435 +++++++++++++ .../views/wms/stockIo/panels/stockIoPage.vue | 373 +++++++++++ gear-ui3/src/views/wms/stockIo/return.vue | 13 + gear-ui3/src/views/wms/warehouse/index.vue | 375 +++++++++++ 43 files changed, 5473 insertions(+), 33 deletions(-) rename gear-ui3/src/api/{wms => oms}/customer.js (100%) rename gear-ui3/src/api/{wms => oms}/order.js (100%) rename gear-ui3/src/api/{wms => oms}/orderDetail.js (100%) create mode 100644 gear-ui3/src/api/wms/stock.js create mode 100644 gear-ui3/src/api/wms/stockIo.js create mode 100644 gear-ui3/src/api/wms/stockIoDetail.js create mode 100644 gear-ui3/src/api/wms/stockLog.js create mode 100644 gear-ui3/src/api/wms/warehouse.js create mode 100644 gear-ui3/src/components/ChartWrapper/index.vue create mode 100644 gear-ui3/src/components/WarehouseSelect/index.vue create mode 100644 gear-ui3/src/components/WarehouseTree/index.vue create mode 100644 gear-ui3/src/views/wms/ledger/index.vue create mode 100644 gear-ui3/src/views/wms/stock/box.vue create mode 100644 gear-ui3/src/views/wms/stock/index.vue create mode 100644 gear-ui3/src/views/wms/stock/panels/bar.vue create mode 100644 gear-ui3/src/views/wms/stock/panels/reattree.vue create mode 100644 gear-ui3/src/views/wms/stock/panels/resize.js create mode 100644 gear-ui3/src/views/wms/stock/panels/stockIo.vue create mode 100644 gear-ui3/src/views/wms/stock/panels/trendChart.vue create mode 100644 gear-ui3/src/views/wms/stockIo/in.vue create mode 100644 gear-ui3/src/views/wms/stockIo/index.vue create mode 100644 gear-ui3/src/views/wms/stockIo/move.vue create mode 100644 gear-ui3/src/views/wms/stockIo/out.vue create mode 100644 gear-ui3/src/views/wms/stockIo/panels/barcode.vue create mode 100644 gear-ui3/src/views/wms/stockIo/panels/detail.vue create mode 100644 gear-ui3/src/views/wms/stockIo/panels/returnCreate.vue create mode 100644 gear-ui3/src/views/wms/stockIo/panels/stockIoPage.vue create mode 100644 gear-ui3/src/views/wms/stockIo/return.vue create mode 100644 gear-ui3/src/views/wms/warehouse/index.vue diff --git a/gear-ui3/src/api/wms/customer.js b/gear-ui3/src/api/oms/customer.js similarity index 100% rename from gear-ui3/src/api/wms/customer.js rename to gear-ui3/src/api/oms/customer.js diff --git a/gear-ui3/src/api/wms/order.js b/gear-ui3/src/api/oms/order.js similarity index 100% rename from gear-ui3/src/api/wms/order.js rename to gear-ui3/src/api/oms/order.js diff --git a/gear-ui3/src/api/wms/orderDetail.js b/gear-ui3/src/api/oms/orderDetail.js similarity index 100% rename from gear-ui3/src/api/wms/orderDetail.js rename to gear-ui3/src/api/oms/orderDetail.js diff --git a/gear-ui3/src/api/wms/stock.js b/gear-ui3/src/api/wms/stock.js new file mode 100644 index 0000000..3356dfa --- /dev/null +++ b/gear-ui3/src/api/wms/stock.js @@ -0,0 +1,55 @@ +import request from '@/utils/request' + +// 查询库存:原材料/产品与库区/库位的存放关系列表 +export function listStock(query) { + return request({ + url: '/gear/stock/list', + method: 'get', + params: query + }) +} + +// 查询库存:原材料/产品与库区/库位的存放关系详细 +export function getStock(stockId) { + return request({ + url: '/gear/stock/' + stockId, + method: 'get' + }) +} + +// 新增库存:原材料/产品与库区/库位的存放关系 +export function addStock(data) { + return request({ + url: '/gear/stock', + method: 'post', + data: data + }) +} + +// 修改库存:原材料/产品与库区/库位的存放关系 +export function updateStock(data) { + return request({ + url: '/gear/stock', + method: 'put', + data: data + }) +} + +// 删除库存:原材料/产品与库区/库位的存放关系 +export function delStock(stockId) { + return request({ + url: '/gear/stock/' + stockId, + method: 'delete' + }) +} + +// 物料追溯:根据批次号查找所有关联的单据明细 +export function getStockTrace(batchNo) { + return request({ + url: '/gear/stockIoDetail/batch', + method: 'post', + data: { + batchNo + } + }) +} diff --git a/gear-ui3/src/api/wms/stockIo.js b/gear-ui3/src/api/wms/stockIo.js new file mode 100644 index 0000000..fa8dd36 --- /dev/null +++ b/gear-ui3/src/api/wms/stockIo.js @@ -0,0 +1,134 @@ +import request from '@/utils/request' + +// 查询出入库单主列表 +export function listStockIo(query) { + return request({ + url: '/gear/stockIo/list', + method: 'get', + params: query + }) +} + +// 查询出入库单主详细 +export function getStockIo(stockIoId) { + return request({ + url: '/gear/stockIo/' + stockIoId, + method: 'get' + }) +} + +// 新增出入库单主 +export function addStockIo(data) { + return request({ + url: '/gear/stockIo', + method: 'post', + data: data + }) +} + +// 修改出入库单主 +export function updateStockIo(data) { + return request({ + url: '/gear/stockIo', + method: 'put', + data: data + }) +} + +// 删除出入库单主 +export function delStockIo(stockIoId) { + return request({ + url: '/gear/stockIo/' + stockIoId, + method: 'delete' + }) +} + +// 审核出入库单 +export function auditStockIo(stockIoId) { + return request({ + url: '/gear/stockIo/audit/' + stockIoId, + method: 'post' + }) +} + +// 撤销出入库单 +export function cancelStockIo(stockIoId) { + return request({ + url: '/gear/stockIo/cancel/' + stockIoId, + method: 'post' + }) +} + +// 根据类型和ID查询明细 +export function detailByTypeAndId(ioType, stockIoId) { + return request({ + url: '/gear/stockIo/detailByTypeAndId', + method: 'get', + params: { + ioType, + stockIoId + } + }) +} + +// 更新出入库单状态 +export function updateStockIoStatus(stockIoId, status) { + return request({ + url: '/gear/stockIo/updateStatus/' + stockIoId, + method: 'post', + params: { + status + } + }) +} + +/** + * 创建入库单,含明细 + * 入库单主表: + * 单号:stockIoCode + * 类型: ioType, + * 业务类型:bizType, + * 状态:status, + * 备注:remark, + * + * 入库单明细: + * warehouseId: 仓库ID, + * itemType: 物料类型, + * itemId: 物料ID, + * quantity: 数量, + * unit: 单位, + * batchNo: 批次号, + * remark: 备注 + * + */ +export function addStockIoWithDetail(data) { + return request({ + url: '/gear/stockIo/withDetail', + method: 'post', + data: data + }) +} + +export function scanInStock(data) { + return request({ + url: '/gear/stockIo/scanInStock', + method: 'post', + data: data + }) +} + +export function scanOutStock(data) { + return request({ + url: '/gear/stockIo/scanOutStock', + method: 'post', + data: data + }) +} + +export function returnStock(data) { + return request({ + url: '/gear/stockIo/returnStock', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/gear-ui3/src/api/wms/stockIoDetail.js b/gear-ui3/src/api/wms/stockIoDetail.js new file mode 100644 index 0000000..5596ace --- /dev/null +++ b/gear-ui3/src/api/wms/stockIoDetail.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询出入库单明细列表 +export function listStockIoDetail(query) { + return request({ + url: '/gear/stockIoDetail/list', + method: 'get', + params: query + }) +} + +// 查询出入库单明细详细 +export function getStockIoDetail(detailId) { + return request({ + url: '/gear/stockIoDetail/' + detailId, + method: 'get' + }) +} + +// 新增出入库单明细 +export function addStockIoDetail(data) { + return request({ + url: '/gear/stockIoDetail', + method: 'post', + data: data + }) +} + +// 修改出入库单明细 +export function updateStockIoDetail(data) { + return request({ + url: '/gear/stockIoDetail', + method: 'put', + data: data + }) +} + +// 删除出入库单明细 +export function delStockIoDetail(detailId) { + return request({ + url: '/gear/stockIoDetail/' + detailId, + method: 'delete' + }) +} diff --git a/gear-ui3/src/api/wms/stockLog.js b/gear-ui3/src/api/wms/stockLog.js new file mode 100644 index 0000000..4a2d9bc --- /dev/null +++ b/gear-ui3/src/api/wms/stockLog.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询库存流水列表 +export function listStockLog(query) { + return request({ + url: '/gear/stockLog/list', + method: 'get', + params: query + }) +} + +// 查询库存流水详细 +export function getStockLog(id) { + return request({ + url: '/gear/stockLog/' + id, + method: 'get' + }) +} + +// 新增库存流水 +export function addStockLog(data) { + return request({ + url: '/gear/stockLog', + method: 'post', + data: data + }) +} + +// 修改库存流水 +export function updateStockLog(data) { + return request({ + url: '/gear/stockLog', + method: 'put', + data: data + }) +} + +// 删除库存流水 +export function delStockLog(id) { + return request({ + url: '/gear/stockLog/' + id, + method: 'delete' + }) +} diff --git a/gear-ui3/src/api/wms/warehouse.js b/gear-ui3/src/api/wms/warehouse.js new file mode 100644 index 0000000..a21cbbc --- /dev/null +++ b/gear-ui3/src/api/wms/warehouse.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询仓库/库区/库位自关联列表 +export function listWarehouse(query) { + return request({ + url: '/gear/warehouse/list', + method: 'get', + params: query + }) +} + +// 查询仓库/库区/库位自关联详细 +export function getWarehouse(warehouseId) { + return request({ + url: '/gear/warehouse/' + warehouseId, + method: 'get' + }) +} + +// 新增仓库/库区/库位自关联 +export function addWarehouse(data) { + return request({ + url: '/gear/warehouse', + method: 'post', + data: data + }) +} + +// 修改仓库/库区/库位自关联 +export function updateWarehouse(data) { + return request({ + url: '/gear/warehouse', + method: 'put', + data: data + }) +} + +// 删除仓库/库区/库位自关联 +export function delWarehouse(warehouseId) { + return request({ + url: '/gear/warehouse/' + warehouseId, + method: 'delete' + }) +} diff --git a/gear-ui3/src/components/ChartWrapper/index.vue b/gear-ui3/src/components/ChartWrapper/index.vue new file mode 100644 index 0000000..18664e9 --- /dev/null +++ b/gear-ui3/src/components/ChartWrapper/index.vue @@ -0,0 +1,207 @@ + + + + + \ No newline at end of file diff --git a/gear-ui3/src/components/CustomerSelect/index.vue b/gear-ui3/src/components/CustomerSelect/index.vue index ed1dafc..ade8903 100644 --- a/gear-ui3/src/components/CustomerSelect/index.vue +++ b/gear-ui3/src/components/CustomerSelect/index.vue @@ -5,7 +5,7 @@ diff --git a/gear-ui3/src/components/ImagePreview/index.vue b/gear-ui3/src/components/ImagePreview/index.vue index ace8a3b..becc11f 100644 --- a/gear-ui3/src/components/ImagePreview/index.vue +++ b/gear-ui3/src/components/ImagePreview/index.vue @@ -24,11 +24,11 @@ const props = defineProps({ }, width: { type: [Number, String], - default: "" + default: "50px" }, height: { type: [Number, String], - default: "" + default: "50px" } }) diff --git a/gear-ui3/src/components/ProductSelect/BomPanel/index.vue b/gear-ui3/src/components/ProductSelect/BomPanel/index.vue index 3d6a563..e33f517 100644 --- a/gear-ui3/src/components/ProductSelect/BomPanel/index.vue +++ b/gear-ui3/src/components/ProductSelect/BomPanel/index.vue @@ -5,7 +5,7 @@ diff --git a/gear-ui3/src/views/wms/stock/box.vue b/gear-ui3/src/views/wms/stock/box.vue new file mode 100644 index 0000000..3c310e0 --- /dev/null +++ b/gear-ui3/src/views/wms/stock/box.vue @@ -0,0 +1,167 @@ + + + + + \ No newline at end of file diff --git a/gear-ui3/src/views/wms/stock/index.vue b/gear-ui3/src/views/wms/stock/index.vue new file mode 100644 index 0000000..514cc8c --- /dev/null +++ b/gear-ui3/src/views/wms/stock/index.vue @@ -0,0 +1,410 @@ + + + + + diff --git a/gear-ui3/src/views/wms/stock/panels/bar.vue b/gear-ui3/src/views/wms/stock/panels/bar.vue new file mode 100644 index 0000000..255454c --- /dev/null +++ b/gear-ui3/src/views/wms/stock/panels/bar.vue @@ -0,0 +1,214 @@ + + + diff --git a/gear-ui3/src/views/wms/stock/panels/reattree.vue b/gear-ui3/src/views/wms/stock/panels/reattree.vue new file mode 100644 index 0000000..517d54e --- /dev/null +++ b/gear-ui3/src/views/wms/stock/panels/reattree.vue @@ -0,0 +1,269 @@ + + + + + diff --git a/gear-ui3/src/views/wms/stock/panels/resize.js b/gear-ui3/src/views/wms/stock/panels/resize.js new file mode 100644 index 0000000..28992ed --- /dev/null +++ b/gear-ui3/src/views/wms/stock/panels/resize.js @@ -0,0 +1,85 @@ +// 防抖函数:避免频繁触发 resize +function debounce(fn, delay = 100) { + let timer = null; + return function (...args) { + if (timer) clearTimeout(timer); + timer = setTimeout(() => { + fn.apply(this, args); + timer = null; + }, delay); + }; +} + +export default { + data() { + return { + // 存储ResizeObserver实例 + resizeObserver: null, + // 标记是否已初始化监听 + isResizeListening: false + }; + }, + methods: { + /** + * 初始化尺寸监听 + * @param {HTMLElement} container - 图表容器DOM(默认取this.$refs.chartContainer) + */ + initResizeListener(container) { + // 防止重复初始化 + if (this.isResizeListening) return; + + // 默认使用组件内的chartContainer作为监听目标 + const target = container || this.$refs.chartContainer; + if (!target) { + console.warn('未找到图表容器,无法初始化尺寸监听'); + return; + } + + // 创建ResizeObserver实例 + this.resizeObserver = new ResizeObserver( + debounce(entries => { + // 触发图表重绘 + this.handleContainerResize(entries); + }) + ); + + // 开始监听容器尺寸变化 + this.resizeObserver.observe(target); + this.isResizeListening = true; + }, + + /** + * 处理容器尺寸变化 + * @param {ResizeObserverEntry[]} entries - ResizeObserver回调参数 + */ + handleContainerResize(entries) { + // 确保图表实例存在 + if (this.chart && this.chart.resize) { + // 调用ECharts的resize方法重绘图表 + this.chart.resize(); + } + }, + + /** + * 销毁尺寸监听 + */ + destroyResizeListener() { + if (this.resizeObserver) { + this.resizeObserver.disconnect(); + this.resizeObserver = null; + } + this.isResizeListening = false; + } + }, + // 组件挂载后初始化监听 + mounted() { + // 延迟初始化,确保DOM已渲染完成 + this.$nextTick(() => { + this.initResizeListener(); + }); + }, + // 组件销毁前清理监听 + beforeDestroy() { + this.destroyResizeListener(); + } +}; \ No newline at end of file diff --git a/gear-ui3/src/views/wms/stock/panels/stockIo.vue b/gear-ui3/src/views/wms/stock/panels/stockIo.vue new file mode 100644 index 0000000..94c0ec0 --- /dev/null +++ b/gear-ui3/src/views/wms/stock/panels/stockIo.vue @@ -0,0 +1,104 @@ + + + \ No newline at end of file diff --git a/gear-ui3/src/views/wms/stock/panels/trendChart.vue b/gear-ui3/src/views/wms/stock/panels/trendChart.vue new file mode 100644 index 0000000..106cfce --- /dev/null +++ b/gear-ui3/src/views/wms/stock/panels/trendChart.vue @@ -0,0 +1,406 @@ + + + + + diff --git a/gear-ui3/src/views/wms/stockIo/in.vue b/gear-ui3/src/views/wms/stockIo/in.vue new file mode 100644 index 0000000..efeef1f --- /dev/null +++ b/gear-ui3/src/views/wms/stockIo/in.vue @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/gear-ui3/src/views/wms/stockIo/index.vue b/gear-ui3/src/views/wms/stockIo/index.vue new file mode 100644 index 0000000..75681b1 --- /dev/null +++ b/gear-ui3/src/views/wms/stockIo/index.vue @@ -0,0 +1,488 @@ + + + diff --git a/gear-ui3/src/views/wms/stockIo/move.vue b/gear-ui3/src/views/wms/stockIo/move.vue new file mode 100644 index 0000000..e505064 --- /dev/null +++ b/gear-ui3/src/views/wms/stockIo/move.vue @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/gear-ui3/src/views/wms/stockIo/out.vue b/gear-ui3/src/views/wms/stockIo/out.vue new file mode 100644 index 0000000..5ed9519 --- /dev/null +++ b/gear-ui3/src/views/wms/stockIo/out.vue @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/gear-ui3/src/views/wms/stockIo/panels/barcode.vue b/gear-ui3/src/views/wms/stockIo/panels/barcode.vue new file mode 100644 index 0000000..5c7828a --- /dev/null +++ b/gear-ui3/src/views/wms/stockIo/panels/barcode.vue @@ -0,0 +1,424 @@ + + + + + \ No newline at end of file diff --git a/gear-ui3/src/views/wms/stockIo/panels/detail.vue b/gear-ui3/src/views/wms/stockIo/panels/detail.vue new file mode 100644 index 0000000..5ed7741 --- /dev/null +++ b/gear-ui3/src/views/wms/stockIo/panels/detail.vue @@ -0,0 +1,609 @@ + + + + diff --git a/gear-ui3/src/views/wms/stockIo/panels/returnCreate.vue b/gear-ui3/src/views/wms/stockIo/panels/returnCreate.vue new file mode 100644 index 0000000..9a40518 --- /dev/null +++ b/gear-ui3/src/views/wms/stockIo/panels/returnCreate.vue @@ -0,0 +1,435 @@ + + + diff --git a/gear-ui3/src/views/wms/stockIo/panels/stockIoPage.vue b/gear-ui3/src/views/wms/stockIo/panels/stockIoPage.vue new file mode 100644 index 0000000..2c4c6cc --- /dev/null +++ b/gear-ui3/src/views/wms/stockIo/panels/stockIoPage.vue @@ -0,0 +1,373 @@ + + + diff --git a/gear-ui3/src/views/wms/stockIo/return.vue b/gear-ui3/src/views/wms/stockIo/return.vue new file mode 100644 index 0000000..b62fe4b --- /dev/null +++ b/gear-ui3/src/views/wms/stockIo/return.vue @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/gear-ui3/src/views/wms/warehouse/index.vue b/gear-ui3/src/views/wms/warehouse/index.vue new file mode 100644 index 0000000..89f7f84 --- /dev/null +++ b/gear-ui3/src/views/wms/warehouse/index.vue @@ -0,0 +1,375 @@ + + +