diff --git a/src/components/WorkbenchPrint/WorkbenchPrint.vue b/src/components/WorkbenchPrint/WorkbenchPrint.vue index 13e17b8..760931b 100644 --- a/src/components/WorkbenchPrint/WorkbenchPrint.vue +++ b/src/components/WorkbenchPrint/WorkbenchPrint.vue @@ -430,12 +430,15 @@ export default { padding-top: 30rpx; border-top: 1rpx solid #eee; display: flex; - gap: 24rpx; ::v-deep .u-button { flex: 1; font-size: 36rpx !important; } + + ::v-deep .u-button + .u-button { + margin-left: 24rpx; + } } } @@ -521,7 +524,6 @@ export default { display: flex; padding: 24rpx 32rpx; border-top: 1rpx solid #f0f0f0; - gap: 24rpx; .u-button { flex: 1; @@ -530,6 +532,10 @@ export default { ::v-deep .u-button { font-size: 36rpx !important; } + + ::v-deep .u-button + .u-button { + margin-left: 24rpx; + } } } \ No newline at end of file diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 8321ef7..5a8c016 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -2419,7 +2419,7 @@ &__title { font-size: 38rpx; - font-weight: 600; + font-weight: bold; color: #333; } @@ -2448,7 +2448,7 @@ &__value { font-size: 44rpx; - font-weight: 600; + font-weight: bold; color: #2979ff; margin-bottom: 10rpx; } diff --git a/src/pages/warehouse/locationInquiry.vue b/src/pages/warehouse/locationInquiry.vue index f283d0c..3ae74ea 100644 --- a/src/pages/warehouse/locationInquiry.vue +++ b/src/pages/warehouse/locationInquiry.vue @@ -710,7 +710,10 @@ export default { goodsImageTask.catch(error => console.warn('[locationInquiry] 拉取商品图片失败:', error)); } if (this.goodsList.length) { - this.toast(`查询到 ${this.goodsList.length} 种商品`, 'none'); + // 未启用筛选时才提示查询到的商品种类数;启用筛选后提示数量会与底部合计(筛选后数量)不一致,故不提示 + if (!this.filterType) { + this.toast(`查询到 ${this.goodsList.length} 种商品`, 'none'); + } } else { this.speak('无记录'); this.toast('该库位无有量库存'); diff --git a/src/pages/work/storage/receiving/receivingDetail.vue b/src/pages/work/storage/receiving/receivingDetail.vue index 2037f10..921850e 100644 --- a/src/pages/work/storage/receiving/receivingDetail.vue +++ b/src/pages/work/storage/receiving/receivingDetail.vue @@ -84,18 +84,79 @@ - + + + + 确认删除 + + {{ deleteConfirmText }} + + + 取消 + + 删除 + + + + + + + + + 商品信息不完整 + + {{ incompleteConfirmText }} + + 知道了 + + + + + + + 完成收货 + + 确定要完成当前收货单吗?完成后将无法修改。 + + + 再想想 + 确定完成 + + + + + 收货明细 - - - - + + + + 关闭 + 确认收货 @@ -144,6 +205,12 @@ // 对话框控制 showActionSheet: false, showCancelConfirm: false, + showDeleteConfirm: false, + pendingDeleteDetail: null, + showIncompleteConfirm: false, + incompleteConfirmText: '', + showCompleteConfirm: false, + _completeReceivingResolve: null, }; }, @@ -153,6 +220,13 @@ return this.receivingInfo.status === 'receiving'; }, + // 删除确认提示文案 + deleteConfirmText() { + return this.pendingDeleteDetail + ? `确定要删除商品"${this.pendingDeleteDetail.product_name}"吗?` + : '确定要删除这个商品明细吗?'; + }, + // 动态Tab列表 tabs() { // 基础Tab:收货单信息 @@ -495,11 +569,9 @@ handleSelectDetail(detail) { this.selectedDetail = detail; }, - async handleDeleteDetail(id) { + handleDeleteDetail(id) { // 先查找要删除的明细信息,用于提示 const detailToDelete = this.details.find(item => item.id === id); - const deletedIndex = this.details.findIndex(item => item.id === id); - const selectedIdBeforeDelete = this.selectedDetail && this.selectedDetail.id; if (!detailToDelete) { uni.showToast({ title: '要删除的明细不存在', @@ -508,64 +580,83 @@ return; } + this.pendingDeleteDetail = detailToDelete; + this.showDeleteConfirm = true; this.speakMessage('请确认删除'); + }, - uni.showModal({ - title: '确认删除', - content: `确定要删除商品"${detailToDelete.product_name}"吗?`, - success: async (res) => { - if (res.confirm) { - try { - const result = await this.$http('storage.receiving.deleteDetail', { - receiving_id: this.receivingId, - detail_id: id - }); - - if (result.code === 200) { - this.showToastMessage('删除成功', 'success', { - speakText: '删除成功' - }); - - // 删除后统一以服务端最新数据重建列表与选中态,避免残留旧引用 - await this.loadReceivingInfo(); - - if (!Array.isArray(this.details) || this.details.length === 0) { - this.selectedDetail = null; - return; - } - - if (selectedIdBeforeDelete && selectedIdBeforeDelete !== id) { - const reboundDetail = this.details.find(item => item.id === selectedIdBeforeDelete); - this.selectedDetail = reboundDetail || this.details[0]; - return; - } - - const nextIndex = Math.min( - Math.max(deletedIndex, 0), - this.details.length - 1 - ); - this.selectedDetail = this.details[nextIndex] || this.details[0]; - } else { - uni.showToast({ - title: result.message || '删除失败', - icon: 'none' - }); - } - } catch (error) { - console.error('删除明细失败:', error); - uni.showToast({ - title: `删除失败: ${error.message}`, - icon: 'error' - }); - } - } else { - this.showToastMessage('已取消', 'none', { - speak: false - }); - } - } + // 取消删除 + cancelDelete() { + this.showDeleteConfirm = false; + this.pendingDeleteDetail = null; + this.showToastMessage('已取消', 'none', { + speak: false }); }, + + // 关闭商品信息不完整提示 + closeIncompleteConfirm() { + this.showIncompleteConfirm = false; + this.incompleteConfirmText = ''; + }, + + // 确认删除 + async confirmDelete() { + const detailToDelete = this.pendingDeleteDetail; + this.showDeleteConfirm = false; + this.pendingDeleteDetail = null; + if (!detailToDelete) { + return; + } + + const id = detailToDelete.id; + const deletedIndex = this.details.findIndex(item => item.id === id); + const selectedIdBeforeDelete = this.selectedDetail && this.selectedDetail.id; + + try { + const result = await this.$http('storage.receiving.deleteDetail', { + receiving_id: this.receivingId, + detail_id: id + }); + + if (result.code === 200) { + this.showToastMessage('删除成功', 'success', { + speakText: '删除成功' + }); + + // 删除后统一以服务端最新数据重建列表与选中态,避免残留旧引用 + await this.loadReceivingInfo(); + + if (!Array.isArray(this.details) || this.details.length === 0) { + this.selectedDetail = null; + return; + } + + if (selectedIdBeforeDelete && selectedIdBeforeDelete !== id) { + const reboundDetail = this.details.find(item => item.id === selectedIdBeforeDelete); + this.selectedDetail = reboundDetail || this.details[0]; + return; + } + + const nextIndex = Math.min( + Math.max(deletedIndex, 0), + this.details.length - 1 + ); + this.selectedDetail = this.details[nextIndex] || this.details[0]; + } else { + uni.showToast({ + title: result.message || '删除失败', + icon: 'none' + }); + } + } catch (error) { + console.error('删除明细失败:', error); + uni.showToast({ + title: `删除失败: ${error.message}`, + icon: 'error' + }); + } + }, // 处理添加明细事件 - 从detail-container组件接收 async handleAddDetail() { try { @@ -686,11 +777,8 @@ this.selectedDetail = baseValidation.detail; const message = baseValidation.message || '商品信息不完整'; this.speakMessage(message); - uni.showModal({ - title: '商品信息不完整', - content: message, - showCancel: false - }); + this.incompleteConfirmText = message; + this.showIncompleteConfirm = true; return; } @@ -698,11 +786,8 @@ if (shelfLifeValidation) { this.currentTab = 1; this.selectedDetail = shelfLifeValidation.detail; - uni.showModal({ - title: '商品信息不完整', - content: `${shelfLifeValidation.detail.product_name || '当前商品'}缺少${shelfLifeValidation.missingFields.join('、')}`, - showCancel: false - }); + this.incompleteConfirmText = `${shelfLifeValidation.detail.product_name || '当前商品'}缺少${shelfLifeValidation.missingFields.join('、')}`; + this.showIncompleteConfirm = true; return; } const expiredDetail = this.validateExpiryDateNotPast(); @@ -746,19 +831,12 @@ }); await new Promise(resolve => setTimeout(resolve, 900)); // 1. 显示确认弹窗 - const confirmResult = await uni.showModal({ - title: '完成收货', - content: '确定要完成当前收货单吗?完成后将无法修改。', - confirmText: '确定完成', - confirmColor: '#2979ff', - cancelText: '再想想', - cancelColor: '#999' - }); + const confirmResult = await this.askCompleteReceiving(); console.log('确认结果:', confirmResult); // 修正:直接使用confirmResult.confirm - if (!confirmResult[1].confirm) { + if (!confirmResult) { this.showToastMessage('已取消', 'none', { speak: false }); @@ -838,6 +916,33 @@ }); } }, + + // 打开完成收货确认弹窗并等待用户选择 + askCompleteReceiving() { + this.showCompleteConfirm = true; + return new Promise((resolve) => { + this._completeReceivingResolve = resolve; + }); + }, + + // 取消完成收货 + cancelCompleteConfirm() { + this.showCompleteConfirm = false; + if (this._completeReceivingResolve) { + this._completeReceivingResolve(false); + this._completeReceivingResolve = null; + } + }, + + // 确认完成收货 + confirmCompleteReceiving() { + this.showCompleteConfirm = false; + if (this._completeReceivingResolve) { + this._completeReceivingResolve(true); + this._completeReceivingResolve = null; + } + }, + confirmCancel() { this.showCancelConfirm = false; this.cancel(); @@ -1139,26 +1244,69 @@ border-radius: 16rpx; } .filter-popup { - height: 750rpx; + height: 900rpx; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); + border-top-left-radius: 20px; + border-top-right-radius: 20px; + overflow: hidden; + background: #f8f9fa; .popup-header { - padding: 40rpx 30rpx 20rpx; - border-bottom: 1rpx solid #f0f0f0; + padding: 16rpx 0 20rpx; + text-align: center; .popup-title { - font-size: 36rpx; - font-weight: 600; - color: #333; + font-size: 40rpx; + font-weight: bold; + color: #303133; } } .popup-content { - padding: 30rpx; + padding: 16rpx 20rpx; height: 100rpx; flex:1; + font-size: 36rpx; + + ::v-deep .receiving-info-card { + margin-left: 0; + margin-right: 0; + } + + ::v-deep .info-item .label, + ::v-deep .info-item .value, + ::v-deep .info-row .label, + ::v-deep .info-row .value, + ::v-deep .goods-name { + font-size: 36rpx; + } + + ::v-deep .info-item .label, + ::v-deep .info-row .label { + width: 180rpx; + white-space: nowrap; + } + + ::v-deep .receiving-number, + ::v-deep .status-badge, + ::v-deep .goods-header .title, + ::v-deep .goods-header .count, + ::v-deep .goods-status { + font-size: 36rpx; + } + + ::v-deep .stats-value { + font-size: 34rpx; + font-weight: bold; + } + + ::v-deep .stats-label, + ::v-deep .goods-footer .time { + font-size: 30rpx; + } + .date-range { font-size: 28rpx; color: #333; @@ -1187,6 +1335,27 @@ font-size: 32rpx; } } + + .popup-footer { + padding: 12rpx; + background: #f8f9fa; + display: flex; + + ::v-deep .u-button { + flex: 1; + height: 88rpx; + font-size: 36rpx; + } + + ::v-deep .u-button + .u-button { + margin-left: 20rpx; + } + + ::v-deep .u-button--primary { + background-color: #2979ff; + border-color: #2979ff; + } + } } // 更多操作弹窗 @@ -1334,4 +1503,50 @@ background: #f56c6c; color: #ffffff; } + + .cancel-confirm-popup__btn--primary { + background: #2979ff; + color: #ffffff; + } + + .incomplete-popup { + width: 640rpx; + padding: 40rpx 32rpx 32rpx; + background: #ffffff; + border-radius: 20rpx; + box-sizing: border-box; + } + + .incomplete-popup__title { + font-size: 40rpx; + font-weight: bold; + color: #303133; + text-align: center; + margin-bottom: 32rpx; + } + + .incomplete-popup__body { + margin-bottom: 36rpx; + padding: 24rpx; + background: #f5f7fa; + border-radius: 12rpx; + } + + .incomplete-popup__text { + font-size: 36rpx; + color: #303133; + line-height: 1.6; + } + + .incomplete-popup__btn { + height: 88rpx; + border-radius: 12rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 36rpx; + font-weight: 500; + background: #2979ff; + color: #ffffff; + } \ No newline at end of file diff --git a/src/pages/work/storage/receiving/receivingList.vue b/src/pages/work/storage/receiving/receivingList.vue index 1260801..cf2b18a 100644 --- a/src/pages/work/storage/receiving/receivingList.vue +++ b/src/pages/work/storage/receiving/receivingList.vue @@ -19,47 +19,47 @@ - 货主: + 货主: {{ receivingInfo.store_name }} - 创建人: + 创建人: {{ creatorName }} - 创建时间: + 创建时间: {{ formatDate(receivingInfo.created_at) }} - 完成时间: + 完成时间: {{ formatDate(receivingInfo.receiving_end_time) }} - 来货方式: + 来货方式: {{ getDeliveryMethodText(receivingInfo.delivery_method) }} - 装卸方式: + 装卸方式: {{ getLoadingMethodText(receivingInfo.loading_method) }} - 商品总数: + 商品总数: {{ receivingInfo.total_items }} 种 - 总数量: + 总数量: {{ formatNumber(receivingInfo.total_quantity) }} - 备注: + 备注: {{ receivingInfo.remark }} @@ -102,48 +102,48 @@ - 条码: + 条码: {{ item.barcode || '无' }} - 数量: + 数量: {{ formatNumber(item.actual_quantity) }} - 重量: + 重量: {{ item.weight||0 }}g - 批次号: + 批次号: {{ item.batch_number }} - 生产日期: + 生产日期: {{ formatDate(item.production_date) }} - 保质期: + 保质期: {{ formatDate(item.expiry_date) }} - 收货货位: + 收货货位: {{ getSpaceName(item.receiving_space) }} - 备注: + 备注: {{ item.remark }} - 照片: + 照片: - 创建时间: {{ formatDate(item.created_at) }} - 更新时间: {{ formatDate(item.updated_at) }} + 创建时间: {{ formatDate(item.created_at) }} + 更新时间: {{ formatDate(item.updated_at) }} @@ -831,4 +831,8 @@ border-radius: 12rpx; } } + + .label-colon { + margin-left: 10rpx; + } \ No newline at end of file