修改打包模块、散单、团购拣货详情
This commit is contained in:
parent
0431271fff
commit
b0abe2234e
@ -19,8 +19,7 @@
|
|||||||
<!-- 工作台绑定状态卡 -->
|
<!-- 工作台绑定状态卡 -->
|
||||||
<view class="state-card">
|
<view class="state-card">
|
||||||
<view class="state-badge">
|
<view class="state-badge">
|
||||||
<u-icon name="checkmark-circle" size="36rpx" color="#19be6b"></u-icon>
|
<text class="state-badge__text">{{ workbenchName || '工作台' }}</text>
|
||||||
<text class="state-badge__text">已绑定 · {{ workbenchName || '工作台' }}</text>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,27 @@
|
|||||||
</template>
|
</template>
|
||||||
</page-nav>
|
</page-nav>
|
||||||
|
|
||||||
|
<view class="search-filter">
|
||||||
|
<view class="search-box">
|
||||||
|
<view class="search-box-inner">
|
||||||
|
<u-search
|
||||||
|
v-model="keyword"
|
||||||
|
placeholder="请输入波次号"
|
||||||
|
:bg-color="'#f5f5f5'"
|
||||||
|
shape="round"
|
||||||
|
:show-action="false"
|
||||||
|
@search="handleSearch"
|
||||||
|
@clear="clearSearch"
|
||||||
|
></u-search>
|
||||||
|
<view class="search-actions">
|
||||||
|
<view class="search-btn" @click="handleSearch">
|
||||||
|
<text class="search-btn__text">搜索</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<scroll-view class="detail-scroll" scroll-y>
|
<scroll-view class="detail-scroll" scroll-y>
|
||||||
<view v-if="displayOrderList.length === 0" class="empty-state">
|
<view v-if="displayOrderList.length === 0" class="empty-state">
|
||||||
<u-icon name="list" size="86" color="#c0c4cc"></u-icon>
|
<u-icon name="list" size="86" color="#c0c4cc"></u-icon>
|
||||||
@ -16,8 +37,18 @@
|
|||||||
<view v-for="item in displayOrderList" :key="item.id" class="record-item" @click="handleWaveItemClick(item)">
|
<view v-for="item in displayOrderList" :key="item.id" class="record-item" @click="handleWaveItemClick(item)">
|
||||||
<view class="record-main">
|
<view class="record-main">
|
||||||
<view class="record-left">
|
<view class="record-left">
|
||||||
<view class="record-line"><text class="record-label">波次号:</text><text class="record-value">{{ item.waveNo || '--' }}</text></view>
|
<view class="record-line"><text class="record-value">{{ item.waveNo || '--' }}</text></view>
|
||||||
<view class="record-line"><text class="record-label">总订单数:</text><text class="record-value">{{ item.totalOrderCount }}</text><text class="record-logistics">{{ item.logisticsName || '--' }}</text></view>
|
<view class="record-line"><text class="record-value">{{ item.storeName || '--' }}</text></view>
|
||||||
|
<view class="record-line record-line--split">
|
||||||
|
<view class="record-half">
|
||||||
|
<text class="record-half-label">创建:</text>
|
||||||
|
<text class="record-half-value">{{ item.creator || '--' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="record-half">
|
||||||
|
<text class="record-half-label">总订单数:</text>
|
||||||
|
<text class="record-half-value">{{ item.totalOrderCount }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="record-line record-line--split">
|
<view class="record-line record-line--split">
|
||||||
<view class="record-half">
|
<view class="record-half">
|
||||||
<text class="record-half-label">库位:</text>
|
<text class="record-half-label">库位:</text>
|
||||||
@ -31,7 +62,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="record-right">
|
<view class="record-right">
|
||||||
<text class="record-count">{{ item.status === '已复核' ? '已复核' : '未复核' }} {{ item.pendingCount }}</text>
|
<text class="record-count">{{ item.status === '已复核' ? '已复核' : '未复核' }} {{ item.pendingCount }}</text>
|
||||||
<text class="record-status">{{ getStatusText(item.status) }}</text>
|
<text class="record-status-value" :class="{ 'record-status-value--success': item.pickAssignmentStatus === '已拣货' }">{{ item.pickAssignmentStatus || '--' }}</text>
|
||||||
|
<text class="record-status-value" :class="{ 'record-status-value--success': item.printAssignmentStatus === '已打印' }">{{ item.printAssignmentStatus || '--' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="record-footer" @click.stop>
|
<view class="record-footer" @click.stop>
|
||||||
@ -71,33 +103,29 @@
|
|||||||
<view class="print-popup-title">打印设置</view>
|
<view class="print-popup-title">打印设置</view>
|
||||||
<view class="print-row print-row--station">
|
<view class="print-row print-row--station">
|
||||||
<text class="print-label">打印台</text>
|
<text class="print-label">打印台</text>
|
||||||
<view class="print-picker" @click="togglePrintStationDropdown">
|
<view class="print-station-input-wrap">
|
||||||
<text class="print-picker-value">{{ printStationName || '--' }}</text>
|
<u-input
|
||||||
<u-icon :name="showPrintStationDropdown ? 'arrow-up' : 'arrow-down'" size="24" color="#909399"></u-icon>
|
v-model="printStationInputKeyword"
|
||||||
</view>
|
placeholder="请输入或扫描打印台编号"
|
||||||
<view v-if="showPrintStationDropdown" class="print-station-dropdown">
|
:clearable="true"
|
||||||
<view
|
:customStyle="{ fontSize: '28rpx', height: '80rpx', lineHeight: '80rpx', padding: '0 20rpx', background: '#fafafa', borderRadius: '10rpx' }"
|
||||||
v-for="station in printStationList"
|
@input="handlePrintStationInput"
|
||||||
:key="station.id"
|
@confirm="handlePrintStationInputConfirm"
|
||||||
class="print-station-option"
|
></u-input>
|
||||||
:class="{ 'print-station-option--active': station.id === printStationId }"
|
|
||||||
@click.stop="handlePrintStationSelect(station)"
|
|
||||||
>
|
|
||||||
{{ station.name }}
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="print-row print-row--action">
|
<view class="print-row print-row--action">
|
||||||
<text class="print-label">打印</text>
|
<text class="print-label">打印</text>
|
||||||
<u-button
|
<view class="print-action-wrap">
|
||||||
type="primary"
|
<u-button
|
||||||
size="mini"
|
type="primary"
|
||||||
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
|
size="mini"
|
||||||
@click="handleConfirmPrint"
|
:customStyle="{ backgroundColor: '#2979ff', borderColor: '#2979ff', fontSize: '26rpx', height: '64rpx', lineHeight: '64rpx', padding: '0 20rpx' }"
|
||||||
@tap="handleConfirmPrint"
|
@click="handleConfirmPrint"
|
||||||
>
|
>
|
||||||
打印
|
打印
|
||||||
</u-button>
|
</u-button>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="print-row print-row--message">
|
<view class="print-row print-row--message">
|
||||||
<text class="print-label">打印消息</text>
|
<text class="print-label">打印消息</text>
|
||||||
@ -115,13 +143,14 @@
|
|||||||
return {
|
return {
|
||||||
title: '团购拣货详情',
|
title: '团购拣货详情',
|
||||||
onlyMine: false,
|
onlyMine: false,
|
||||||
|
keyword: '',
|
||||||
currentUserId: '',
|
currentUserId: '',
|
||||||
grabCount: 0,
|
grabCount: 0,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
paginationTotal: 0,
|
paginationTotal: 0,
|
||||||
showPrintPopup: false,
|
showPrintPopup: false,
|
||||||
showPrintStationDropdown: false,
|
printStationInputKeyword: '',
|
||||||
printStationName: '--',
|
printStationName: '--',
|
||||||
printStationId: '',
|
printStationId: '',
|
||||||
printStationList: [],
|
printStationList: [],
|
||||||
@ -140,15 +169,53 @@
|
|||||||
return this.orderList;
|
return this.orderList;
|
||||||
}
|
}
|
||||||
return this.orderList.filter(item => item.isMine);
|
return this.orderList.filter(item => item.isMine);
|
||||||
|
},
|
||||||
|
currentUserName() {
|
||||||
|
const user = this.$store?.getters?.user || {};
|
||||||
|
const userInfo = this.$store?.getters?.userInfo || {};
|
||||||
|
const candidates = [
|
||||||
|
user?.employees_name,
|
||||||
|
user?.employee_name,
|
||||||
|
user?.real_name,
|
||||||
|
user?.name,
|
||||||
|
user?.username,
|
||||||
|
userInfo?.employees_name,
|
||||||
|
userInfo?.employee_name,
|
||||||
|
userInfo?.real_name,
|
||||||
|
userInfo?.name
|
||||||
|
];
|
||||||
|
for (let i = 0; i < candidates.length; i += 1) {
|
||||||
|
const value = String(candidates[i] || '').trim();
|
||||||
|
if (value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
|
this.safeDispatchBroadcast('setCallbacks', {
|
||||||
|
onResult: this.handleBroadcastResult
|
||||||
|
});
|
||||||
|
this.safeDispatchBroadcast('start');
|
||||||
this.currentUserId = String(this.$store?.getters?.user?.id || this.$store?.getters?.user?.user_id || '').trim();
|
this.currentUserId = String(this.$store?.getters?.user?.id || this.$store?.getters?.user?.user_id || '').trim();
|
||||||
const hasGrabCountParam = options && Object.prototype.hasOwnProperty.call(options, 'grabCount');
|
const hasGrabCountParam = options && Object.prototype.hasOwnProperty.call(options, 'grabCount');
|
||||||
const parsedGrabCount = Number(options?.grabCount || 0);
|
const parsedGrabCount = Number(options?.grabCount || 0);
|
||||||
this.grabCount = hasGrabCountParam ? Math.max(0, parsedGrabCount) : 6;
|
this.grabCount = hasGrabCountParam ? Math.max(0, parsedGrabCount) : 6;
|
||||||
this.loadBatchWaveNoList();
|
this.loadBatchWaveNoList();
|
||||||
},
|
},
|
||||||
|
onShow() {
|
||||||
|
this.safeDispatchBroadcast('setCallbacks', {
|
||||||
|
onResult: this.handleBroadcastResult
|
||||||
|
});
|
||||||
|
this.safeDispatchBroadcast('resume');
|
||||||
|
},
|
||||||
|
onHide() {
|
||||||
|
this.safeDispatchBroadcast('pause');
|
||||||
|
},
|
||||||
|
onUnload() {
|
||||||
|
this.safeDispatchBroadcast('stop');
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
normalizeReviewAssignmentStatus(status) {
|
normalizeReviewAssignmentStatus(status) {
|
||||||
const rawValue = status ?? '';
|
const rawValue = status ?? '';
|
||||||
@ -182,15 +249,20 @@
|
|||||||
return normalized || '未复核';
|
return normalized || '未复核';
|
||||||
},
|
},
|
||||||
buildBatchListParams(page = this.currentPage) {
|
buildBatchListParams(page = this.currentPage) {
|
||||||
|
const where = {
|
||||||
|
wave_type: 1
|
||||||
|
};
|
||||||
|
const keyword = this.normalizeKeyword(this.keyword);
|
||||||
|
if (keyword) {
|
||||||
|
where.wave_no = keyword;
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
pagination: {
|
pagination: {
|
||||||
page: Number(page || 1),
|
page: Number(page || 1),
|
||||||
pageSize: Number(this.pageSize || 20)
|
pageSize: Number(this.pageSize || 20)
|
||||||
},
|
},
|
||||||
only_todo: 1,
|
only_todo: 1,
|
||||||
where: {
|
where
|
||||||
wave_type: 1
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
extractPagination(payload, response) {
|
extractPagination(payload, response) {
|
||||||
@ -239,13 +311,15 @@
|
|||||||
const rowId = source.wave_id ?? source.waveId ?? source.id ?? waveNo;
|
const rowId = source.wave_id ?? source.waveId ?? source.id ?? waveNo;
|
||||||
const waveId = source.wave_id ?? source.waveId ?? source.id ?? '';
|
const waveId = source.wave_id ?? source.waveId ?? source.id ?? '';
|
||||||
const pickerName = String(source.picker_name || source.pickerName || source.user_name || source.userName || '--').trim() || '--';
|
const pickerName = String(source.picker_name || source.pickerName || source.user_name || source.userName || '--').trim() || '--';
|
||||||
const totalOrderCount = Number(source.total_order_count ?? source.totalOrderCount ?? source.order_count ?? source.orderCount ?? source.total_count ?? source.totalCount ?? source.order_num ?? source.orderNum ?? 0);
|
const totalOrderCount = Number(source.total_orders ?? source.totalOrders ?? source.total_order_count ?? source.totalOrderCount ?? source.order_count ?? source.orderCount ?? source.total_count ?? source.totalCount ?? source.order_num ?? source.orderNum ?? 0);
|
||||||
const pendingCount = Number(source.unreviewed_order_count ?? source.unreviewedOrderCount ?? source.pending_count ?? source.pendingCount ?? source.unreviewed_count ?? source.unreviewedCount ?? 0);
|
const pendingCount = Number(source.unreviewed_order_count ?? source.unreviewedOrderCount ?? source.pending_count ?? source.pendingCount ?? source.unreviewed_count ?? source.unreviewedCount ?? 0);
|
||||||
const reviewAssignmentStatus = this.normalizeReviewAssignmentStatus(source.review_assignment_status ?? source.reviewAssignmentStatus ?? source.status);
|
const reviewAssignmentStatus = this.normalizeReviewAssignmentStatus(source.review_assignment_status ?? source.reviewAssignmentStatus ?? source.status);
|
||||||
const assigneeId = String((source.picker_id ?? source.pickerId ?? source.user_id ?? source.userId) || '').trim();
|
|
||||||
const logisticsName = String(source.logistics_name || '').trim();
|
|
||||||
const storageAssignmentStatus = String(source.storage_assignment_status || '').trim();
|
const storageAssignmentStatus = String(source.storage_assignment_status || '').trim();
|
||||||
const expressAssignmentStatus = String(source.express_assignment_status || '').trim();
|
const expressAssignmentStatus = String(source.express_assignment_status || '').trim();
|
||||||
|
const storeName = String(source.store_name || source.storeName || '').trim();
|
||||||
|
const pickAssignmentStatus = String(source.pick_assignment_status || source.pickAssignmentStatus || '').trim();
|
||||||
|
const printAssignmentStatus = String(source.print_assignment_status || source.printAssignmentStatus || '').trim();
|
||||||
|
const creator = String(source.creator || source.creator_name || source.creatorName || '').trim();
|
||||||
return {
|
return {
|
||||||
id: String(rowId || ''),
|
id: String(rowId || ''),
|
||||||
waveId: typeof waveId === 'number' ? waveId : String(waveId || '').trim(),
|
waveId: typeof waveId === 'number' ? waveId : String(waveId || '').trim(),
|
||||||
@ -254,10 +328,13 @@
|
|||||||
totalOrderCount: Number.isFinite(totalOrderCount) ? totalOrderCount : 0,
|
totalOrderCount: Number.isFinite(totalOrderCount) ? totalOrderCount : 0,
|
||||||
pendingCount: Number.isFinite(pendingCount) ? pendingCount : 0,
|
pendingCount: Number.isFinite(pendingCount) ? pendingCount : 0,
|
||||||
status: reviewAssignmentStatus,
|
status: reviewAssignmentStatus,
|
||||||
isMine: !!this.currentUserId && !!assigneeId && assigneeId === this.currentUserId,
|
isMine: !!this.currentUserName && !!creator && creator === this.currentUserName,
|
||||||
logisticsName,
|
|
||||||
storageAssignmentStatus,
|
storageAssignmentStatus,
|
||||||
expressAssignmentStatus
|
expressAssignmentStatus,
|
||||||
|
storeName,
|
||||||
|
pickAssignmentStatus,
|
||||||
|
printAssignmentStatus,
|
||||||
|
creator
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter(item => !!item.waveNo)
|
.filter(item => !!item.waveNo)
|
||||||
@ -346,6 +423,109 @@
|
|||||||
.map(group => (group && typeof group === 'object' ? group : null))
|
.map(group => (group && typeof group === 'object' ? group : null))
|
||||||
.filter(group => !!group);
|
.filter(group => !!group);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 提取 getWavePlatformPrintData 返回的 locked_wave_groups(打印锁占用的分组)
|
||||||
|
* 已打印面单的数据会出现在 locked_wave_groups,而 waveGroups 为空
|
||||||
|
* @param {object} payload
|
||||||
|
*/
|
||||||
|
extractLockedWaveGroups(payload) {
|
||||||
|
const groups = Array.isArray(payload?.locked_wave_groups) ? payload.locked_wave_groups : [];
|
||||||
|
return groups
|
||||||
|
.map(group => (group && typeof group === 'object' ? group : null))
|
||||||
|
.filter(group => !!group);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 判断锁定订单是否为拦截订单(无需解锁,禁止打印)
|
||||||
|
* 当 locked_orders 的 order_id 与 intercepted_orders 的 order_id 一致(拦截集合覆盖全部锁定集合)时返回 true
|
||||||
|
* @param {object} payload getWavePlatformPrintData 返回的数据
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isInterceptedPrintBlock(payload) {
|
||||||
|
const lockedOrders = Array.isArray(payload?.locked_orders) ? payload.locked_orders : [];
|
||||||
|
const interceptedOrders = Array.isArray(payload?.intercepted_orders) ? payload.intercepted_orders : [];
|
||||||
|
const lockedIds = new Set(
|
||||||
|
lockedOrders.map(order => order?.order_id ?? order?.orderId ?? '').filter(id => id !== '' && id != null)
|
||||||
|
);
|
||||||
|
const interceptedIds = new Set(
|
||||||
|
interceptedOrders.map(order => order?.order_id ?? order?.orderId ?? '').filter(id => id !== '' && id != null)
|
||||||
|
);
|
||||||
|
if (!lockedIds.size || !interceptedIds.size) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// 拦截集合覆盖全部锁定集合 → 锁定订单均为拦截订单,不支持打印
|
||||||
|
for (const id of lockedIds) {
|
||||||
|
if (!interceptedIds.has(id)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 将 locked_wave_groups 转换为 unlockWavePlatformPrintDataByGroup 所需的 groups 分组条件
|
||||||
|
* 每个(波次 + 平台 + 系统快递编码)组合为一个分组
|
||||||
|
* @param {Array} lockedWaveGroups 打印锁占用的波次平台分组
|
||||||
|
*/
|
||||||
|
buildUnlockGroups(lockedWaveGroups) {
|
||||||
|
const groups = [];
|
||||||
|
(Array.isArray(lockedWaveGroups) ? lockedWaveGroups : []).forEach(waveGroup => {
|
||||||
|
const waveId = waveGroup?.wave_id ?? waveGroup?.waveId ?? waveGroup?.id ?? '';
|
||||||
|
const platforms = Array.isArray(waveGroup?.platforms) ? waveGroup.platforms : [];
|
||||||
|
if (platforms.length) {
|
||||||
|
platforms.forEach(platform => {
|
||||||
|
groups.push({
|
||||||
|
wave_id: waveId,
|
||||||
|
platform: platform?.platform ?? platform?.platform_code ?? '',
|
||||||
|
sys_logistics_code: platform?.sys_logistics_code ?? platform?.sysLogisticsCode ?? platform?.logistics_code ?? '',
|
||||||
|
order_ids: Array.isArray(platform?.order_ids) ? platform.order_ids : []
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else if (waveId !== '' && waveId != null) {
|
||||||
|
// 无平台嵌套时按波次兜底
|
||||||
|
groups.push({ wave_id: waveId, platform: '', sys_logistics_code: '', order_ids: [] });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return groups.filter(group => group.wave_id !== '' && group.wave_id != null);
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 按分组解锁波次平台打印锁(order.print.unlockWavePlatformPrintDataByGroup)
|
||||||
|
* 将传入的分组中已锁定的订单 print_lock_status 置为 none
|
||||||
|
* @param {Array} lockedWaveGroups 打印锁占用的波次平台分组(用于构建 groups 条件)
|
||||||
|
* @returns {Promise<object>} 解锁结果(summary / unlocked_order_ids / unlocked_orders 等)
|
||||||
|
*/
|
||||||
|
async unlockWavePlatformPrintDataByGroup(lockedWaveGroups) {
|
||||||
|
const warehouseId = this.resolveWarehouseId();
|
||||||
|
if (!warehouseId) {
|
||||||
|
throw new Error('缺少仓库ID');
|
||||||
|
}
|
||||||
|
const groups = this.buildUnlockGroups(lockedWaveGroups);
|
||||||
|
if (!groups.length) {
|
||||||
|
throw new Error('缺少可解锁的分组条件');
|
||||||
|
}
|
||||||
|
const waveIds = Array.from(new Set(
|
||||||
|
groups.map(g => g.wave_id).filter(id => id !== '' && id != null)
|
||||||
|
));
|
||||||
|
const params = {
|
||||||
|
warehouse_id: warehouseId,
|
||||||
|
wave_ids: waveIds,
|
||||||
|
group_type: 'platform_express',
|
||||||
|
unlock_scope: 'group',
|
||||||
|
groups
|
||||||
|
};
|
||||||
|
const response = await this.$http('order.print.unlockWavePlatformPrintDataByGroup', params);
|
||||||
|
const unlockPayload = response?.data?.data
|
||||||
|
|| response?.data
|
||||||
|
|| response?.result
|
||||||
|
|| response
|
||||||
|
|| {};
|
||||||
|
const unlockedIds = unlockPayload?.unlocked_order_ids || [];
|
||||||
|
const unlockedCount = Array.isArray(unlockedIds) ? unlockedIds.length : 0;
|
||||||
|
console.log(`[GrouponPickingDetail] 波次平台打印锁解锁成功,解锁订单数: ${unlockedCount}`);
|
||||||
|
return response;
|
||||||
|
},
|
||||||
|
async fetchWavePlatformPrintPayload(params) {
|
||||||
|
const response = await this.$http('order.print.getWavePlatformPrintData', params);
|
||||||
|
return this.extractWavePlatformPrintPayload(response);
|
||||||
|
},
|
||||||
buildPrintRequestCode() {
|
buildPrintRequestCode() {
|
||||||
const timePart = Date.now().toString(36);
|
const timePart = Date.now().toString(36);
|
||||||
const randomPart = Math.random().toString(36).slice(2, 10);
|
const randomPart = Math.random().toString(36).slice(2, 10);
|
||||||
@ -456,23 +636,38 @@
|
|||||||
},
|
},
|
||||||
async requestWavePlatformPrintData() {
|
async requestWavePlatformPrintData() {
|
||||||
const params = this.buildWavePlatformPrintParams();
|
const params = this.buildWavePlatformPrintParams();
|
||||||
console.log('[GrouponPickingDetail] getWavePlatformPrintData params:', params);
|
if (!params.warehouse_id) {
|
||||||
try {
|
throw new Error('缺少仓库ID');
|
||||||
const response = await this.$http('order.print.getWavePlatformPrintData', params);
|
|
||||||
console.log('[GrouponPickingDetail] getWavePlatformPrintData success:', response);
|
|
||||||
const payload = this.extractWavePlatformPrintPayload(response);
|
|
||||||
const waveGroups = this.normalizeWaveGroups(payload);
|
|
||||||
if (!waveGroups.length) {
|
|
||||||
throw new Error('未获取到可打印的waveGroups');
|
|
||||||
}
|
|
||||||
this.printWavePlatformPrintData = payload;
|
|
||||||
this.printWaveGroups = waveGroups;
|
|
||||||
this.printRequestCode = this.buildPrintRequestCode();
|
|
||||||
return payload;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('[GrouponPickingDetail] getWavePlatformPrintData error:', error);
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
|
if (!params.wave_ids.length) {
|
||||||
|
throw new Error('缺少波次ID');
|
||||||
|
}
|
||||||
|
|
||||||
|
let payload = await this.fetchWavePlatformPrintPayload(params);
|
||||||
|
let waveGroups = this.normalizeWaveGroups(payload);
|
||||||
|
const lockedWaveGroups = this.extractLockedWaveGroups(payload);
|
||||||
|
// 打印锁占用:waveGroups 为空 + locked_wave_groups 有值 → 先按分组解锁打印锁,解锁后重新获取可打印数据
|
||||||
|
if (!waveGroups.length && lockedWaveGroups.length) {
|
||||||
|
// 拦截订单与锁定订单 order_id 一致 → 拦截订单不支持打印,无需解锁
|
||||||
|
if (this.isInterceptedPrintBlock(payload)) {
|
||||||
|
throw new Error('拦截订单,不支持打印');
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await this.unlockWavePlatformPrintDataByGroup(lockedWaveGroups);
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`解锁打印锁失败:${String(error?.message || error?.msg || error?.errMsg || '请稍后重试')}`);
|
||||||
|
}
|
||||||
|
payload = await this.fetchWavePlatformPrintPayload(params);
|
||||||
|
waveGroups = this.normalizeWaveGroups(payload);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!waveGroups.length) {
|
||||||
|
throw new Error('未获取到可打印的waveGroups');
|
||||||
|
}
|
||||||
|
this.printWavePlatformPrintData = payload;
|
||||||
|
this.printWaveGroups = waveGroups;
|
||||||
|
this.printRequestCode = this.buildPrintRequestCode();
|
||||||
|
return payload;
|
||||||
},
|
},
|
||||||
buildPrintRecordWhere() {
|
buildPrintRecordWhere() {
|
||||||
return {};
|
return {};
|
||||||
@ -494,39 +689,170 @@
|
|||||||
const source = item && typeof item === 'object' ? item : {};
|
const source = item && typeof item === 'object' ? item : {};
|
||||||
const id = String(source.id ?? source.print_station_id ?? source.printStationId ?? '').trim();
|
const id = String(source.id ?? source.print_station_id ?? source.printStationId ?? '').trim();
|
||||||
const name = String(source.name || source.station_name || source.print_station_name || '').trim();
|
const name = String(source.name || source.station_name || source.print_station_name || '').trim();
|
||||||
|
const customBarcode = String(source.custom_barcode || source.bar_code || source.barcode || source.station_code || source.print_station_code || '').trim();
|
||||||
return {
|
return {
|
||||||
id,
|
id,
|
||||||
name
|
name,
|
||||||
|
customBarcode
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter(item => !!item.id && !!item.name);
|
.filter(item => !!item.id && !!item.name);
|
||||||
},
|
},
|
||||||
async loadPrintStations() {
|
async loadPrintStations(autoAssign = false) {
|
||||||
const response = await this.$http('print.getList', this.buildPrintRecordParams());
|
const response = await this.$http('print.getList', this.buildPrintRecordParams());
|
||||||
const list = this.extractPrintRecordList(response);
|
const list = this.extractPrintRecordList(response);
|
||||||
const stations = this.normalizePrintStations(list);
|
const stations = this.normalizePrintStations(list);
|
||||||
this.printStationList = stations;
|
this.printStationList = stations;
|
||||||
this.printStationId = stations[0]?.id || '';
|
// 输入框模式:不再默认分配打印台,需扫码/输入精确匹配
|
||||||
this.printStationName = stations[0]?.name || '--';
|
if (autoAssign && stations.length && !this.printStationId) {
|
||||||
|
this.printStationId = stations[0]?.id || '';
|
||||||
|
this.printStationName = stations[0]?.name || '--';
|
||||||
|
}
|
||||||
},
|
},
|
||||||
togglePrintStationDropdown() {
|
async ensurePrintStationsLoaded() {
|
||||||
if (!this.printStationList.length) {
|
if (Array.isArray(this.printStationList) && this.printStationList.length) {
|
||||||
uni.showToast({
|
return true;
|
||||||
title: '暂无可用打印台',
|
}
|
||||||
icon: 'none'
|
try {
|
||||||
});
|
uni.showLoading({ title: '加载打印台...' });
|
||||||
|
await this.loadPrintStations(false);
|
||||||
|
return Array.isArray(this.printStationList) && this.printStationList.length;
|
||||||
|
} catch (error) {
|
||||||
|
console.warn('[GrouponPickingDetail] 加载打印台列表失败:', error);
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
resolvePrintStationByKeyword(keyword) {
|
||||||
|
const list = Array.isArray(this.printStationList) ? this.printStationList : [];
|
||||||
|
if (!list.length) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const kw = this.normalizeKeyword(keyword).toLowerCase();
|
||||||
|
if (!kw) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return list.find(station =>
|
||||||
|
String(station.name || '').toLowerCase() === kw
|
||||||
|
|| String(station.id || '').toLowerCase() === kw
|
||||||
|
|| String(station.customBarcode || '').toLowerCase() === kw
|
||||||
|
) || null;
|
||||||
|
},
|
||||||
|
applyPrintStation(station) {
|
||||||
|
if (!station) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
this.printStationId = String(station.id || '');
|
||||||
|
this.printStationName = String(station.name || '--');
|
||||||
|
// 仅回显打印台名称,不追加条码
|
||||||
|
this.printStationInputKeyword = String(station.name || '');
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
handlePrintStationInput(value) {
|
||||||
|
const keyword = this.normalizeKeyword(value);
|
||||||
|
if (!keyword) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.showPrintStationDropdown = !this.showPrintStationDropdown;
|
const matched = this.resolvePrintStationByKeyword(keyword);
|
||||||
|
if (matched) {
|
||||||
|
this.applyPrintStation(matched);
|
||||||
|
uni.showToast({ title: `已匹配打印台:${matched.name}`, icon: 'none' });
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handlePrintStationSelect(station) {
|
async matchPrintStationByKeyword(keyword) {
|
||||||
this.printStationId = String(station?.id || '');
|
const text = this.normalizeKeyword(keyword);
|
||||||
this.printStationName = String(station?.name || '--');
|
if (!text) {
|
||||||
this.showPrintStationDropdown = false;
|
return;
|
||||||
|
}
|
||||||
|
// 打印台列表未加载时自动加载,保证广播扫描可直接匹配
|
||||||
|
const loaded = await this.ensurePrintStationsLoaded();
|
||||||
|
if (!loaded) {
|
||||||
|
uni.showToast({ title: '暂无可用打印台', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const matched = this.resolvePrintStationByKeyword(text);
|
||||||
|
if (matched) {
|
||||||
|
this.applyPrintStation(matched);
|
||||||
|
uni.showToast({ title: `已匹配打印台:${matched.name}`, icon: 'success' });
|
||||||
|
} else {
|
||||||
|
uni.showToast({ title: '未匹配到打印台', icon: 'none' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handlePrintStationInputConfirm() {
|
||||||
|
const keyword = this.normalizeKeyword(this.printStationInputKeyword);
|
||||||
|
if (!keyword) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const matched = this.resolvePrintStationByKeyword(keyword);
|
||||||
|
if (matched) {
|
||||||
|
this.applyPrintStation(matched);
|
||||||
|
uni.showToast({ title: `已匹配打印台:${matched.name}`, icon: 'success' });
|
||||||
|
} else {
|
||||||
|
this.matchPrintStationByKeyword(keyword);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handlePrintPopupClose() {
|
handlePrintPopupClose() {
|
||||||
this.showPrintPopup = false;
|
this.showPrintPopup = false;
|
||||||
this.showPrintStationDropdown = false;
|
},
|
||||||
|
normalizeKeyword(value) {
|
||||||
|
return String(value || '').replace(/\s+/g, '');
|
||||||
|
},
|
||||||
|
normalizeScanResult(scanResult) {
|
||||||
|
if (!scanResult) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof scanResult === 'string') {
|
||||||
|
return this.normalizeKeyword(scanResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof scanResult.result === 'string') {
|
||||||
|
return this.normalizeKeyword(scanResult.result);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(scanResult.result)) {
|
||||||
|
const firstResult = scanResult.result.find(item => item);
|
||||||
|
if (typeof firstResult === 'string') {
|
||||||
|
return this.normalizeKeyword(firstResult);
|
||||||
|
}
|
||||||
|
if (firstResult && typeof firstResult.data === 'string') {
|
||||||
|
return this.normalizeKeyword(firstResult.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof scanResult.data === 'string') {
|
||||||
|
return this.normalizeKeyword(scanResult.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
handleBroadcastResult(result) {
|
||||||
|
const scanText = this.normalizeScanResult(result);
|
||||||
|
if (!scanText) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 打印设置弹窗打开时,扫描结果填入打印台输入框并自动匹配打印台
|
||||||
|
if (this.showPrintPopup) {
|
||||||
|
this.printStationInputKeyword = scanText;
|
||||||
|
this.matchPrintStationByKeyword(scanText);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 弹窗未打开:按扫码内容搜索波次号
|
||||||
|
this.keyword = scanText;
|
||||||
|
this.handleSearch();
|
||||||
|
},
|
||||||
|
safeDispatchBroadcast(action, payload) {
|
||||||
|
try {
|
||||||
|
const task = this.$store.dispatch(`broadcast/${action}`, payload);
|
||||||
|
if (task && typeof task.catch === 'function') {
|
||||||
|
task.catch(error => {
|
||||||
|
console.warn(`[GrouponPickingDetail] broadcast/${action} 调用失败:`, error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.warn(`[GrouponPickingDetail] broadcast/${action} 调用异常:`, error);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async loadBatchWaveNoList(page = this.currentPage) {
|
async loadBatchWaveNoList(page = this.currentPage) {
|
||||||
const targetPage = Math.max(1, Number(page || 1));
|
const targetPage = Math.max(1, Number(page || 1));
|
||||||
@ -552,6 +878,16 @@
|
|||||||
toggleOnlyMine() {
|
toggleOnlyMine() {
|
||||||
this.onlyMine = !this.onlyMine;
|
this.onlyMine = !this.onlyMine;
|
||||||
},
|
},
|
||||||
|
handleSearch() {
|
||||||
|
this.keyword = this.normalizeKeyword(this.keyword);
|
||||||
|
this.currentPage = 1;
|
||||||
|
this.loadBatchWaveNoList(1);
|
||||||
|
},
|
||||||
|
clearSearch() {
|
||||||
|
this.keyword = '';
|
||||||
|
this.currentPage = 1;
|
||||||
|
this.loadBatchWaveNoList(1);
|
||||||
|
},
|
||||||
buildMockOrderList(count) {
|
buildMockOrderList(count) {
|
||||||
const listCount = Math.max(0, Number(count || 0));
|
const listCount = Math.max(0, Number(count || 0));
|
||||||
return Array.from({ length: listCount }).map((_, index) => {
|
return Array.from({ length: listCount }).map((_, index) => {
|
||||||
@ -570,9 +906,6 @@
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getStatusText(status) {
|
|
||||||
return this.normalizeReviewAssignmentStatus(status);
|
|
||||||
},
|
|
||||||
async showRecordDetail(item) {
|
async showRecordDetail(item) {
|
||||||
const target = item && typeof item === 'object' ? item : null;
|
const target = item && typeof item === 'object' ? item : null;
|
||||||
console.log('[GrouponPickingDetail] print button clicked:', target);
|
console.log('[GrouponPickingDetail] print button clicked:', target);
|
||||||
@ -605,17 +938,19 @@
|
|||||||
this.printMessage = message;
|
this.printMessage = message;
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: message,
|
title: message,
|
||||||
icon: 'none'
|
icon: 'none',
|
||||||
|
duration: 4000
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.loadPrintStations();
|
await this.loadPrintStations(false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.printStationList = [];
|
this.printStationList = [];
|
||||||
this.printStationId = '';
|
this.printStationId = '';
|
||||||
this.printStationName = '--';
|
this.printStationName = '--';
|
||||||
|
this.printStationInputKeyword = '';
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '打印台加载失败',
|
title: '打印台加载失败',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
@ -623,7 +958,14 @@
|
|||||||
}
|
}
|
||||||
this.pendingPrintCount = Number(target.pendingCount || 0);
|
this.pendingPrintCount = Number(target.pendingCount || 0);
|
||||||
this.printMessage = `待打印未复核订单 ${this.pendingPrintCount} 条`;
|
this.printMessage = `待打印未复核订单 ${this.pendingPrintCount} 条`;
|
||||||
this.showPrintStationDropdown = false;
|
// 回显已匹配的打印台;未匹配时清空输入等待扫码/输入
|
||||||
|
if (this.printStationId && this.printStationName && this.printStationName !== '--') {
|
||||||
|
this.printStationInputKeyword = this.printStationName;
|
||||||
|
} else {
|
||||||
|
this.printStationId = '';
|
||||||
|
this.printStationName = '--';
|
||||||
|
this.printStationInputKeyword = '';
|
||||||
|
}
|
||||||
this.showPrintPopup = true;
|
this.showPrintPopup = true;
|
||||||
},
|
},
|
||||||
buildPrintSendParams() {
|
buildPrintSendParams() {
|
||||||
@ -640,18 +982,20 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
async handleConfirmPrint() {
|
async handleConfirmPrint() {
|
||||||
console.log('[GrouponPickingDetail] handleConfirmPrint clicked:', {
|
if (!Array.isArray(this.printStationList) || !this.printStationList.length) {
|
||||||
printStationId: this.printStationId,
|
console.warn('[GrouponPickingDetail] handleConfirmPrint blocked: no print station list');
|
||||||
printStationName: this.printStationName,
|
this.printMessage = '暂无可用打印台';
|
||||||
printStationListLength: Array.isArray(this.printStationList) ? this.printStationList.length : 0,
|
|
||||||
pendingPrintCount: this.pendingPrintCount,
|
|
||||||
waveGroupsLength: Array.isArray(this.printWaveGroups) ? this.printWaveGroups.length : 0
|
|
||||||
});
|
|
||||||
if (!this.printStationList.length || !this.printStationId || !this.printStationName || this.printStationName === '--') {
|
|
||||||
console.warn('[GrouponPickingDetail] handleConfirmPrint blocked: invalid print station');
|
|
||||||
this.printMessage = '请选择打印台';
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请选择打印台',
|
title: '暂无可用打印台',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.printStationId || !this.printStationName || this.printStationName === '--') {
|
||||||
|
console.warn('[GrouponPickingDetail] handleConfirmPrint blocked: print station not matched');
|
||||||
|
this.printMessage = '请先扫描/输入打印台';
|
||||||
|
uni.showToast({
|
||||||
|
title: '请先扫描/输入打印台',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
@ -749,6 +1093,64 @@
|
|||||||
background: #1f67e6;
|
background: #1f67e6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-filter {
|
||||||
|
background: #ffffff;
|
||||||
|
padding: 20rpx 24rpx;
|
||||||
|
border: 1rpx solid #f0f0f0;
|
||||||
|
border-top: none;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box-inner {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .search-box-inner .u-search {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .search-box-inner .u-search__content {
|
||||||
|
padding-right: 200rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .search-box-inner .u-search__content__close {
|
||||||
|
margin-right: 12rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-actions {
|
||||||
|
position: absolute;
|
||||||
|
right: 24rpx;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
height: 68rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-btn {
|
||||||
|
height: 68rpx;
|
||||||
|
padding: 0 8rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
opacity: 0.88;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-btn__text {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #2979ff;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.detail-scroll {
|
.detail-scroll {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
@ -791,8 +1193,8 @@
|
|||||||
.record-line {
|
.record-line {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 32rpx;
|
font-size: 36rpx;
|
||||||
line-height: 52rpx;
|
line-height: 60rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-line + .record-line {
|
.record-line + .record-line {
|
||||||
@ -812,23 +1214,10 @@
|
|||||||
color: #303133;
|
color: #303133;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-logistics {
|
|
||||||
color: #303133;
|
|
||||||
font-size: 30rpx;
|
|
||||||
margin-left: 16rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.record-logistics-label {
|
|
||||||
color: #909399;
|
|
||||||
margin-left: 16rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.record-line--split {
|
.record-line--split {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 16rpx;
|
gap: 16rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-half {
|
.record-half {
|
||||||
@ -865,16 +1254,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.record-count {
|
.record-count {
|
||||||
font-size: 30rpx;
|
font-size: 36rpx;
|
||||||
line-height: 40rpx;
|
line-height: 46rpx;
|
||||||
color: #fa8c16;
|
color: #fa8c16;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-status {
|
.record-status-value {
|
||||||
margin-top: 12rpx;
|
margin-top: 8rpx;
|
||||||
font-size: 30rpx;
|
font-size: 36rpx;
|
||||||
line-height: 40rpx;
|
line-height: 46rpx;
|
||||||
color: #2979ff;
|
color: #303133;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-status-value--success {
|
||||||
|
color: #07c160;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-footer {
|
.record-footer {
|
||||||
@ -921,99 +1315,84 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.print-row {
|
.print-row {
|
||||||
position: relative;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
justify-content: space-between;
|
|
||||||
padding: 16rpx 0;
|
padding: 16rpx 0;
|
||||||
border-bottom: 1rpx solid #f5f5f5;
|
border-bottom: 1rpx solid #f2f3f5;
|
||||||
gap: 16rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-row--station {
|
.print-row--station {
|
||||||
align-items: flex-start;
|
position: relative;
|
||||||
padding-top: 8rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-row--station .print-label {
|
.print-row--station .print-label {
|
||||||
padding-top: 10rpx;
|
padding-top: 20rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.print-row--action {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.print-row--message {
|
||||||
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-label {
|
.print-label {
|
||||||
min-width: 120rpx;
|
min-width: 130rpx;
|
||||||
font-size: 30rpx;
|
width: 130rpx;
|
||||||
color: #606266;
|
|
||||||
line-height: 44rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.print-picker {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 0;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 10rpx 16rpx;
|
|
||||||
border: 1rpx solid #dcdfe6;
|
|
||||||
border-radius: 10rpx;
|
|
||||||
background: #fafafa;
|
|
||||||
}
|
|
||||||
|
|
||||||
.print-picker-value {
|
|
||||||
flex: 1;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
color: #303133;
|
line-height: 40rpx;
|
||||||
padding-right: 16rpx;
|
color: #909399;
|
||||||
word-break: break-all;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-station-dropdown {
|
.print-value {
|
||||||
position: absolute;
|
flex: 1;
|
||||||
right: 0;
|
|
||||||
top: calc(100% - 4rpx);
|
|
||||||
width: calc(100% - 144rpx);
|
|
||||||
max-height: 360rpx;
|
|
||||||
overflow-y: auto;
|
|
||||||
background: #ffffff;
|
|
||||||
border: 1rpx solid #ebeef5;
|
|
||||||
border-radius: 12rpx;
|
|
||||||
box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.08);
|
|
||||||
z-index: 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
.print-station-option {
|
|
||||||
padding: 16rpx 20rpx;
|
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
color: #303133;
|
color: #303133;
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-station-option + .print-station-option {
|
.print-station-input-wrap {
|
||||||
border-top: 1rpx solid #f5f5f5;
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
max-width: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-station-option--active {
|
.print-station-input-wrap ::v-deep .u-input {
|
||||||
color: #2979ff;
|
flex: 1;
|
||||||
background: rgba(41, 121, 255, 0.08);
|
min-width: 0;
|
||||||
|
width: auto;
|
||||||
|
max-width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-row--action .u-btn {
|
.print-station-input-wrap ::v-deep .u-input__content {
|
||||||
min-width: 160rpx;
|
min-width: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-row--message {
|
.print-action-wrap {
|
||||||
align-items: flex-start;
|
flex: 1;
|
||||||
justify-content: flex-start;
|
min-width: 0;
|
||||||
border-bottom: none;
|
max-width: 100%;
|
||||||
padding-bottom: 0;
|
display: flex;
|
||||||
padding-top: 12rpx;
|
align-items: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.print-action-wrap ::v-deep .u-button {
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.print-message {
|
.print-message {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
color: #606266;
|
color: #303133;
|
||||||
text-align: left;
|
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,8 +37,18 @@
|
|||||||
<view v-for="item in displayOrderList" :key="item.id" class="record-item" @click="goPickGoodsDetail(item)">
|
<view v-for="item in displayOrderList" :key="item.id" class="record-item" @click="goPickGoodsDetail(item)">
|
||||||
<view class="record-main">
|
<view class="record-main">
|
||||||
<view class="record-left">
|
<view class="record-left">
|
||||||
<view class="record-line"><text class="record-label">波次号:</text><text class="record-value">{{ item.waveNo || '--' }}</text></view>
|
<view class="record-line"><text class="record-value">{{ item.waveNo || '--' }}</text></view>
|
||||||
<view class="record-line"><text class="record-label">总订单数:</text><text class="record-value">{{ item.totalOrderCount }}</text><text class="record-logistics">{{ item.logisticsName || '--' }}</text></view>
|
<view class="record-line"><text class="record-value">{{ item.storeName || '--' }}</text></view>
|
||||||
|
<view class="record-line record-line--split">
|
||||||
|
<view class="record-half">
|
||||||
|
<text class="record-half-label">创建:</text>
|
||||||
|
<text class="record-half-value">{{ item.creator || '--' }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="record-half">
|
||||||
|
<text class="record-half-label">总订单数:</text>
|
||||||
|
<text class="record-half-value">{{ item.totalOrderCount }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="record-line record-line--split">
|
<view class="record-line record-line--split">
|
||||||
<view class="record-half">
|
<view class="record-half">
|
||||||
<text class="record-half-label">库位:</text>
|
<text class="record-half-label">库位:</text>
|
||||||
@ -51,8 +61,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="record-right">
|
<view class="record-right">
|
||||||
<text class="record-count">未复核 {{ item.unreviewedCount }}</text>
|
<text class="record-count">{{ item.status === '已复核' ? '已复核' : '未复核' }} {{ item.unreviewedCount }}</text>
|
||||||
<text class="record-status">{{ getStatusText(item.status) }}</text>
|
<text class="record-status-value" :class="{ 'record-status-value--success': item.pickAssignmentStatus === '已拣货' }">{{ item.pickAssignmentStatus || '--' }}</text>
|
||||||
|
<text class="record-status-value" :class="{ 'record-status-value--success': item.printAssignmentStatus === '已打印' }">{{ item.printAssignmentStatus || '--' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="record-footer" @click.stop>
|
<view class="record-footer" @click.stop>
|
||||||
@ -155,7 +166,33 @@
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
displayOrderList() {
|
displayOrderList() {
|
||||||
return Array.isArray(this.orderList) ? this.orderList : [];
|
const list = Array.isArray(this.orderList) ? this.orderList : [];
|
||||||
|
if (!this.onlyMine) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
return list.filter(item => item.isMine);
|
||||||
|
},
|
||||||
|
currentUserName() {
|
||||||
|
const user = this.$store?.getters?.user || {};
|
||||||
|
const userInfo = this.$store?.getters?.userInfo || {};
|
||||||
|
const candidates = [
|
||||||
|
user?.employees_name,
|
||||||
|
user?.employee_name,
|
||||||
|
user?.real_name,
|
||||||
|
user?.name,
|
||||||
|
user?.username,
|
||||||
|
userInfo?.employees_name,
|
||||||
|
userInfo?.employee_name,
|
||||||
|
userInfo?.real_name,
|
||||||
|
userInfo?.name
|
||||||
|
];
|
||||||
|
for (let i = 0; i < candidates.length; i += 1) {
|
||||||
|
const value = String(candidates[i] || '').trim();
|
||||||
|
if (value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
@ -270,9 +307,6 @@
|
|||||||
const where = {
|
const where = {
|
||||||
wave_type: 2
|
wave_type: 2
|
||||||
};
|
};
|
||||||
if (this.onlyMine && this.currentUserId) {
|
|
||||||
where.picker_id = this.currentUserId;
|
|
||||||
}
|
|
||||||
const keyword = this.normalizeKeyword(this.keyword);
|
const keyword = this.normalizeKeyword(this.keyword);
|
||||||
if (keyword) {
|
if (keyword) {
|
||||||
where.wave_no = keyword;
|
where.wave_no = keyword;
|
||||||
@ -336,10 +370,12 @@
|
|||||||
const totalOrderCount = Number(source.total_order_count ?? source.totalOrderCount ?? source.order_count ?? source.orderCount ?? source.total_count ?? source.totalCount ?? source.order_num ?? source.orderNum ?? 0);
|
const totalOrderCount = Number(source.total_order_count ?? source.totalOrderCount ?? source.order_count ?? source.orderCount ?? source.total_count ?? source.totalCount ?? source.order_num ?? source.orderNum ?? 0);
|
||||||
const unreviewedCount = Number(source.unreviewed_order_count ?? source.unreviewedOrderCount ?? source.unreviewed_count ?? source.unreviewedCount ?? source.pending_count ?? source.pendingCount ?? 0);
|
const unreviewedCount = Number(source.unreviewed_order_count ?? source.unreviewedOrderCount ?? source.unreviewed_count ?? source.unreviewedCount ?? source.pending_count ?? source.pendingCount ?? 0);
|
||||||
const reviewAssignmentStatus = this.normalizeReviewAssignmentStatus(source.review_assignment_status ?? source.reviewAssignmentStatus ?? source.status);
|
const reviewAssignmentStatus = this.normalizeReviewAssignmentStatus(source.review_assignment_status ?? source.reviewAssignmentStatus ?? source.status);
|
||||||
const assigneeId = String((source.picker_id ?? source.pickerId ?? source.user_id ?? source.userId) || '').trim();
|
|
||||||
const logisticsName = String(source.logistics_name || '').trim();
|
|
||||||
const storageAssignmentStatus = String(source.storage_assignment_status || '').trim();
|
const storageAssignmentStatus = String(source.storage_assignment_status || '').trim();
|
||||||
const expressAssignmentStatus = String(source.express_assignment_status || '').trim();
|
const expressAssignmentStatus = String(source.express_assignment_status || '').trim();
|
||||||
|
const storeName = String(source.store_name || source.storeName || '').trim();
|
||||||
|
const pickAssignmentStatus = String(source.pick_assignment_status || source.pickAssignmentStatus || '').trim();
|
||||||
|
const printAssignmentStatus = String(source.print_assignment_status || source.printAssignmentStatus || '').trim();
|
||||||
|
const creator = String(source.creator || source.creator_name || source.creatorName || '').trim();
|
||||||
return {
|
return {
|
||||||
id: String(rowId || `batch-${this.currentPage}-${index + 1}`),
|
id: String(rowId || `batch-${this.currentPage}-${index + 1}`),
|
||||||
waveId: typeof waveId === 'number' ? waveId : String(waveId || '').trim(),
|
waveId: typeof waveId === 'number' ? waveId : String(waveId || '').trim(),
|
||||||
@ -350,8 +386,11 @@
|
|||||||
unreviewedCount: Number.isFinite(unreviewedCount) ? unreviewedCount : 0,
|
unreviewedCount: Number.isFinite(unreviewedCount) ? unreviewedCount : 0,
|
||||||
status: reviewAssignmentStatus,
|
status: reviewAssignmentStatus,
|
||||||
waybillCode: String(source.waybill_no || source.waybillCode || source.waybill_code || ''),
|
waybillCode: String(source.waybill_no || source.waybillCode || source.waybill_code || ''),
|
||||||
isMine: !!this.currentUserId && !!assigneeId && assigneeId === this.currentUserId,
|
isMine: !!this.currentUserName && !!creator && creator === this.currentUserName,
|
||||||
logisticsName,
|
storeName,
|
||||||
|
pickAssignmentStatus,
|
||||||
|
printAssignmentStatus,
|
||||||
|
creator,
|
||||||
storageAssignmentStatus,
|
storageAssignmentStatus,
|
||||||
expressAssignmentStatus
|
expressAssignmentStatus
|
||||||
};
|
};
|
||||||
@ -798,9 +837,6 @@
|
|||||||
this.currentPage = 1;
|
this.currentPage = 1;
|
||||||
this.loadBatchWaveNoList(1);
|
this.loadBatchWaveNoList(1);
|
||||||
},
|
},
|
||||||
getStatusText(status) {
|
|
||||||
return this.normalizeReviewAssignmentStatus(status);
|
|
||||||
},
|
|
||||||
extractPickQueryPayload(response) {
|
extractPickQueryPayload(response) {
|
||||||
const candidates = [
|
const candidates = [
|
||||||
response?.data?.data,
|
response?.data?.data,
|
||||||
@ -1191,9 +1227,8 @@
|
|||||||
.record-line {
|
.record-line {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-wrap: nowrap;
|
font-size: 36rpx;
|
||||||
font-size: 32rpx;
|
line-height: 60rpx;
|
||||||
line-height: 52rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-line + .record-line {
|
.record-line + .record-line {
|
||||||
@ -1215,16 +1250,10 @@
|
|||||||
color: #303133;
|
color: #303133;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-logistics {
|
|
||||||
color: #303133;
|
|
||||||
font-size: 32rpx;
|
|
||||||
margin-left: 16rpx;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.record-line--split {
|
.record-line--split {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 16rpx;
|
gap: 16rpx;
|
||||||
|
font-size: 34rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-half {
|
.record-half {
|
||||||
@ -1261,16 +1290,21 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.record-count {
|
.record-count {
|
||||||
font-size: 30rpx;
|
font-size: 36rpx;
|
||||||
line-height: 40rpx;
|
line-height: 46rpx;
|
||||||
color: #fa8c16;
|
color: #fa8c16;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-status {
|
.record-status-value {
|
||||||
margin-top: 12rpx;
|
margin-top: 8rpx;
|
||||||
font-size: 30rpx;
|
font-size: 36rpx;
|
||||||
line-height: 40rpx;
|
line-height: 46rpx;
|
||||||
color: #2979ff;
|
color: #303133;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-status-value--success {
|
||||||
|
color: #07c160;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-footer {
|
.record-footer {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user