Compare commits

..

21 Commits

Author SHA1 Message Date
edmondlang 2bc43cbc8f list order v2 2023-04-25 23:40:27 +08:00
Omair Saleh e0a02c7051 update foshan map png 2023-04-20 00:01:38 +08:00
Omair Saleh 34a08563f3 Merge remote-tracking branch 'origin/master' 2023-04-19 23:57:31 +08:00
Omair Saleh 9df1e158a4 disable temporary include new columns to invoice export for chasing payment 2023-04-19 23:55:31 +08:00
edmondlang 33cd313950 foshan-warehouse image 2023-04-19 23:53:16 +08:00
EDMOND MING 2af5035e99 Delete foshan-map.png 2023-04-19 15:52:26 +00:00
Omair Saleh acb7337b4a temporary include new columns to invoice export for chasing payment 2023-04-19 15:41:19 +08:00
Omair Saleh 0a9bc29202 temporary include new columns to invoice export for chasing payment 2023-04-19 15:33:16 +08:00
Omair Saleh 1568c7272a temporary include new columns to invoice export for chasing payment 2023-04-19 15:31:12 +08:00
Omair Saleh 14f0560055 Merge remote-tracking branch 'origin/master' 2023-04-19 15:27:06 +08:00
Omair Saleh fc339f1dec temporary include new columns to invoice export for chasing payment 2023-04-19 15:26:45 +08:00
edmondlang 77f7e86a5f fix bug date error in update announcement function in settings page 2023-04-19 12:52:46 +08:00
edmondlang 6970908b75 update generate PDF controller 2023-04-19 12:34:01 +08:00
edmondlang 3f31d2d578 add foshan map 2023-04-19 00:32:22 +08:00
edmondlang 8d8c468b09 foshan-warehouse 2023-04-18 23:42:49 +08:00
Dillon Ngo 557ab483f8 Merge branch 'dillon/improvement-1' into 'master'
Reduce flooding of logs from Perfex CRM

See merge request CIEFWorldwideSdnBhd/shipping-portal!162
2023-04-15 14:02:03 +00:00
Dillon 4b0b88b5d8 Reduce flooding of logs from Perfex CRM 2023-04-15 21:46:26 +08:00
edmondlang 1960cff426 create a cron job to fix all billplz failed callback for all the success payments. 2023-04-14 11:39:24 +08:00
edmondlang 0402fc67e2 update package loading animation 2023-04-13 22:57:46 +08:00
edmondlang 4089683ab7 remove all css comments 2023-04-13 22:53:12 +08:00
edmondlang 3fdd2a2b56 update package loading animation 2023-04-13 22:46:41 +08:00
23 changed files with 492 additions and 72 deletions
+19 -2
View File
@@ -2,8 +2,8 @@
namespace App\Classes\General;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Log;
class Helper
{
@@ -24,4 +24,21 @@ class Helper
return array_slice(get_class_methods($className), 1);
}
}
/**
* @param $log
* @return none
*/
static function debugLoggerForPerfexCRM($log){
if($log){
$message = $log['message'];
$substring = 'No data were found';
if (isset($message)) {
if (strpos($message, $substring) !== false) {
// Log::info('Message exist');
} else {
Log::info($log['message']);
}
}
}
}
}
+7 -2
View File
@@ -19,7 +19,7 @@ use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use App\Classes\General\Helper;
class UpdatePerfexCRMInvoice implements ShouldQueue
{
@@ -51,7 +51,12 @@ class UpdatePerfexCRMInvoice implements ShouldQueue
if(is_null($invoice)){
$result = (App()->make(CreatePerfexCRMInvoiceProcessor::class))->execute($transaction->owner, $this->updatePerfexCRMInvoiceObject->getIsPaid());
$invoiceId = $result->payload['id'];
if ($result) {
$invoiceId = $result->payload['id'];
} else {
// Log::error(json_encode('UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed'));
Helper::debugLoggerForPerfexCRM('UpdatePerfexCRMInvoice CreatePerfexCRMInvoiceProcessor failed');
}
}
else{
$invoiceId = $invoice->id;
@@ -10,7 +10,7 @@ use App\Classes\Modules\Announcements\Services\FetchesAnnouncement;
use App\Classes\Modules\Announcements\Services\UpdatesAnnouncement;
use App\Http\Resources\AnnouncementResource;
use Carbon\Carbon;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -66,8 +66,8 @@ class UpdateAnnouncementLogic extends AbstractControllerLogic
$annoucement_object = new AnnouncementObject(
$request->input('title'),
$request->input('description'),
$request->input('starting_on'),
$request->input('ending_on')
Carbon::createFromFormat('d-m-Y', $request->input('starting_on'))->format('Y-m-d H:i:s'),
Carbon::createFromFormat('d-m-Y', $request->input('ending_on'))->format('Y-m-d H:i:s')
);
$this->canUpdateAnnouncement->passes($annoucement_object);
@@ -39,7 +39,12 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
'ProjNo',
'DeptNo',
'Qty',
'UnitPrice'
'UnitPrice',
// 'marking',
// 'contact person',
// 'contact number',
// 'link',
// 'amount'
];
}
@@ -97,6 +102,10 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
$order = $transaction->owner->owner;
$company = $order->companyModule->company;
$shippingTransactionDetails = $transaction->transactionDetails()->where('reference', 'SHIPPING_FEE')->first();
$marking = $order->companyModule->inviters()->withPivot('invitee_reference')->first()->pivot->invitee_reference;
$contact = $order->companyModule->company->contacts->first();
$userName = $order->companyModule->employees()->first();
$link = route('customer.payment-and-billing', $marking);
$furtherDescription = '';
@@ -123,7 +132,12 @@ class ExportsPaymentTransactions implements FromQuery, WithHeadings, WithHeading
$container->reference,
'CIEF',
$shippingTransactionDetails->quantity,
$shippingTransactionDetails->price
$shippingTransactionDetails->price,
// $marking,
// $contact ? $contact->phone : '',
// $userName->name,
// $link,
// $transaction->amount
];
return [
'<<New>>',
@@ -18,7 +18,8 @@ use Illuminate\Http\JsonResponse;
class CreateOrderLogic extends AbstractControllerLogic
{
protected function notification():array {
protected function notification(): array
{
return [
'title' => 'Created Order',
'message' => 'You have successfully created a new Order'
@@ -62,19 +63,31 @@ class CreateOrderLogic extends AbstractControllerLogic
}
public function logic(Request $request) : JsonResponse {
public function logic(Request $request): JsonResponse
{
$company = $this->fetchesCompany->execute(['id' => $request->input('company_id')]);
$address = $this->fetchesAddress->execute(['id' => $request->input('address_id')]);
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $request->input('warehouse_id')]);
// todo-new: fix this
// if select warehouse foshan
if ($request->input('warehouse_id') === 'foshan') {
// 13 - sabah, 14 - sarawak
if (in_array($address->state->id, [13, 14])) {
$originWarehouse = $this->fetchesCompanyModule->execute(['reference' => WarehouseReferences::YD_FS_WEST_MALAYSIA]);
} else {
$originWarehouse = $this->fetchesCompanyModule->execute(['reference' => WarehouseReferences::YD_FS_WEST_MALAYSIA]);
}
} else {
$originWarehouse = $this->fetchesCompanyModule->execute(['id' => $request->input('warehouse_id')]);
if(!in_array($company->companyModules()->importers()->first()->id, WarehouseReferences::YD_EXEMPT_LIST)){
$originWarehouse = $this->fetchesCompanyModule->execute(['reference' => $originWarehouse->reference === WarehouseReferences::VT_GUANG_ZHOU ? WarehouseReferences::YD_GUANG_ZHOU : WarehouseReferences::YD_YIWU]);
if (!in_array($company->companyModules()->importers()->first()->id, WarehouseReferences::YD_EXEMPT_LIST)) {
$originWarehouse = $this->fetchesCompanyModule->execute(['reference' => $originWarehouse->reference === WarehouseReferences::VT_GUANG_ZHOU ? WarehouseReferences::YD_GUANG_ZHOU : WarehouseReferences::YD_YIWU]);
}
}
if($originWarehouse->reference === WarehouseReferences::YD_YIWU && in_array($address->state_id, [5, 13, 14])) {
throw new RequestValidationException('Our Yiwu warehouse is unable to ship goods to Sabah & Sarawak at the moment. you can select our Guangzhou warehouse as an alternative.');
}
@@ -0,0 +1,56 @@
<?php
namespace App\Classes\Modules\Orders\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Classes\Modules\Orders\Services\ListsOrders;
use App\Classes\Modules\Orders\Standards\Rules\CanListOrders;
use App\Classes\ValueObjects\Constants\OrderType;
use App\Http\Resources\OrderV2Resource;
use ErrorException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class ListOrdersV2Logic extends AbstractControllerLogic
{
/**
* @return array
*/
protected function notification():array {
return [
'title' => 'Retrieved Orders',
'message' => 'You have successfully retrieved a list of Orders'
];
}
/** @var CanListOrders */
private $canListOrders;
/** @var ListsOrders */
private $listsOrders;
/**
* ListOrdersLogic constructor.
* @param CanListOrders $canListOrders
* @param ListsOrders $listsOrders
*/
public function __construct(CanListOrders $canListOrders, ListsOrders $listsOrders)
{
$this->canListOrders = $canListOrders;
$this->listsOrders = $listsOrders;
}
public function logic(Request $request) : JsonResponse
{
$this->canListOrders->passes();
$query = $this->listsOrders->execute(array_merge($this->listsOrders->deserializeFilters($request->input('filters')), ['with_parcels' => true, 'type_in' => [OrderType::SHARED_CONTAINER, OrderType::DEDICATED_CONTAINER]]));
return $this->collectionResponse(OrderV2Resource::collection($query));
}
}
@@ -5,6 +5,7 @@ namespace App\Classes\Modules\PerfexCRM\Services;
use Illuminate\Support\Facades\Http;
use App\Classes\Exceptions\MalformedRequestException;
use Illuminate\Support\Facades\Log;
use App\Classes\General\Helper;
class FetchesPerfexCRMTask
{
@@ -38,7 +39,7 @@ class FetchesPerfexCRMTask
return (object) $data;
}else{
Log::error($response);
Helper::debugLoggerForPerfexCRM($response);
return null;
}
}catch(\Exception $exception){
@@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Http;
use App\Classes\Exceptions\MalformedRequestException;
use Illuminate\Support\Facades\Log;
use App\Classes\ValueObjects\Constants\PerfexCRMCustomFields;
use App\Classes\General\Helper;
class UpdatesPerfexCRMCustomer
{
@@ -37,7 +38,7 @@ class UpdatesPerfexCRMCustomer
$data = $response->json();
return (object) $data;
}else{
Log::error($response);
Helper::debugLoggerForPerfexCRM($response);
return null;
}
}catch(\Exception $exception){
@@ -22,6 +22,10 @@ final class WarehouseReferences {
public const VT_SARAWAK = 'SRW-V01';
public const YD_FS_WEST_MALAYSIA = 'FS-V01';
public const YD_FS_EAST_MALAYSIA = 'FS-V02';
public const VT_DESTINATION_WAREHOUSE = [
1 => self::VT_KLANG,
2 => self::VT_KLANG,
@@ -32,7 +32,7 @@ class FixBillplzFailedCallbackPayment extends Command
*
* @var string
*/
protected $description = 'Check all failled callback from billplz';
protected $description = 'Fix all failled callback from billplz';
protected $output = null;
@@ -77,7 +77,7 @@ class FixBillplzFailedCallbackPayment extends Command
{
ini_set('memory_limit', '-1');
$this->info(Carbon::now() . ' : Billplz Failled Callback cron started.');
$this->info(Carbon::now() . ' : Fix failled callback from billplz cron started.');
$this->outputArray = [];
$start = new Carbon();
+5
View File
@@ -47,6 +47,11 @@ class Kernel extends ConsoleKernel
->hourly()
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/auto_generate_invoice.log');
$schedule->command('billplz-failed-callback:fix')
->dailyAt('00:00')
->withoutOverlapping()
->appendOutputTo (storage_path().'/logs/dix_failed_callback_from_billplz.log');
}
/**
@@ -41,7 +41,7 @@ class DownloadOrderQrPdfController
$warehousePrefix = 'YW/';
}
if(in_array($warehouse->reference,[WarehouseReferences::YD_GUANG_ZHOU, WarehouseReferences::YD_GUANG_ZHOU_2])){
if(in_array($warehouse->reference,[WarehouseReferences::YD_GUANG_ZHOU, WarehouseReferences::YD_GUANG_ZHOU_2, WarehouseReferences::YD_FS_EAST_MALAYSIA, WarehouseReferences::YD_FS_WEST_MALAYSIA])){
$warehousePrefix = 'YD/';
if(strtolower($deliveryAddress->state->name) === 'sabah' || strtolower($deliveryAddress->state->name) === 'labuan' || in_array(strtolower($deliveryAddress->district->name), ['limbang', 'lawas'])) {
@@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers\Orders;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Orders\ControllersLogic\ListOrdersV2Logic;
class ListOrdersV2Controller
{
/**
* @param Request $request
* @param ListOrdersV2Logic $logic
* @return JsonResponse
*/
public function list(Request $request, ListOrdersV2Logic $logic) : JsonResponse {
return $logic->execute($request);
}
}
+2 -2
View File
@@ -20,8 +20,8 @@ class AnnouncementResource extends JsonResource
'title' => $this->title,
'description' => $this->description,
'segments' => $this->segments,
'starting_on' => Carbon::parse($this->starting_on)->format('Y-m-d'),
'ending_on' => Carbon::parse($this->ending_on)->format('Y-m-d'),
'starting_on' => Carbon::parse($this->starting_on)->format('d-m-Y'),
'ending_on' => Carbon::parse($this->ending_on)->format('d-m-Y'),
'created_at' => Carbon::parse($this->created_at)->format('d-m-Y'),
];
}
@@ -0,0 +1,127 @@
<?php
namespace Database\Seeders;
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
use App\Classes\Modules\Addresses\Processors\CreateAddressFromOldAddressProcessor;
use App\Classes\Modules\Addresses\Services\CreatesAddress;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyConnectionObject;
use App\Classes\Modules\Companies\DataTransferObjects\CompanyObject;
use App\Classes\Modules\Companies\Processors\CreateCompanyModuleProcessor;
use App\Classes\Modules\Companies\Processors\CreateCompanyProcessor;
use App\Classes\Modules\Companies\Services\ApprovesCompanyConnection;
use App\Classes\Modules\Companies\Services\CreatesCompany;
use App\Classes\Modules\Companies\Services\CreatesCompanyConnection;
use App\Classes\Modules\Companies\Services\FetchesCompany;
use App\Classes\Modules\Companies\Services\UpdatesCompanyStatus;
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
use App\Classes\Modules\Contacts\Services\CreatesContact;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\CompanyType;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\WarehouseReferences;
use App\Models\CompanyModule;
use App\Models\OldCompany;
use Illuminate\Database\Seeder;
use App\Models\Company;
class FoshanWarehouseTableSeeder extends Seeder
{
/** @var CreateCompanyProcessor */
private $createCompanyProcessor;
/** @var UpdatesCompanyStatus*/
private $updatesCompanyStatus;
/** @var CreateCompanyModuleProcessor */
private $createCompanyModuleProcessor;
/** @var CreateContactProcessor */
private $createContactProcessor;
/** @var CreatesCompanyConnection */
private $createsCompanyConnection;
/** @var ApprovesCompanyConnection */
private $approvesCompanyConnection;
/** @var CreateAddressFromOldAddressProcessor */
private $createAddressFromOldAddressProcessor;
/** @var CreatesAddress */
private $createsAddress;
/** @var FetchesCompany */
private $fetchesCompany;
/** @var CreatesContact */
private $createsContact;
/**
* ModernWarehouseTableSeeder constructor.
* @param CreateCompanyProcessor $createCompanyProcessor
* @param UpdatesCompanyStatus $updatesCompanyStatus
* @param CreateCompanyModuleProcessor $createCompanyModuleProcessor
* @param CreateContactProcessor $createContactProcessor
* @param CreatesCompanyConnection $createsCompanyConnection
* @param ApprovesCompanyConnection $approvesCompanyConnection
* @param CreateAddressFromOldAddressProcessor $createAddressFromOldAddressProcessor
* @param CreatesAddress $createsAddress
* @param FetchesCompany $fetchesCompany
* @param CreatesContact $createsContact
*/
public function __construct(CreateCompanyProcessor $createCompanyProcessor, UpdatesCompanyStatus $updatesCompanyStatus, CreateCompanyModuleProcessor $createCompanyModuleProcessor, CreateContactProcessor $createContactProcessor, CreatesCompanyConnection $createsCompanyConnection, ApprovesCompanyConnection $approvesCompanyConnection, CreateAddressFromOldAddressProcessor $createAddressFromOldAddressProcessor, CreatesAddress $createsAddress, FetchesCompany $fetchesCompany, CreatesContact $createsContact)
{
$this->createCompanyProcessor = $createCompanyProcessor;
$this->updatesCompanyStatus = $updatesCompanyStatus;
$this->createCompanyModuleProcessor = $createCompanyModuleProcessor;
$this->createContactProcessor = $createContactProcessor;
$this->createsCompanyConnection = $createsCompanyConnection;
$this->approvesCompanyConnection = $approvesCompanyConnection;
$this->createAddressFromOldAddressProcessor = $createAddressFromOldAddressProcessor;
$this->createsAddress = $createsAddress;
$this->fetchesCompany = $fetchesCompany;
$this->createsContact = $createsContact;
}
/**
* Run the database seeds.
*
* @return void
* @throws \App\Classes\Exceptions\AccessForbiddenException
* @throws \App\Classes\Exceptions\MalformedRequestException
* @throws \App\Classes\Exceptions\RequestValidationException
*/
public function run()
{
/** @var Company $company */
$company = $this->fetchesCompany->execute(['reference' => 'MODERN']);
// YD_FS_WEST_MALAYSIA - FS-V01
/** @var CompanyModule $companyModule */
$companyModule = $this->createCompanyModuleProcessor->execute($company, BusinessType::WAREHOUSE);
$companyModule->update(['name' => 'Foshan', 'reference' => WarehouseReferences::YD_FS_WEST_MALAYSIA]);
$address = new AddressObject('广东省 佛山市 南海区 狮山镇北园东路6号D幢1楼', '', 2, 35, 638, 528225, AddressType::DELIVERY, ApprovalStatus::APPROVED);
$contact = new ContactObject('郑佳鹏', '18520607573', '', '');
$this->createsAddress->execute($companyModule, $address);
$this->createsContact->execute($companyModule, $contact);
// FS_EAST_MALAYSIA - FS-V02
/** @var CompanyModule $companyModule */
$companyModule = $this->createCompanyModuleProcessor->execute($company, BusinessType::WAREHOUSE);
$companyModule->update(['name' => 'Foshan', 'reference' => WarehouseReferences::YD_FS_EAST_MALAYSIA]);
$address = new AddressObject('广东省 佛山市 南海区 狮山镇北园东路6号C幢1楼', '', 2, 35, 638, 528225, AddressType::DELIVERY, ApprovalStatus::APPROVED);
$contact = new ContactObject('游万彬', '18520607573', '', '');
$this->createsAddress->execute($companyModule, $address);
$this->createsContact->execute($companyModule, $contact);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -1,16 +1,55 @@
<template>
<div class="row align-items-center justify-content-center w-100">
<div class="row" style="margin-top: 100px; margin-bottom: 100px;">
<div class="col">
<div class='tetrominos'>
<div class='tetromino box1'></div>
<div class='tetromino box2'></div>
<div class='tetromino box3'></div>
<div class='tetromino box4'></div>
<div class="row align-items-center justify-content-center w-100" style="height: 200px; top: 0;">
<div class="col">
<div class='tetrominos'>
<div class='tetromino box1'></div>
<div class='tetromino box2'></div>
<div class='tetromino box3'></div>
<div class='tetromino box4'></div>
</div>
</div>
</div>
<div class="row align-items-center justify-content-center">
<div class="col">
<p class="text-center fs-15 muted all-caps font-lato" style="letter-spacing: 2px">
Loading Packages Data
<span class="loading-text"></span>
</p>
</div>
</div>
</div>
</div>
</template>
<style>
.loading-text::after {
content: ".";
animation: loading 2s infinite;
}
@keyframes loading {
0% {
content: ". ";
}
25% {
content: ". . ";
}
50% {
content: ". . . ";
}
75% {
content: ". . . . ";
}
100% {
content: ". . . . . ";
}
}
.tetrominos {
position: absolute;
top: 50%;
@@ -45,31 +84,23 @@
@keyframes tetromino1 {
/* compose logo */
/* 1 on 3 */
/* L-shape */
0%,
40% {
transform: translate(0, 0);
}
50% {
/* pre-box */
transform: translate(48px, -27px);
}
60%,
100% {
/* box */
/* compose logo */
transform: translate(96px, 0);
}
}
@keyframes tetromino2 {
/* compose logo */
/* 1 on 3 */
0%,
20% {
transform: translate(96px, 0px);
@@ -77,41 +108,29 @@
40%,
100% {
/* L-shape */
/* box */
/* compose logo */
transform: translate(144px, 27px);
}
}
@keyframes tetromino3 {
/* compose logo */
0% {
transform: translate(144px, 27px);
}
20%,
60% {
/* 1 on 3 */
/* L-shape */
/* box */
transform: translate(96px, 54px);
}
90%,
100% {
/* compose logo */
transform: translate(48px, 27px);
}
}
@keyframes tetromino4 {
/* compose logo */
/* 1 on 3 */
/* L-shape */
/* box */
0%,
60% {
transform: translate(48px, 27px);
@@ -119,7 +138,6 @@
90%,
100% {
/* compose logo */
transform: translate(0, 0);
}
}
@@ -0,0 +1,124 @@
<template>
<transition-component group enter-class="animate__animated animate__fadeInRight animate__delay-1 animate__faster p-r-30" leave-class="animate__animated animate__fadeOutLeft animate__faster p-r-30" style="min-height: 300px;width:100%">
<loading-component style="height: 200px; top: 0;" key="1" color="success" v-show="isLoading"></loading-component>
<div class="row" key="2" v-show="!isLoading">
<div class="col">
<div class="row">
<div class="col">
<div class="row align-items-center justify-content-center p-t-50 p-b-50" v-show="!$store.getters.getListData(section).length && !$store.getters.isLoading(section) && emptyListSection">
<div class="col-10">
<div class="row align-items-center justify-content-center hint-text">
<div class="col-4 hint-text"><img src="/images/not-found-illustration.png" class="w-100 hint-text"/></div>
</div>
<div class="row text-center">
<div class="col">
<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</p>
</div>
</div>
<div class="row m-t-5 align-items-center justify-content-center hide">
<div class="col">
<small class="fs-9 muted all-caps font-lato" style="letter-spacing: 2px">There is no results found, Try adjusting your filters to find what you are looking for.</small>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="list disable-text-selection" data-check-all="checkAll">
<div class="row" v-for="group in Math.ceil($store.getters.getListData(section).length / columns)">
<div class="col-12" :class="'col-md-'+(12/columns)" v-for="item in $store.getters.getListData(section).slice((group - 1) * columns, group * columns)" v-bind:key="item.id" :data="item">
<slot name="list" :data="item"></slot>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<pagination-component :section="section" class="mb-5" ref="pagination"></pagination-component>
</div>
</div>
</div>
</div>
</div>
</div>
</transition-component>
</template>
<script>
export default {
props: {
section:{
type: String,
required: true
},
endpoint: {
type: String,
default: route('api.order.v2.list'),
},
options: {
default () {
return {}
}
},
emptyListSection: {
type: Boolean,
default: true
},
columns: {
type: Number,
validator: (prop) => [1, 2, 3, 4, 6, 12].includes(prop),
default: 1
}
},
data(){
return {
filters: this.options,
api_count: 0,
isLoading: true,
}
},
created(){
this.setDecoratorDefault();
this.$store.dispatch('updateListQueue', {'name': this.section, 'page': 1, 'filters': this.filters});
},
computed: {
pendingList () {
return this.$store.getters.isInCompleteQueue(this.section);
}
},
watch: {
pendingList(inComplete){
if(inComplete){
this.fetchList();
}
}
},
methods: {
fetchList(){
let listDecorators = this.$store.getters.getListDetails(this.section);
this.submit(this.endpoint + '?page=' + listDecorators.page + '&filters=' + JSON.stringify(listDecorators.filters), 'get', this.section, false, false)
},
updateFilters(filters){
this.filters = filters;
this.setDecoratorDefault();
this.submit(this.endpoint + '?page=1&filters=' + JSON.stringify(this.filters), 'get', this.section, false, false)
},
successHandler(response){
this.$store.dispatch('completeList', {'name': this.section, 'data': response.payload.data});
this.$refs.pagination.makePagination(response.payload.meta, response.payload.links);
this.api_count += 1;
this.isLoading = false;
if (this.endpoint === route('api.order.v2.list') && this.api_count === 1) {
let listDecorators = this.$store.getters.getListDetails(this.section);
this.submit(this.route('api.order.list') + '?page=' + listDecorators.page + '&filters=' + JSON.stringify(listDecorators.filters), 'get', this.section, false, false)
}
},
}
}
</script>
@@ -62,15 +62,18 @@
<div class="row text-center">
<div class="col b-r b-grey text-info p-t-5 p-b-10">
<small class="fs-10 all-caps bold">Received</small>
<h6 class="bold no-margin text-info">{{item.parcels.received_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.quantity + total, 0)}}</h6>
<h6 class="bold no-margin text-info" v-if="item.parcels" >{{item.parcels.received_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.quantity + total, 0)}}</h6>
<h6 class="bold no-margin text-info" v-else > - </h6>
</div>
<div class="col b-r b-grey text-primary p-t-5 p-b-10">
<small class="fs-10 all-caps bold">In Transit</small>
<h6 class="bold no-margin text-primary">{{item.parcels.in_transit_packages.flatMap(packing_list => packing_list.packages).concat(item.parcels.destination_warehouse_packages.flatMap(packing_list => packing_list.packages)).reduce((total, obj) => obj.quantity + total, 0)}}</h6>
<h6 class="bold no-margin text-primary" v-if="item.parcels" >{{item.parcels.in_transit_packages.flatMap(packing_list => packing_list.packages).concat(item.parcels.destination_warehouse_packages.flatMap(packing_list => packing_list.packages)).reduce((total, obj) => obj.quantity + total, 0)}}</h6>
<h6 class="bold no-margin text-info" v-else > - </h6>
</div>
<div class="col text-success p-t-5 p-b-10">
<small class="fs-10 all-caps bold">Delivered</small>
<h6 class="bold no-margin text-success">{{item.parcels.delivered_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.quantity + total, 0)}}</h6>
<h6 class="bold no-margin text-success" v-if="item.parcels" >{{item.parcels.delivered_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.quantity + total, 0)}}</h6>
<h6 class="bold no-margin text-info" v-else > - </h6>
</div>
</div>
</div>
@@ -90,7 +93,8 @@
</div>
<div class="col-auto text-right">
<small class="fs-10 all-caps muted">Total CBM</small>
<h6 class="no-margin semi-bold">{{(Math.ceil((item.parcels.origin_warehouse_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.cbm + total, 0) + item.parcels.in_transit_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.cbm + total, 0) + item.parcels.destination_warehouse_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.cbm + total, 0) + item.parcels.delivered_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.cbm + total, 0)) * 10000) / 10000).toFixed(3)}}</h6>
<h6 class="no-margin semi-bold" v-if="item.parcels">{{(Math.ceil((item.parcels.origin_warehouse_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.cbm + total, 0) + item.parcels.in_transit_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.cbm + total, 0) + item.parcels.destination_warehouse_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.cbm + total, 0) + item.parcels.delivered_packages.flatMap(packing_list => packing_list.packages).reduce((total, obj) => obj.cbm + total, 0)) * 10000) / 10000).toFixed(3)}}</h6>
<h6 class="bold no-margin text-info" v-else > - </h6>
</div>
</div>
</div>
@@ -12,8 +12,8 @@
</div>
</div>
<div class="row text-center justify-content-center">
<div class="col col-md-3 p-r-5">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" :class="{ 'b-primary': parameters.warehouse_id === 3, 'b-grey': parameters.warehouse_id !== 3 }" @click="parameters.warehouse_id = 3">
<div class="col-12 col-md-3 p-l-5 p-r-5">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer h-100" :class="{ 'b-primary': parameters.warehouse_id === 3, 'b-grey': parameters.warehouse_id !== 3 }" @click="parameters.warehouse_id = 3">
<div class="row m-b-15 justify-content-center">
<div class="col-8">
<img src="/images/guangzhou-map.png" class="w-100">
@@ -26,8 +26,8 @@
</div>
</div>
</div>
<div class="col col-md-3 p-l-5">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer" @click="parameters.warehouse_id = 4" :class="{ 'b-primary': parameters.warehouse_id === 4, 'b-grey': parameters.warehouse_id !== 4 }">
<div class="col-12 col-md-3 p-l-5 p-r-5">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer h-100" @click="parameters.warehouse_id = 4" :class="{ 'b-primary': parameters.warehouse_id === 4, 'b-grey': parameters.warehouse_id !== 4 }">
<div class="row m-b-15 justify-content-center">
<div class="col-8">
<img src="/images/yiwu-map.png" class="w-100">
@@ -40,6 +40,20 @@
</div>
</div>
</div>
<div class="col-12 col-md-3 p-l-5 p-r-5">
<div class="b-a b-thick p-t-15 p-b-15 p-l-35 p-r-35 pointer h-100" @click="parameters.warehouse_id = 'foshan'" :class="{ 'b-primary': parameters.warehouse_id === 'foshan', 'b-grey': parameters.warehouse_id !== 'foshan'}">
<div class="row m-b-15 justify-content-center">
<div class="col-8">
<img src="/images/foshan-map.png" class="w-100">
</div>
</div>
<div class="row">
<div class="col">
<h5 class="no-margin" :class="{ 'text-primary': parameters.warehouse_id === 'foshan', 'semi-bold': parameters.warehouse_id === 'foshan'}">Foshan</h5>
</div>
</div>
</div>
</div>
</div>
<div class="row justify-content-center m-t-15 align-items-center" v-if="parameters.warehouse_id">
<div class="col-6">
@@ -1,13 +1,7 @@
<template>
<div class="row">
<div class="col">
<!-- <loading-component style="height: 200px; top: 0;" v-if="isLoading"></loading-component> -->
<box-loading-component style="height: 200px; top: 0; margin-top: 50px;" v-if="isLoading"></box-loading-component>
<div class="row align-items-center justify-content-center" v-if="isLoading">
<div class="col">
<p class="text-center fs-15 muted all-caps font-lato" style="letter-spacing: 2px">Loading Packages Data</p>
</div>
</div>
<box-loading-component v-if="isLoading"></box-loading-component>
<div class="row" v-if="!dataLoaded">
<div class="col">
<div v-if="!isLoading" class="btn btn-sm btn-block p-t-10 p-b-10 p-r-35 p-l-35 btn-primary b-rad-none p-r-30" @click="fetchCompany">Click here to load Package Data</div>
@@ -162,11 +162,11 @@
<div class="col">
<div class="row">
<div class="col">
<list-component v-show="!$store.getters.isShowing('createOrderForm')" section="pendingOrderListSection" :endpoint="route('api.order.list')" :options="item ? {per_page: 12, status_in: [1], company_module_id: item.company_module.id, with_packing_lists: true} : {per_page: 30, status_in: [1], with_packing_lists: true}" :columns=3>
<list-order-component v-show="!$store.getters.isShowing('createOrderForm')" section="pendingOrderListSection" :options="item ? {per_page: 12, status_in: [1], company_module_id: item.company_module.id, with_packing_lists: true} : {per_page: 30, status_in: [1], with_packing_lists: true}" :columns=3>
<template slot="list" slot-scope="{data}">
<order-component :data="data"></order-component>
</template>
</list-component>
</list-order-component>
</div>
</div>
</div>
@@ -179,11 +179,11 @@
<div class="col">
<div class="row">
<div class="col">
<list-component v-show="!$store.getters.isShowing('createOrderForm')" section="activeOrderListSection" :endpoint="route('api.order.list')" :options="item ? {per_page: 12, order_by: {column: 'created_at', DESC: true}, status_in: [2], company_module_id: item.company_module.id, with_packing_lists: true} : {per_page: 30, order_by: {column: 'created_at', DESC: true}, status_in: [2], with_packing_lists: true}" :columns=3>
<list-order-component v-show="!$store.getters.isShowing('createOrderForm')" section="activeOrderListSection" :options="item ? {per_page: 12, order_by: {column: 'created_at', DESC: true}, status_in: [2], company_module_id: item.company_module.id, with_packing_lists: true} : {per_page: 30, order_by: {column: 'created_at', DESC: true}, status_in: [2], with_packing_lists: true}" :columns=3>
<template slot="list" slot-scope="{data}">
<order-component :data="data"></order-component>
</template>
</list-component>
</list-order-component>
</div>
</div>
</div>
@@ -196,11 +196,11 @@
<div class="col">
<div class="row">
<div class="col">
<list-component v-show="!$store.getters.isShowing('createOrderForm')" section="completeOrderListSection" :endpoint="route('api.order.list')" :options="item ? {per_page: 12, status_in: [3], company_module_id: item.company_module.id, with_packing_lists: true} : {per_page: 30, status_in: [3], with_packing_lists: true}" :columns=3>
<list-order-component v-show="!$store.getters.isShowing('createOrderForm')" section="completeOrderListSection" :options="item ? {per_page: 12, status_in: [3], company_module_id: item.company_module.id, with_packing_lists: true} : {per_page: 30, status_in: [3], with_packing_lists: true}" :columns=3>
<template slot="list" slot-scope="{data}">
<order-component :data="data"></order-component>
</template>
</list-component>
</list-order-component>
</div>
</div>
</div>
@@ -213,11 +213,11 @@
<div class="col">
<div class="row">
<div class="col">
<list-component v-show="!$store.getters.isShowing('createOrderForm')" section="cancelledOrderListSection" :endpoint="route('api.order.list')" :options="item ? {per_page: 12, status_in: [4, 5, 6], company_module_id: item.company_module.id, with_packing_lists: true} : {per_page: 30, status_in: [4, 5, 6], with_packing_lists: true}" :columns=3>
<list-order-component v-show="!$store.getters.isShowing('createOrderForm')" section="cancelledOrderListSection" :options="item ? {per_page: 12, status_in: [4, 5, 6], company_module_id: item.company_module.id, with_packing_lists: true} : {per_page: 30, status_in: [4, 5, 6], with_packing_lists: true}" :columns=3>
<template slot="list" slot-scope="{data}">
<order-component :data="data"></order-component>
</template>
</list-component>
</list-order-component>
</div>
</div>
</div>
+1
View File
@@ -6,6 +6,7 @@ Route::group(['prefix' => 'order', 'as' => 'order.', 'namespace' => 'Orders'], f
Route::get('/show/{id}', 'FetchOrderController@fetch')->name('show');
Route::get('/v2/show/{id}', 'FetchOrderV2Controller@fetch')->name('v2.show');
Route::get('/list', 'ListOrdersController@list')->name('list');
Route::get('/v2/list', 'ListOrdersV2Controller@list')->name('v2.list');
Route::post('/create', 'CreateOrderController@create')->name('create');
Route::put('/confirm/{id}', 'ConfirmOrderController@confirm')->name('confirm');
Route::put('/cancel/{id}', 'CancelOrderController@cancel')->name('cancel');