add: tracking load & clean code save load
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
import { getDateMonthDay } from '../helpers/date_formats';
|
||||
import { getStatusPublished } from '../helpers/status';
|
||||
import { getStatusLoad } from '../helpers/status';
|
||||
import { useLoadsStore } from '../stores/loads';
|
||||
import Swal from 'sweetalert2'
|
||||
|
||||
const router = useRouter();
|
||||
const loadsStore = useLoadsStore();
|
||||
|
||||
const props = defineProps({
|
||||
load: {
|
||||
type: Object,
|
||||
required: true,
|
||||
},
|
||||
readOnly: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
});
|
||||
|
||||
@@ -71,6 +78,14 @@
|
||||
loadsStore.openProposalsModal = true;
|
||||
}
|
||||
|
||||
const handleTracking = () => {
|
||||
let code = props.load.shipment_code;
|
||||
router.push({
|
||||
name: 'tracking-load',
|
||||
params: {code}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -101,7 +116,7 @@
|
||||
<div class="col-lg-4 col-sm-12">
|
||||
<p><span>Segmento: </span> {{ load._categories }}</p>
|
||||
<p><span>Código de carga: </span> {{ load.shipment_code }}
|
||||
<span v-if="load.load_status !== 'Draft'" class="tracking-icon">
|
||||
<span v-if="load.load_status !== 'Draft' && !readOnly" class="tracking-icon" @click="handleTracking">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-geo-alt-fill" viewBox="0 0 16 16">
|
||||
<path d="M8 16s6-5.686 6-10A6 6 0 0 0 2 6c0 4.314 6 10 6 10zm0-7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"></path>
|
||||
</svg>
|
||||
@@ -114,7 +129,7 @@
|
||||
<div v-if="load.notes" class="box-note">
|
||||
{{ load.notes }}
|
||||
</div>
|
||||
<div class="btn-row">
|
||||
<div class="btn-row" v-if="!readOnly">
|
||||
<button
|
||||
class="btn-primary-sm bg-dark"
|
||||
@click="handleDeleteLoad"
|
||||
|
||||
Reference in New Issue
Block a user