🔀 合并 websoft/dev,统一待回单确认与公路配载校验
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -42,7 +42,7 @@ export const waybillStatusOptions = [
|
||||
{ label: '草稿', value: 'draft' },
|
||||
{ label: '待执行', value: 'pending' },
|
||||
{ label: '进行中', value: 'running' },
|
||||
{ label: '待确认回单', value: 'pending_return' },
|
||||
{ label: '待回单确认', value: 'pending_return_confirm' },
|
||||
{ label: '已完成', value: 'completed' },
|
||||
{ label: '已取消', value: 'cancelled' },
|
||||
];
|
||||
|
||||
@@ -471,26 +471,20 @@ export const config = {
|
||||
endDateRange: ['endDateStart', 'endDateEnd'],
|
||||
createTimeRange: ['createTimeStart', 'createTimeEnd'],
|
||||
},
|
||||
actions: ['copy', 'cancel', 'reassign', 'complete', 'batchComplete'],
|
||||
actions: ['copy', 'cancel', 'reassign', 'complete', 'batchComplete', 'confirmReturn'],
|
||||
detailButton: true,
|
||||
statusProp: 'businessStatus',
|
||||
statusTextProp: 'businessStatusName',
|
||||
formatStatus(row, prop, defaultText) {
|
||||
if (prop !== 'businessStatus') return defaultText;
|
||||
const status = String(row.businessStatus || '');
|
||||
const terminalStatuses = [
|
||||
'draft',
|
||||
'completed',
|
||||
'cancelled',
|
||||
'waiting_dispatch',
|
||||
'dispatching',
|
||||
'pending_return',
|
||||
];
|
||||
if (status === 'pending_return') return '待确认回单';
|
||||
const terminalStatuses = ['draft', 'completed', 'cancelled', 'waiting_dispatch', 'dispatching'];
|
||||
const needAccept =
|
||||
row.requireAccept === true ||
|
||||
row.requireAccept === 1 ||
|
||||
requiresDriverAcceptConfirmation(row);
|
||||
// 待回单确认由末位打卡产生,司机必然已接单
|
||||
if (status === 'pending_return_confirm') return '待回单确认';
|
||||
// 需司机接单且尚未接单 → 待执行(含库中仍为 running 的历史数据展示校正)
|
||||
if (needAccept && !hasDriverAcceptRecord(row) && !terminalStatuses.includes(status)) {
|
||||
return '待执行';
|
||||
@@ -505,20 +499,14 @@ export const config = {
|
||||
getDriverRejectReason,
|
||||
isDriverRejectedWaybill,
|
||||
canEdit(row) {
|
||||
// 进行中、待确认回单不允许编辑
|
||||
// 进行中的运单不允许编辑
|
||||
if (isInProgressStatus(row, row.businessStatusName)) {
|
||||
return false;
|
||||
}
|
||||
if (String(row.businessStatus || '') === 'pending_return') {
|
||||
return false;
|
||||
}
|
||||
return !isDriverRejectedWaybill(row);
|
||||
},
|
||||
canCancel(row) {
|
||||
// 进行中、待确认回单不允许取消
|
||||
if (String(row.businessStatus || '') === 'pending_return') {
|
||||
return false;
|
||||
}
|
||||
// 进行中的运单不允许取消;待回单确认仍可取消(与页面 canCancel 一致)
|
||||
return !isInProgressStatus(row, row.businessStatusName);
|
||||
},
|
||||
deleteStatus: ['draft'],
|
||||
|
||||
Reference in New Issue
Block a user