1058 lines
26 KiB
Vue
1058 lines
26 KiB
Vue
<template>
|
||
<view class="replenish-shorts-page">
|
||
<view class="status-bar"></view>
|
||
<view class="page-header">
|
||
<view class="header-side header-side--left">
|
||
<view class="header-side__btn" @click="handleBack">
|
||
<u-icon name="arrow-left" size="18" color="#303133"></u-icon>
|
||
</view>
|
||
<view class="header-side__btn header-side__btn--store" @click="openStoreDrawer">
|
||
<text class="header-side__btn-text">货主</text>
|
||
<view v-if="selectedStoreIds.length" class="header-side__btn-badge">{{ selectedStoreIds.length }}</view>
|
||
</view>
|
||
</view>
|
||
<text class="header-title">分拣缺货补货</text>
|
||
<view class="header-side header-side--right">
|
||
<view class="header-btn-refresh" @click="handleRefresh">刷新</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 汇总统计栏 -->
|
||
<view v-if="summary" class="summary-bar">
|
||
<view class="summary-bar__item">
|
||
<text class="summary-bar__item-label">SKU总数</text>
|
||
<text class="summary-bar__item-value">{{ getSummaryVal(summary.total_skus) }}</text>
|
||
</view>
|
||
<view class="summary-bar__item">
|
||
<text class="summary-bar__item-label">缺货SKU</text>
|
||
<text class="summary-bar__item-value summary-bar__item-value--warning">{{ getSummaryVal(summary.total_shortage_skus) }}</text>
|
||
</view>
|
||
<view class="summary-bar__item">
|
||
<text class="summary-bar__item-label">建议补货总量</text>
|
||
<text class="summary-bar__item-value summary-bar__item-value--primary">{{ formatQty(summary.total_replenishment_needed) }}</text>
|
||
</view>
|
||
<view class="summary-bar__item">
|
||
<text class="summary-bar__item-label">真实缺货SKU</text>
|
||
<text class="summary-bar__item-value summary-bar__item-value--danger">{{ getSummaryVal(summary.total_true_shortage_skus) }}</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 搜索框 -->
|
||
<view class="search-bar">
|
||
<view class="search-bar__input-wrap">
|
||
<u-icon name="search" size="20" color="#909399"></u-icon>
|
||
<input
|
||
class="search-bar__input"
|
||
type="text"
|
||
v-model="searchKeyword"
|
||
placeholder="输入商品名称/条码搜索..."
|
||
placeholder-style="color: #c0c4cc; font-size: 34rpx;"
|
||
confirm-type="search"
|
||
/>
|
||
<text v-if="searchKeyword" class="search-bar__clear" @click="searchKeyword = ''">
|
||
<u-icon name="close-circle-fill" size="20" color="#c0c4cc"></u-icon>
|
||
</text>
|
||
</view>
|
||
</view>
|
||
|
||
<view class="page-body">
|
||
<!-- 加载状态 -->
|
||
<view v-if="loading" class="loading-state">
|
||
<u-loading-icon mode="circle" size="36"></u-loading-icon>
|
||
<text class="loading-state__text">加载中...</text>
|
||
</view>
|
||
|
||
<!-- 空数据 -->
|
||
<view v-else-if="filteredList.length === 0" class="empty-card">
|
||
<u-icon name="info-circle" size="72" color="#c0c4cc"></u-icon>
|
||
<text class="empty-card__title">{{ list.length === 0 ? '暂无缺货数据' : '未找到匹配的商品' }}</text>
|
||
<text class="empty-card__desc">{{ list.length === 0 ? '当前仓库所有SKU分拣区库存充足,无需补货。' : '请尝试其他搜索关键词' }}</text>
|
||
</view>
|
||
|
||
<!-- 数据列表:卡片模式 -->
|
||
<scroll-view v-else class="card-scroll" scroll-y>
|
||
<view class="card-list">
|
||
<view
|
||
v-for="(item, index) in filteredList"
|
||
:key="item.stock_id || index"
|
||
class="card-item"
|
||
@click="goProductQuery(item)"
|
||
>
|
||
<!-- 卡片内容:标签名在左,数值在右,斑马纹 -->
|
||
<view class="card-item__body">
|
||
<view class="card-metric card-metric--0">
|
||
<text class="card-metric__label">SKU编码</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value card-metric__value--code">{{ item.stock_code || item.stock_id || '-' }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--1">
|
||
<text class="card-metric__label">缺货数</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value card-metric__value--danger">{{ formatQty(item.shortage) }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--0">
|
||
<text class="card-metric__label">补货状态</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value" :class="replenishStatusClass(item)">{{ replenishStatusText(item.replenishment_status) }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--1">
|
||
<text class="card-metric__label">商品名称</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value card-metric__value--name">{{ item.stock_name || '-' }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--0">
|
||
<text class="card-metric__label">货主名称</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value card-metric__value--name">{{ item.store_name || '-' }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--1">
|
||
<text class="card-metric__label">商品条码</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value card-metric__value--name">{{ formatBarcodes(item.barcodes) }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--0">
|
||
<text class="card-metric__label">出货数量</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value">{{ formatQty(item.total_demand) }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--1">
|
||
<text class="card-metric__label">分拣区数量</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value">{{ formatQty(item.pick_zone_quantity) }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--0">
|
||
<text class="card-metric__label">存储区数量</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value">{{ formatQty(item.storage_zone_quantity) }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--1">
|
||
<text class="card-metric__label">推荐补货量</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value card-metric__value--primary">{{ formatQty(item.replenishment_needed) }}</text>
|
||
</view>
|
||
<view class="card-metric card-metric--0">
|
||
<text class="card-metric__label">补货库位</text>
|
||
<view class="card-metric__divider"></view>
|
||
<text class="card-metric__value card-metric__value--spaces">
|
||
<text
|
||
v-for="(loc, i) in item.replenishment_locations || []"
|
||
:key="i"
|
||
class="card-metric__value--spaces-item"
|
||
>
|
||
<text v-if="i > 0" class="card-metric__value--spaces-sep">、</text>{{ formatSpaceLabel(loc) }}<text class="card-metric__value--spaces-qty">({{ loc.available_quantity }})</text>
|
||
</text>
|
||
<text v-if="!item.replenishment_locations || item.replenishment_locations.length === 0">-</text>
|
||
</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 底部安全区 -->
|
||
<view class="safe-area-bottom"></view>
|
||
</scroll-view>
|
||
|
||
<!-- 底部统计栏 -->
|
||
<view v-if="summary" class="bottom-bar">
|
||
<view class="bottom-bar__pagination">
|
||
<template v-if="hasSearch">
|
||
<text class="bottom-bar__text">共 {{ filteredList.length }} 条(搜索结果)</text>
|
||
</template>
|
||
<template v-else>
|
||
<view
|
||
class="pagination-btn"
|
||
:class="{ 'pagination-btn--disabled': page <= 1 }"
|
||
@click="goPrevPage"
|
||
>
|
||
上一页
|
||
</view>
|
||
<text class="bottom-bar__text">
|
||
第 {{ page }}/{{ totalPages }} 页,共 {{ getSummaryVal(summary.total_skus) }} 条
|
||
</text>
|
||
<view
|
||
class="pagination-btn"
|
||
:class="{ 'pagination-btn--disabled': page >= totalPages }"
|
||
@click="goNextPage"
|
||
>
|
||
下一页
|
||
</view>
|
||
</template>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 货主抽屉弹窗 -->
|
||
<view class="store-drawer-layer">
|
||
<u-popup :show="storeDrawerVisible" mode="left" :closeable="false" border-radius="0" :safeAreaInsetTop="true" bg-color="transparent" @close="handleStoreDrawerClose">
|
||
<view class="store-drawer">
|
||
<view class="store-drawer__header">
|
||
<text class="store-drawer__title">选择货主</text>
|
||
<view class="store-drawer__close" @click="handleStoreDrawerClose">
|
||
<u-icon name="close" color="#909399" size="18"></u-icon>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 搜索框 -->
|
||
<view class="store-drawer__search">
|
||
<u-input
|
||
v-model="storeSearchText"
|
||
placeholder="输入货主名称搜索"
|
||
:border="'none'"
|
||
prefixIcon="search"
|
||
prefixIconStyle="color: #909399; font-size: 18px"
|
||
clearable
|
||
></u-input>
|
||
</view>
|
||
|
||
<view v-if="storeLoading" class="store-drawer__loading">
|
||
<u-loading-icon mode="circle" size="28"></u-loading-icon>
|
||
<text class="store-drawer__loading-text">加载中...</text>
|
||
</view>
|
||
<scroll-view v-else class="store-drawer__list" scroll-y>
|
||
<view
|
||
v-for="store in filteredStores"
|
||
:key="getStoreId(store)"
|
||
class="store-drawer__item"
|
||
:class="{ 'store-drawer__item--active': isStoreSelected(store) }"
|
||
@click="toggleStore(store)"
|
||
>
|
||
<text class="store-drawer__item-name">{{ getStoreName(store) }}</text>
|
||
<u-icon v-if="isStoreSelected(store)" name="checkbox-mark" color="#07c160" size="20"></u-icon>
|
||
</view>
|
||
<u-empty v-if="filteredStores.length === 0" mode="data" text="暂无货主"></u-empty>
|
||
</scroll-view>
|
||
|
||
<!-- 底部操作栏 -->
|
||
<view class="store-drawer__footer">
|
||
<view class="store-drawer__footer-info">
|
||
<text class="store-drawer__footer-text">已选 {{ pendingSelectedStoreIds.length }} 个货主</text>
|
||
<text v-if="pendingSelectedStoreIds.length" class="store-drawer__footer-clear" @click="clearStoreSelection">清空</text>
|
||
</view>
|
||
<view class="store-drawer__footer-btns">
|
||
<view class="store-drawer__footer-btn store-drawer__footer-btn--reset" @click="resetStoreSelection">重置</view>
|
||
<view class="store-drawer__footer-btn store-drawer__footer-btn--confirm" @click="applyStoreSelection">确定</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</u-popup>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
export default {
|
||
data() {
|
||
return {
|
||
loading: false,
|
||
list: [],
|
||
summary: null,
|
||
total: 0,
|
||
page: 1,
|
||
pageSize: 20,
|
||
storeDrawerVisible: false,
|
||
storeList: [],
|
||
storeLoading: false,
|
||
storeSearchText: '',
|
||
selectedStoreIds: [],
|
||
pendingSelectedStoreIds: [],
|
||
searchKeyword: '',
|
||
sort: {
|
||
sortField: 'shortage',
|
||
sortOrder: 'DESC'
|
||
}
|
||
};
|
||
},
|
||
computed: {
|
||
totalPages() {
|
||
return Math.max(1, Math.ceil(this.total / this.pageSize));
|
||
},
|
||
hasSearch() {
|
||
return Boolean(this.searchKeyword.trim());
|
||
},
|
||
filteredList() {
|
||
const keyword = this.searchKeyword.trim();
|
||
if (!keyword) {
|
||
return this.list;
|
||
}
|
||
const kw = keyword.toLowerCase();
|
||
return this.list.filter(item => {
|
||
const name = String(item.stock_name || '').toLowerCase();
|
||
if (name.includes(kw)) return true;
|
||
const barcodes = Array.isArray(item.barcodes) ? item.barcodes : [];
|
||
return barcodes.some(b => {
|
||
const code = String(b.barcode || b.code || b.custom_code || '').toLowerCase();
|
||
return code.includes(kw);
|
||
});
|
||
});
|
||
},
|
||
filteredStores() {
|
||
const keyword = String(this.storeSearchText || '').trim().toLowerCase();
|
||
if (!keyword) {
|
||
return this.storeList;
|
||
}
|
||
return this.storeList.filter(store => {
|
||
const name = String(this.getStoreName(store) || '').toLowerCase();
|
||
return name.includes(keyword);
|
||
});
|
||
}
|
||
},
|
||
onLoad() {
|
||
this.safeDispatchBroadcast('setCallbacks', {
|
||
onResult: this.handleBroadcastResult
|
||
});
|
||
this.safeDispatchBroadcast('start');
|
||
this.fetchData();
|
||
},
|
||
onShow() {
|
||
this.safeDispatchBroadcast('setCallbacks', {
|
||
onResult: this.handleBroadcastResult
|
||
});
|
||
this.safeDispatchBroadcast('resume');
|
||
},
|
||
onHide() {
|
||
this.safeDispatchBroadcast('pause');
|
||
},
|
||
onUnload() {
|
||
this.safeDispatchBroadcast('stop');
|
||
},
|
||
methods: {
|
||
safeDispatchBroadcast(action, payload) {
|
||
try {
|
||
const task = this.$store.dispatch(`broadcast/${action}`, payload);
|
||
if (task && typeof task.catch === 'function') {
|
||
task.catch(error => {
|
||
console.warn(`[ReplenishShorts] broadcast/${action} 调用失败:`, error);
|
||
});
|
||
}
|
||
} catch (error) {
|
||
console.warn(`[ReplenishShorts] broadcast/${action} 调用异常:`, error);
|
||
}
|
||
},
|
||
normalizeUniScanResult(scanResult) {
|
||
if (!scanResult) {
|
||
return '';
|
||
}
|
||
if (typeof scanResult === 'string') {
|
||
return scanResult.trim();
|
||
}
|
||
if (typeof scanResult.result === 'string') {
|
||
return scanResult.result.trim();
|
||
}
|
||
if (Array.isArray(scanResult.result)) {
|
||
const firstResult = scanResult.result.find(item => item);
|
||
if (typeof firstResult === 'string') {
|
||
return firstResult.trim();
|
||
}
|
||
if (firstResult && typeof firstResult.data === 'string') {
|
||
return firstResult.data.trim();
|
||
}
|
||
}
|
||
if (typeof scanResult.data === 'string') {
|
||
return scanResult.data.trim();
|
||
}
|
||
return '';
|
||
},
|
||
handleBroadcastResult(result) {
|
||
const rawCode = this.normalizeUniScanResult(result);
|
||
if (!rawCode) {
|
||
return;
|
||
}
|
||
this.searchKeyword = rawCode;
|
||
},
|
||
goProductQuery(item) {
|
||
const keyword = item.stock_name || item.stock_code || item.stock_id || '';
|
||
const stockId = item.stock_id || '';
|
||
uni.setStorageSync('replenish_query_keyword', keyword);
|
||
uni.navigateTo({
|
||
url: `/pages/work/product/query?stock_id=${encodeURIComponent(stockId)}`
|
||
});
|
||
},
|
||
async openStoreDrawer() {
|
||
this.storeDrawerVisible = true;
|
||
this.pendingSelectedStoreIds = [...this.selectedStoreIds];
|
||
if (this.storeList.length > 0 || this.storeLoading) return;
|
||
this.storeLoading = true;
|
||
try {
|
||
const res = await this.$http('common.store', {});
|
||
this.storeList = Array.isArray(res && res.stores) ? res.stores : [];
|
||
} catch (error) {
|
||
console.error('[replenishShorts] 加载货主失败:', error);
|
||
uni.showToast({ title: error?.message || error?.msg || '加载货主失败', icon: 'none' });
|
||
} finally {
|
||
this.storeLoading = false;
|
||
}
|
||
},
|
||
getStoreId(store) {
|
||
return store?.value ?? store?.id ?? store?.store_id ?? store?.storeId;
|
||
},
|
||
getStoreName(store) {
|
||
return store?.label || store?.name || store?.store_name || '-';
|
||
},
|
||
isStoreSelected(store) {
|
||
const id = this.getStoreId(store);
|
||
if (id === undefined || id === null) return false;
|
||
return this.pendingSelectedStoreIds.some(sel => String(sel) === String(id));
|
||
},
|
||
toggleStore(store) {
|
||
const id = this.getStoreId(store);
|
||
if (id === undefined || id === null) return;
|
||
const index = this.pendingSelectedStoreIds.findIndex(sel => String(sel) === String(id));
|
||
if (index >= 0) {
|
||
this.pendingSelectedStoreIds.splice(index, 1);
|
||
} else {
|
||
this.pendingSelectedStoreIds.push(id);
|
||
}
|
||
},
|
||
clearStoreSelection() {
|
||
this.pendingSelectedStoreIds = [];
|
||
},
|
||
resetStoreSelection() {
|
||
this.pendingSelectedStoreIds = [];
|
||
this.storeSearchText = '';
|
||
},
|
||
applyStoreSelection() {
|
||
this.selectedStoreIds = [...this.pendingSelectedStoreIds];
|
||
this.storeDrawerVisible = false;
|
||
this.page = 1;
|
||
this.list = [];
|
||
this.fetchData();
|
||
},
|
||
handleStoreDrawerClose() {
|
||
this.storeDrawerVisible = false;
|
||
},
|
||
handleBack() {
|
||
uni.navigateBack({ delta: 1 });
|
||
},
|
||
handleRefresh() {
|
||
this.page = 1;
|
||
this.list = [];
|
||
this.fetchData();
|
||
uni.showToast({ title: '已刷新', icon: 'none' });
|
||
},
|
||
goNextPage() {
|
||
if (this.page >= this.totalPages || this.loading) return;
|
||
this.page += 1;
|
||
this.fetchData();
|
||
},
|
||
goPrevPage() {
|
||
if (this.page <= 1 || this.loading) return;
|
||
this.page -= 1;
|
||
this.fetchData();
|
||
},
|
||
getSummaryVal(val) {
|
||
return val ?? 0;
|
||
},
|
||
formatSpaceLabel(loc) {
|
||
return loc.space_name || loc.name || loc.custom_name || loc.space_code || '-';
|
||
},
|
||
formatBarcodes(barcodes) {
|
||
if (!Array.isArray(barcodes) || barcodes.length === 0) return '-';
|
||
return barcodes.map(b => b.barcode || b.code || b.custom_code || '').filter(Boolean).join('、');
|
||
},
|
||
replenishStatusText(status) {
|
||
const map = {
|
||
true_shortage: '真实缺货',
|
||
replenishable: '可补货'
|
||
};
|
||
return map[status] || status || '-';
|
||
},
|
||
replenishStatusClass(item) {
|
||
const status = item.replenishment_status;
|
||
if (status === 'replenishable') {
|
||
return 'card-metric__value--primary';
|
||
}
|
||
if (status === 'true_shortage') {
|
||
return 'card-metric__value--danger';
|
||
}
|
||
return '';
|
||
},
|
||
formatQty(val) {
|
||
const num = Number(val);
|
||
return isNaN(num) ? '-' : num.toLocaleString();
|
||
},
|
||
async fetchData() {
|
||
this.loading = true;
|
||
|
||
try {
|
||
const params = {
|
||
pagination: {
|
||
page: this.page,
|
||
pageSize: this.pageSize
|
||
},
|
||
sort: {
|
||
sortField: this.sort.sortField,
|
||
sortOrder: this.sort.sortOrder
|
||
}
|
||
};
|
||
if (this.selectedStoreIds.length > 0) {
|
||
params.store_id = this.selectedStoreIds.map(id => Number(id));
|
||
}
|
||
|
||
const res = await this.$http('storage.management.replenishmentDemand', params);
|
||
|
||
this.list = Array.isArray(res.list) ? res.list : [];
|
||
this.total = Number(res.pagination?.total ?? this.list.length);
|
||
this.summary = res.summary ?? null;
|
||
} catch (error) {
|
||
console.error('[replenishShorts] 请求失败:', error);
|
||
uni.showToast({
|
||
title: error?.message || error?.msg || '请求失败',
|
||
icon: 'none'
|
||
});
|
||
this.list = [];
|
||
this.total = 0;
|
||
} finally {
|
||
this.loading = false;
|
||
}
|
||
}
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.replenish-shorts-page {
|
||
height: 100vh;
|
||
display: flex;
|
||
flex-direction: column;
|
||
background: #f5f7fa;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.status-bar {
|
||
height: var(--status-bar-height);
|
||
background: #ffffff;
|
||
}
|
||
|
||
.page-header {
|
||
height: 88rpx;
|
||
padding: 0 24rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
background: #ffffff;
|
||
border-bottom: 1rpx solid #ebeef5;
|
||
box-sizing: border-box;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.header-side {
|
||
min-width: 112rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.header-side--left {
|
||
justify-content: flex-start;
|
||
}
|
||
|
||
.header-side__btn {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6rpx;
|
||
padding: 12rpx 16rpx;
|
||
border-radius: 8rpx;
|
||
background: #f5f7fa;
|
||
}
|
||
|
||
.header-side__btn--store {
|
||
background: #07c160;
|
||
padding: 12rpx 28rpx;
|
||
margin-left: 32rpx;
|
||
}
|
||
|
||
.header-side__btn--store .header-side__btn-text {
|
||
color: #ffffff;
|
||
font-size: 30rpx;
|
||
}
|
||
|
||
.header-side__btn-badge {
|
||
min-width: 28rpx;
|
||
height: 28rpx;
|
||
padding: 0 6rpx;
|
||
border-radius: 14rpx;
|
||
background: #ff4d4f;
|
||
color: #ffffff;
|
||
font-size: 20rpx;
|
||
line-height: 28rpx;
|
||
text-align: center;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.header-side__btn-text {
|
||
font-size: 26rpx;
|
||
color: #303133;
|
||
line-height: 1;
|
||
}
|
||
|
||
.header-side--right {
|
||
justify-content: flex-end;
|
||
}
|
||
|
||
.header-title {
|
||
flex: 1;
|
||
padding: 0 16rpx;
|
||
font-size: 32rpx;
|
||
font-weight: bold;
|
||
color: #333;
|
||
text-align: center;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
}
|
||
|
||
.header-action-text {
|
||
margin-left: 8rpx;
|
||
font-size: 28rpx;
|
||
color: #303133;
|
||
line-height: 1;
|
||
}
|
||
|
||
.header-btn-refresh {
|
||
padding: 14rpx 28rpx;
|
||
background: #2979ff;
|
||
color: #ffffff;
|
||
font-size: 30rpx;
|
||
border-radius: 8rpx;
|
||
line-height: 1;
|
||
}
|
||
|
||
/* ===== 汇总统计栏 ===== */
|
||
.summary-bar {
|
||
display: flex;
|
||
align-items: stretch;
|
||
padding: 16rpx 16rpx;
|
||
background: #ffffff;
|
||
border-bottom: 1rpx solid #ebeef5;
|
||
gap: 8rpx;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.summary-bar__item {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 6rpx;
|
||
padding: 12rpx 8rpx;
|
||
background: #f5f7fa;
|
||
border-radius: 12rpx;
|
||
}
|
||
|
||
.summary-bar__item-value {
|
||
font-size: 36rpx;
|
||
font-weight: 700;
|
||
color: #303133;
|
||
line-height: 1.2;
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
|
||
.summary-bar__item-value--danger {
|
||
color: #f56c6c;
|
||
}
|
||
|
||
.summary-bar__item-value--primary {
|
||
color: #2979ff;
|
||
}
|
||
|
||
.summary-bar__item-value--warning {
|
||
color: #e6a23c;
|
||
}
|
||
|
||
.summary-bar__item-label {
|
||
font-size: 22rpx;
|
||
color: #909399;
|
||
line-height: 1;
|
||
}
|
||
|
||
/* ===== 搜索框 ===== */
|
||
.search-bar {
|
||
padding: 12rpx 16rpx;
|
||
background: #ffffff;
|
||
border-bottom: 1rpx solid #ebeef5;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.search-bar__input-wrap {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 16rpx;
|
||
padding: 20rpx 24rpx;
|
||
background: #f5f7fa;
|
||
border-radius: 12rpx;
|
||
}
|
||
|
||
.search-bar__input {
|
||
flex: 1;
|
||
font-size: 34rpx;
|
||
color: #303133;
|
||
height: 48rpx;
|
||
line-height: 48rpx;
|
||
padding: 0;
|
||
background: transparent;
|
||
border: none;
|
||
outline: none;
|
||
}
|
||
|
||
.search-bar__clear {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 6rpx;
|
||
}
|
||
|
||
/* ===== 页面主体 ===== */
|
||
.page-body {
|
||
flex: 1;
|
||
min-height: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
padding: 0;
|
||
}
|
||
|
||
.loading-state {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 120rpx 0;
|
||
gap: 24rpx;
|
||
}
|
||
|
||
.loading-state__text {
|
||
font-size: 28rpx;
|
||
color: #909399;
|
||
}
|
||
|
||
.empty-card {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 120rpx 48rpx;
|
||
gap: 24rpx;
|
||
}
|
||
|
||
.empty-card__title {
|
||
font-size: 32rpx;
|
||
font-weight: 500;
|
||
color: #303133;
|
||
}
|
||
|
||
.empty-card__desc {
|
||
font-size: 26rpx;
|
||
color: #909399;
|
||
text-align: center;
|
||
line-height: 1.6;
|
||
}
|
||
|
||
/* ===== 卡片列表 ===== */
|
||
.card-scroll {
|
||
flex: 1;
|
||
min-height: 0;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.card-list {
|
||
padding: 16rpx;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.card-item {
|
||
background: #ffffff;
|
||
border-radius: 16rpx;
|
||
padding: 24rpx 20rpx;
|
||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.04);
|
||
}
|
||
|
||
.card-item__body {
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.card-metric {
|
||
display: flex;
|
||
align-items: center;
|
||
padding: 18rpx 16rpx;
|
||
}
|
||
|
||
.card-metric--1 {
|
||
background: #f0f2f5;
|
||
border-radius: 6rpx;
|
||
}
|
||
|
||
.card-metric__label {
|
||
font-size: 30rpx;
|
||
color: #303133;
|
||
line-height: 1;
|
||
flex-shrink: 0;
|
||
width: 150rpx;
|
||
}
|
||
|
||
.card-metric__divider {
|
||
width: 2rpx;
|
||
height: 28rpx;
|
||
background: #e4e7ed;
|
||
flex-shrink: 0;
|
||
margin: 0 16rpx;
|
||
}
|
||
|
||
.card-metric__value {
|
||
font-size: 32rpx;
|
||
font-weight: 600;
|
||
color: #303133;
|
||
line-height: 1.4;
|
||
font-variant-numeric: tabular-nums;
|
||
text-align: left;
|
||
flex: 1;
|
||
min-width: 0;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.card-metric__value--code {
|
||
font-weight: 700;
|
||
font-size: 34rpx;
|
||
}
|
||
|
||
.card-metric__value--name {
|
||
font-weight: 400;
|
||
font-size: 30rpx;
|
||
color: #303133;
|
||
}
|
||
|
||
.card-metric__value--danger {
|
||
background-color: #f56c6c;
|
||
color: #ffffff;
|
||
padding: 18rpx 12rpx;
|
||
margin: -18rpx 0;
|
||
border-radius: 0 6rpx 6rpx 0;
|
||
}
|
||
|
||
.card-metric__value--primary {
|
||
color: #2979ff;
|
||
}
|
||
|
||
.card-metric__value--warning {
|
||
color: #e6a23c;
|
||
}
|
||
|
||
.card-metric__value--spaces {
|
||
font-weight: 400;
|
||
color: #303133;
|
||
max-width: 60%;
|
||
white-space: normal;
|
||
word-break: break-all;
|
||
line-height: 1.4;
|
||
font-size: 28rpx;
|
||
}
|
||
|
||
.card-metric__value--spaces-qty {
|
||
font-weight: 700;
|
||
}
|
||
|
||
/* ===== 加载更多 ===== */
|
||
.loadmore-state {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 24rpx 0;
|
||
gap: 12rpx;
|
||
}
|
||
|
||
.loadmore-state__text {
|
||
font-size: 24rpx;
|
||
color: #909399;
|
||
}
|
||
|
||
.no-more-tip {
|
||
padding: 24rpx 0;
|
||
text-align: center;
|
||
}
|
||
|
||
.no-more-tip__text {
|
||
font-size: 24rpx;
|
||
color: #c0c4cc;
|
||
}
|
||
|
||
.safe-area-bottom {
|
||
height: 20rpx;
|
||
}
|
||
|
||
/* ===== 底部统计栏 ===== */
|
||
.bottom-bar {
|
||
flex-shrink: 0;
|
||
padding: 24rpx 24rpx;
|
||
background: #ffffff;
|
||
border-top: 1rpx solid #ebeef5;
|
||
}
|
||
|
||
.bottom-bar__pagination {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 24rpx;
|
||
}
|
||
|
||
.bottom-bar__text {
|
||
font-size: 26rpx;
|
||
color: #909399;
|
||
}
|
||
|
||
.pagination-btn {
|
||
padding: 18rpx 36rpx;
|
||
font-size: 30rpx;
|
||
color: #2979ff;
|
||
background: #f0f5ff;
|
||
border-radius: 8rpx;
|
||
line-height: 1;
|
||
transition: opacity 0.2s;
|
||
}
|
||
|
||
.pagination-btn--disabled {
|
||
color: #c0c4cc;
|
||
background: #f5f7fa;
|
||
}
|
||
|
||
/* ===== 货主抽屉 ===== */
|
||
.store-drawer-layer {
|
||
position: fixed;
|
||
top: 0;
|
||
left: 0;
|
||
width: 0;
|
||
height: 0;
|
||
overflow: visible;
|
||
z-index: 9999;
|
||
}
|
||
|
||
.store-drawer {
|
||
width: 560rpx;
|
||
height: calc(100vh - var(--status-bar-height));
|
||
display: flex;
|
||
flex-direction: column;
|
||
background: #ffffff;
|
||
}
|
||
|
||
.store-drawer__header {
|
||
height: 88rpx;
|
||
padding: 0 32rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
border-bottom: 1rpx solid #ebeef5;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.store-drawer__close {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 8rpx;
|
||
}
|
||
|
||
.store-drawer__title {
|
||
font-size: 32rpx;
|
||
font-weight: bold;
|
||
color: #303133;
|
||
}
|
||
|
||
.store-drawer__loading {
|
||
flex: 1;
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.store-drawer__loading-text {
|
||
font-size: 26rpx;
|
||
color: #909399;
|
||
}
|
||
|
||
.store-drawer__list {
|
||
flex: 1;
|
||
min-height: 0;
|
||
}
|
||
|
||
.store-drawer__search {
|
||
padding: 16rpx 24rpx;
|
||
border-bottom: 1rpx solid #f0f2f5;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.store-drawer__item {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 16rpx;
|
||
padding: 28rpx 32rpx;
|
||
border-bottom: 1rpx solid #f0f2f5;
|
||
}
|
||
|
||
.store-drawer__item--active {
|
||
background: #f0f9f0;
|
||
}
|
||
|
||
.store-drawer__item-name {
|
||
font-size: 30rpx;
|
||
color: #303133;
|
||
line-height: 1.4;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.store-drawer__footer {
|
||
flex-shrink: 0;
|
||
padding: 20rpx 24rpx;
|
||
border-top: 1rpx solid #ebeef5;
|
||
background: #ffffff;
|
||
}
|
||
|
||
.store-drawer__footer-info {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 16rpx;
|
||
}
|
||
|
||
.store-drawer__footer-text {
|
||
font-size: 26rpx;
|
||
color: #909399;
|
||
}
|
||
|
||
.store-drawer__footer-clear {
|
||
font-size: 26rpx;
|
||
color: #2979ff;
|
||
}
|
||
|
||
.store-drawer__footer-btns {
|
||
display: flex;
|
||
gap: 16rpx;
|
||
}
|
||
|
||
.store-drawer__footer-btn {
|
||
flex: 1;
|
||
height: 72rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
border-radius: 8rpx;
|
||
font-size: 30rpx;
|
||
line-height: 1;
|
||
}
|
||
|
||
.store-drawer__footer-btn--reset {
|
||
background: #f5f7fa;
|
||
color: #606266;
|
||
}
|
||
|
||
.store-drawer__footer-btn--confirm {
|
||
background: #07c160;
|
||
color: #ffffff;
|
||
}
|
||
</style> |