修改复核列表、复核发货页面
This commit is contained in:
parent
9cf1b2331c
commit
2335ee8fd9
@ -459,6 +459,12 @@ export default {
|
||||
auth: true,
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
},
|
||||
detail: {
|
||||
path: "order.deliveryOrder.detail",
|
||||
auth: true,
|
||||
method: "POST",
|
||||
isSystemApi: true
|
||||
}
|
||||
},
|
||||
detail: {
|
||||
|
||||
4
env.js
4
env.js
@ -1,4 +1,4 @@
|
||||
export const BASE_URL = 'http://qimen.wms.gztbyc.com' //生产环境接口地址
|
||||
// export const BASE_URL = 'http://192.168.11.56:6060' //开发环境接口地址
|
||||
// export const BASE_URL = 'http://qimen.wms.gztbyc.com' //生产环境接口地址
|
||||
export const BASE_URL = 'http://192.168.11.56:6060' //开发环境接口地址
|
||||
export const API_URL = `${BASE_URL}/system` //后台接口域名
|
||||
export const IMG_URL = 'https://ye4s.file.gzxunren.com' //全局网络图片地址变量,css背景图片地址变量在uni.scss
|
||||
|
||||
@ -551,6 +551,14 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
|
||||
// 监听拦截完成事件
|
||||
uni.$on('orderInterceptCompleted', this.handleInterceptCompleted);
|
||||
|
||||
// 从散单已复核列表点击跳转,调用 order.deliveryOrder.detail 获取订单详情
|
||||
const initDetailId = options?.orderId || '';
|
||||
const initTableType = options?.tableType || 'dispatch';
|
||||
if (initDetailId) {
|
||||
this.printMode = 'noPrint';
|
||||
this.fetchReviewedDetail(initDetailId, initTableType);
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.safeDispatchBroadcast('setCallbacks', {
|
||||
@ -1872,6 +1880,70 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
this.selectedStationId = station.id;
|
||||
}
|
||||
},
|
||||
async fetchReviewedDetail(id, tableType = 'dispatch') {
|
||||
uni.showLoading({ title: '加载详情...' });
|
||||
try {
|
||||
const response = await this.$http('order.deliveryOrder.detail', {
|
||||
id: Number(id),
|
||||
tableType
|
||||
});
|
||||
const data = response?.data || response || {};
|
||||
const detail = data?.detail || data?.info || data || {};
|
||||
if (!detail || !detail.id) {
|
||||
uni.showToast({ title: '未查询到订单详情', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
// 提取商品明细(items 在 data 层级)
|
||||
const responseItems = Array.isArray(data?.items) ? data.items
|
||||
: Array.isArray(detail.items) ? detail.items
|
||||
: Array.isArray(detail.goods_items) ? detail.goods_items
|
||||
: Array.isArray(detail.stocks) ? detail.stocks
|
||||
: [];
|
||||
// 统一商品图片字段名(接口返回 image_url 数组)
|
||||
const normalizedItems = responseItems.map(item => ({
|
||||
...item,
|
||||
images: Array.isArray(item.image_url) ? item.image_url
|
||||
: Array.isArray(item.images) ? item.images
|
||||
: []
|
||||
}));
|
||||
// 提取运单号(优先 data.waybill_codes)
|
||||
const waybillNo = String(
|
||||
data?.waybill_codes?.[0]
|
||||
|| detail.waybill_no
|
||||
|| detail.waybillNo
|
||||
|| detail.express_code
|
||||
|| data?.expresses?.[0]?.waybill_code
|
||||
|| '--'
|
||||
);
|
||||
// 构造符合 goPickGoodsDetail 格式的数据
|
||||
const detailItem = {
|
||||
id: String(detail.id || ''),
|
||||
orderId: Number(detail.id || detail.order_id || 0),
|
||||
waveNo: String(detail.wave_no || detail.waveNo || '--'),
|
||||
waveId: String(detail.wave_id || detail.waveId || ''),
|
||||
waybillNo,
|
||||
recheckStatus: 'fin',
|
||||
pickerName: String(detail.operator_name || detail.picker_name || detail.pickerName || '--'),
|
||||
cartNo: String(detail.basket_number || detail.cart_code || detail.cartCode || detail.cart_no || detail.cartNo || '--'),
|
||||
status: 'reviewed',
|
||||
unreviewedCount: 0,
|
||||
storeRemark: String(detail.remark || detail.store_remark || detail.storeRemark || ''),
|
||||
waveIndex: String(detail.wave_index || detail.waveIndex || '').trim(),
|
||||
interceptStatus: String(detail.intercept_status || detail.interceptStatus || ''),
|
||||
boxNo: String(detail.box_no || detail.boxNo || ''),
|
||||
isPrinted: !!detail.is_printed || !!detail.isPrinted || detail.print_status === 'fin',
|
||||
detailItems: normalizedItems,
|
||||
stocks: normalizedItems,
|
||||
orderIds: []
|
||||
};
|
||||
this.goPickGoodsDetail(detailItem);
|
||||
} catch (error) {
|
||||
console.error('[order-review] fetchReviewedDetail error:', error);
|
||||
uni.showToast({ title: '加载订单详情失败', icon: 'none' });
|
||||
} finally {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
goPickGoodsDetail(item) {
|
||||
if (!item) return;
|
||||
|
||||
|
||||
@ -88,6 +88,8 @@
|
||||
v-for="(item, index) in listData"
|
||||
:key="'scatter-' + index"
|
||||
class="record-item"
|
||||
:class="{ 'record-item--clickable': currentSubTab === 1 }"
|
||||
@click="currentSubTab === 1 && handleReviewedItemClick(item)"
|
||||
>
|
||||
<template v-if="currentSubTab === 1">
|
||||
<view class="record-main">
|
||||
@ -316,7 +318,7 @@ export default {
|
||||
if (this.currentMode === 'scatter') {
|
||||
rawList = rawList.filter(item => {
|
||||
const w = (item.wave_no || '').toUpperCase();
|
||||
return w.startsWith('E') || w.startsWith('D');
|
||||
return w.startsWith('E') || w.startsWith('D') || w.startsWith('A');
|
||||
});
|
||||
} else {
|
||||
rawList = rawList.filter(item => {
|
||||
@ -419,6 +421,16 @@ export default {
|
||||
url: `/pages/work/order/order-review?waveId=${item.wave_id}&mode=group`
|
||||
});
|
||||
}
|
||||
},
|
||||
handleReviewedItemClick(item) {
|
||||
const orderId = item.id || item.order_id || '';
|
||||
if (!orderId) {
|
||||
uni.showToast({ title: '缺少订单ID', icon: 'none' });
|
||||
return;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/work/order/order-review?orderId=${orderId}&tableType=dispatch`
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -668,6 +680,10 @@ export default {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
|
||||
.record-item--clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.record-simple-text {
|
||||
font-size: 34rpx;
|
||||
color: #000000;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user