feat: 立即发货、延迟发货、查看订单按钮展示调整
This commit is contained in:
@@ -108,6 +108,8 @@
|
||||
:status="Number(state.orderInfo.status)"
|
||||
:disableDelayShipment="isPickUpOrder || !isAiStoreOrder"
|
||||
:hasDelayedItems="hasDelayedItems"
|
||||
:canDelayItems="canDelayItems"
|
||||
:canShipItems="canShipItems"
|
||||
:logisticsId="state.orderInfo.logisticsId"
|
||||
:logisticsNo="state.orderInfo.logisticsNo"
|
||||
:deliveryTime="state.orderInfo.deliveryTime"
|
||||
@@ -257,6 +259,43 @@
|
||||
return records.some((record) => Number(record?.status) === 1);
|
||||
});
|
||||
|
||||
const getCurrentDelayRecords = () => {
|
||||
if (Array.isArray(state.delayRecords) && state.delayRecords.length > 0) return state.delayRecords;
|
||||
const orderRecords = Array.isArray(state.orderInfo?.delayRecords)
|
||||
? state.orderInfo.delayRecords
|
||||
: Array.isArray(state.orderInfo?.delayRecordList)
|
||||
? state.orderInfo.delayRecordList
|
||||
: [];
|
||||
return orderRecords;
|
||||
};
|
||||
|
||||
const canDelayItems = computed(() => {
|
||||
if (!isAiStoreOrder.value) return false;
|
||||
if (isPickUpOrder.value) return false;
|
||||
const delayRecords = getCurrentDelayRecords();
|
||||
const hasActivated = delayRecords.some((record) => Number(record?.status) === 2);
|
||||
if (hasActivated) return true;
|
||||
if (delayRecords.length === 0) {
|
||||
const totalCount = Number(state.orderInfo?.productCount || state.orderInfo?.totalCount || 0) || 0;
|
||||
if (totalCount > 0) return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
const canShipItems = computed(() => {
|
||||
if (!isAiStoreOrder.value) return false;
|
||||
if (isPickUpOrder.value) return false;
|
||||
const delayRecords = getCurrentDelayRecords();
|
||||
if (delayRecords.length === 0) {
|
||||
const totalCount = Number(state.orderInfo?.productCount || state.orderInfo?.totalCount || 0) || 0;
|
||||
return totalCount > 0;
|
||||
}
|
||||
return delayRecords.some((record) => {
|
||||
const status = Number(record?.status);
|
||||
return status === 1 || status === 2;
|
||||
});
|
||||
});
|
||||
|
||||
const hasLogistics = computed(() => {
|
||||
const info = state.orderInfo || {};
|
||||
if (Number(info.logisticsId) > 0) return true;
|
||||
|
||||
Reference in New Issue
Block a user