set filters loads locations & images preview
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<div v-if="!attachments || attachments.total == 0" class="card-body">
|
||||
<p class="empty">{{ t('evidence.empty') }}</p>
|
||||
</div>
|
||||
<div v-else class="card-body">
|
||||
<div v-else class="card-body box-attachments">
|
||||
<div class="attachment" v-for="data in attachments.data">
|
||||
<p v-if="data.type == 'Loading'">{{ t('evidence.loadEvidence') }}</p>
|
||||
<p v-else>{{ t('evidence.downloadEvidence') }}</p>
|
||||
@@ -66,11 +66,17 @@
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.box-attachments {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
gap: 20px;
|
||||
}
|
||||
.attachment {
|
||||
width: 100%;
|
||||
width: 45%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px;
|
||||
padding: 16px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 13px;
|
||||
align-content: center;
|
||||
@@ -88,7 +94,7 @@
|
||||
}
|
||||
|
||||
.attachment img {
|
||||
width: 33%;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin: 0 auto;
|
||||
@@ -96,8 +102,19 @@
|
||||
}
|
||||
|
||||
@media (max-width: 568px) {
|
||||
.attachment img {
|
||||
width: 50%;
|
||||
.attachment {
|
||||
width: 90%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 16px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 13px;
|
||||
align-content: center;
|
||||
align-items: center;
|
||||
box-shadow: 3px 5px 10px 5px rgba(0,0,0,0.10);
|
||||
-webkit-box-shadow: 3px 5px 10px 5px rgba(0,0,0,0.10);
|
||||
-moz-box-shadow: 3px 5px 10px 5px rgba(0,0,0,0.10);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -160,6 +160,17 @@
|
||||
<div v-if="load.notes" class="box-note">
|
||||
{{ load.notes }}
|
||||
</div>
|
||||
<div class="btn-row">
|
||||
<button v-if="load.status !== 'Draft' && load.load_status !== 'Published' && load.load_status !== 'Loading' && !tracking"
|
||||
type="button"
|
||||
data-toggle="modal" data-target="#attachmentModal"
|
||||
class="btn-primary-sm"
|
||||
@click="openAttachmentsModal"
|
||||
>
|
||||
<i class="fa-solid fa-image"></i>
|
||||
{{ t('evidence.evidence') }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-row" v-if="load?.company?._id === authStore?.user?.company._id">
|
||||
<button
|
||||
v-if="(authStore.user?.job_role === 'owner' || authStore.user?.job_role === 'manager') || authStore.user._id === props.load.posted_by"
|
||||
|
||||
@@ -80,9 +80,9 @@
|
||||
zoom.value = 4;
|
||||
heightMap.value = 420;
|
||||
}
|
||||
if(companyStore.locationsLoads.length <= 0) {
|
||||
getLocations();
|
||||
}
|
||||
// if(companyStore.locationsLoads.length <= 0) {
|
||||
// getLocations();
|
||||
// }
|
||||
formLoad.owner = auth.user?.first_name + ' ' + auth.user?.last_name;
|
||||
//origin_formatted_address
|
||||
if(loadStore.currentLoad){
|
||||
@@ -160,9 +160,9 @@
|
||||
destinationRef.value = locationDownloadSelected.value.description;
|
||||
});
|
||||
|
||||
const getLocations = async() => {
|
||||
const getLocations = async(type) => {
|
||||
loadingLocations.value = true;
|
||||
await companyStore.getLocationsLoads()
|
||||
await companyStore.getLocationsLoads(type)
|
||||
loadingLocations.value = false;
|
||||
}
|
||||
|
||||
@@ -465,13 +465,14 @@
|
||||
<div class="form-section">
|
||||
<h2>{{ t('loads.addressOrigin') }}</h2>
|
||||
|
||||
<div class="form-check my-4" v-if="loadingLocations === false">
|
||||
<div class="form-check my-4" @click="getLocations('loading')">
|
||||
<input class="form-check-input chekmark" type="checkbox" id="directoryOrigin" v-model="checkLocationLoad">
|
||||
<label class="form-check-label custom-label" for="directoryOrigin">
|
||||
{{ t('loads.checkAddress') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="d-flex flex-column mb-4" v-if="checkLocationLoad">
|
||||
<Spiner v-if="loadingLocations"/>
|
||||
<div class="d-flex flex-column mb-4" v-if="checkLocationLoad && !loadingLocations">
|
||||
<label class="custom-label mb-2" for="locationLoad">{{ t('loads.locationsRegistered') }}:</label>
|
||||
<select
|
||||
class="custom-input-light"
|
||||
@@ -480,7 +481,7 @@
|
||||
v-model="locationLoadSelected"
|
||||
>
|
||||
<option disabled value="">-- {{ t('loads.selectedLocation') }} --</option>
|
||||
<option v-for="loc in companyStore.locationsLoads" :value="loc">{{ loc.branch_name }}</option>
|
||||
<option v-for="loc in companyStore.locationsLoad" :value="loc">{{ loc.branch_name }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<Custominput
|
||||
@@ -535,13 +536,14 @@
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<h2>{{ t('loads.addressDestination') }}</h2>
|
||||
<div class="form-check my-4" v-if="loadingLocations === false">
|
||||
<div class="form-check my-4" @click="getLocations('unloading')">
|
||||
<input class="form-check-input chekmark" type="checkbox" id="directoryDestination" v-model="checkLocationDownload">
|
||||
<label class="form-check-label custom-label" for="directoryDestination">
|
||||
{{ t('loads.checkAddress') }}
|
||||
</label>
|
||||
</div>
|
||||
<div class="d-flex flex-column mb-4" v-if="checkLocationDownload">
|
||||
<Spiner v-if="loadingLocations"/>
|
||||
<div class="d-flex flex-column mb-4" v-if="checkLocationDownload && !loadingLocations">
|
||||
<label class="custom-label mb-2" for="locationDownload">{{ t('loads.locationsRegistered') }}:</label>
|
||||
<select
|
||||
class="custom-input-light"
|
||||
@@ -550,7 +552,7 @@
|
||||
v-model="locationDownloadSelected"
|
||||
>
|
||||
<option disabled value="">-- {{ t('loads.selectedLocation') }} --</option>
|
||||
<option v-for="loc in companyStore.locationsLoads" :value="loc">{{ loc.branch_name }}</option>
|
||||
<option v-for="loc in companyStore.locationsDowload" :value="loc">{{ loc.branch_name }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<Custominput
|
||||
|
||||
Reference in New Issue
Block a user