mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d79571f48 | |||
| ff86009ddf | |||
| 928593e32d | |||
| 56802de67f | |||
| 912324cac9 |
@@ -16,16 +16,31 @@ class OrderPackagesReceivedResource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$received_packages = $this->packingLists()->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)->whereHas('packages')->get();
|
||||
$limit = (int) $request->input('limit_paking_list_per_page');
|
||||
$page = (int) $request->input('page', 1);
|
||||
$query = $this->packingLists()
|
||||
->where('type', PackingListType::WAREHOUSE_RECEIVE_LIST)
|
||||
->whereHas('packages');
|
||||
|
||||
$count = $query->count();
|
||||
|
||||
if ($limit) {
|
||||
$received_packages = $query->orderBy('id', 'desc')
|
||||
->skip(($page - 1) * $limit)
|
||||
->limit($limit)
|
||||
->get();
|
||||
} else {
|
||||
$received_packages = $query->get();
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
// 'reference' => $this->reference,
|
||||
'reference_contract' => (int) $this->type,
|
||||
'type' => (int) $this->type,
|
||||
'status' => (int) $this->status,
|
||||
'received_packages' => PackingListForPackagesReceivedResource::collection($received_packages),
|
||||
'created_at' => $this->created_at->format('d-m-Y')
|
||||
'received_packages' => PackingListForPackagesReceivedResource::collection($received_packages),
|
||||
'created_at' => $this->created_at->format('d-m-Y'),
|
||||
'max_page' => $limit ? ceil($count / $limit) : 1,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,29 @@ class OrderV2Resource extends JsonResource
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
$invoicePerPage = (int) $request->input('invoice_per_page');
|
||||
$invoicePageNo = (int) $request->input('invoice_page_no');
|
||||
// $invoices = collect();
|
||||
// $totalInvoices = 0;
|
||||
|
||||
// if ($this->relationLoaded('packingLists')) {
|
||||
// $invoicesQuery = $this->transactions()
|
||||
// ->whereNotIn('transactions.status', [0, 1])
|
||||
// ->whereIn('transactions.type', [
|
||||
// TransactionType::SHIPPING_INVOICE,
|
||||
// TransactionType::STORAGE_INVOICE,
|
||||
// ]);
|
||||
|
||||
// $totalInvoices = $invoicesQuery->count();
|
||||
|
||||
// if ($invoicePerPage > 0 && $invoicePageNo > 0) {
|
||||
// $invoicesQuery->skip(($invoicePageNo - 1) * $invoicePerPage)
|
||||
// ->orderBy('transactions.id', 'desc')
|
||||
// ->limit($invoicePerPage);
|
||||
// }
|
||||
// $invoices = $invoicesQuery->get();
|
||||
// }
|
||||
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'reference' => $this->reference,
|
||||
@@ -30,14 +53,16 @@ class OrderV2Resource extends JsonResource
|
||||
'warehouse' => new CompanyModuleResource($this->orderRoles()->where('role_id', '=', OrderRoleTypes::ORIGIN_WAREHOUSE)->first()->appointee),
|
||||
'address' => new AddressResource($this->addresses()->where('status', '=', ApprovalStatus::APPROVED)->first()),
|
||||
'address_change_request' => new AddressResource($this->addressesPendingVerification()->first()),
|
||||
'invoices' => $this->whenLoaded('packingLists', function() {
|
||||
return TransactionWithStorageResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get());
|
||||
}),
|
||||
'invoices' => $invoicePerPage ?
|
||||
[]
|
||||
: $this->whenLoaded('packingLists', function () {
|
||||
return TransactionWithStorageResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->whereIn('transactions.type', [TransactionType::SHIPPING_INVOICE, TransactionType::STORAGE_INVOICE])->get());
|
||||
}),
|
||||
'storages' => $this->storages ? $this->storages : null, //from middleware
|
||||
'remarks' => RemarkResource::collection($this->remarks),
|
||||
'supplier_tax_rebate' => SupplierTaxRebateResource::collection($this->supplierTaxRebate),
|
||||
'created_at' => $this->created_at->format('d-m-Y')
|
||||
'created_at' => $this->created_at->format('d-m-Y'),
|
||||
// 'invoices_max_page' => $totalInvoices > 0 ? (int) ceil($totalInvoices / ($invoicePerPage < 1 ? 1 : $invoicePerPage)) : 1,
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,91 +1,139 @@
|
||||
<template>
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-4">
|
||||
<loading-component style="height: 200px; top: 0;" v-if="isLoading"></loading-component>
|
||||
<div class="row" v-if="!isLoading && order">
|
||||
<div class="col bg-complete-lighter p-b-10 ml-4 mr-4 mt-2 m-sm-0">
|
||||
<div class="row align-item-center p-t-10 p-b-10">
|
||||
<div class="col">
|
||||
<h6 class="bold no-margin">Received Parcels</h6>
|
||||
<p class="no-margin ">Parcels received at our warehouse</p>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="40" height="40"
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g fill="#000000"><path d="M8.6,23.65c-2.37676,0 -4.3,1.92324 -4.3,4.3c0,2.37676 1.92324,4.3 4.3,4.3c2.37676,0 4.3,-1.92324 4.3,-4.3c4.77031,0 8.6,3.82969 8.6,8.6v85.10137c0,8.28926 6.76074,15.05 15.05,15.05h0.50391c0.99941,2.98145 3.72051,5.19863 7.02109,5.19863h4.43438c-0.74746,1.26816 -1.20938,2.72949 -1.20938,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20938,-4.3h66.91875c-0.74746,1.26816 -1.20937,2.72949 -1.20937,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20937,-4.3h4.43437c3.36777,0 6.13926,-2.30117 7.08828,-5.375h0.43672v-2.15c0,-3.90527 -3.04863,-7.12188 -6.87832,-7.45781c0.26035,-0.69707 0.42832,-1.43613 0.42832,-2.21719v-40.85c0,-1.67129 -0.73066,-3.14941 -1.78887,-4.3c1.0582,-1.15059 1.78887,-2.62871 1.78887,-4.3v-43c0,-3.53574 -2.91426,-6.45 -6.45,-6.45h-94.6c-3.53574,0 -6.45,2.91426 -6.45,6.45v43c0,1.67129 0.73066,3.14941 1.78887,4.3c-1.0582,1.15059 -1.78887,2.62871 -1.78887,4.3v40.85c0,0.78105 0.16797,1.52012 0.42832,2.21719c-3.15781,0.27715 -5.75293,2.51953 -6.57598,5.48418h-0.30234c-5.96289,0 -10.75,-4.78711 -10.75,-10.75v-85.10137c0,-7.09668 -5.80332,-12.9 -12.9,-12.9zM49.45,30.1h94.6c1.21777,0 2.15,0.93223 2.15,2.15v43c0,1.21777 -0.93223,2.15 -2.15,2.15c-1.17578,0.0168 -2.11641,0.97422 -2.11641,2.15c0,1.17578 0.94062,2.1332 2.11641,2.15c1.21777,0 2.15,0.93223 2.15,2.15v40.85c0,1.21777 -0.93223,2.15 -2.15,2.15h-94.6c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-40.85c0,-1.21777 0.93223,-2.15 2.15,-2.15c1.17578,-0.0168 2.11641,-0.97422 2.11641,-2.15c0,-1.17578 -0.94063,-2.1332 -2.11641,-2.15c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-43c0,-1.21777 0.93223,-2.15 2.15,-2.15zM88.15,38.7c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM58.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM66.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM75.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM83.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM92.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM101.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM109.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM118.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM126.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM135.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM88.15,90.3c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM44.075,131.15h105.35c1.80566,0 3.225,1.41934 3.225,3.225c0,1.80566 -1.41934,3.225 -3.225,3.225h-105.35c-1.80566,0 -3.225,-1.41934 -3.225,-3.225c0,-1.80566 1.41934,-3.225 3.225,-3.225zM55.9,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3zM137.6,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3z"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="$store.getters.isSuperAdmin">
|
||||
<div class="col">
|
||||
<div data-type="createWarehousePackageList" class="text-complete pointer requestModal fs-11 all-caps text-underline">Add Arrived Parcel</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="stick-up" type="createWarehousePackageList" >
|
||||
<create-warehouse-package-list-form-component :id="order.id" :section="section"></create-warehouse-package-list-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="order.received_packages" v-for="(group, reference, index) in groupedParcelsByReference" :key="reference">
|
||||
<div class="col">
|
||||
<parcel-component
|
||||
v-for="parcel in group"
|
||||
:key="parcel.id"
|
||||
:data="parcel"
|
||||
:section="section"
|
||||
></parcel-component>
|
||||
<div class="row justify-content-center mt-3">
|
||||
<div class="col-auto">
|
||||
<p class="no-margin bold fs-14">
|
||||
<a :href="route('order.tracking', group[0].reference_encrypted)" target="_blank">
|
||||
Tracking Details <i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
<div class="col-12 col-sm-4">
|
||||
<loading-component style="height: 200px; top: 0;" v-if="isLoading"></loading-component>
|
||||
<div class="row" v-if="!isLoading && order">
|
||||
<div class="col bg-complete-lighter p-b-10 ml-4 mr-4 mt-2 m-sm-0">
|
||||
<div class="row align-item-center p-t-10 p-b-10">
|
||||
<div class="col">
|
||||
<h6 class="bold no-margin">Received Parcels</h6>
|
||||
<p class="no-margin ">Parcels received at our warehouse</p>
|
||||
</div>
|
||||
|
||||
<hr v-if="index < Object.keys(groupedParcelsByReference).length - 1" class="my-2" style="border: none; border-top: 1px solid #000;" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row" v-if="order.received_packages">
|
||||
<div class="col">
|
||||
<parcel-component :section="section" v-for="parcel in order.received_packages.flatMap(packing_list => packing_list.packages)" :data="parcel" :key="parcel.id"></parcel-component>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<loading-component style="height: 200px; top: 0;" v-if="isLoading"></loading-component>
|
||||
<div class="row" v-if="!isLoading && order">
|
||||
<div class="col">
|
||||
<div class="row" v-if="order.received_packages.flatMap(packing_list => packing_list.packages).length">
|
||||
<div class="col">
|
||||
<div class="row" v-for="group in Math.ceil(order.received_packages.flatMap(packing_list => packing_list.packages).length / 3)">
|
||||
<div class="col-12" :class="'col-md-'+(12/3)" v-for="item in order.received_packages.flatMap(packing_list => packing_list.packages).slice((group - 1) * 3, group * 3)" v-bind:key="item.id" :data="item">
|
||||
<package-v2-component :section="section" :data="item" status="Shipping"></package-v2-component>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
|
||||
width="40" height="40"
|
||||
viewBox="0 0 172 172"
|
||||
style=" fill:#000000;"><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g fill="#000000"><path d="M8.6,23.65c-2.37676,0 -4.3,1.92324 -4.3,4.3c0,2.37676 1.92324,4.3 4.3,4.3c2.37676,0 4.3,-1.92324 4.3,-4.3c4.77031,0 8.6,3.82969 8.6,8.6v85.10137c0,8.28926 6.76074,15.05 15.05,15.05h0.50391c0.99941,2.98145 3.72051,5.19863 7.02109,5.19863h4.43438c-0.74746,1.26816 -1.20938,2.72949 -1.20938,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20938,-4.3h66.91875c-0.74746,1.26816 -1.20937,2.72949 -1.20937,4.3c0,4.72832 3.87168,8.6 8.6,8.6c4.72832,0 8.6,-3.87168 8.6,-8.6c0,-1.57051 -0.46191,-3.03184 -1.20937,-4.3h4.43437c3.36777,0 6.13926,-2.30117 7.08828,-5.375h0.43672v-2.15c0,-3.90527 -3.04863,-7.12188 -6.87832,-7.45781c0.26035,-0.69707 0.42832,-1.43613 0.42832,-2.21719v-40.85c0,-1.67129 -0.73066,-3.14941 -1.78887,-4.3c1.0582,-1.15059 1.78887,-2.62871 1.78887,-4.3v-43c0,-3.53574 -2.91426,-6.45 -6.45,-6.45h-94.6c-3.53574,0 -6.45,2.91426 -6.45,6.45v43c0,1.67129 0.73066,3.14941 1.78887,4.3c-1.0582,1.15059 -1.78887,2.62871 -1.78887,4.3v40.85c0,0.78105 0.16797,1.52012 0.42832,2.21719c-3.15781,0.27715 -5.75293,2.51953 -6.57598,5.48418h-0.30234c-5.96289,0 -10.75,-4.78711 -10.75,-10.75v-85.10137c0,-7.09668 -5.80332,-12.9 -12.9,-12.9zM49.45,30.1h94.6c1.21777,0 2.15,0.93223 2.15,2.15v43c0,1.21777 -0.93223,2.15 -2.15,2.15c-1.17578,0.0168 -2.11641,0.97422 -2.11641,2.15c0,1.17578 0.94062,2.1332 2.11641,2.15c1.21777,0 2.15,0.93223 2.15,2.15v40.85c0,1.21777 -0.93223,2.15 -2.15,2.15h-94.6c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-40.85c0,-1.21777 0.93223,-2.15 2.15,-2.15c1.17578,-0.0168 2.11641,-0.97422 2.11641,-2.15c0,-1.17578 -0.94063,-2.1332 -2.11641,-2.15c-1.21777,0 -2.15,-0.93223 -2.15,-2.15v-43c0,-1.21777 0.93223,-2.15 2.15,-2.15zM88.15,38.7c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM58.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM66.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM75.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM83.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM92.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM101.05,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM109.65,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM118.25,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM126.85,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM135.45,77.4c-1.18418,0 -2.15,0.96582 -2.15,2.15c0,1.18418 0.96582,2.15 2.15,2.15c1.18418,0 2.15,-0.96582 2.15,-2.15c0,-1.18418 -0.96582,-2.15 -2.15,-2.15zM88.15,90.3c-0.77266,-0.0084 -1.49492,0.39473 -1.88965,1.0666c-0.38633,0.67188 -0.38633,1.49492 0,2.1668c0.39473,0.67188 1.11699,1.075 1.88965,1.0666h17.2c0.77266,0.0084 1.49492,-0.39473 1.88965,-1.0666c0.38633,-0.67187 0.38633,-1.49492 0,-2.1668c-0.39472,-0.67187 -1.11699,-1.075 -1.88965,-1.0666zM44.075,131.15h105.35c1.80566,0 3.225,1.41934 3.225,3.225c0,1.80566 -1.41934,3.225 -3.225,3.225h-105.35c-1.80566,0 -3.225,-1.41934 -3.225,-3.225c0,-1.80566 1.41934,-3.225 3.225,-3.225zM55.9,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3zM137.6,141.9c2.40195,0 4.3,1.89805 4.3,4.3c0,2.40195 -1.89805,4.3 -4.3,4.3c-2.40195,0 -4.3,-1.89805 -4.3,-4.3c0,-2.40195 1.89805,-4.3 4.3,-4.3z"></path></g></g></svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.received_packages.length">
|
||||
<div class="col-10">
|
||||
<div class="row align-items-center justify-content-center hint-text">
|
||||
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
|
||||
<div class="row" v-if="$store.getters.isSuperAdmin">
|
||||
<div class="col">
|
||||
<div data-type="createWarehousePackageList" class="text-complete pointer requestModal fs-11 all-caps text-underline">Add Arrived Parcel</div>
|
||||
<modal-component class="animate__animated animate__fast animate__fadeIn" styleType="stick-up" type="createWarehousePackageList" >
|
||||
<create-warehouse-package-list-form-component :id="order.id" :section="section"></create-warehouse-package-list-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
<div class="row text-center">
|
||||
</div>
|
||||
<div class="row" v-if="order.received_packages" v-for="(group, reference, index) in groupedParcelsByReference" :key="reference">
|
||||
<div class="col">
|
||||
<div class="row m-t-20">
|
||||
<parcel-component
|
||||
v-for="parcel in group"
|
||||
:key="parcel.id"
|
||||
:data="parcel"
|
||||
:section="section"
|
||||
></parcel-component>
|
||||
<div class="row justify-content-center mt-3">
|
||||
<div class="col-auto">
|
||||
<p class="no-margin bold fs-14">
|
||||
<a :href="route('order.tracking', group[0].reference_encrypted)" target="_blank">
|
||||
Tracking Details <i class="fa fa-external-link"></i>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr v-if="index < Object.keys(groupedParcelsByReference).length - 1" class="my-2" style="border: none; border-top: 1px solid #000;" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row" v-if="order.received_packages">
|
||||
<div class="col">
|
||||
<parcel-component :section="section" v-for="parcel in order.received_packages.flatMap(packing_list => packing_list.packages)" :data="parcel" :key="parcel.id"></parcel-component>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<loading-component style="height: 200px; top: 0;" v-if="isLoading"></loading-component>
|
||||
<div class="row" v-if="!isLoading && order">
|
||||
<div class="col">
|
||||
<div class="row" v-if="order.received_packages.flatMap(packing_list => packing_list.packages).length">
|
||||
<div class="col">
|
||||
<div class="row" v-for="group in Math.ceil(order.received_packages.flatMap(packing_list => packing_list.packages).length / 3)">
|
||||
<div class="col-12" :class="'col-md-'+(12/3)" v-for="item in order.received_packages.flatMap(packing_list => packing_list.packages).slice((group - 1) * 3, group * 3)" v-bind:key="item.id" :data="item">
|
||||
<package-v2-component :section="section" :data="item" status="Shipping"></package-v2-component>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-if="!order.received_packages.length">
|
||||
<div class="col-10">
|
||||
<div class="row align-items-center justify-content-center hint-text">
|
||||
<div class="col-4 hint-text"><img :src="asset('images/not-found-illustration.png')" class="w-100 hint-text"/></div>
|
||||
</div>
|
||||
<div class="row text-center">
|
||||
<div class="col">
|
||||
<p class="all-caps no-margin fs-11" style="letter-spacing: 2px;">Nothing To Show Here Yet!</p>
|
||||
<div class="row m-t-20">
|
||||
<div class="col">
|
||||
<p class="all-caps no-margin fs-11" style="letter-spacing: 2px;">Nothing To Show Here Yet!</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- custom pagination -->
|
||||
<div class="row no-margin mt-3" v-if="order?.max_page > 1">
|
||||
<div class="col">
|
||||
<div class="row justify-content-end">
|
||||
<!-- First Page -->
|
||||
<div
|
||||
class="col-auto b-a p-t-5 p-b-5 m-l-5 pointer b-grey"
|
||||
v-if="packingListFilters.page !== 1 && !pageNumbers.includes(1)"
|
||||
@click="callPage(1)"
|
||||
>
|
||||
<i class="fa fa-angle-double-left fs-14 muted lh-16"></i>
|
||||
</div>
|
||||
|
||||
<!-- Page Numbers -->
|
||||
<div
|
||||
class="col-auto b-a p-t-5 p-b-5 m-l-5"
|
||||
v-for="n in pageNumbers"
|
||||
:key="n"
|
||||
@click="callPage(n)"
|
||||
:class="[
|
||||
{ 'b-grey pointer': n !== packingListFilters.page },
|
||||
{ 'b-primary bg-primary': n === packingListFilters.page }
|
||||
]"
|
||||
>
|
||||
<small
|
||||
class="fs-11"
|
||||
:class="[
|
||||
{ muted: n !== packingListFilters.page },
|
||||
{ 'text-white bold': n === packingListFilters.page }
|
||||
]"
|
||||
>{{ n }}</small>
|
||||
</div>
|
||||
|
||||
<!-- Last Page -->
|
||||
<div
|
||||
class="col-auto b-a p-t-5 p-b-5 m-l-5 pointer b-grey"
|
||||
v-if="packingListFilters.page !== order.max_page && !pageNumbers.includes(order.max_page)"
|
||||
@click="callPage(order.max_page)"
|
||||
>
|
||||
<i class="fa fa-angle-double-right fs-14 muted lh-16"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
@@ -112,6 +160,20 @@
|
||||
}
|
||||
|
||||
return groups;
|
||||
},
|
||||
pageNumbers() {
|
||||
const pages = [];
|
||||
const total = this.order?.max_page || 1;
|
||||
const current = this.packingListFilters.page;
|
||||
|
||||
const range = 2; // Show current ± 2 pages
|
||||
const start = Math.max(1, current - range);
|
||||
const end = Math.min(total, current + range);
|
||||
|
||||
for (let i = start; i <= end; i++) {
|
||||
pages.push(i);
|
||||
}
|
||||
return pages;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -124,18 +186,32 @@
|
||||
order: null,
|
||||
dataLoaded: false,
|
||||
filters: {},
|
||||
packingListFilters: {
|
||||
page: 1,
|
||||
limit_paking_list_per_page: 10,
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fetch(){
|
||||
this.isLoading = true;
|
||||
this.submit(route('api.order.packages.v2', this.order_number) + '?filters=' + JSON.stringify(this.filters), 'get', this.section, false, false);
|
||||
},
|
||||
successHandler(response){
|
||||
this.dataLoaded = true;
|
||||
this.isLoading = false;
|
||||
this.order = response.payload.data;
|
||||
}
|
||||
}
|
||||
methods: {
|
||||
fetch(){
|
||||
this.isLoading = true;
|
||||
const params = new URLSearchParams({
|
||||
...this.filters,
|
||||
limit_paking_list_per_page: this.packingListFilters.limit_paking_list_per_page,
|
||||
page: this.packingListFilters.page
|
||||
});
|
||||
this.submit(route('api.order.packages.v2', this.order_number) + '?' + params.toString(), 'get', this.section, false, false);
|
||||
},
|
||||
successHandler(response){
|
||||
this.dataLoaded = true;
|
||||
this.isLoading = false;
|
||||
this.order = response.payload.data;
|
||||
},
|
||||
callPage(page) {
|
||||
if (page === this.packingListFilters.page) return;
|
||||
this.packingListFilters.page = page;
|
||||
this.fetch();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -165,6 +165,54 @@
|
||||
<customer-payments-billing-component :data="invoice" invoice_status="Pending Payment" :section="section"></customer-payments-billing-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row no-margin mt-3" v-if="order.invoices_max_page > 1">
|
||||
<div class="col">
|
||||
<!-- custom pagination -->
|
||||
<div class="row no-margin mt-3">
|
||||
<div class="col">
|
||||
<div class="row justify-content-end">
|
||||
<!-- First Page -->
|
||||
<div
|
||||
class="col-auto b-a p-t-5 p-b-5 m-l-5 pointer b-grey"
|
||||
v-if="invoiceFilters.page !== 1 && !pageNumbers.includes(1)"
|
||||
@click="callPage(1)"
|
||||
>
|
||||
<i class="fa fa-angle-double-left fs-14 muted lh-16"></i>
|
||||
</div>
|
||||
|
||||
<!-- Page Numbers -->
|
||||
<div
|
||||
class="col-auto b-a p-t-5 p-b-5 m-l-5"
|
||||
v-for="n in pageNumbers"
|
||||
:key="n"
|
||||
@click="callPage(n)"
|
||||
:class="[
|
||||
{ 'b-grey pointer': n !== invoiceFilters.page },
|
||||
{ 'b-primary bg-primary': n === invoiceFilters.page }
|
||||
]"
|
||||
>
|
||||
<small
|
||||
class="fs-11"
|
||||
:class="[
|
||||
{ muted: n !== invoiceFilters.page },
|
||||
{ 'text-white bold': n === invoiceFilters.page }
|
||||
]"
|
||||
>{{ n }}</small>
|
||||
</div>
|
||||
|
||||
<!-- Last Page -->
|
||||
<div
|
||||
class="col-auto b-a p-t-5 p-b-5 m-l-5 pointer b-grey"
|
||||
v-if="invoiceFilters.page !== order.invoices_max_page && !pageNumbers.includes(order.invoices_max_page)"
|
||||
@click="callPage(order.invoices_max_page)"
|
||||
>
|
||||
<i class="fa fa-angle-double-right fs-14 muted lh-16"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -200,6 +248,10 @@
|
||||
isLoading: true,
|
||||
order: null,
|
||||
addComment: false,
|
||||
invoiceFilters: {
|
||||
perPage: 5,
|
||||
page: 1,
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -215,6 +267,20 @@
|
||||
}
|
||||
}
|
||||
return storageMap;
|
||||
},
|
||||
pageNumbers() {
|
||||
const pages = [];
|
||||
const total = this.order?.invoices_max_page || 1;
|
||||
const current = this.invoiceFilters.page;
|
||||
|
||||
const range = 2; // Show current ± 2 pages
|
||||
const start = Math.max(1, current - range);
|
||||
const end = Math.min(total, current + range);
|
||||
|
||||
for (let i = start; i <= end; i++) {
|
||||
pages.push(i);
|
||||
}
|
||||
return pages;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -230,7 +296,7 @@
|
||||
methods: {
|
||||
fetchCompany(){
|
||||
this.isLoading = true;
|
||||
this.submit(route('api.order.v2.show', this.order_number), 'get', this.section, false, false)
|
||||
this.submit(route('api.order.v2.show', this.order_number) + '?invoice_per_page=' + this.invoiceFilters.perPage + '&invoice_page_no=' + this.invoiceFilters.page, 'get', this.section, false, false)
|
||||
},
|
||||
successHandler(response){
|
||||
this.$store.dispatch('completeList', {'name': this.section, 'data': []});
|
||||
@@ -292,6 +358,11 @@
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
},
|
||||
callPage(page) {
|
||||
if (page === this.invoiceFilters.page) return;
|
||||
this.invoiceFilters.page = page;
|
||||
this.fetchCompany();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user