From 196f55961ab1b3f655a0d802be4b16592ffa7a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Tue, 4 Nov 2025 13:07:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E9=A1=B5=E9=9D=A2=E5=92=8C=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E5=BA=93=E5=8C=BA=E9=80=89=E6=8B=A9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增扫码成功页面,优化用户体验 - 添加实际库区选择组件和API接口 - 修改合并功能表单,增加实际库区选择 - 更新应用版本号和配置 - 优化首页跳转逻辑和错误处理 --- apps/hand-factory/App.vue | 4 +- apps/hand-factory/api/wms/actualWarehouse.js | 44 + .../klp-warehouse-picker.vue | 425 +++ .../components/panels/code/apart.vue | 2376 ++++++++--------- .../components/panels/code/merge.vue | 15 +- .../components/panels/code/typing.vue | 2093 +++++++-------- apps/hand-factory/config.js | 6 +- apps/hand-factory/manifest.json | 2 +- apps/hand-factory/pages.json | 7 + apps/hand-factory/pages/easycode/easycode.vue | 23 +- apps/hand-factory/pages/index.vue | 195 +- .../pages/scansuccess/scansuccess.vue | 142 + 12 files changed, 2889 insertions(+), 2443 deletions(-) create mode 100644 apps/hand-factory/api/wms/actualWarehouse.js create mode 100644 apps/hand-factory/components/klp-warehouse-picker/klp-warehouse-picker.vue create mode 100644 apps/hand-factory/pages/scansuccess/scansuccess.vue diff --git a/apps/hand-factory/App.vue b/apps/hand-factory/App.vue index ca4d332..d262251 100644 --- a/apps/hand-factory/App.vue +++ b/apps/hand-factory/App.vue @@ -6,7 +6,7 @@ export default { onLaunch: function() { this.initApp() - updateManager.checkUpdate(); + // updateManager.checkUpdate(); }, methods: { // 初始化应用 @@ -33,7 +33,7 @@ this.$tab.reLaunch('/pages/login') return; } - this.$store.dispatch('GetInfo') + } } } diff --git a/apps/hand-factory/api/wms/actualWarehouse.js b/apps/hand-factory/api/wms/actualWarehouse.js new file mode 100644 index 0000000..b9edb67 --- /dev/null +++ b/apps/hand-factory/api/wms/actualWarehouse.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询实际库区/库位自关联列表 +export function listActualWarehouse(query) { + return request({ + url: '/wms/actualWarehouse/list', + method: 'get', + params: query + }) +} + +// 查询实际库区/库位自关联详细 +export function getActualWarehouse(actualWarehouseId) { + return request({ + url: '/wms/actualWarehouse/' + actualWarehouseId, + method: 'get' + }) +} + +// 新增实际库区/库位自关联 +export function addActualWarehouse(data) { + return request({ + url: '/wms/actualWarehouse', + method: 'post', + data: data + }) +} + +// 修改实际库区/库位自关联 +export function updateActualWarehouse(data) { + return request({ + url: '/wms/actualWarehouse', + method: 'put', + data: data + }) +} + +// 删除实际库区/库位自关联 +export function delActualWarehouse(actualWarehouseId) { + return request({ + url: '/wms/actualWarehouse/' + actualWarehouseId, + method: 'delete' + }) +} diff --git a/apps/hand-factory/components/klp-warehouse-picker/klp-warehouse-picker.vue b/apps/hand-factory/components/klp-warehouse-picker/klp-warehouse-picker.vue new file mode 100644 index 0000000..0f97665 --- /dev/null +++ b/apps/hand-factory/components/klp-warehouse-picker/klp-warehouse-picker.vue @@ -0,0 +1,425 @@ + + + + + \ No newline at end of file diff --git a/apps/hand-factory/components/panels/code/apart.vue b/apps/hand-factory/components/panels/code/apart.vue index 7e3ff4a..4584282 100644 --- a/apps/hand-factory/components/panels/code/apart.vue +++ b/apps/hand-factory/components/panels/code/apart.vue @@ -1,6 +1,6 @@ + + /* 参数按钮 */ + .more-btn { + display: flex; + align-items: center; + gap: 8rpx; + padding: 8rpx 16rpx; + background: #fff3e0; + border-radius: 20rpx; + border: 1rpx solid #ff9500; + + .icon-more { + font-size: 24rpx; + color: #ff9500; + } + + .more-text { + font-size: 24rpx; + color: #ff9500; + } + } + + /* BOM弹窗 */ + .bom-popup { + background: #fff; + border-radius: 24rpx 24rpx 0 0; + max-height: 70vh; + + .popup-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 30rpx; + border-bottom: 1rpx solid #f0f0f0; + + .popup-title { + font-size: 32rpx; + color: #333; + font-weight: 600; + } + + .popup-close { + font-size: 40rpx; + color: #999; + width: 60rpx; + height: 60rpx; + display: flex; + align-items: center; + justify-content: center; + } + } + + .popup-body { + padding: 30rpx; + max-height: 500rpx; + + .bom-item { + display: flex; + gap: 20rpx; + padding: 24rpx; + background: #f8f9fa; + border-radius: 12rpx; + margin-bottom: 20rpx; + + &:last-child { + margin-bottom: 0; + } + + .bom-index { + width: 60rpx; + height: 60rpx; + background: #ff9500; + color: #fff; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 24rpx; + font-weight: bold; + flex-shrink: 0; + } + + .bom-content { + flex: 1; + + .bom-row { + display: flex; + margin-bottom: 10rpx; + + &:last-child { + margin-bottom: 0; + } + + .bom-label { + font-size: 26rpx; + color: #666; + min-width: 120rpx; + } + + .bom-value { + font-size: 26rpx; + color: #333; + font-weight: 500; + } + } + } + } + + .empty-tip { + text-align: center; + padding: 60rpx 0; + color: #999; + font-size: 28rpx; + } + } + } + \ No newline at end of file diff --git a/apps/hand-factory/components/panels/code/merge.vue b/apps/hand-factory/components/panels/code/merge.vue index c1a42f5..8113900 100644 --- a/apps/hand-factory/components/panels/code/merge.vue +++ b/apps/hand-factory/components/panels/code/merge.vue @@ -71,18 +71,26 @@ - 目标库区 + 目标库位 - {{ warehouseName || '请选择目标库区' }} + {{ warehouseName || '请选择目标库位' }} + + + 实际库区 + + + + 物品类型 @@ -299,6 +307,7 @@ export default { mergedCoilNo: '', team: '', warehouseId: undefined, + actualWarehouseId: undefined, warehouseName: '', warehouseKeyword: '', warehouses: [], @@ -686,6 +695,7 @@ export default { this.mergedCoilNo = ''; this.team = ''; this.warehouseId = undefined; + this.actualWarehouseId = undefined; this.warehouseName = ''; this.warehouseKeyword = ''; this.itemType = ''; @@ -752,6 +762,7 @@ export default { itemType: this.itemType || this.scannedCoils[0].itemType, // 优先使用选择的itemType itemId: this.itemId || this.scannedCoils[0].itemId, // 优先使用选择的itemId warehouseId: this.warehouseId || this.scannedCoils[0].warehouseId, // 使用选择的库区或第一个钢卷的库区 + actualWarehouseId: this.actualWarehouseId || this.scannedCoils[0].actualWarehouseId grossWeight: this.grossWeight ? Number(this.grossWeight) : null, netWeight: this.netWeight ? Number(this.netWeight) : null, newCoils: this.scannedCoils.map(coil => ({ diff --git a/apps/hand-factory/components/panels/code/typing.vue b/apps/hand-factory/components/panels/code/typing.vue index 0c350d0..7367517 100644 --- a/apps/hand-factory/components/panels/code/typing.vue +++ b/apps/hand-factory/components/panels/code/typing.vue @@ -9,7 +9,7 @@ 点击扫描二维码 - + @@ -23,7 +23,7 @@ 参数 - + 入场钢卷号 @@ -39,7 +39,7 @@ - + ⚠️ @@ -48,176 +48,106 @@ 此为历史记录,仅供查看,不允许进行修改操作 - + 录入信息 - + 当前钢卷号 - + - + 班组 - + - + - 目标库区 - - - {{ currentWarehouseName || '请选择目标库区' }} - - - + 目标库位 + + + 真实库区 + + + 物品类型 - + {{ form.itemType === 'product' ? '成品' : form.itemType === 'raw_material' ? '原料' : '请选择物品类型' }} - + 选择产品 - + {{ selectedProductName || '请选择产品' }} - + 选择原材料 - + {{ selectedRawMaterialName || '请选择原材料' }} - + 毛重 (吨) - + - + 净重 (吨) - + - + 操作人: {{ operatorName }} - + - - + - - - - - - 选择库区 - - - - - - - - {{ warehouse.warehouseName }} - - - - 未找到匹配的库区 - - - - - + @@ -226,20 +156,12 @@ - + - + {{ product.productName }} @@ -249,7 +171,7 @@ - + @@ -258,20 +180,12 @@ - + - + {{ material.rawMaterialName }} @@ -281,7 +195,7 @@ - + @@ -301,7 +215,7 @@ - + @@ -333,1064 +247,1031 @@ + + /* 操作按钮 */ + .action-buttons { + display: flex; + gap: 20rpx; + margin-top: 30rpx; + + .btn { + flex: 1; + height: 88rpx; + border-radius: 12rpx; + font-size: 30rpx; + font-weight: 500; + border: none; + transition: all 0.2s; + + &:active { + transform: scale(0.98); + } + + &[disabled] { + opacity: 0.6; + } + } + + .btn-secondary { + background: #f5f5f5; + color: #666; + } + + .btn-primary { + background: linear-gradient(135deg, #007aff 0%, #0051d5 100%); + color: #fff; + box-shadow: 0 4rpx 16rpx rgba(0, 122, 255, 0.3); + } + } + + /* BOM弹窗 */ + .bom-popup { + background: #fff; + border-radius: 24rpx 24rpx 0 0; + max-height: 70vh; + + .popup-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 30rpx; + border-bottom: 1rpx solid #f0f0f0; + + .popup-title { + font-size: 32rpx; + color: #333; + font-weight: 600; + } + + .popup-close { + font-size: 40rpx; + color: #999; + width: 60rpx; + height: 60rpx; + display: flex; + align-items: center; + justify-content: center; + } + } + + .popup-body { + padding: 30rpx; + max-height: 500rpx; + + .bom-item { + display: flex; + gap: 20rpx; + padding: 24rpx; + background: #f8f9fa; + border-radius: 12rpx; + margin-bottom: 20rpx; + + &:last-child { + margin-bottom: 0; + } + + .bom-index { + width: 60rpx; + height: 60rpx; + background: #007aff; + color: #fff; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 24rpx; + font-weight: bold; + flex-shrink: 0; + } + + .bom-content { + flex: 1; + + .bom-row { + display: flex; + margin-bottom: 10rpx; + + &:last-child { + margin-bottom: 0; + } + + .bom-label { + font-size: 26rpx; + color: #666; + min-width: 120rpx; + } + + .bom-value { + font-size: 26rpx; + color: #333; + font-weight: 500; + } + } + } + } + + .empty-tip { + text-align: center; + padding: 60rpx 0; + color: #999; + font-size: 28rpx; + } + } + } + \ No newline at end of file diff --git a/apps/hand-factory/config.js b/apps/hand-factory/config.js index b5f8e87..cc41aeb 100644 --- a/apps/hand-factory/config.js +++ b/apps/hand-factory/config.js @@ -1,14 +1,14 @@ // 应用全局配置 module.exports = { - baseUrl: 'http://192.168.31.116:8080', - // baseUrl: 'http://140.143.206.120:8080', + // baseUrl: 'http://192.168.31.116:8080', + baseUrl: 'http://140.143.206.120:8080', // baseUrl: 'http://localhost:8080', // 应用信息 appInfo: { // 应用名称 name: "ruoyi-app", // 应用版本 - version: "1.2.0", + version: "1.3.5", // 应用logo logo: "/static/logo.jpg", // 官方网站 diff --git a/apps/hand-factory/manifest.json b/apps/hand-factory/manifest.json index e2dbaee..c40791d 100644 --- a/apps/hand-factory/manifest.json +++ b/apps/hand-factory/manifest.json @@ -2,7 +2,7 @@ "name" : "科伦普", "appid" : "__UNI__E781B49", "description" : "", - "versionName" : "3.4", + "versionName" : "3.5", "versionCode" : 1, "transformPx" : false, "app-plus" : { diff --git a/apps/hand-factory/pages.json b/apps/hand-factory/pages.json index 3de6508..de46b11 100644 --- a/apps/hand-factory/pages.json +++ b/apps/hand-factory/pages.json @@ -48,6 +48,13 @@ "navigationBarTitleText" : "产线监控", "navigationStyle": "custom" } + }, + { + "path" : "pages/scansuccess/scansuccess", + "style" : + { + "navigationBarTitleText" : "扫码结果" + } } // { // "path": "pages/register", diff --git a/apps/hand-factory/pages/easycode/easycode.vue b/apps/hand-factory/pages/easycode/easycode.vue index 205ff62..d9a6586 100644 --- a/apps/hand-factory/pages/easycode/easycode.vue +++ b/apps/hand-factory/pages/easycode/easycode.vue @@ -137,17 +137,20 @@ uni.hideLoading(); console.log('=== 扫码流程完成 ==='); - uni.showToast({ - title: '创建成功', - icon: 'success', - duration: 2000 - }); + uni.navigateTo({ + url: '/pages/scansuccess/scansuccess' + }) + // uni.showToast({ + // title: '创建成功', + // icon: 'success', + // duration: 2000 + // }); - // 延迟后返回或跳转 - setTimeout(() => { - // 可以跳转到待操作列表或返回上一页 - uni.navigateBack(); - }, 2000); + // // 延迟后返回或跳转 + // setTimeout(() => { + // // 可以跳转到待操作列表或返回上一页 + // uni.navigateBack(); + // }, 2000); } catch (err) { console.error('=== 扫码处理失败 ==='); diff --git a/apps/hand-factory/pages/index.vue b/apps/hand-factory/pages/index.vue index 9ae633c..207e16a 100644 --- a/apps/hand-factory/pages/index.vue +++ b/apps/hand-factory/pages/index.vue @@ -1,93 +1,139 @@ + \ No newline at end of file diff --git a/apps/hand-factory/pages/scansuccess/scansuccess.vue b/apps/hand-factory/pages/scansuccess/scansuccess.vue new file mode 100644 index 0000000..eea494f --- /dev/null +++ b/apps/hand-factory/pages/scansuccess/scansuccess.vue @@ -0,0 +1,142 @@ + + + + + \ No newline at end of file