feat: 收货任务详情页与打印弹窗 UI 优化

收货部分(detail-container / ProductInfoEditor):
- 顶部搜索框样式统一,新增「搜索」按钮,扫描图标由 camera 改为 scan
- 删除按钮去掉图标、字号 36rpx、高度调大;「新增商品」按钮去掉 + 图标、高度调大
- 表单标签、输入值、单位、按钮字号统一为 36rpx(参考收货单信息)
- 「存放库位」扫描图标调大;「快速生成」按钮单行显示
- 底部「共 x 项」与页码字号 34rpx,页码单行显示

更多操作与整单作废(receivingDetail):
- 「···」菜单由 u-action-sheet 改为底部「更多操作」抽屉(参考上架作业样式)
- 整单作废二次确认由 uni.showModal 改为居中自定义弹窗(参考完成盘点弹窗样式)

打印弹窗(PrintPanel / WorkbenchPrint):
- 打印选项弹窗参考筛选条件弹窗样式,新增「取消」按钮
- 内容与按钮字号统一 36rpx
- 选择工作台/打印机/模板三个弹窗顶部圆角统一、新增右上角关闭按钮
This commit is contained in:
zm2000 2026-11-22 18:00:49 +08:00
parent afd1672610
commit 28f7dc412b
5 changed files with 338 additions and 93 deletions

View File

@ -4,13 +4,17 @@
<u-popup <u-popup
:show="show" :show="show"
mode="bottom" mode="bottom"
closeable round="20"
:closeable="false"
@close="handleClose" @close="handleClose"
> >
<view class="print-panel"> <view class="print-panel">
<!-- 标题 --> <!-- 标题 -->
<view class="panel-header"> <view class="popup-header">
<text class="title">打印选项</text> <text class="popup-title">打印选项</text>
<view class="popup-close" @click="handleClose">
<u-icon name="close" color="#909399" size="18"></u-icon>
</view>
</view> </view>
<!-- 内容区域,只保留工作台打印 --> <!-- 内容区域,只保留工作台打印 -->
@ -18,6 +22,7 @@
<WorkbenchPrint <WorkbenchPrint
:printData="printData" :printData="printData"
@print="handleWorkbenchPrint" @print="handleWorkbenchPrint"
@cancel="handleClose"
/> />
</view> </view>
</view> </view>
@ -66,22 +71,37 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.print-panel { .print-panel {
height: 90vh; height: 90vh;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding-bottom: env(safe-area-inset-bottom);
.panel-header { .popup-header {
padding: 30rpx; position: relative;
text-align: center; display: flex;
border-bottom: 1rpx solid #f5f5f5; flex-direction: column;
align-items: center;
padding: 32rpx 30rpx 24rpx;
flex-shrink: 0;
border-bottom: 1rpx solid #f0f0f0;
}
.title { .popup-close {
font-size: 36rpx; position: absolute;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
padding: 8rpx;
}
.popup-title {
font-size: 38rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
} }
}
.panel-content { .panel-content {
flex: 1; flex: 1;

View File

@ -40,6 +40,9 @@
<!-- 操作按钮 --> <!-- 操作按钮 -->
<view class="action-buttons"> <view class="action-buttons">
<u-button type="info" @click="handleCancel">
取消
</u-button>
<u-button type="primary" :disabled="!selectedWorkbench || !selectedTemplate || !selectedPrinter" <u-button type="primary" :disabled="!selectedWorkbench || !selectedTemplate || !selectedPrinter"
@click="handlePrint" :loading="printing"> @click="handlePrint" :loading="printing">
{{ printing ? '打印中...' : '开始打印' }} {{ printing ? '打印中...' : '开始打印' }}
@ -48,7 +51,7 @@
</view> </view>
<!-- 工作台选择弹窗 --> <!-- 工作台选择弹窗 -->
<u-popup :show="showWorkbenchSelector" mode="bottom" round="20" @close="showWorkbenchSelector = false"> <u-popup :show="showWorkbenchSelector" mode="bottom" round="20" closeable @close="showWorkbenchSelector = false">
<view class="workbench-selector-popup"> <view class="workbench-selector-popup">
<view class="popup-header"> <view class="popup-header">
<text class="popup-title">选择打印工作台</text> <text class="popup-title">选择打印工作台</text>
@ -73,7 +76,7 @@
</scroll-view> </scroll-view>
<view class="popup-actions"> <view class="popup-actions">
<u-button type="default" @click="showWorkbenchSelector = false">取消</u-button> <u-button type="info" @click="showWorkbenchSelector = false">取消</u-button>
<u-button type="primary" @click="confirmWorkbenchSelection" :disabled="!selectedWorkbench"> <u-button type="primary" @click="confirmWorkbenchSelection" :disabled="!selectedWorkbench">
确定 确定
</u-button> </u-button>
@ -81,7 +84,7 @@
</view> </view>
</u-popup> </u-popup>
<!-- 打印机选择弹窗 --> <!-- 打印机选择弹窗 -->
<u-popup :show="showPrinterSelector" mode="bottom" round="20" @close="showPrinterSelector = false"> <u-popup :show="showPrinterSelector" mode="bottom" round="20" closeable @close="showPrinterSelector = false">
<view class="printer-selector-popup"> <view class="printer-selector-popup">
<view class="popup-header"> <view class="popup-header">
<text class="popup-title">选择打印机</text> <text class="popup-title">选择打印机</text>
@ -105,7 +108,7 @@
</scroll-view> </scroll-view>
<view class="popup-actions"> <view class="popup-actions">
<u-button type="default" @click="showPrinterSelector = false">取消</u-button> <u-button type="info" @click="showPrinterSelector = false">取消</u-button>
<u-button type="primary" @click="confirmPrinterSelection" :disabled="!selectedPrinter"> <u-button type="primary" @click="confirmPrinterSelection" :disabled="!selectedPrinter">
确定 确定
</u-button> </u-button>
@ -114,7 +117,7 @@
</u-popup> </u-popup>
<!-- 打印模板选择弹窗 --> <!-- 打印模板选择弹窗 -->
<u-popup :show="showTemplateSelector" mode="bottom" round="20" @close="showTemplateSelector = false"> <u-popup :show="showTemplateSelector" mode="bottom" round="20" closeable @close="showTemplateSelector = false">
<view class="template-selector-popup"> <view class="template-selector-popup">
<view class="popup-header"> <view class="popup-header">
<text class="popup-title">选择打印模板</text> <text class="popup-title">选择打印模板</text>
@ -139,7 +142,7 @@
</scroll-view> </scroll-view>
<view class="popup-actions"> <view class="popup-actions">
<u-button type="default" @click="showTemplateSelector = false">取消</u-button> <u-button type="info" @click="showTemplateSelector = false">取消</u-button>
<u-button type="primary" @click="confirmTemplateSelection" :disabled="!selectedTemplate"> <u-button type="primary" @click="confirmTemplateSelection" :disabled="!selectedTemplate">
确定 确定
</u-button> </u-button>
@ -292,6 +295,11 @@ export default {
this.showTemplateSelector = false; this.showTemplateSelector = false;
}, },
// 取消打印选项弹窗
handleCancel() {
this.$emit('cancel');
},
// 处理打印 // 处理打印
async handlePrint() { async handlePrint() {
if (!this.selectedWorkbench) { if (!this.selectedWorkbench) {
@ -395,7 +403,7 @@ export default {
} }
.detail-item-label { .detail-item-label {
font-size: 32rpx; font-size: 36rpx;
color: #333; color: #333;
font-weight: 500; font-weight: 500;
} }
@ -404,7 +412,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 16rpx; gap: 16rpx;
font-size: 28rpx; font-size: 36rpx;
color: #666; color: #666;
max-width: 60%; max-width: 60%;
text-align: right; text-align: right;
@ -421,6 +429,13 @@ export default {
margin-top: auto; margin-top: auto;
padding-top: 30rpx; padding-top: 30rpx;
border-top: 1rpx solid #eee; border-top: 1rpx solid #eee;
display: flex;
gap: 24rpx;
::v-deep .u-button {
flex: 1;
font-size: 36rpx !important;
}
} }
} }
@ -428,14 +443,20 @@ export default {
.workbench-selector-popup, .workbench-selector-popup,
.template-selector-popup { .template-selector-popup {
background-color: #fff; background-color: #fff;
border-radius: 20rpx 20rpx 0 0; border-radius: 40rpx 40rpx 0 0;
overflow: hidden;
.popup-header { .popup-header {
padding: 40rpx 32rpx 24rpx; position: relative;
display: flex;
flex-direction: column;
align-items: center;
padding: 32rpx 30rpx 24rpx;
flex-shrink: 0;
border-bottom: 1rpx solid #f0f0f0; border-bottom: 1rpx solid #f0f0f0;
.popup-title { .popup-title {
font-size: 36rpx; font-size: 38rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
} }
@ -475,7 +496,7 @@ export default {
.workbench-name, .workbench-name,
.printer-name, .printer-name,
.template-name { .template-name {
font-size: 32rpx; font-size: 36rpx;
color: #333; color: #333;
font-weight: 500; font-weight: 500;
} }
@ -490,7 +511,7 @@ export default {
.empty-text { .empty-text {
margin-top: 24rpx; margin-top: 24rpx;
font-size: 28rpx; font-size: 36rpx;
color: #999; color: #999;
} }
} }
@ -505,6 +526,10 @@ export default {
.u-button { .u-button {
flex: 1; flex: 1;
} }
::v-deep .u-button {
font-size: 36rpx !important;
}
} }
} }
</style> </style>

View File

@ -175,7 +175,7 @@
<view class="space-barcode-input-row"> <view class="space-barcode-input-row">
<u-input class="space-barcode-input" v-model="spaceBarcode" placeholder="请扫描库位条码" clearable <u-input class="space-barcode-input" v-model="spaceBarcode" placeholder="请扫描库位条码" clearable
@blur="handleSpaceBarcodeInput" @focus="handleSpaceBarcodeOnput" /> @blur="handleSpaceBarcodeInput" @focus="handleSpaceBarcodeOnput" />
<u-icon class="scan-icon" name="scan" size="20" color="#2979ff" /> <u-icon class="scan-icon" name="scan" size="48rpx" color="#2979ff" />
</view> </view>
</view> </view>
</u-form-item> </u-form-item>
@ -893,11 +893,26 @@
padding: 20rpx; padding: 20rpx;
box-sizing: border-box; box-sizing: border-box;
/* 表单标签、输入框字号统一为 36rpx(参考收货单信息) */
::v-deep .u-form-item__body__left__content__label {
font-size: 36rpx;
white-space: nowrap;
}
::v-deep .u-input__content__field-wrapper__field {
font-size: 36rpx !important;
}
/* 按钮字号统一为 36rpx */
::v-deep .u-button {
font-size: 36rpx !important;
}
.section { .section {
margin-bottom: 30rpx; margin-bottom: 30rpx;
.section-title { .section-title {
font-size: 32rpx; font-size: 34rpx;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
margin-bottom: 20rpx; margin-bottom: 20rpx;
@ -917,7 +932,7 @@
.detail-item-label { .detail-item-label {
width: 220rpx; width: 220rpx;
color: #333; color: #333;
font-size: 15px !important; font-size: 36rpx;
flex-shrink: 0; flex-shrink: 0;
white-space: nowrap; white-space: nowrap;
} }
@ -933,7 +948,7 @@
.detail-item-value { .detail-item-value {
flex: 1; flex: 1;
color: #333; color: #333;
font-size: 15px !important; font-size: 36rpx;
} }
} }
@ -971,7 +986,7 @@
.space-name { .space-name {
flex: 1; flex: 1;
color: #333; color: #333;
font-size: 28rpx; font-size: 36rpx;
} }
} }
} }
@ -1025,7 +1040,7 @@
.unit-text { .unit-text {
width: 100rpx; width: 100rpx;
color: #666; color: #666;
font-size: 28rpx; font-size: 36rpx;
text-align: center; text-align: center;
margin-left: 10rpx; margin-left: 10rpx;
flex-shrink: 0; flex-shrink: 0;
@ -1068,16 +1083,16 @@
} }
.quick-generate-btn { .quick-generate-btn {
width: 200rpx; width: 240rpx;
flex-shrink: 0; flex-shrink: 0;
white-space: nowrap;
} }
} }
.date-display { .date-display {
padding: 18rpx 0; padding: 18rpx 0;
color: #333; color: #333;
font-size: 35rpx; font-size: 36rpx;
} }
} }
</style> </style>

View File

@ -7,8 +7,7 @@
<SearchBar <SearchBar
v-model="searchKeyword" v-model="searchKeyword"
placeholder="搜索运单号、货主、商品条码、车牌" placeholder="搜索运单号、货主、商品条码、车牌"
:show-search="false" scan-icon="scan"
scan-icon="camera"
:input-font-size="'34rpx'" :input-font-size="'34rpx'"
:search-text-font-size="'34rpx'" :search-text-font-size="'34rpx'"
@search="handleSearch" @search="handleSearch"
@ -18,8 +17,8 @@
</view> </view>
<view class="detail-actions"> <view class="detail-actions">
<u-button type="error" size="mini" @click="handleDeleteDetail(selectedDetail.id)"> <u-button class="delete-btn" type="error" size="mini" @click="handleDeleteDetail(selectedDetail.id)">
<u-icon name="trash"></u-icon> 删除 <text class="delete-btn-text">删除</text>
</u-button> </u-button>
</view> </view>
</view> </view>
@ -41,8 +40,8 @@
<text class="total">共 {{ totalDetails }} 项</text> <text class="total">共 {{ totalDetails }} 项</text>
<view class="list-actions"> <view class="list-actions">
<view class="page-info">{{ currentPage }} / {{ totalPages }}</view> <view class="page-info">{{ currentPage }} / {{ totalPages }}</view>
<u-button type="primary" size="mini" @click="handleAddDetail"> <u-button class="add-btn" type="primary" size="mini" @click="handleAddDetail">
<u-icon name="plus" size="14"></u-icon> 新增商品 新增商品
</u-button> </u-button>
</view> </view>
</view> </view>
@ -417,6 +416,18 @@
.detail-actions { .detail-actions {
display: flex; display: flex;
gap: 10rpx; gap: 10rpx;
::v-deep .delete-btn {
height: 68rpx;
padding: 0 24rpx;
display: flex;
align-items: center;
justify-content: center;
}
.delete-btn-text {
font-size: 36rpx;
}
} }
} }
@ -511,7 +522,7 @@
.total { .total {
color: #666; color: #666;
font-size: 28rpx; font-size: 34rpx;
} }
.list-actions { .list-actions {
@ -521,9 +532,15 @@
.page-info { .page-info {
width: 100rpx; width: 100rpx;
font-size: 28rpx; font-size: 34rpx;
color: #666; color: #666;
text-align: center; text-align: center;
white-space: nowrap;
}
::v-deep .add-btn {
font-size: 36rpx;
height: 68rpx;
} }
} }
} }

View File

@ -34,10 +34,56 @@
</view> </view>
<stockList :stock-list="stockList" :show="showStockList" @select="selectStock" @close="showStockList=false" @tryGetStock="tryGetStock"></stockList> <stockList :stock-list="stockList" :show="showStockList" @select="selectStock" @close="showStockList=false" @tryGetStock="tryGetStock"></stockList>
<space-list :space-list="spaceList" :show="showSpaceList" @select="selectSpace" @close="showSpaceList=false" @searchSpace="searchSpace"></space-list> <space-list :space-list="spaceList" :show="showSpaceList" @select="selectSpace" @close="showSpaceList=false" @searchSpace="searchSpace"></space-list>
<!-- 操作菜单 --> <!-- 操作菜单(更多操作) -->
<u-action-sheet :actions="actionList" :show="showActionSheet" @select="handleAction" <u-popup :show="showActionSheet" mode="bottom" round="20" closeable :closeOnClickOverlay="false"
@close="showActionSheet = false"> @close="showActionSheet = false">
</u-action-sheet> <view class="action-drawer">
<view class="action-drawer__header">
<text class="action-drawer__title">更多操作</text>
</view>
<view class="action-drawer__body">
<view class="action-drawer__item action-drawer__item--primary-outline" @click="handleAction('initData')">
<text class="action-drawer__item-text action-drawer__item-text--primary">刷新数据</text>
</view>
<view class="action-drawer__item action-drawer__item--primary-outline" @click="handleAction('completeReceiving')">
<text class="action-drawer__item-text action-drawer__item-text--primary">完成收货</text>
</view>
<view class="action-drawer__item action-drawer__item--neutral" @click="handleAction('printReceiving')">
<text class="action-drawer__item-text">打印收货单</text>
</view>
<view class="action-drawer__item action-drawer__item--danger-outline" @click="handleAction('cancel')">
<text class="action-drawer__item-text action-drawer__item-text--danger">整单作废</text>
</view>
<view class="action-drawer__item action-drawer__item--close" @click="showActionSheet = false">
<text class="action-drawer__item-text">关闭</text>
</view>
</view>
</view>
</u-popup>
<!-- 整单作废确认弹窗 -->
<u-popup
:show="showCancelConfirm"
mode="center"
:closeable="true"
:closeOnClickOverlay="false"
round="20"
@close="showCancelConfirm = false"
>
<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="showCancelConfirm = false">再想想</view>
<view class="cancel-confirm-popup__btn cancel-confirm-popup__btn--confirm" @click="confirmCancel">
<text>确定作废</text>
</view>
</view>
</view>
</u-popup>
<u-popup :show="showComplete" mode="bottom" :closeable="true" border-radius="20" @close="showComplete = false"> <u-popup :show="showComplete" mode="bottom" :closeable="true" border-radius="20" @close="showComplete = false">
<view class="filter-popup"> <view class="filter-popup">
<view class="popup-header"> <view class="popup-header">
@ -97,29 +143,7 @@
// 对话框控制 // 对话框控制
showActionSheet: false, showActionSheet: false,
showCancelConfirm: false,
// 下拉菜单
actionList: [{
name: '刷新数据',
color: '#2979ff',
action:"initData"
},
{
name: '完成收货',
color: '#9a3130',
action:"completeReceiving"
},
{
name: '打印收货单',
color: '#9a3130',
action:"comfir"
},
{
name: '整单作废',
color: '#FF0000',
action:"cancel"
}
],
}; };
}, },
@ -629,17 +653,29 @@
}, },
// 操作菜单处理 // 操作菜单处理
handleAction(index) { handleAction(action) {
console.log("菜单点击",index); console.log("菜单点击", action);
switch (index.action) { this.showActionSheet = false;
switch (action) {
case "initData": case "initData":
this.initData(); this.initData();
break; break;
case "completeReceiving": case "completeReceiving":
this.showComplete = true; this.showComplete = true;
break; break;
case "printReceiving":
this.handlePrint({
type: "STOCK",
value: {
product_barcode: this.receivingInfo.receiving_number,
product_name: this.receivingInfo.creator_name
}
});
break;
case "cancel": case "cancel":
this.cancel(); this.showCancelConfirm = true;
this.speakMessage('请确认作废');
break;
} }
}, },
async completeReceiving() { async completeReceiving() {
@ -802,27 +838,13 @@
}); });
} }
}, },
confirmCancel() {
this.showCancelConfirm = false;
this.cancel();
},
async cancel() { async cancel() {
try { try {
this.speakMessage('请确认作废'); // 1. 显示加载状态
// 1. 显示确认弹窗
const confirmResult = await uni.showModal({
title: '整单作废',
content: '确定要作废当前收货单吗?此操作不可撤销。',
confirmText: '确定作废',
confirmColor: '#e64340',
cancelText: '再想想',
cancelColor: '#999'
});
console.log(confirmResult);
if (!confirmResult[1].confirm) {
this.showToastMessage('已取消', 'none', {
speak: false
});
return;
}
// 2. 显示加载状态
uni.showLoading({ uni.showLoading({
title: '正在作废...', title: '正在作废...',
mask: true mask: true
@ -1166,4 +1188,150 @@
} }
} }
} }
// 更多操作弹窗
.action-drawer {
padding: 20rpx 24rpx calc(24rpx + env(safe-area-inset-bottom));
background: #f8f9fa;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
overflow: hidden;
}
.action-drawer__header {
padding: 8rpx 0 32rpx;
text-align: center;
}
.action-drawer__title {
font-size: 40rpx;
font-weight: bold;
color: #303133;
}
.action-drawer__body {
display: flex;
flex-direction: column;
}
.action-drawer__item + .action-drawer__item {
margin-top: 20rpx;
}
.action-drawer__item {
background: #ffffff;
border-radius: 12rpx;
padding: 24rpx;
display: flex;
justify-content: center;
align-items: center;
}
.action-drawer__item:active {
opacity: 0.75;
}
.action-drawer__item--neutral {
background: #f5f7fa;
border: 1rpx solid #dcdfe6;
}
.action-drawer__item--neutral .action-drawer__item-text {
color: #606266;
}
.action-drawer__item--close {
background: #e4e7ed;
border: 1rpx solid #dcdfe6;
}
.action-drawer__item--close .action-drawer__item-text {
color: #606266;
}
.action-drawer__item--primary-outline {
background: #eaf2ff;
border: 1rpx solid #b8d4ff;
}
.action-drawer__item--danger-outline {
background: #fef0f0;
border: 1rpx solid #fbc4c4;
}
.action-drawer__item-text {
font-size: 38rpx;
color: #303133;
}
.action-drawer__item-text--primary {
color: #2979ff;
font-weight: bold;
}
.action-drawer__item-text--danger {
color: #f56c6c;
font-weight: bold;
}
// 整单作废确认弹窗
.cancel-confirm-popup {
width: 640rpx;
padding: 40rpx 32rpx 32rpx;
background: #ffffff;
border-radius: 20rpx;
box-sizing: border-box;
}
.cancel-confirm-popup__title {
font-size: 42rpx;
font-weight: bold;
color: #303133;
text-align: center;
margin-bottom: 32rpx;
}
.cancel-confirm-popup__body {
margin-bottom: 36rpx;
padding: 24rpx;
background: #f5f7fa;
border-radius: 12rpx;
}
.cancel-confirm-popup__text {
font-size: 36rpx;
color: #303133;
line-height: 1.6;
}
.cancel-confirm-popup__actions {
display: flex;
align-items: center;
}
.cancel-confirm-popup__btn {
flex: 1;
height: 88rpx;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 36rpx;
font-weight: 500;
}
.cancel-confirm-popup__btn + .cancel-confirm-popup__btn {
margin-left: 20rpx;
}
.cancel-confirm-popup__btn--cancel {
background: #f5f7fa;
color: #606266;
border: 1rpx solid #dcdfe6;
}
.cancel-confirm-popup__btn--confirm {
background: #f56c6c;
color: #ffffff;
}
</style> </style>