fix: 收货明细弹窗样式优化与真机按钮间隔修复

- 收货任务详情(receivingDetail)
  - 收货明细弹窗参考“更多操作”弹窗:标题/顶部圆角/间距对齐,整体弹窗调高、标题与底部固定区调矮
  - 弹窗内容与各面板字号统一:标题40rpx、正文36rpx、汇总值34rpx加粗、标签/时间30rpx
  - 底部新增固定「关闭/确认收货」按钮(蓝色36rpx)
  - 确认删除、商品信息不完整、完成收货由 uni.showModal 改为自定义弹窗(参考整单作废/确认删除样式)
  - 各面板左右留白收窄并对齐

- 收货清单(receivingList)
  - 标签文字与冒号之间增加间隔(label-colon),创建/更新时间标签同步处理

- 打印(WorkbenchPrint)
  - 打印选项及工作台/打印机/模板选择弹窗底部按钮间隔由 flex gap 改为兄弟选择器 margin-left,兼容旧真机

- 首页(index)
  - 通知信息标题与数值加粗 font-weight: 600 → bold

- 库位查询(locationInquiry)
  - 启用筛选时不提示查询到的商品数量,避免与底部筛选后合计不一致
This commit is contained in:
zm2000 2026-11-23 17:59:03 +08:00
parent 79d410680b
commit 35113f7fe0
5 changed files with 343 additions and 115 deletions

View File

@ -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;
}
}
}
</style>

View File

@ -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;
}

View File

@ -710,7 +710,10 @@ export default {
goodsImageTask.catch(error => console.warn('[locationInquiry] 拉取商品图片失败:', error));
}
if (this.goodsList.length) {
// 未启用筛选时才提示查询到的商品种类数;启用筛选后提示数量会与底部合计(筛选后数量)不一致,故不提示
if (!this.filterType) {
this.toast(`查询到 ${this.goodsList.length} 种商品`, 'none');
}
} else {
this.speak('无记录');
this.toast('该库位无有量库存');

View File

@ -84,18 +84,79 @@
</view>
</u-popup>
<u-popup :show="showComplete" mode="bottom" :closeable="true" border-radius="20" @close="showComplete = false">
<!-- 确认删除弹窗 -->
<u-popup
:show="showDeleteConfirm"
mode="center"
:closeable="true"
:closeOnClickOverlay="false"
round="20"
@close="cancelDelete"
>
<view class="cancel-confirm-popup">
<view class="cancel-confirm-popup__title">确认删除</view>
<view class="cancel-confirm-popup__body">
<text class="cancel-confirm-popup__text">{{ deleteConfirmText }}</text>
</view>
<view class="cancel-confirm-popup__actions">
<view class="cancel-confirm-popup__btn cancel-confirm-popup__btn--cancel" @click="cancelDelete">取消</view>
<view class="cancel-confirm-popup__btn cancel-confirm-popup__btn--confirm" @click="confirmDelete">
<text>删除</text>
</view>
</view>
</view>
</u-popup>
<!-- 商品信息不完整弹窗 -->
<u-popup
:show="showIncompleteConfirm"
mode="center"
:closeable="true"
:closeOnClickOverlay="false"
round="20"
@close="closeIncompleteConfirm"
>
<view class="incomplete-popup">
<view class="incomplete-popup__title">商品信息不完整</view>
<view class="incomplete-popup__body">
<text class="incomplete-popup__text">{{ incompleteConfirmText }}</text>
</view>
<view class="incomplete-popup__btn" @click="closeIncompleteConfirm">知道了</view>
</view>
</u-popup>
<!-- 完成收货确认弹窗 -->
<u-popup
:show="showCompleteConfirm"
mode="center"
:closeable="true"
:closeOnClickOverlay="false"
round="20"
@close="cancelCompleteConfirm"
>
<view class="cancel-confirm-popup">
<view class="cancel-confirm-popup__title">完成收货</view>
<view class="cancel-confirm-popup__body">
<text class="cancel-confirm-popup__text">确定要完成当前收货单吗?完成后将无法修改。</text>
</view>
<view class="cancel-confirm-popup__actions">
<view class="cancel-confirm-popup__btn cancel-confirm-popup__btn--cancel" @click="cancelCompleteConfirm">再想想</view>
<view class="cancel-confirm-popup__btn cancel-confirm-popup__btn--primary" @click="confirmCompleteReceiving">确定完成</view>
</view>
</view>
</u-popup>
<u-popup :show="showComplete" mode="bottom" :closeable="true" round="20" @close="showComplete = false">
<view class="filter-popup">
<view class="popup-header">
<text class="popup-title">收货明细</text>
</view>
<view class="popup-content">
<receivingList :receiving-data="receivingInfo" :detail-list="details">
<template #bottom>
<u-button @click="completeReceiving">确认收货</u-button>
</template>
</receivingList>
<receivingList :receiving-data="receivingInfo" :detail-list="details" />
</view>
<view class="popup-footer">
<u-button @click="showComplete = false">关闭</u-button>
<u-button type="primary" @click="completeReceiving">确认收货</u-button>
</view>
</view>
</u-popup>
@ -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,13 +580,39 @@
return;
}
this.pendingDeleteDetail = detailToDelete;
this.showDeleteConfirm = true;
this.speakMessage('请确认删除');
},
// 取消删除
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;
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,
@ -558,13 +656,6 @@
icon: 'error'
});
}
} else {
this.showToastMessage('已取消', 'none', {
speak: false
});
}
}
});
},
// 处理添加明细事件 - 从detail-container组件接收
async handleAddDetail() {
@ -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;
}
</style>

View File

@ -19,47 +19,47 @@
<view class="info-content" :class="{ collapsed: !infoExpanded, 'no-transition': disableInfoTransition }">
<view class="info-item">
<text class="label">货主:</text>
<text class="label">货主<text class="label-colon">:</text></text>
<text class="value">{{ receivingInfo.store_name }}</text>
</view>
<view class="info-item">
<text class="label">创建人:</text>
<text class="label">创建人<text class="label-colon">:</text></text>
<text class="value">{{ creatorName }}</text>
</view>
<view class="info-item">
<text class="label">创建时间:</text>
<text class="label">创建时间<text class="label-colon">:</text></text>
<text class="value">{{ formatDate(receivingInfo.created_at) }}</text>
</view>
<view class="info-item">
<text class="label">完成时间:</text>
<text class="label">完成时间<text class="label-colon">:</text></text>
<text class="value">{{ formatDate(receivingInfo.receiving_end_time) }}</text>
</view>
<view class="info-item">
<text class="label">来货方式:</text>
<text class="label">来货方式<text class="label-colon">:</text></text>
<text class="value">{{ getDeliveryMethodText(receivingInfo.delivery_method) }}</text>
</view>
<view class="info-item">
<text class="label">装卸方式:</text>
<text class="label">装卸方式<text class="label-colon">:</text></text>
<text class="value">{{ getLoadingMethodText(receivingInfo.loading_method) }}</text>
</view>
<view class="info-item">
<text class="label">商品总数:</text>
<text class="label">商品总数<text class="label-colon">:</text></text>
<text class="value">{{ receivingInfo.total_items }} 种</text>
</view>
<view class="info-item">
<text class="label">总数量:</text>
<text class="label">总数量<text class="label-colon">:</text></text>
<text class="value">{{ formatNumber(receivingInfo.total_quantity) }}</text>
</view>
<view v-if="receivingInfo.remark" class="info-item remark">
<text class="label">备注:</text>
<text class="label">备注<text class="label-colon">:</text></text>
<text class="value">{{ receivingInfo.remark }}</text>
</view>
</view>
@ -102,48 +102,48 @@
<view class="goods-info">
<view class="info-row">
<text class="label">条码:</text>
<text class="label">条码<text class="label-colon">:</text></text>
<text class="value">{{ item.barcode || '无' }}</text>
</view>
<view class="info-row">
<text class="label">数量:</text>
<text class="label">数量<text class="label-colon">:</text></text>
<text class="value">{{ formatNumber(item.actual_quantity) }}</text>
</view>
<view class="info-row">
<text class="label">重量:</text>
<text class="label">重量<text class="label-colon">:</text></text>
<text class="value">{{ item.weight||0 }}g</text>
</view>
<view v-if="item.batch_number" class="info-row">
<text class="label">批次号:</text>
<text class="label">批次号<text class="label-colon">:</text></text>
<text class="value">{{ item.batch_number }}</text>
</view>
<view v-if="item.production_date" class="info-row">
<text class="label">生产日期:</text>
<text class="label">生产日期<text class="label-colon">:</text></text>
<text class="value">{{ formatDate(item.production_date) }}</text>
</view>
<view v-if="item.expiry_date" class="info-row">
<text class="label">保质期:</text>
<text class="label">保质期<text class="label-colon">:</text></text>
<text class="value">{{ formatDate(item.expiry_date) }}</text>
</view>
<view class="info-row">
<text class="label">收货货位:</text>
<text class="label">收货货位<text class="label-colon">:</text></text>
<text class="value">{{ getSpaceName(item.receiving_space) }}</text>
</view>
<view v-if="item.remark" class="info-row">
<text class="label">备注:</text>
<text class="label">备注<text class="label-colon">:</text></text>
<text class="value remark-text">{{ item.remark }}</text>
</view>
<!-- 商品图片 -->
<view v-if="item.images && item.images.length > 0" class="goods-images">
<text class="label">照片:</text>
<text class="label">照片<text class="label-colon">:</text></text>
<scroll-view class="images-scroll" scroll-x>
<view v-for="(img, imgIndex) in item.images" :key="imgIndex" class="image-item">
<image :src="img.url" mode="aspectFill" class="goods-image"
@ -154,8 +154,8 @@
</view>
<view class="goods-footer">
<text class="time">创建时间: {{ formatDate(item.created_at) }}</text>
<text class="time">更新时间: {{ formatDate(item.updated_at) }}</text>
<text class="time">创建时间<text class="label-colon">:</text> {{ formatDate(item.created_at) }}</text>
<text class="time">更新时间<text class="label-colon">:</text> {{ formatDate(item.updated_at) }}</text>
</view>
</view>
<slot name="bottom"></slot>
@ -831,4 +831,8 @@
border-radius: 12rpx;
}
}
.label-colon {
margin-left: 10rpx;
}
</style>