修改复核列表、商品查询页面
This commit is contained in:
parent
f063287083
commit
bdb44a385b
@ -416,6 +416,12 @@ export default {
|
|||||||
method: "POST",
|
method: "POST",
|
||||||
isSystemApi: true
|
isSystemApi: true
|
||||||
},
|
},
|
||||||
|
queryRecheckOrderSingleList: {
|
||||||
|
path: "order.recheckOrder.queryRecheckOrderSingleList",
|
||||||
|
auth: true,
|
||||||
|
method: "POST",
|
||||||
|
isSystemApi: true
|
||||||
|
},
|
||||||
scanTask: {
|
scanTask: {
|
||||||
path: "order.recheckOrder.scanTask",
|
path: "order.recheckOrder.scanTask",
|
||||||
auth: true,
|
auth: true,
|
||||||
|
|||||||
@ -88,49 +88,14 @@
|
|||||||
v-for="item in listData"
|
v-for="item in listData"
|
||||||
:key="item.order_id"
|
:key="item.order_id"
|
||||||
class="record-item"
|
class="record-item"
|
||||||
:class="{ 'record-item--reviewed': item.recheck_status === 'fin' }"
|
|
||||||
>
|
>
|
||||||
<view class="record-main">
|
<text class="record-simple-text">
|
||||||
<view class="record-left">
|
{{ item.delivery_order_code || '--' }}
|
||||||
<view class="record-line">
|
<text
|
||||||
<text class="record-label">订单号:</text>
|
class="record-simple-status"
|
||||||
<text class="record-value">{{ item.delivery_order_code || '--' }}</text>
|
:class="item.pick_status === 'printed' ? 'record-simple-status--done' : 'record-simple-status--pending'"
|
||||||
</view>
|
>({{ getPickStatusText(item.pick_status) }})</text>
|
||||||
<view class="record-line">
|
</text>
|
||||||
<text class="record-label">{{ item.logistics_name || '--' }}</text>
|
|
||||||
<text v-if="item.shop_nick" class="record-shop">[{{ item.shop_nick }}]</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.items_count || 0 }}</text>
|
|
||||||
</view>
|
|
||||||
<view class="record-half">
|
|
||||||
<text class="record-half-label">数量:</text>
|
|
||||||
<text class="record-half-value">{{ item.items_total || 0 }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="record-right">
|
|
||||||
<text
|
|
||||||
class="record-status"
|
|
||||||
:class="item.recheck_status === 'fin' ? 'record-status--done' : 'record-status--pending'"
|
|
||||||
>{{ item.recheck_status === 'fin' ? '已复核' : '待复核' }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<view class="record-footer">
|
|
||||||
<text class="record-time">{{ item.create_at || item.pick_time || '--' }}</text>
|
|
||||||
<view v-if="item.recheck_status !== 'fin'" class="record-actions">
|
|
||||||
<u-button
|
|
||||||
type="primary"
|
|
||||||
size="mini"
|
|
||||||
:customStyle="{ backgroundColor: '#e74c3c', borderColor: '#e74c3c', fontSize: '26rpx', height: '60rpx', lineHeight: '60rpx', padding: '0 20rpx' }"
|
|
||||||
@click="handleStartReview(item)"
|
|
||||||
>
|
|
||||||
开始复核
|
|
||||||
</u-button>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<!-- 团购模式:波次汇总列表 -->
|
<!-- 团购模式:波次汇总列表 -->
|
||||||
@ -287,35 +252,32 @@ export default {
|
|||||||
async fetchList() {
|
async fetchList() {
|
||||||
uni.showLoading({ title: '加载中...' });
|
uni.showLoading({ title: '加载中...' });
|
||||||
try {
|
try {
|
||||||
const listType = this.currentMode === 'group' ? 'group' : 'single';
|
|
||||||
const where = {};
|
const where = {};
|
||||||
if (this.keyword) {
|
|
||||||
where.keyword = this.keyword;
|
|
||||||
}
|
|
||||||
// 待复核/已复核筛选
|
|
||||||
if (this.currentMode === 'scatter') {
|
if (this.currentMode === 'scatter') {
|
||||||
if (this.currentSubTab === 0) {
|
// 散单模式where传空
|
||||||
where.recheck_status = 'pending';
|
|
||||||
} else {
|
|
||||||
where.recheck_status = 'fin';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
if (this.keyword) {
|
||||||
|
where.keyword = this.keyword;
|
||||||
|
}
|
||||||
if (this.currentSubTab === 0) {
|
if (this.currentSubTab === 0) {
|
||||||
where.review_assignment_status = ['unreviewed', 'partially_reviewed'];
|
where.review_assignment_status = ['unreviewed', 'partially_reviewed'];
|
||||||
} else {
|
} else {
|
||||||
where.review_assignment_status = 'reviewed';
|
where.review_assignment_status = 'reviewed';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const params = {
|
const pagination = {
|
||||||
list_type: listType,
|
page: this.currentPage,
|
||||||
where,
|
pageSize: this.pageSize
|
||||||
pagination: {
|
|
||||||
page: this.currentPage,
|
|
||||||
pageSize: this.pageSize
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
console.log('[orderReviewList] fetchList params:', JSON.stringify(params));
|
const requestParams = this.currentMode === 'scatter'
|
||||||
const response = await this.$http('order.recheckOrder.recheckOrderList', params);
|
? { where: {}, pagination }
|
||||||
|
: { where, pagination, list_type: 'group' };
|
||||||
|
console.log('[orderReviewList] fetchList params:', JSON.stringify(requestParams));
|
||||||
|
// 散单模式使用散单复核接口,团购模式使用原有接口
|
||||||
|
const apiName = this.currentMode === 'scatter'
|
||||||
|
? 'order.recheckOrder.queryRecheckOrderSingleList'
|
||||||
|
: 'order.recheckOrder.recheckOrderList';
|
||||||
|
const response = await this.$http(apiName, requestParams);
|
||||||
const data = response?.data || response || {};
|
const data = response?.data || response || {};
|
||||||
this.listData = Array.isArray(data.list) ? data.list : [];
|
this.listData = Array.isArray(data.list) ? data.list : [];
|
||||||
const pag = data.pagination || {};
|
const pag = data.pagination || {};
|
||||||
@ -332,6 +294,15 @@ export default {
|
|||||||
this.currentPage = page;
|
this.currentPage = page;
|
||||||
this.fetchList();
|
this.fetchList();
|
||||||
},
|
},
|
||||||
|
getPickStatusText(status) {
|
||||||
|
const map = {
|
||||||
|
'printed': '已打印',
|
||||||
|
'unprinted': '未打印',
|
||||||
|
'partially_printed': '部分打印',
|
||||||
|
'fin': '未打印'
|
||||||
|
};
|
||||||
|
return map[status] || status || '未打印';
|
||||||
|
},
|
||||||
reviewStatusText(status) {
|
reviewStatusText(status) {
|
||||||
const map = {
|
const map = {
|
||||||
'unreviewed': '未复核',
|
'unreviewed': '未复核',
|
||||||
@ -522,8 +493,14 @@ export default {
|
|||||||
|
|
||||||
/* ===== 子标签切换条 ===== */
|
/* ===== 子标签切换条 ===== */
|
||||||
.sub-tabs {
|
.sub-tabs {
|
||||||
padding: 16rpx 24rpx 0;
|
padding: 16rpx 0 16rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
border-bottom: 2rpx solid #e4e7ed;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-tabs .sub-switch-bar {
|
||||||
|
margin: 0 24rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub-switch-bar {
|
.sub-switch-bar {
|
||||||
@ -562,7 +539,7 @@ export default {
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
padding: 16rpx 24rpx;
|
padding: 16rpx 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -583,19 +560,40 @@ export default {
|
|||||||
.record-list {
|
.record-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 16rpx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-item {
|
.record-item {
|
||||||
|
padding: 20rpx 0;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 12rpx;
|
}
|
||||||
padding: 24rpx;
|
|
||||||
border: 1rpx solid #ebeef5;
|
.record-item:nth-child(even) {
|
||||||
|
background: #f5f7fa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-item--reviewed {
|
.record-item--reviewed {
|
||||||
background: #f9f9f9;
|
background: #f9f9f9;
|
||||||
border-color: #e0e0e0;
|
}
|
||||||
|
|
||||||
|
.record-simple-text {
|
||||||
|
font-size: 30rpx;
|
||||||
|
color: #000000;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 0 24rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-simple-status {
|
||||||
|
font-size: 26rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-simple-status--pending {
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.record-simple-status--done {
|
||||||
|
color: #000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.record-main {
|
.record-main {
|
||||||
|
|||||||
@ -1663,6 +1663,29 @@
|
|||||||
const detailList = listOk ? this.extractListFromResponse(listRes) : [];
|
const detailList = listOk ? this.extractListFromResponse(listRes) : [];
|
||||||
let mergedList = this.mergeProductResultLists(nextList, warehouseList, detailList);
|
let mergedList = this.mergeProductResultLists(nextList, warehouseList, detailList);
|
||||||
|
|
||||||
|
// 优先使用 stock.warehouse.search 的库存数据(storage 数组),覆盖其他来源的库存数据
|
||||||
|
// 注意:必须用 id 精确匹配,不能用条码等共享字段,否则多个商品共用同一条码时会互相覆盖
|
||||||
|
if (searchOk && Array.isArray(nextList) && nextList.length) {
|
||||||
|
const searchStorageById = new Map();
|
||||||
|
nextList.forEach(item => {
|
||||||
|
if (item && typeof item === 'object' && Array.isArray(item.storage)) {
|
||||||
|
const id = this.normalizePositiveId(item.id);
|
||||||
|
if (id) {
|
||||||
|
searchStorageById.set(id, item.storage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (searchStorageById.size) {
|
||||||
|
mergedList = mergedList.map(item => {
|
||||||
|
const id = this.normalizePositiveId(item.id || item.stock_id);
|
||||||
|
if (id && searchStorageById.has(id)) {
|
||||||
|
return { ...item, storage: searchStorageById.get(id) };
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 从分拣缺货补货进入时,根据 stock_id 精确匹配
|
// 从分拣缺货补货进入时,根据 stock_id 精确匹配
|
||||||
if (this.routeStockId) {
|
if (this.routeStockId) {
|
||||||
const targetStockId = Number(this.routeStockId);
|
const targetStockId = Number(this.routeStockId);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user