From fa37b697e678dee7910cdb260771c16a8b8a83f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Mon, 29 Dec 2025 11:16:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20=E5=AE=9E=E7=8E=B0=E5=A4=9A?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E6=94=AF=E6=8C=81=E5=B9=B6=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor: 重构组件以使用i18n动态文本 style: 调整代码格式和结构 docs: 更新多语言翻译文件 --- apps/hand-factory/pages/easycode/easycode.vue | 2 +- apps/hand-factory/pages/receive/receive.vue | 255 ++++++++--- apps/hand-factory/utils/update.js | 34 +- apps/l2/src/components/TrackMeasure/index.vue | 21 +- apps/l2/src/i18n/en-US.js | 431 +++++++++++++++++- apps/l2/src/i18n/index.js | 7 +- apps/l2/src/i18n/zh-CN.js | 431 +++++++++++++++++- apps/l2/src/views/components/HomeMain.vue | 4 +- apps/l2/src/views/index.vue | 103 +++-- apps/l2/src/views/l2/log/index.vue | 112 ++--- apps/l2/src/views/l2/pdo/index.vue | 88 ++-- apps/l2/src/views/l2/plan/index.vue | 102 ++--- apps/l2/src/views/l2/report/stop.vue | 54 +-- .../src/views/l2/roller/components/filter.vue | 40 +- .../views/l2/roller/components/history.vue | 68 +-- .../src/views/l2/roller/components/online.vue | 22 +- .../views/l2/roller/components/standby.vue | 34 +- apps/l2/src/views/l2/track/index.vue | 116 ++--- apps/l2/src/views/l2/track/rect.vue | 300 ++++++------ apps/l2/src/views/login.vue | 40 +- 20 files changed, 1645 insertions(+), 619 deletions(-) diff --git a/apps/hand-factory/pages/easycode/easycode.vue b/apps/hand-factory/pages/easycode/easycode.vue index e158396..f7cd6f0 100644 --- a/apps/hand-factory/pages/easycode/easycode.vue +++ b/apps/hand-factory/pages/easycode/easycode.vue @@ -168,7 +168,7 @@ }) }, - scan(mode = 'pda') { + scan(mode = 'camera') { return new Promise((resolve, reject) => { if (mode == 'camera') { uni.scanCode({ diff --git a/apps/hand-factory/pages/receive/receive.vue b/apps/hand-factory/pages/receive/receive.vue index e455a73..ff3d1a8 100644 --- a/apps/hand-factory/pages/receive/receive.vue +++ b/apps/hand-factory/pages/receive/receive.vue @@ -46,7 +46,7 @@ - + @@ -54,75 +54,197 @@ 录入信息 - + 当前钢卷号 - + 班组 - + 目标库位 - - - + - - + + 毛重 (吨) - + 净重 (吨) - + 操作人: {{ operatorName }} - + - + + + + + 钢卷详情信息 + + + + + + + + + + 入场钢卷号 + {{ form.enterCoilNo || '-' }} + + + 钢卷号 + {{ form.currentCoilNo || '-' }} + + + 班组 + {{ form.team || '-' }} + + + 数据类型 + {{ form.dataType === 0 ? '默认数据' : form.dataType === 10 ? '待收货数据' : '-' }} + + + 目标库位 + {{ form.warehouseName || (form.warehouseId ? '已选库位(未获取名称)' : '-') }} + + + 真实库区 + {{ form.actualWarehouseName || '已选库位(未获取名称)' }} + + + + + + + 物料信息 + + + + + 物品名称 + {{ form.rawMaterial.rawMaterialName || form.product.productName || '-' }} + + + 规格 + {{ form.rawMaterial.specification || form.product.specification || '-' }} + + + 材质 + {{ form.rawMaterial.material || form.product.material || '-' }} + + + 厂家 + {{ form.rawMaterial.manufacturer || form.product.manufacturer || '-' }} + + + + + + + 重量信息 + + + + 毛重(吨) + {{ form.grossWeight || '-' }} + + + 净重(吨) + {{ form.netWeight || '-' }} + + + + + + + 操作信息 + + + + 操作人 + {{ operatorName }} + + + 更新时间 + {{ currentAction.updateTime || '-' }} + + + 操作状态 + {{ currentAction.actionStatus === 0 ? '未开始' : currentAction.actionStatus === 2 ? '已完成' : '-' }} + + + + + + + 暂无钢卷详情数据 + + + + + - + 暂无待操作数据 @@ -177,6 +299,7 @@ form: {}, loading: false, currentAction: {}, + loadingDetail: false, }; }, computed: { @@ -294,12 +417,42 @@ */ openReceivePopup(row) { this.$refs.receivePopup.open('bottom') + // this.loadingDetail = false; + uni.showLoading({ + title: '正在加载收货详情' + }) getMaterialCoil(row.coilId).then(res => { this.form = res.data; this.currentAction = row; + // this.loadingDetail = true + uni.hideLoading() }) }, + openViewPopup(row) { + this.$refs.viewPopup.open('bottom') + // this.loadingDetail = false; + uni.showLoading({ + title: '正在加载收货详情' + }) + getMaterialCoil(row.coilId).then(res => { + this.form = res.data; + this.currentAction = row; + uni.hideLoading() + // this.loadingDetail = true + }) + }, + + /** + * 关闭钢卷详情弹窗 + */ + closeViewPopup() { + this.$refs.viewPopup.close(); + // 可选:清空表单临时数据(根据业务需求决定是否保留) + this.form = {}; + this.currentAction = {}; + }, + /** * 确认收货 */ @@ -491,7 +644,7 @@ .uni-load-more { margin: 20rpx 0; } - + .form-card { background: #fff; border-radius: 16rpx; @@ -500,7 +653,7 @@ height: 70vh; box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04); } - + .card-title { display: flex; align-items: center; @@ -508,7 +661,7 @@ margin-bottom: 25rpx; padding-bottom: 20rpx; border-bottom: 1rpx solid #f0f0f0; - + .title-dot { width: 8rpx; height: 28rpx; @@ -516,31 +669,31 @@ border-radius: 4rpx; margin-right: 12rpx; } - + .title-text { flex: 1; font-size: 32rpx; font-weight: 600; color: #333; } - + .status-badge { font-size: 22rpx; padding: 4rpx 12rpx; border-radius: 12rpx; margin-right: 10rpx; - + &.status-1 { background: #d1f2eb; color: #0c6957; } - + &.status-0 { background: #f8d7da; color: #721c24; } } - + .more-btn { display: flex; align-items: center; @@ -549,43 +702,43 @@ background: #f0f7ff; border-radius: 20rpx; border: 1rpx solid #007aff; - + .icon-more { font-size: 24rpx; color: #007aff; } - + .more-text { font-size: 24rpx; color: #007aff; } } } - + /* 信息网格 */ .info-grid { display: flex; flex-wrap: wrap; gap: 20rpx; - + .info-item { flex: 1; min-width: 45%; background: #f8f9fa; padding: 20rpx; border-radius: 12rpx; - + &.full-width { flex: 0 0 100%; } - + .item-label { display: block; font-size: 24rpx; color: #999; margin-bottom: 10rpx; } - + .item-value { display: block; font-size: 28rpx; @@ -594,29 +747,29 @@ } } } - + /* 表单项 */ .form-item { margin-bottom: 30rpx; - + &:last-of-type { margin-bottom: 0; } - + .form-label { display: block; font-size: 28rpx; color: #333; margin-bottom: 15rpx; font-weight: 500; - + &::before { content: '*'; color: #ff4d4f; margin-right: 6rpx; } } - + .form-label-optional { display: block; font-size: 28rpx; @@ -624,7 +777,7 @@ margin-bottom: 15rpx; font-weight: 500; } - + .form-input { width: 100%; height: 88rpx; @@ -636,12 +789,12 @@ color: #333; box-sizing: border-box; transition: all 0.3s; - + &:focus { background: #fff; border-color: #007aff; } - + &.form-input-disabled { background: #f5f5f5; color: #999; @@ -649,7 +802,7 @@ } } } - + /* 操作者信息 */ .operator-info { display: flex; @@ -657,25 +810,25 @@ justify-content: center; padding: 20rpx 0; margin-top: 20rpx; - + .operator-label { font-size: 26rpx; color: #999; } - + .operator-name { font-size: 26rpx; color: #007aff; font-weight: 500; } } - + /* 操作按钮 */ .action-buttons { display: flex; gap: 20rpx; margin-top: 30rpx; - + .btn { flex: 1; height: 88rpx; @@ -684,21 +837,21 @@ 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; diff --git a/apps/hand-factory/utils/update.js b/apps/hand-factory/utils/update.js index 1b98d04..f504c2e 100644 --- a/apps/hand-factory/utils/update.js +++ b/apps/hand-factory/utils/update.js @@ -151,24 +151,24 @@ function checkUpdate(forceCheck = false) { // 显示更新提示模态框 function showUpdateModal(remoteVersion, wgtUrl) { - uni.showModal({ - title: '发现新版本', - content: `检测到新版本(${remoteVersion}),是否立即下载并更新?`, - confirmText: '立即更新', - cancelText: '退出', - showCancel: true, - success: (modalRes) => { - if (modalRes.confirm) { - // 用户确认更新:检查存储空间 -> 下载 -> 安装 - handleConfirmUpdate(wgtUrl, remoteVersion); - } else { - // 直接退出 + // uni.showModal({ + // title: '发现新版本', + // content: `检测到新版本(${remoteVersion}),是否立即下载并更新?`, + // confirmText: '立即更新', + // cancelText: '退出', + // showCancel: true, + // success: (modalRes) => { + // if (modalRes.confirm) { + // // 用户确认更新:检查存储空间 -> 下载 -> 安装 + // handleConfirmUpdate(wgtUrl, remoteVersion); + // } else { + // // 直接退出 - // 用户取消更新:询问是否忽略该版本 - handleCancelUpdate(remoteVersion); - } - } - }); + // // 用户取消更新:询问是否忽略该版本 + // handleCancelUpdate(remoteVersion); + // } + // } + // }); } diff --git a/apps/l2/src/components/TrackMeasure/index.vue b/apps/l2/src/components/TrackMeasure/index.vue index ab6b89f..46827de 100644 --- a/apps/l2/src/components/TrackMeasure/index.vue +++ b/apps/l2/src/components/TrackMeasure/index.vue @@ -3,7 +3,7 @@
- +