mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-26 16:04:11 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bcfeb49275 | |||
| b4c6e721fd | |||
| a953f78771 | |||
| cf3e7f04e4 | |||
| be0cd16285 | |||
| 2f55821046 | |||
| 4a9ac3de02 | |||
| 1e6fafef28 | |||
| 9d0924c674 |
@@ -15,6 +15,7 @@ use App\Classes\Modules\Contacts\Processors\CreateContactProcessor;
|
|||||||
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
|
use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
|
||||||
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
|
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
|
||||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||||
|
use App\Classes\ValueObjects\Constants\RemarkTypes;
|
||||||
use App\Http\Resources\AddressResource;
|
use App\Http\Resources\AddressResource;
|
||||||
use App\Models\Address;
|
use App\Models\Address;
|
||||||
use ErrorException;
|
use ErrorException;
|
||||||
@@ -100,6 +101,16 @@ class CreateAddressLogic extends AbstractControllerLogic
|
|||||||
$this->createRemarkProcessor->execute($address, $remarkObject);
|
$this->createRemarkProcessor->execute($address, $remarkObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$addressExtraFields = [
|
||||||
|
'property_type' => $request->input('property_type'),
|
||||||
|
'tools_required_unload' => $request->input('tools_required_unload'),
|
||||||
|
'pickup_time_from' => $request->input('pickup_time_from'),
|
||||||
|
'pickup_time_to' => $request->input('pickup_time_to'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$addressExtraFieldsObject = new RemarkObject(json_encode($addressExtraFields), Auth()->user()->id, RemarkTypes::ADDRESS_EXTRA_COLUMNS);
|
||||||
|
$this->createRemarkProcessor->execute($address, $addressExtraFieldsObject);
|
||||||
|
|
||||||
return $this->resourceResponse(new AddressResource($address));
|
return $this->resourceResponse(new AddressResource($address));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,10 +15,12 @@ use App\Classes\Modules\Remarks\DataTransferObjects\RemarkObject;
|
|||||||
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
|
use App\Classes\Modules\Remarks\Processors\CreateRemarkProcessor;
|
||||||
use App\Classes\ValueObjects\Constants\AddressType;
|
use App\Classes\ValueObjects\Constants\AddressType;
|
||||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||||
|
use App\Classes\ValueObjects\Constants\RemarkTypes;
|
||||||
use App\Http\Resources\AddressResource;
|
use App\Http\Resources\AddressResource;
|
||||||
use App\Models\Address;
|
use App\Models\Address;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class UpdateAddressLogic extends AbstractControllerLogic
|
class UpdateAddressLogic extends AbstractControllerLogic
|
||||||
{
|
{
|
||||||
@@ -102,6 +104,25 @@ class UpdateAddressLogic extends AbstractControllerLogic
|
|||||||
$this->createRemarkProcessor->execute($address, $remarkObject);
|
$this->createRemarkProcessor->execute($address, $remarkObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($request->input('pickup_time_to') <= $request->input('pickup_time_from')) {
|
||||||
|
$pickupTimeFrom = Carbon::parse($request->input('pickup_time_from'));
|
||||||
|
$request->merge([
|
||||||
|
'pickup_time_to' => $pickupTimeFrom->addHour()->format('H:i') // Format to hh:mm
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$addressExtraFields = [
|
||||||
|
'property_type' => $request->input('property_type'),
|
||||||
|
'additional_request' => $request->input('additional_request'),
|
||||||
|
'receive_goods_working_hours' => $request->input('receive_goods_working_hours'),
|
||||||
|
'receive_goods_after_hours' => $request->input('receive_goods_after_hours'),
|
||||||
|
'receive_goods_on_saturday' => $request->input('receive_goods_on_saturday'),
|
||||||
|
];
|
||||||
|
|
||||||
|
$address->addressExtraFields()->delete();
|
||||||
|
$addressExtraFieldsObject = new RemarkObject(json_encode($addressExtraFields), Auth()->user()->id, RemarkTypes::ADDRESS_EXTRA_COLUMNS);
|
||||||
|
$this->createRemarkProcessor->execute($address, $addressExtraFieldsObject);
|
||||||
|
|
||||||
return $this->resourceResponse(new AddressResource($address));
|
return $this->resourceResponse(new AddressResource($address));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,14 @@ class RemarkObject implements DataTransferObject
|
|||||||
/** @var string*/
|
/** @var string*/
|
||||||
private $content;
|
private $content;
|
||||||
|
|
||||||
public function __construct(string $content, int $commenterID)
|
/** @var int|null */
|
||||||
|
private $type;
|
||||||
|
|
||||||
|
public function __construct(string $content, int $commenterID, int $type = null)
|
||||||
{
|
{
|
||||||
$this->commenterID = $commenterID;
|
$this->commenterID = $commenterID;
|
||||||
$this->content = $content;
|
$this->content = $content;
|
||||||
|
$this->type = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -35,4 +39,12 @@ class RemarkObject implements DataTransferObject
|
|||||||
return $this->content;
|
return $this->content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int|null
|
||||||
|
*/
|
||||||
|
public function getType(): ?int
|
||||||
|
{
|
||||||
|
return $this->type;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ class CreatesRemark extends AbstractUpdateRelationshipRecord
|
|||||||
|
|
||||||
$model->commenter_id = $object->getCommenterId();
|
$model->commenter_id = $object->getCommenterId();
|
||||||
$model->content = $object->getContent();
|
$model->content = $object->getContent();
|
||||||
|
$model->type = $object->getType();
|
||||||
|
|
||||||
return $this->handler($remarkable->remarks(), $model);
|
return $this->handler($remarkable->remarks(), $model);
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,6 @@ final class RemarkTypes
|
|||||||
|
|
||||||
public const EXTERNAL = 1;
|
public const EXTERNAL = 1;
|
||||||
|
|
||||||
}
|
public const ADDRESS_EXTRA_COLUMNS = 2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -27,7 +27,11 @@ class AddressResource extends JsonResource
|
|||||||
$outstationPostcodeConstant = $outstationPostcodeConstantObject->isEmpty() ? [] : (array)$outstationPostcodeConstantObject->first()->value;
|
$outstationPostcodeConstant = $outstationPostcodeConstantObject->isEmpty() ? [] : (array)$outstationPostcodeConstantObject->first()->value;
|
||||||
in_array((String)$this->postcode, $outstationPostcodeConstant) ? $postcodeArea = 'OUTSTATION_POSTCODE' : null;
|
in_array((String)$this->postcode, $outstationPostcodeConstant) ? $postcodeArea = 'OUTSTATION_POSTCODE' : null;
|
||||||
|
|
||||||
return [
|
// Handle extra fields
|
||||||
|
$extrafields = $this->addressExtraFields->first();
|
||||||
|
$extrafields = $extrafields ? json_decode($extrafields->content, true) : [];
|
||||||
|
|
||||||
|
$returnArray = [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'reference' => $this->reference,
|
'reference' => $this->reference,
|
||||||
'street_one' => $this->street_one,
|
'street_one' => $this->street_one,
|
||||||
@@ -52,5 +56,12 @@ class AddressResource extends JsonResource
|
|||||||
])
|
])
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Merge extra fields into the return array
|
||||||
|
if ($extrafields) {
|
||||||
|
$returnArray = array_merge($returnArray, $extrafields);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $returnArray;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Http\Resources;
|
|||||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||||
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
|
use App\Classes\ValueObjects\Constants\OrderRoleTypes;
|
||||||
use App\Classes\ValueObjects\Constants\PackingListType;
|
use App\Classes\ValueObjects\Constants\PackingListType;
|
||||||
|
use App\Classes\ValueObjects\Constants\RemarkTypes;
|
||||||
use App\Classes\ValueObjects\Constants\TransactionType;
|
use App\Classes\ValueObjects\Constants\TransactionType;
|
||||||
use App\Classes\ValueObjects\Constants\TransportType;
|
use App\Classes\ValueObjects\Constants\TransportType;
|
||||||
use App\Models\Transaction;
|
use App\Models\Transaction;
|
||||||
@@ -53,7 +54,7 @@ class OrderResource extends JsonResource
|
|||||||
'invoices' => $this->whenLoaded('packingLists', function() use ($orderId) {
|
'invoices' => $this->whenLoaded('packingLists', function() use ($orderId) {
|
||||||
return TransactionResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->where('transactions.type', TransactionType::SHIPPING_INVOICE)->get());
|
return TransactionResource::collection($this->transactions()->whereNotIn('transactions.status', [0, 1])->where('transactions.type', TransactionType::SHIPPING_INVOICE)->get());
|
||||||
}),
|
}),
|
||||||
'remarks' => RemarkResource::collection($this->remarks),
|
'remark' => new RemarkResource($this->remarks->first()),
|
||||||
'created_at' => $this->created_at->format('d-m-Y')
|
'created_at' => $this->created_at->format('d-m-Y')
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
+10
-1
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use App\Classes\General\Interfaces\Contactable;
|
use App\Classes\General\Interfaces\Contactable;
|
||||||
use App\Classes\General\Interfaces\Remarkable;
|
use App\Classes\General\Interfaces\Remarkable;
|
||||||
|
use App\Classes\ValueObjects\Constants\RemarkTypes;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
@@ -87,6 +88,14 @@ class Address extends AbstractModel implements Contactable, Remarkable
|
|||||||
*/
|
*/
|
||||||
public function remarks(): morphMany
|
public function remarks(): morphMany
|
||||||
{
|
{
|
||||||
return $this->morphMany(Remark::class, 'owner');
|
return $this->morphMany(Remark::class, 'owner')->whereNull('type');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return MorphMany
|
||||||
|
*/
|
||||||
|
public function addressExtraFields(): MorphMany
|
||||||
|
{
|
||||||
|
return $this->morphMany(Remark::class, 'owner')->where('type', RemarkTypes::ADDRESS_EXTRA_COLUMNS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddTypeToRemarksTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('remarks', function (Blueprint $table) {
|
||||||
|
$table->string('type')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('remarks', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('type');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
"vue": "^2.6.10",
|
"vue": "^2.6.10",
|
||||||
"vue-avatar": "^2.1.8",
|
"vue-avatar": "^2.1.8",
|
||||||
"vue-debounce": "^2.6.0",
|
"vue-debounce": "^2.6.0",
|
||||||
|
"vue-multi-select": "^4.6.0",
|
||||||
"vue-template-compiler": "^2.6.10",
|
"vue-template-compiler": "^2.6.10",
|
||||||
"vue-the-mask": "^0.11.1",
|
"vue-the-mask": "^0.11.1",
|
||||||
"vuelidate": "^0.7.4",
|
"vuelidate": "^0.7.4",
|
||||||
|
|||||||
@@ -3,14 +3,6 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="row" v-if="![7,8].includes($store.getters.getCompanyModuleType)">
|
<div class="row" v-if="![7,8].includes($store.getters.getCompanyModuleType)">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="row m-b-15">
|
|
||||||
<div class="col">
|
|
||||||
<validation-wrapper-component :validator="$v.parameters.reference">
|
|
||||||
<label>Address Reference/Label</label>
|
|
||||||
<input class="form-control" name="reference" v-model="parameters.reference">
|
|
||||||
</validation-wrapper-component>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row m-b-15">
|
<div class="row m-b-15">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<validation-wrapper-component :validator="$v.parameters.street_one">
|
<validation-wrapper-component :validator="$v.parameters.street_one">
|
||||||
@@ -41,6 +33,14 @@
|
|||||||
</validation-wrapper-component>
|
</validation-wrapper-component>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row m-b-15">
|
||||||
|
<div class="col">
|
||||||
|
<validation-wrapper-component :validator="$v.parameters.reference">
|
||||||
|
<label>Address Name / Label</label>
|
||||||
|
<input class="form-control" name="reference" v-model="parameters.reference" placeholder="E.g. Home Address">
|
||||||
|
</validation-wrapper-component>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -59,14 +59,6 @@
|
|||||||
</validation-wrapper-component>
|
</validation-wrapper-component>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row m-b-15">
|
|
||||||
<div class="col">
|
|
||||||
<validation-wrapper-component :validator="$v.parameters.remark">
|
|
||||||
<label>Delivery Remark</label>
|
|
||||||
<input class="form-control" name="remark" v-model="parameters.remark">
|
|
||||||
</validation-wrapper-component>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -125,16 +117,70 @@
|
|||||||
</validation-wrapper-component>
|
</validation-wrapper-component>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row m-b-15">
|
</div>
|
||||||
<div class="col">
|
</div>
|
||||||
<validation-wrapper-component :validator="$v.parameters.remark">
|
<div class="row m-b-15">
|
||||||
<label>Remark</label>
|
<div class="col">
|
||||||
<input class="form-control" name="remark" v-model="parameters.remark">
|
<validation-wrapper-component :validator="$v.parameters.remark">
|
||||||
</validation-wrapper-component>
|
<label>Delivery Remark</label>
|
||||||
|
<input class="form-control" name="remark" v-model="parameters.remark">
|
||||||
|
</validation-wrapper-component>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row m-b-15">
|
||||||
|
<div class="col">
|
||||||
|
<validation-wrapper-component selectable :validator="$v.parameters.property_type">
|
||||||
|
<label>房型 Receiver's property type</label>
|
||||||
|
<select-component :options="['住家Landed house', '公寓Condominium (Drop on lobby only)', '工厂Factory', '店面Shop', '商场Shopping Mall (Drop on loading bay only)', 'Others']" v-model="parameters.property_type"></select-component>
|
||||||
|
</validation-wrapper-component>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row m-b-15">
|
||||||
|
<div class="col">
|
||||||
|
<div class="form-group no-margin form-group-default p-b-5">
|
||||||
|
<label>Available to receive goods on: </label>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-md pb-3 pb-md-0">
|
||||||
|
<div class="row justify-content-center m-t-10 m-b-10" @click="parameters.receive_goods_working_hours = !parameters.receive_goods_working_hours">
|
||||||
|
<div class="col pointer d-flex justtify-content-center align-items-center">
|
||||||
|
<i class="fa fs-20 fa-fw m-r-5" :class="{'fa-square-o': !parameters.receive_goods_working_hours, 'fa-check-square': parameters.receive_goods_working_hours, 'text-primary':parameters.receive_goods_working_hours}" ></i>
|
||||||
|
<p class="m-b-0">Working Hours (9am-6pm)</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-md pb-3 pb-md-0">
|
||||||
|
<div class="row justify-content-center m-t-10 m-b-10" @click="parameters.receive_goods_after_hours = !parameters.receive_goods_after_hours">
|
||||||
|
<div class="col pointer d-flex justtify-content-center align-items-center">
|
||||||
|
<i class="fa fs-20 fa-fw m-r-5" :class="{'fa-square-o': !parameters.receive_goods_after_hours, 'fa-check-square': parameters.receive_goods_after_hours, 'text-primary':parameters.receive_goods_after_hours}" ></i>
|
||||||
|
<p class="m-b-0">After Working Hours</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-md pb-3 pb-md-0">
|
||||||
|
<div class="row justify-content-center m-t-10 m-b-10" @click="parameters.receive_goods_on_saturday = !parameters.receive_goods_on_saturday">
|
||||||
|
<div class="col pointer d-flex justtify-content-center align-items-center">
|
||||||
|
<i class="fa fs-20 fa-fw m-r-5" :class="{'fa-square-o': !parameters.receive_goods_on_saturday, 'fa-check-square': parameters.receive_goods_on_saturday, 'text-primary':parameters.receive_goods_on_saturday}" ></i>
|
||||||
|
<p class="m-b-0">On Saturday</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row m-b-15">
|
||||||
|
<div class="col">
|
||||||
|
<validation-wrapper-component :validator="$v.parameters.additional_request">
|
||||||
|
<label>Additional Request</label>
|
||||||
|
<input class="form-control" name="additional_request" v-model="parameters.additional_request">
|
||||||
|
</validation-wrapper-component>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row justify-content-center allign-items-center">
|
||||||
|
<div class="col-12 col-sm-7">
|
||||||
|
<h6 class="text-center fs-12 text-danger">**kindly reply within 2 hours while warehouse contact to arrange for delivery, otherwise, reschedule of delivery date will apply</h6>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -154,7 +200,7 @@
|
|||||||
props: {
|
props: {
|
||||||
id: {
|
id: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
// required: true
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -174,6 +220,11 @@
|
|||||||
remark: '',
|
remark: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
person_in_charge: '',
|
person_in_charge: '',
|
||||||
|
property_type: '',
|
||||||
|
additional_request: '',
|
||||||
|
receive_goods_working_hours: false,
|
||||||
|
receive_goods_after_hours: false,
|
||||||
|
receive_goods_on_saturday: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -189,6 +240,11 @@
|
|||||||
this.parameters.phone = this.data.contact ? this.data.contact.phone : '';
|
this.parameters.phone = this.data.contact ? this.data.contact.phone : '';
|
||||||
this.parameters.person_in_charge = this.data.contact ? this.data.contact.reference : '';
|
this.parameters.person_in_charge = this.data.contact ? this.data.contact.reference : '';
|
||||||
this.parameters.remark = this.data.remark ? this.data.remark.content : '';
|
this.parameters.remark = this.data.remark ? this.data.remark.content : '';
|
||||||
|
this.parameters.property_type = this.data.property_type ? this.data.property_type : '';
|
||||||
|
this.parameters.additional_request = this.data.additional_request ? this.data.additional_request : '';
|
||||||
|
this.parameters.receive_goods_working_hours = this.data.receive_goods_working_hours ? this.data.receive_goods_working_hours : false;
|
||||||
|
this.parameters.receive_goods_after_hours = this.data.receive_goods_after_hours ? this.data.receive_goods_after_hours : false;
|
||||||
|
this.parameters.receive_goods_on_saturday = this.data.receive_goods_on_saturday ? this.data.receive_goods_on_saturday : false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
<template>
|
||||||
|
<div class="w-100 multi-select-container">
|
||||||
|
<vue-multi-select ref="multiSelect" v-model="localValue" search :options="settings" :btnLabel="btnLabel" :selectOptions="options" class="w-100" style="height: 25px;" @close="close">
|
||||||
|
<template v-slot:option="{ option }">
|
||||||
|
<div class="d-flex justify-content-start align-items-center">
|
||||||
|
<input class="m-l-5 m-r-5" type="checkbox" :checked="option.selected" />
|
||||||
|
<span>{{ option.name }}</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</vue-multi-select>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import vueMultiSelect from 'vue-multi-select';
|
||||||
|
import 'vue-multi-select/dist/lib/vue-multi-select.css';
|
||||||
|
import PerfectScrollbar from 'perfect-scrollbar';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
value: {
|
||||||
|
type: Array,
|
||||||
|
required: false,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
type: Array,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
localValue: this.value,
|
||||||
|
settings: {
|
||||||
|
multi: true,
|
||||||
|
groups: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
btnLabel(localValue) {
|
||||||
|
if (localValue.length === 0) {
|
||||||
|
return 'Please select';
|
||||||
|
}
|
||||||
|
return localValue.join(', ');
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$emit('input', this.localValue);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
vueMultiSelect,
|
||||||
|
PerfectScrollbar,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.multi-select-container .select>button {
|
||||||
|
width: 100%;
|
||||||
|
min-height: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.multi-select-container .select .selectItem {
|
||||||
|
color: black !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
+6
-3
@@ -10,15 +10,18 @@ export default {
|
|||||||
},
|
},
|
||||||
street_one: { required },
|
street_one: { required },
|
||||||
street_two: {
|
street_two: {
|
||||||
required: requiredIf(function(){
|
required
|
||||||
return [7,8].includes(this.$store.getters.getCompanyModuleType);
|
// required: requiredIf(function(){
|
||||||
})
|
// return [7,8].includes(this.$store.getters.getCompanyModuleType);
|
||||||
|
// })
|
||||||
},
|
},
|
||||||
district_id: { required },
|
district_id: { required },
|
||||||
post_code: { required },
|
post_code: { required },
|
||||||
remark: {},
|
remark: {},
|
||||||
phone: {required, numeric},
|
phone: {required, numeric},
|
||||||
person_in_charge: { required },
|
person_in_charge: { required },
|
||||||
|
property_type: { required },
|
||||||
|
additional_request: { },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mixins: [addressFormHandler]
|
mixins: [addressFormHandler]
|
||||||
|
|||||||
Reference in New Issue
Block a user