0510刘付明仁提交,优化散单策略列表和团购策略列表,和拣货列表,拣货列表尚未完成。
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
2d6ffc0451
commit
c8a3344b7a
@ -203,6 +203,12 @@ export default {
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
},
|
||||
getBarcodes: {
|
||||
path: "stock.warehouse.getBarcodes",
|
||||
auth: true,
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
},
|
||||
saveWarehouseStock: {
|
||||
path: "stock.warehouse.saveWarehouseStock",
|
||||
auth: true,
|
||||
@ -218,6 +224,12 @@ export default {
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
},
|
||||
wavePickTaskDetail: {
|
||||
path: "pick.wavePickTaskDetail",
|
||||
auth: true,
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
},
|
||||
items: {
|
||||
path: "pick.items",
|
||||
auth: true,
|
||||
@ -238,6 +250,12 @@ export default {
|
||||
auth: true,
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
},
|
||||
waveStrategyFetchPda: {
|
||||
path: "order.wave.waveStrategyFetchPda",
|
||||
auth: true,
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -163,6 +163,13 @@
|
||||
"titleNView": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/work/storage/gBWaveStrategy",
|
||||
"style" :
|
||||
{
|
||||
"titleNView": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/work/order/scatter-picking-detail",
|
||||
"style" :
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -2,9 +2,6 @@
|
||||
<view class="scatter-wave-page">
|
||||
<view class="normar_container">
|
||||
<page-nav :title="title">
|
||||
<template #right>
|
||||
<view class="nav-right-pending">待处理{{ pendingCount }}</view>
|
||||
</template>
|
||||
</page-nav>
|
||||
|
||||
<view class="content-layout">
|
||||
@ -18,18 +15,46 @@
|
||||
<view class="top-module">
|
||||
<view class="content-card content-card--detail">
|
||||
<view class="card-title">{{ currentStrategy.strategyName }}</view>
|
||||
<view class="card-row"><text class="value shentong-e-value">申通E</text></view>
|
||||
<view class="card-row"><text class="label">货主:</text><text class="value">{{ currentStrategy.ownerText }}</text></view>
|
||||
<view class="card-row"><text class="label">订单小于SKU数:</text><text class="value">{{ currentStrategy.orderMaxSku }}个</text></view>
|
||||
<view class="card-row"><text class="label">订单最小SKU数:</text><text class="value">{{ currentStrategy.orderMinSku }}个</text></view>
|
||||
<view class="card-row"><text class="label">订单最大商品数:</text><text class="value">{{ currentStrategy.orderMaxQty }}个</text></view>
|
||||
<view class="card-row"><text class="label">订单最小商品数:</text><text class="value">{{ currentStrategy.orderMinQty }}个</text></view>
|
||||
<view class="card-row"><text class="label">拣货类型:</text><text class="value">{{ currentStrategy.pickTypeText }}</text></view>
|
||||
<view class="card-row card-row--inline-group">
|
||||
<view class="group-item"><text class="label">订单快递限制:</text><text class="value">{{ currentStrategy.expressLimitText }}</text></view>
|
||||
<view class="group-item"><text class="label">订单平台限制:</text><text class="value">{{ currentStrategy.platformLimitText }}</text></view>
|
||||
<view class="card-row"><text class="label">创建人:</text><text class="value">{{ currentStrategy.creatorName }}</text></view>
|
||||
<view class="card-row"><text class="label">匹配订单:</text><text class="value">{{ currentStrategy.matchedOrderCountFiltered }}</text></view>
|
||||
<view class="card-row"><text class="label">SKU区间:</text><text class="value">{{ currentStrategy.orderMinSku }} - {{ currentStrategy.orderMaxSku }}</text></view>
|
||||
<view class="card-row"><text class="label">件数区间:</text><text class="value">{{ currentStrategy.orderMinQty }} - {{ currentStrategy.orderMaxQty }}</text></view>
|
||||
<view class="card-row"><text class="label">同结构区间:</text><text class="value">{{ currentStrategy.minSameStructure }} - {{ currentStrategy.maxSameStructure }}</text></view>
|
||||
<view class="card-row"><text class="label">策略类型:</text><text class="value">{{ currentStrategy.strategyTypeText }}</text></view>
|
||||
<view class="card-row card-row--inline-tag">
|
||||
<text class="label">分批模式:</text>
|
||||
<view v-if="currentStrategy.batchModeText" class="batch-mode-tag">{{ currentStrategy.batchModeText }}</view>
|
||||
<text v-else class="value">{{ currentStrategy.batchMode }}</text>
|
||||
</view>
|
||||
<view class="card-grid">
|
||||
<view class="group-item">
|
||||
<text class="label">货主限制:</text>
|
||||
<view class="limit-brief" :class="{ 'limit-brief--disabled': !hasLimitList(currentStrategy.ownerLimitList) }" @click="openLimitPopup('货主限制', currentStrategy.ownerLimitList)">
|
||||
<text class="value limit-brief__text">{{ getLimitFirst(currentStrategy.ownerLimitList) }}</text>
|
||||
<text v-if="hasLimitList(currentStrategy.ownerLimitList)" class="limit-brief__plus">+</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group-item">
|
||||
<text class="label">订单快递限制:</text>
|
||||
<view class="limit-brief" :class="{ 'limit-brief--disabled': !hasLimitList(currentStrategy.expressLimitList) }" @click="openLimitPopup('订单快递限制', currentStrategy.expressLimitList)">
|
||||
<text class="value limit-brief__text">{{ getLimitFirst(currentStrategy.expressLimitList) }}</text>
|
||||
<text v-if="hasLimitList(currentStrategy.expressLimitList)" class="limit-brief__plus">+</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group-item">
|
||||
<text class="label">省份限制:</text>
|
||||
<view class="limit-brief" :class="{ 'limit-brief--disabled': !hasLimitList(currentStrategy.provinceLimitList) }" @click="openLimitPopup('省份限制', currentStrategy.provinceLimitList)">
|
||||
<text class="value limit-brief__text">{{ getLimitFirst(currentStrategy.provinceLimitList) }}</text>
|
||||
<text v-if="hasLimitList(currentStrategy.provinceLimitList)" class="limit-brief__plus">+</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group-item">
|
||||
<text class="label">订单平台限制:</text>
|
||||
<view class="limit-brief" :class="{ 'limit-brief--disabled': !hasLimitList(currentStrategy.platformLimitList) }" @click="openLimitPopup('订单平台限制', currentStrategy.platformLimitList)">
|
||||
<text class="value limit-brief__text">{{ getLimitFirst(currentStrategy.platformLimitList) }}</text>
|
||||
<text v-if="hasLimitList(currentStrategy.platformLimitList)" class="limit-brief__plus">+</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-row card-row--inline-group">
|
||||
<view class="group-item"><text class="label">按货主分组:</text><text class="value">{{ currentStrategy.groupByOwnerText }}</text></view>
|
||||
<view class="group-item"><text class="label">按快递分组:</text><text class="value">{{ currentStrategy.groupByExpressText }}</text></view>
|
||||
</view>
|
||||
@ -37,34 +62,77 @@
|
||||
</view>
|
||||
|
||||
<view class="bottom-module">
|
||||
<scroll-view class="grid-scroll" scroll-y>
|
||||
<view class="strategy-grid-container">
|
||||
<view class="strategy-grid-wrapper" @touchstart="handleGridTouchStart" @touchmove="handleGridTouchMove" @touchend="handleGridTouchEnd" @touchcancel="handleGridTouchEnd">
|
||||
<view class="grid-wrap">
|
||||
<view v-for="slot in currentPageSlots" :key="slot.key" class="pick-slot">
|
||||
<view
|
||||
v-for="item in strategyList"
|
||||
:key="item.id"
|
||||
v-if="slot.item"
|
||||
class="pick-card"
|
||||
:class="{ 'pick-card--active': currentStrategyId === item.id }"
|
||||
@click="selectStrategy(item)"
|
||||
:class="{ 'pick-card--active': currentStrategyId === slot.item.id }"
|
||||
@click="selectStrategy(slot.item)"
|
||||
>
|
||||
<view class="pick-card__top">
|
||||
<text class="pick-card__tag-left">申通E</text>
|
||||
<text class="pick-card__tag-right">{{ item.ownerText }}</text>
|
||||
<view class="pick-card__title-marquee">
|
||||
<u-notice-bar
|
||||
:text="slot.item.strategyName || '--'"
|
||||
mode="horizontal"
|
||||
bg-color="#19be6b"
|
||||
color="#ffffff"
|
||||
:volume-icon="false"
|
||||
:more-icon="false"
|
||||
:speed="60"
|
||||
:padding="0"
|
||||
:radius="0"
|
||||
:autoplay="true"
|
||||
></u-notice-bar>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pick-card__main">
|
||||
<text class="pick-card__num">{{ item.orderMaxQty }}</text>
|
||||
<text class="pick-card__num">{{ slot.item.matchedOrderCountFiltered }}</text>
|
||||
</view>
|
||||
<view class="pick-card__bottom">{{ item.pickTypeText }}</view>
|
||||
<view class="pick-card__bottom">抓:{{ slot.item.nextFetchOrderCount }}</view>
|
||||
</view>
|
||||
<view v-else class="pick-card pick-card--empty"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="safe-area-bottom"></view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pagination-bar">
|
||||
<view class="pagination-btn" :class="{ 'pagination-btn--disabled': currentPage === 1 }" @click="prevPage">上一页</view>
|
||||
<view class="pagination-current">{{ currentPage }}/{{ totalPages }}</view>
|
||||
<input
|
||||
v-model="pageJumpInput"
|
||||
class="pagination-input"
|
||||
type="number"
|
||||
placeholder="页码"
|
||||
confirm-type="go"
|
||||
@confirm="jumpToPage"
|
||||
/>
|
||||
<view class="pagination-btn pagination-btn--primary" @click="jumpToPage">跳转</view>
|
||||
<view class="pagination-btn" :class="{ 'pagination-btn--disabled': currentPage === totalPages }" @click="nextPage">下一页</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
<view class="bottom-action-bar">
|
||||
<u-button @click="handleRefresh">刷新</u-button>
|
||||
<u-button type="primary" :customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff' }" @click="handleGrabScatter">抓取散单({{ grabCount }})个</u-button>
|
||||
<u-button type="primary" :loading="creatingTask" :disabled="creatingTask" :customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff' }" @click="handleGrabScatter">抓取散单</u-button>
|
||||
</view>
|
||||
|
||||
<view v-if="limitPopup.visible" class="limit-popup-mask" @click="closeLimitPopup">
|
||||
<view class="limit-popup-panel" @click.stop>
|
||||
<view class="limit-popup-title">{{ limitPopup.title }}</view>
|
||||
<scroll-view class="limit-popup-list" scroll-y>
|
||||
<view v-for="(item, index) in limitPopup.items" :key="`${limitPopup.title}-${index}`" class="limit-popup-item">{{ item }}</view>
|
||||
<view v-if="!limitPopup.items.length" class="limit-popup-empty">暂无数据</view>
|
||||
</scroll-view>
|
||||
<view class="limit-popup-footer">
|
||||
<u-button size="mini" @click="closeLimitPopup">关闭</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -74,10 +142,24 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '散单待拣货列表',
|
||||
pendingCount: 50,
|
||||
grabCount: 5,
|
||||
title: '散单拣货策略',
|
||||
paginationTotal: null,
|
||||
loading: false,
|
||||
creatingTask: false,
|
||||
currentPage: 1,
|
||||
pageJumpInput: '',
|
||||
pageSize: 8,
|
||||
gridGesture: {
|
||||
startX: 0,
|
||||
startY: 0,
|
||||
deltaX: 0,
|
||||
deltaY: 0
|
||||
},
|
||||
limitPopup: {
|
||||
visible: false,
|
||||
title: '',
|
||||
items: []
|
||||
},
|
||||
currentStrategyId: '',
|
||||
strategyList: []
|
||||
};
|
||||
@ -85,19 +167,208 @@
|
||||
computed: {
|
||||
currentStrategy() {
|
||||
return this.strategyList.find(item => String(item.id) === String(this.currentStrategyId)) || this.strategyList[0] || {};
|
||||
},
|
||||
totalPages() {
|
||||
const total = Number(this.paginationTotal || 0);
|
||||
const pageSize = Number(this.pageSize || 8);
|
||||
return Math.max(1, Math.ceil(total / pageSize));
|
||||
},
|
||||
currentPageSlots() {
|
||||
return Array.from({ length: this.pageSize }, (_, index) => {
|
||||
const item = this.strategyList[index] || null;
|
||||
return {
|
||||
index,
|
||||
item,
|
||||
key: item ? `strategy-${item.id}` : `empty-${this.currentPage}-${index}`
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.loadStrategyList();
|
||||
},
|
||||
methods: {
|
||||
normalizeLimitList(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return value
|
||||
.map(item => String(item || '').trim())
|
||||
.filter(Boolean);
|
||||
}
|
||||
if (value == null || value === '') {
|
||||
return [];
|
||||
}
|
||||
if (typeof value === 'string') {
|
||||
const text = value.trim();
|
||||
if (!text || text === '--') {
|
||||
return [];
|
||||
}
|
||||
if (text.includes('、')) {
|
||||
return text.split('、').map(item => item.trim()).filter(Boolean);
|
||||
}
|
||||
return [text];
|
||||
}
|
||||
return [String(value)];
|
||||
},
|
||||
hasLimitList(value) {
|
||||
return this.normalizeLimitList(value).length > 0;
|
||||
},
|
||||
getLimitFirst(value) {
|
||||
const list = this.normalizeLimitList(value);
|
||||
return list.length ? list[0] : '--';
|
||||
},
|
||||
openLimitPopup(title, value) {
|
||||
const list = this.normalizeLimitList(value);
|
||||
if (!list.length) {
|
||||
return;
|
||||
}
|
||||
this.limitPopup = {
|
||||
visible: true,
|
||||
title,
|
||||
items: list
|
||||
};
|
||||
},
|
||||
closeLimitPopup() {
|
||||
this.limitPopup.visible = false;
|
||||
},
|
||||
syncPageJumpInput() {
|
||||
this.pageJumpInput = String(this.currentPage || 1);
|
||||
},
|
||||
ensureCurrentPageInRange() {
|
||||
if (this.currentPage > this.totalPages) {
|
||||
this.currentPage = this.totalPages;
|
||||
}
|
||||
if (this.currentPage < 1) {
|
||||
this.currentPage = 1;
|
||||
}
|
||||
this.syncPageJumpInput();
|
||||
},
|
||||
prevPage() {
|
||||
if (this.currentPage > 1) {
|
||||
this.currentPage -= 1;
|
||||
this.loadStrategyList();
|
||||
}
|
||||
this.syncPageJumpInput();
|
||||
},
|
||||
nextPage() {
|
||||
if (this.currentPage < this.totalPages) {
|
||||
this.currentPage += 1;
|
||||
this.loadStrategyList();
|
||||
}
|
||||
this.syncPageJumpInput();
|
||||
},
|
||||
jumpToPage() {
|
||||
const targetPage = Number(this.pageJumpInput);
|
||||
if (!Number.isInteger(targetPage) || targetPage < 1) {
|
||||
this.syncPageJumpInput();
|
||||
return;
|
||||
}
|
||||
this.currentPage = Math.min(targetPage, this.totalPages);
|
||||
this.loadStrategyList();
|
||||
this.syncPageJumpInput();
|
||||
},
|
||||
handleGridTouchStart(event) {
|
||||
const touch = event?.changedTouches?.[0] || event?.touches?.[0];
|
||||
if (!touch) {
|
||||
return;
|
||||
}
|
||||
this.gridGesture.startX = touch.clientX;
|
||||
this.gridGesture.startY = touch.clientY;
|
||||
this.gridGesture.deltaX = 0;
|
||||
this.gridGesture.deltaY = 0;
|
||||
},
|
||||
handleGridTouchMove(event) {
|
||||
const touch = event?.changedTouches?.[0] || event?.touches?.[0];
|
||||
if (!touch) {
|
||||
return;
|
||||
}
|
||||
this.gridGesture.deltaX = touch.clientX - this.gridGesture.startX;
|
||||
this.gridGesture.deltaY = touch.clientY - this.gridGesture.startY;
|
||||
},
|
||||
handleGridTouchEnd() {
|
||||
const absX = Math.abs(this.gridGesture.deltaX);
|
||||
const absY = Math.abs(this.gridGesture.deltaY);
|
||||
if (absX > 60 && absX > absY) {
|
||||
if (this.gridGesture.deltaX > 0) {
|
||||
this.prevPage();
|
||||
} else {
|
||||
this.nextPage();
|
||||
}
|
||||
}
|
||||
this.gridGesture.deltaX = 0;
|
||||
this.gridGesture.deltaY = 0;
|
||||
},
|
||||
getApiErrorMessage(error, fallback = '请求失败') {
|
||||
const message = error?.message || error?.msg || error?.errMsg || error?.data?.message;
|
||||
return String(message || fallback);
|
||||
},
|
||||
buildWaveStrategyListParams() {
|
||||
extractFetchTaskPayload(response) {
|
||||
const candidates = [
|
||||
response?.data?.data,
|
||||
response?.data,
|
||||
response?.result,
|
||||
response
|
||||
];
|
||||
for (let i = 0; i < candidates.length; i += 1) {
|
||||
const current = candidates[i];
|
||||
if (current && typeof current === 'object' && !Array.isArray(current)) {
|
||||
return current;
|
||||
}
|
||||
}
|
||||
return {};
|
||||
},
|
||||
buildFetchTaskErrorMessage(payload, fallback = '创建抓取任务失败') {
|
||||
const validationErrors = Array.isArray(payload?.validation_errors) ? payload.validation_errors : [];
|
||||
if (validationErrors.length) {
|
||||
const firstError = validationErrors[0] || {};
|
||||
const field = String(firstError.field || '').trim();
|
||||
const message = String(firstError.message || '').trim();
|
||||
if (field && message) {
|
||||
return `${field}: ${message}`;
|
||||
}
|
||||
if (message) {
|
||||
return message;
|
||||
}
|
||||
}
|
||||
const rawMessage = payload?.message || payload?.msg || payload?.error_message || payload?.error;
|
||||
return String(rawMessage || fallback);
|
||||
},
|
||||
buildFetchTaskParams() {
|
||||
const strategyId = Number(this.currentStrategy?.id || 0);
|
||||
return {
|
||||
strategy_id: strategyId,
|
||||
strategyId,
|
||||
source: 'pda',
|
||||
operation_source: 'pda'
|
||||
};
|
||||
},
|
||||
buildPickingRouteParams(payload) {
|
||||
const taskId = payload?.task_id ?? payload?.taskId;
|
||||
const params = [];
|
||||
if (taskId != null && taskId !== '') {
|
||||
params.push(`taskId=${encodeURIComponent(String(taskId))}`);
|
||||
}
|
||||
return params;
|
||||
},
|
||||
routeToPickingPage(payload) {
|
||||
const params = this.buildPickingRouteParams(payload);
|
||||
const query = params.length ? `?${params.join('&')}` : '';
|
||||
this.$tools.routerTo(`/pages/work/order/picking${query}`);
|
||||
},
|
||||
buildWaveStrategyListParams() {
|
||||
return {
|
||||
calculate_next_fetch_order_count: 1,
|
||||
where: {
|
||||
strategy_type: 1
|
||||
},
|
||||
pagination: {
|
||||
page: Number(this.currentPage || 1),
|
||||
pageSize: Number(this.pageSize || 8)
|
||||
}
|
||||
};
|
||||
},
|
||||
extractPagination(payload, response) {
|
||||
return payload?.pagination || payload?.page || response?.data?.pagination || response?.pagination || null;
|
||||
},
|
||||
extractWaveStrategyPayload(response) {
|
||||
const candidates = [
|
||||
response?.data?.data,
|
||||
@ -134,45 +405,75 @@
|
||||
const normalized = Number(value) === 1 || value === true;
|
||||
return normalized ? '是' : '否';
|
||||
},
|
||||
normalizeStrategyTypeText(value) {
|
||||
const type = Number(value);
|
||||
if (type === 1) {
|
||||
return '散单';
|
||||
}
|
||||
if (type === 2) {
|
||||
return '团购';
|
||||
}
|
||||
return '--';
|
||||
},
|
||||
normalizeBatchModeText(value) {
|
||||
const map = {
|
||||
0: '团购',
|
||||
1: '单品单件',
|
||||
2: '先拣后分',
|
||||
3: '边拣边分',
|
||||
4: '边拣边分H型',
|
||||
5: '播种墙',
|
||||
6: '流利架'
|
||||
};
|
||||
if (value == null || value === '') {
|
||||
return '--';
|
||||
}
|
||||
return map[Number(value)] ?? String(value);
|
||||
},
|
||||
normalizeLimitText(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return value.length ? value.join('、') : '不限';
|
||||
return value.length ? value.join('、') : '--';
|
||||
}
|
||||
if (value == null || value === '') {
|
||||
return '不限';
|
||||
return '--';
|
||||
}
|
||||
if (typeof value === 'string') {
|
||||
return value.trim() ? value : '不限';
|
||||
return value.trim() ? value : '--';
|
||||
}
|
||||
return String(value);
|
||||
},
|
||||
normalizePickTypeText(item) {
|
||||
const type = Number(item?.strategy_type || 0);
|
||||
const mode = Number(item?.batch_mode || 0);
|
||||
if (mode === 1) {
|
||||
return 'E型';
|
||||
}
|
||||
if (type === 1) {
|
||||
return 'F型';
|
||||
}
|
||||
return '未知';
|
||||
},
|
||||
normalizeWaveStrategyItem(item) {
|
||||
const source = item && typeof item === 'object' ? item : {};
|
||||
const ownerText = this.normalizeLimitText(source.allowed_owners);
|
||||
const ownerLimitList = this.normalizeLimitList(source.allowed_owners);
|
||||
const expressLimitList = this.normalizeLimitList(source.allowed_expresses);
|
||||
const provinceLimitList = this.normalizeLimitList(source.allowed_provinces);
|
||||
const platformLimitList = this.normalizeLimitList(source.allowed_platforms);
|
||||
return {
|
||||
id: source.id || Math.random().toString(36).slice(2),
|
||||
strategyName: source.strategy_name || '--',
|
||||
ownerText,
|
||||
id: source.id ?? '',
|
||||
strategyName: source.strategy_name || '',
|
||||
strategyType: source.strategy_type ?? '--',
|
||||
strategyTypeText: this.normalizeStrategyTypeText(source.strategy_type),
|
||||
batchMode: source.batch_mode ?? '--',
|
||||
batchModeText: this.normalizeBatchModeText(source.batch_mode),
|
||||
creatorName: source.creator_name || '--',
|
||||
ownerLimitList,
|
||||
expressLimitList,
|
||||
provinceLimitList,
|
||||
platformLimitList,
|
||||
ownerText: ownerLimitList.length ? ownerLimitList.join('、') : '--',
|
||||
orderMaxSku: Number(source.order_max_sku || 0),
|
||||
orderMinSku: Number(source.order_min_sku || 0),
|
||||
orderMaxQty: Number(source.order_max_qty || 0),
|
||||
orderMinQty: Number(source.order_min_qty || 0),
|
||||
expressLimitText: this.normalizeLimitText(source.allowed_expresses),
|
||||
platformLimitText: this.normalizeLimitText(source.allowed_platforms),
|
||||
minSameStructure: Number(source.min_same_structure || 0),
|
||||
maxSameStructure: Number(source.max_same_structure || 0),
|
||||
matchedOrderCountFiltered: Number(source.matched_order_count_filtered || 0),
|
||||
nextFetchOrderCount: Number(source.next_fetch_order_count || 0),
|
||||
expressLimitText: expressLimitList.length ? expressLimitList.join('、') : '--',
|
||||
provinceLimitText: provinceLimitList.length ? provinceLimitList.join('、') : '--',
|
||||
platformLimitText: platformLimitList.length ? platformLimitList.join('、') : '--',
|
||||
groupByOwnerText: this.normalizeBooleanText(source.allow_cross_owner),
|
||||
groupByExpressText: this.normalizeBooleanText(source.require_same_express),
|
||||
pickTypeText: this.normalizePickTypeText(source)
|
||||
groupByExpressText: this.normalizeBooleanText(source.require_same_express)
|
||||
};
|
||||
},
|
||||
parseWaveStrategyResponse(response) {
|
||||
@ -189,7 +490,7 @@
|
||||
handleRefresh() {
|
||||
this.loadStrategyList();
|
||||
},
|
||||
handleGrabScatter() {
|
||||
async handleGrabScatter() {
|
||||
if (!this.currentStrategy || !this.currentStrategy.id) {
|
||||
uni.showToast({
|
||||
title: '请先选择策略',
|
||||
@ -197,15 +498,45 @@
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.creatingTask) {
|
||||
return;
|
||||
}
|
||||
|
||||
const params = [
|
||||
`strategyId=${encodeURIComponent(String(this.currentStrategy.id || ''))}`,
|
||||
`strategyName=${encodeURIComponent(String(this.currentStrategy.strategyName || '--'))}`,
|
||||
`ownerText=${encodeURIComponent(String(this.currentStrategy.ownerText || '--'))}`,
|
||||
`pickTypeText=${encodeURIComponent(String(this.currentStrategy.pickTypeText || '--'))}`,
|
||||
`grabCount=${encodeURIComponent(String(this.grabCount || 0))}`
|
||||
];
|
||||
this.$tools.routerTo(`/pages/work/order/scatter-picking-detail?${params.join('&')}`);
|
||||
this.creatingTask = true;
|
||||
try {
|
||||
const fetchParams = this.buildFetchTaskParams();
|
||||
const response = await this.$http('order.wave.waveStrategyFetchPda', fetchParams);
|
||||
const payload = this.extractFetchTaskPayload(response);
|
||||
const taskId = payload?.task_id ?? payload?.taskId;
|
||||
const state = String(payload?.state || '').toLowerCase();
|
||||
if (taskId != null && taskId !== '') {
|
||||
this.routeToPickingPage(payload);
|
||||
return;
|
||||
}
|
||||
if (state === 'created') {
|
||||
this.routeToPickingPage(payload);
|
||||
return;
|
||||
}
|
||||
if (payload?.can_enter_pick_flow === true || payload?.canEnterPickFlow === true) {
|
||||
this.routeToPickingPage(payload);
|
||||
return;
|
||||
}
|
||||
if (state !== 'created') {
|
||||
uni.showToast({
|
||||
title: this.buildFetchTaskErrorMessage(payload, '创建抓取任务失败'),
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.routeToPickingPage(payload);
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: this.getApiErrorMessage(error, '创建抓取任务失败'),
|
||||
icon: 'none'
|
||||
});
|
||||
} finally {
|
||||
this.creatingTask = false;
|
||||
}
|
||||
},
|
||||
async loadStrategyList() {
|
||||
this.loading = true;
|
||||
@ -213,13 +544,21 @@
|
||||
const params = this.buildWaveStrategyListParams();
|
||||
const response = await this.$http('order.wave.waveStrategyList', params);
|
||||
const payload = this.extractWaveStrategyPayload(response);
|
||||
this.pendingCount = Number(payload?.pending_count ?? payload?.pendingCount ?? 50);
|
||||
this.strategyList = this.parseWaveStrategyResponse(response);
|
||||
const pagination = this.extractPagination(payload, response);
|
||||
const parsedList = this.parseWaveStrategyResponse(response);
|
||||
this.paginationTotal = Number(pagination?.total ?? parsedList.length ?? 0);
|
||||
this.currentPage = Number((pagination?.page ?? this.currentPage) || 1);
|
||||
this.pageSize = Number((pagination?.pageSize ?? this.pageSize) || 8);
|
||||
this.strategyList = parsedList;
|
||||
this.currentStrategyId = this.strategyList[0]?.id || '';
|
||||
this.ensureCurrentPageInRange();
|
||||
this.syncPageJumpInput();
|
||||
} catch (error) {
|
||||
this.pendingCount = 50;
|
||||
this.paginationTotal = null;
|
||||
this.currentStrategyId = '';
|
||||
this.strategyList = [];
|
||||
this.currentPage = 1;
|
||||
this.syncPageJumpInput();
|
||||
uni.showToast({
|
||||
title: this.getApiErrorMessage(error, '策略加载失败'),
|
||||
icon: 'none'
|
||||
@ -259,19 +598,44 @@
|
||||
background: #2979ff;
|
||||
}
|
||||
|
||||
.list-content {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.content-layout {
|
||||
height: calc(100vh - 170rpx - env(safe-area-inset-bottom));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20rpx 24rpx 120rpx;
|
||||
padding: 20rpx 24rpx 124rpx;
|
||||
background: #f3f4f6;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.summary-strip {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
column-gap: 12rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.summary-item {
|
||||
background: #ffffff;
|
||||
border-radius: 12rpx;
|
||||
padding: 10rpx 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4rpx;
|
||||
}
|
||||
|
||||
.summary-item__label {
|
||||
font-size: 22rpx;
|
||||
color: #909399;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.summary-item__value {
|
||||
font-size: 34rpx;
|
||||
line-height: 1.1;
|
||||
font-weight: 600;
|
||||
color: #1f2d3d;
|
||||
}
|
||||
|
||||
.top-module,
|
||||
.bottom-module {
|
||||
flex: 1;
|
||||
@ -279,24 +643,45 @@
|
||||
}
|
||||
|
||||
.top-module {
|
||||
padding-bottom: 10rpx;
|
||||
padding-bottom: 8rpx;
|
||||
flex: 0 0 50%;
|
||||
}
|
||||
|
||||
.bottom-module {
|
||||
padding-top: 10rpx;
|
||||
padding-top: 8rpx;
|
||||
flex: 0 0 50%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.grid-scroll {
|
||||
.strategy-grid-container {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.strategy-grid-wrapper {
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: 14rpx;
|
||||
padding: 10rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.grid-wrap {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
row-gap: 8rpx;
|
||||
column-gap: 16rpx;
|
||||
height: 100%;
|
||||
align-content: flex-start;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.pick-slot {
|
||||
width: 25%;
|
||||
height: 50%;
|
||||
padding: 4rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.content-card {
|
||||
@ -327,22 +712,65 @@
|
||||
line-height: 48rpx;
|
||||
}
|
||||
|
||||
.card-row--inline-tag {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.card-row--inline-group {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.group-item {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
background: #f7f8fa;
|
||||
border-radius: 10rpx;
|
||||
padding: 8rpx 10rpx;
|
||||
}
|
||||
|
||||
.group-item + .group-item {
|
||||
margin-left: 6rpx;
|
||||
.limit-brief {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 2rpx 0;
|
||||
}
|
||||
|
||||
.limit-brief--disabled {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.limit-brief__text {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding-right: 8rpx;
|
||||
}
|
||||
|
||||
.limit-brief__plus {
|
||||
flex: 0 0 auto;
|
||||
width: 28rpx;
|
||||
height: 28rpx;
|
||||
line-height: 28rpx;
|
||||
text-align: center;
|
||||
border-radius: 50%;
|
||||
background: #2979ff;
|
||||
color: #ffffff;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.card-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8rpx;
|
||||
margin-top: 8rpx;
|
||||
}
|
||||
|
||||
.group-item .label {
|
||||
width: auto;
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
@ -360,17 +788,26 @@
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.shentong-e-value {
|
||||
font-size: 32rpx;
|
||||
line-height: 46rpx;
|
||||
.batch-mode-tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 14rpx;
|
||||
height: 40rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #f0f2f5;
|
||||
color: #606266;
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.pick-card {
|
||||
width: calc(25% - 12rpx);
|
||||
height: 180rpx;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
border-radius: 14rpx;
|
||||
padding: 10rpx;
|
||||
padding: 8rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -385,6 +822,12 @@
|
||||
box-shadow: inset 0 0 0 6rpx #2979ff, 0 10rpx 24rpx rgba(41, 121, 255, 0.2);
|
||||
}
|
||||
|
||||
.pick-card--empty {
|
||||
background: #f8f9fb;
|
||||
border: 1rpx dashed #e7eaf0;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.pick-card__top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@ -392,29 +835,31 @@
|
||||
min-height: 34rpx;
|
||||
}
|
||||
|
||||
.pick-card__tag-left,
|
||||
.pick-card__tag-right {
|
||||
.pick-card__title-marquee {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
font-size: 22rpx;
|
||||
line-height: 30rpx;
|
||||
padding: 4rpx 14rpx 6rpx;
|
||||
background: #19be6b;
|
||||
color: #fff;
|
||||
max-width: 48%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.pick-card__tag-left {
|
||||
left: 0;
|
||||
clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);
|
||||
width: 100%;
|
||||
height: 40rpx;
|
||||
padding: 0 8rpx;
|
||||
box-sizing: border-box;
|
||||
background: #19be6b;
|
||||
border-bottom-right-radius: 12rpx;
|
||||
}
|
||||
|
||||
.pick-card__tag-right {
|
||||
right: 0;
|
||||
clip-path: polygon(14% 0, 100% 0, 100% 100%, 0 100%);
|
||||
::v-deep .pick-card__title-marquee .u-notice-bar {
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::v-deep .pick-card__title-marquee .u-notice__content__text {
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
::v-deep .pick-card__title-marquee .u-notice__left-icon,
|
||||
::v-deep .pick-card__title-marquee .u-notice__right-icon {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.pick-card__main {
|
||||
@ -425,7 +870,7 @@
|
||||
}
|
||||
|
||||
.pick-card__num {
|
||||
font-size: 40rpx;
|
||||
font-size: 36rpx;
|
||||
line-height: 1;
|
||||
font-weight: 700;
|
||||
color: #303133;
|
||||
@ -456,11 +901,64 @@
|
||||
padding: 2rpx 6rpx;
|
||||
}
|
||||
|
||||
.empty-wrap {
|
||||
min-height: 400rpx;
|
||||
.pagination-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
column-gap: 10rpx;
|
||||
margin-top: 10rpx;
|
||||
padding-top: 12rpx;
|
||||
}
|
||||
|
||||
.pagination-btn {
|
||||
min-width: 104rpx;
|
||||
height: 56rpx;
|
||||
padding: 0 16rpx;
|
||||
border-radius: 28rpx;
|
||||
background: #eef2f7;
|
||||
color: #3b4a5a;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.pagination-btn--primary {
|
||||
background: #2979ff;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.pagination-btn--disabled {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
.pagination-current {
|
||||
min-width: 92rpx;
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.pagination-input {
|
||||
width: 96rpx;
|
||||
height: 56rpx;
|
||||
background: #ffffff;
|
||||
border: 1rpx solid #dcdfe6;
|
||||
border-radius: 28rpx;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
color: #303133;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.empty-wrap {
|
||||
min-height: 460rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
border-radius: 14rpx;
|
||||
}
|
||||
|
||||
.empty-text {
|
||||
@ -468,10 +966,6 @@
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.safe-area-bottom {
|
||||
height: calc(20rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.bottom-action-bar {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
@ -485,4 +979,76 @@
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.limit-popup-mask {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.45);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 999;
|
||||
padding: 32rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.limit-popup-panel {
|
||||
width: 100%;
|
||||
max-width: 640rpx;
|
||||
max-height: 70vh;
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.limit-popup-title {
|
||||
padding: 22rpx 24rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
border-bottom: 1rpx solid #f0f2f5;
|
||||
}
|
||||
|
||||
.limit-popup-list {
|
||||
max-height: 52vh;
|
||||
padding: 8rpx 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.limit-popup-item {
|
||||
padding: 16rpx 24rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 40rpx;
|
||||
color: #303133;
|
||||
border-bottom: 1rpx solid #f7f7f8;
|
||||
}
|
||||
|
||||
.limit-popup-empty {
|
||||
padding: 36rpx 24rpx;
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.limit-popup-footer {
|
||||
padding: 16rpx 24rpx 20rpx;
|
||||
border-top: 1rpx solid #f0f2f5;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
@media (min-width: 960px) {
|
||||
.top-module {
|
||||
flex-basis: 42%;
|
||||
}
|
||||
|
||||
.bottom-module {
|
||||
flex-basis: 48%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
1054
pages/work/storage/gBWaveStrategy.vue
Normal file
1054
pages/work/storage/gBWaveStrategy.vue
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user