feat(首页): 欢迎语新增未领料波次并优化公告条与通知弹窗
- 新增未领料波次字段(order.wave.confirmPrintUnclaimedWaveCount), 仅当同时拥有「领取快递面单」与「订单拣货」菜单时展示 - 顶部公告条改为自定义无缝滚动,消除首尾空白 - 「看板统计」弹窗更名为「通知信息」,调大字体并修复3列布局
This commit is contained in:
parent
c443f7ccae
commit
7070aac1ca
@ -9,11 +9,21 @@
|
||||
<text class="org-name">{{ userInfo.store_name || '选择主体' }}</text>
|
||||
<text class="org-id">{{ userInfo.employees_name || '---' }}</text>
|
||||
</view>
|
||||
<u-icon @click="showStoreSelector" name="arrow-down" size="16" color="#666" v-if="userInfo.employees && userInfo.employees.length > 1"></u-icon>
|
||||
<u-icon class="org-arrow" @click="showStoreSelector" name="arrow-down" size="16" color="#666" v-if="userInfo.employees && userInfo.employees.length > 1"></u-icon>
|
||||
<view class="news-wrapper" @click="openNoticePopup">
|
||||
<u-notice-bar :text="noticeText" mode="horizontal" bg-color="transparent" color="#666"
|
||||
:font-size="12" :padding="0" :radius="0" :volume-icon="false" :more-icon="false" :speed="60"
|
||||
:height="30" :autoplay="true"></u-notice-bar>
|
||||
<view class="news-pill">
|
||||
<view class="news-pill__icon">
|
||||
<u-icon name="bell-fill" size="14" color="#2979ff"></u-icon>
|
||||
</view>
|
||||
<view class="news-pill__body">
|
||||
<view class="news-marquee">
|
||||
<view class="news-marquee__track" :style="{ animationDuration: marqueeDuration }">
|
||||
<text class="news-marquee__text">{{ noticeText }}</text>
|
||||
<text class="news-marquee__text">{{ noticeText }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@ -137,11 +147,11 @@
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 看板统计弹窗 -->
|
||||
<!-- 通知信息弹窗 -->
|
||||
<u-popup :show="showNoticePopup" mode="bottom" round="20" :closeable="true" :safeAreaInsetBottom="true" @close="closeNoticePopup">
|
||||
<view class="notice-popup">
|
||||
<view class="notice-popup__header">
|
||||
<text class="notice-popup__title">看板统计</text>
|
||||
<text class="notice-popup__title">通知信息</text>
|
||||
</view>
|
||||
<scroll-view scroll-y class="notice-popup__body">
|
||||
<view class="notice-popup__grid">
|
||||
@ -173,6 +183,8 @@
|
||||
dashboardStats: null,
|
||||
hasReviewShippingMenu: false,
|
||||
hasOrderPickingMenu: false,
|
||||
hasClaimShippingMenu: false,
|
||||
unclaimedWaveCount: 0,
|
||||
showNoticePopup: false,
|
||||
unreadCount: 0,
|
||||
quickActions: [],
|
||||
@ -291,35 +303,57 @@
|
||||
|
||||
noticeText() {
|
||||
const stats = this.dashboardStats || null;
|
||||
if (!stats || (!this.hasReviewShippingMenu && !this.hasOrderPickingMenu)) {
|
||||
const showUnclaimed = this.hasClaimShippingMenu && this.hasOrderPickingMenu;
|
||||
if (!stats && !showUnclaimed) {
|
||||
return '欢迎使用PDA仓库管理系统';
|
||||
}
|
||||
|
||||
const parts = [];
|
||||
parts.push(`今日订单 ${this.formatStatNumber(stats.todayOrders)}`);
|
||||
if (this.hasOrderPickingMenu) {
|
||||
parts.push(`未拣货 ${this.formatStatNumber(stats.unpickedOrders)}`);
|
||||
if (stats) {
|
||||
parts.push(`今日订单 ${this.formatStatNumber(stats.todayOrders)}`);
|
||||
}
|
||||
if (this.hasReviewShippingMenu) {
|
||||
parts.push(`已复核 ${this.formatStatNumber(stats.recheckedOrders)}`);
|
||||
if (showUnclaimed) {
|
||||
parts.push(`未领料波次 ${this.formatStatNumber(this.unclaimedWaveCount)}`);
|
||||
}
|
||||
return parts.join(',');
|
||||
if (stats) {
|
||||
if (showUnclaimed) {
|
||||
parts.push(`未拣货 ${this.formatStatNumber(stats.unpickedOrders)}`);
|
||||
}
|
||||
if (this.hasReviewShippingMenu) {
|
||||
parts.push(`已复核 ${this.formatStatNumber(stats.recheckedOrders)}`);
|
||||
}
|
||||
}
|
||||
return parts.length ? parts.join(',') : '欢迎使用PDA仓库管理系统';
|
||||
},
|
||||
|
||||
// 滚动时长:按文字长度估算,保证滚动速度稳定
|
||||
marqueeDuration() {
|
||||
const len = String(this.noticeText || '').length;
|
||||
return `${Math.max(8, len * 0.4)}s`;
|
||||
},
|
||||
|
||||
noticeStatItems() {
|
||||
const stats = this.dashboardStats || null;
|
||||
if (!stats || (!this.hasReviewShippingMenu && !this.hasOrderPickingMenu)) {
|
||||
const showUnclaimed = this.hasClaimShippingMenu && this.hasOrderPickingMenu;
|
||||
if (!stats && !showUnclaimed) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const f = this.formatStatNumber;
|
||||
const items = [];
|
||||
items.push({ label: '今日订单', value: f(stats.todayOrders) });
|
||||
if (this.hasOrderPickingMenu) {
|
||||
items.push({ label: '未拣货', value: f(stats.unpickedOrders) });
|
||||
if (stats) {
|
||||
items.push({ label: '今日订单', value: f(stats.todayOrders) });
|
||||
}
|
||||
if (this.hasReviewShippingMenu) {
|
||||
items.push({ label: '已复核', value: f(stats.recheckedOrders) });
|
||||
if (showUnclaimed) {
|
||||
items.push({ label: '未领料波次', value: f(this.unclaimedWaveCount) });
|
||||
}
|
||||
if (stats) {
|
||||
if (showUnclaimed) {
|
||||
items.push({ label: '未拣货', value: f(stats.unpickedOrders) });
|
||||
}
|
||||
if (this.hasReviewShippingMenu) {
|
||||
items.push({ label: '已复核', value: f(stats.recheckedOrders) });
|
||||
}
|
||||
}
|
||||
return items;
|
||||
}
|
||||
@ -513,6 +547,7 @@
|
||||
async loadUserInfo() {
|
||||
await this.refreshQuickActions();
|
||||
await this.loadDashboardStats();
|
||||
await this.loadUnclaimedWaveCount();
|
||||
},
|
||||
|
||||
// 刷新快捷入口
|
||||
@ -573,7 +608,7 @@
|
||||
}
|
||||
},
|
||||
|
||||
// 根据用户菜单识别看板相关功能(复核发货 / 订单拣货)
|
||||
// 根据用户菜单识别看板相关功能(复核发货 / 订单拣货 / 领取快递面单)
|
||||
detectDashboardMenus(actions) {
|
||||
const list = Array.isArray(actions) ? actions.filter(Boolean) : [];
|
||||
this.hasReviewShippingMenu = list.some(item => {
|
||||
@ -586,6 +621,10 @@
|
||||
const name = this.sanitizeText(item?.name);
|
||||
return name === '订单拣货' || (name.includes('订单') && name.includes('拣货'));
|
||||
});
|
||||
this.hasClaimShippingMenu = list.some(item => {
|
||||
const name = this.sanitizeText(item?.name);
|
||||
return name === '领取快递面单' || (name.includes('领取') && name.includes('面单'));
|
||||
});
|
||||
},
|
||||
|
||||
// 加载仓库/货主看板统计
|
||||
@ -608,6 +647,33 @@
|
||||
}
|
||||
},
|
||||
|
||||
// 加载「未领料波次」数量(order.wave.confirmPrintUnclaimedWaveCount)
|
||||
// 仅同时拥有「领取快递面单」与「订单拣货」菜单时展示
|
||||
async loadUnclaimedWaveCount() {
|
||||
if (!this.hasClaimShippingMenu || !this.hasOrderPickingMenu) {
|
||||
this.unclaimedWaveCount = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await this.$http(
|
||||
'order.wave.confirmPrintUnclaimedWaveCount',
|
||||
{},
|
||||
'',
|
||||
false
|
||||
);
|
||||
const data = (res && res.data && typeof res.data === 'object' && !Array.isArray(res.data))
|
||||
? res.data
|
||||
: {};
|
||||
const payload = { ...(res || {}), ...data };
|
||||
const count = Number(payload.count);
|
||||
this.unclaimedWaveCount = Number.isFinite(count) ? count : 0;
|
||||
} catch (error) {
|
||||
console.warn('[index] 未领料波次数量加载失败:', error);
|
||||
this.unclaimedWaveCount = 0;
|
||||
}
|
||||
},
|
||||
|
||||
formatStatNumber(value) {
|
||||
const num = Number(value);
|
||||
return Number.isFinite(num) ? num : '--';
|
||||
@ -1426,11 +1492,15 @@
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.org-arrow {
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
|
||||
.org-info {
|
||||
flex: 0 0 auto;
|
||||
max-width: 40%;
|
||||
min-width: 0;
|
||||
margin-right: 40rpx;
|
||||
margin-right: 70rpx;
|
||||
|
||||
.org-name {
|
||||
font-size: 28rpx;
|
||||
@ -1458,9 +1528,53 @@
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
|
||||
::v-deep .u-notice-bar {
|
||||
height: 30rpx !important;
|
||||
line-height: 30rpx !important;
|
||||
.news-pill {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 52rpx;
|
||||
padding: 0 18rpx;
|
||||
background: transparent;
|
||||
border: 1rpx solid #e3edff;
|
||||
border-radius: 8rpx;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
|
||||
&__icon {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
&__body {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
|
||||
.news-marquee {
|
||||
width: 100%;
|
||||
height: 52rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
|
||||
&__track {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
white-space: nowrap;
|
||||
will-change: transform;
|
||||
animation: news-marquee-scroll 12s linear infinite;
|
||||
}
|
||||
|
||||
&__text {
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
padding-right: 60rpx;
|
||||
font-size: 24rpx;
|
||||
color: #2979ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1486,6 +1600,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 顶部公告无缝滚动
|
||||
@keyframes news-marquee-scroll {
|
||||
from {
|
||||
transform: translateX(0);
|
||||
}
|
||||
to {
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
// 主滚动区域
|
||||
.main-scroll {
|
||||
flex: 1;
|
||||
@ -1887,10 +2011,12 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 24rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 32rpx;
|
||||
font-size: 38rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
@ -1908,23 +2034,25 @@
|
||||
&__item {
|
||||
width: calc(33.333% - 24rpx);
|
||||
margin: 12rpx;
|
||||
background: #f5f6f8;
|
||||
border-radius: 12rpx;
|
||||
padding: 24rpx 12rpx;
|
||||
background: #f6f8fb;
|
||||
border-radius: 16rpx;
|
||||
padding: 32rpx 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
|
||||
}
|
||||
|
||||
&__value {
|
||||
font-size: 34rpx;
|
||||
font-size: 44rpx;
|
||||
font-weight: 600;
|
||||
color: #2979ff;
|
||||
margin-bottom: 8rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 22rpx;
|
||||
font-size: 34rpx;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user