修改复核发货页面
This commit is contained in:
parent
fe7dde14ed
commit
524da0b7e5
@ -1946,7 +1946,8 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
|||||||
: Array.isArray(item?.stocks) ? item.stocks
|
: Array.isArray(item?.stocks) ? item.stocks
|
||||||
: [],
|
: [],
|
||||||
expresses: Array.isArray(item?.expresses) ? item.expresses : [],
|
expresses: Array.isArray(item?.expresses) ? item.expresses : [],
|
||||||
logs: Array.isArray(item?.logs) ? item.logs : []
|
logs: Array.isArray(item?.logs) ? item.logs : [],
|
||||||
|
suggestedPkg: item?.suggested_package_material || item?.suggestedPkg || item?.suggested_pkg || null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
handleScanOrderSuccess(result, silent = false) {
|
handleScanOrderSuccess(result, silent = false) {
|
||||||
@ -1987,7 +1988,8 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
|||||||
totalOrders: Number(item?.totalOrders ?? 0),
|
totalOrders: Number(item?.totalOrders ?? 0),
|
||||||
storeRemark: item?.storeRemark || '',
|
storeRemark: item?.storeRemark || '',
|
||||||
storeName: item?.storeName || '',
|
storeName: item?.storeName || '',
|
||||||
detailItems: Array.isArray(item?.items) ? item.items : []
|
detailItems: Array.isArray(item?.items) ? item.items : [],
|
||||||
|
suggestedPkg: item?.suggestedPkg || null
|
||||||
}));
|
}));
|
||||||
this.paginationTotal = result?.total ?? flatList.length;
|
this.paginationTotal = result?.total ?? flatList.length;
|
||||||
this.goodsInfoList = [];
|
this.goodsInfoList = [];
|
||||||
@ -3411,13 +3413,57 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 散单:解析推荐包材 ID 并发起绑定请求(失败不阻塞复核)
|
||||||
|
* 有推荐包材数据时仅传数据提交,页面不显示包材绑定弹窗
|
||||||
|
*/
|
||||||
|
async bindSuggestedPackageForSingle() {
|
||||||
|
const pkg = this.detailInfo?.suggestedPkg || null;
|
||||||
|
if (!pkg) return null;
|
||||||
|
const waybillNo = String(this.detailInfo?.waybillNo || this.detailInfo?.waybillCode || '').trim();
|
||||||
|
if (!waybillNo) {
|
||||||
|
console.warn('[packageBinding] 散单缺少运单号,跳过包材绑定');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
const pkgCode = String(pkg.code || pkg.material_code || '').trim();
|
||||||
|
let finalPackageCode = String(pkg.id || pkg.material_id || '');
|
||||||
|
if (!finalPackageCode && pkgCode) {
|
||||||
|
try {
|
||||||
|
const res = await this.$http('setting.packageMaterial.search', { keyword: pkgCode });
|
||||||
|
const list = Array.isArray(res?.data) ? res.data : [];
|
||||||
|
const matched = list.find(item => String(item.material_code || '') === pkgCode);
|
||||||
|
if (matched) {
|
||||||
|
finalPackageCode = String(matched.id || '');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.warn('[packageBinding] 散单搜索推荐包材失败:', e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!finalPackageCode) {
|
||||||
|
console.warn('[packageBinding] 散单推荐包材缺少ID,跳过绑定');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return this.$http('order.bindExpressPackageMaterialByWaybill', {
|
||||||
|
waybill_code: waybillNo,
|
||||||
|
package_material_id: finalPackageCode
|
||||||
|
});
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 执行发货(确认复核)及后续跳转
|
* 执行发货(确认复核)及后续跳转
|
||||||
* @param {string} action autoNext | manual | dprefixed
|
* @param {string} action autoNext | manual | dprefixed
|
||||||
*/
|
*/
|
||||||
async doShip(action = 'autoNext') {
|
async doShip(action = 'autoNext') {
|
||||||
|
// 散单:有推荐包材数据时,包材绑定与复核确认并发提交,页面不显示包材绑定弹窗
|
||||||
|
const pkgBindPromise = this.listType === 'single'
|
||||||
|
? this.bindSuggestedPackageForSingle().catch(err => {
|
||||||
|
console.warn('[packageBinding] 散单包材绑定失败(不阻塞):', err);
|
||||||
|
})
|
||||||
|
: null;
|
||||||
const ok = await this.callConfirmRecheck();
|
const ok = await this.callConfirmRecheck();
|
||||||
if (!ok) return;
|
if (!ok) return;
|
||||||
|
if (pkgBindPromise) {
|
||||||
|
await pkgBindPromise;
|
||||||
|
}
|
||||||
this.printFailDismissed = false;
|
this.printFailDismissed = false;
|
||||||
// 散单称重模式:发货(确认复核)成功后弹出称重弹窗,称重完成后再进入下一单
|
// 散单称重模式:发货(确认复核)成功后弹出称重弹窗,称重完成后再进入下一单
|
||||||
if (this.listType === 'single' && this.weighAfterReview && !this.isDprefixedWave) {
|
if (this.listType === 'single' && this.weighAfterReview && !this.isDprefixedWave) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user