Small changes and fixes, highlight days on the calendar
This commit is contained in:
@@ -17,7 +17,7 @@ const siteControlStore = useSiteControlStore();
|
||||
const { contractor, contractors } = storeToRefs(contractorsStore);
|
||||
const { deliveryDate, uuid } = storeToRefs(ordersStore);
|
||||
const { categories } = storeToRefs(categoriesStore);
|
||||
const { showConfirmationModal, isDarkTheme } = storeToRefs(siteControlStore);
|
||||
const { showConfirmationModal, showCancellationModal, isDarkTheme } = storeToRefs(siteControlStore);
|
||||
|
||||
const contractorSearch = ref<string>();
|
||||
const filteredContractors = ref<Array<Contractor>>();
|
||||
@@ -41,6 +41,10 @@ watch(contractor, (contractor) => {
|
||||
function createJSON(event: Event) {
|
||||
event.preventDefault();
|
||||
console.log(route);
|
||||
console.log(deliveryDate.value);
|
||||
if(typeof deliveryDate.value != typeof Date) {
|
||||
deliveryDate.value = new Date(deliveryDate.value as unknown as string);
|
||||
}
|
||||
const json = {
|
||||
MZN_UUID: uuid.value,
|
||||
MZN_DataZam: new Date(Date.now()).toISOString(),
|
||||
@@ -70,7 +74,8 @@ function createJSON(event: Event) {
|
||||
for (let category of categories.value) {
|
||||
for (let product of category.Towary) {
|
||||
if(product.Quantity != null && product.Quantity != '') {
|
||||
if(isNaN(Number(product.Quantity)) || isNaN(Number(product.Twr_CenaZ)) || isNaN(Number(product.Twr_Cena))) {
|
||||
if(isNaN(Number(product.Quantity)) || isNaN(Number(product.Twr_CenaZ)) || isNaN(Number(product.Twr_Cena))
|
||||
|| product.Twr_Cena == "" || product.Twr_CenaZ == "") {
|
||||
showErrorNotification.value=true;
|
||||
errorNotificationMessage.value = "W zamówieniu znajdują się niepoprawne wartości.";
|
||||
return;
|
||||
@@ -83,6 +88,7 @@ function createJSON(event: Event) {
|
||||
MZE_TwrCena: product.ChosenOption == product.Twr_JMZ ? product.Twr_CenaZ : product.Twr_Cena,
|
||||
MZE_TwrIlosc: product.Quantity,
|
||||
MZE_TwrNazwa: product.Twr_Nazwa,
|
||||
MZE_TwrKod: product.Twr_Kod,
|
||||
MZE_MZNID: undefined,
|
||||
MZE_MZEID: undefined,
|
||||
MZE_TwrStawka: undefined
|
||||
@@ -118,8 +124,7 @@ function setConfirmationModal(event : Event) {
|
||||
|
||||
function cancelOrder(event: Event) {
|
||||
event.preventDefault();
|
||||
axiosInstance.delete('/zamowienie/' + uuid.value);
|
||||
siteControlStore.newOrder();
|
||||
showCancellationModal.value = true;
|
||||
}
|
||||
|
||||
function filterContractors() {
|
||||
@@ -220,7 +225,7 @@ onBeforeUnmount( function () {
|
||||
></textarea>
|
||||
</div>
|
||||
<button class="button is-info mt-5">Zapisz</button>
|
||||
<button class="button is-success mt-5 ml-3" @click="setConfirmationModal">Potwierdź</button>
|
||||
<button class="button is-success mt-5 ml-3" @click="setConfirmationModal" v-bind:disabled="uuid == undefined">Potwierdź</button>
|
||||
<button class="button is-danger mt-5 ml-3" @click="cancelOrder" v-bind:disabled="uuid == undefined">Anuluj</button>
|
||||
<div v-if="showErrorNotification" class="notification is-danger is-bold mt-5">
|
||||
<button class="delete" @click.prevent="showErrorNotification = false"></button>
|
||||
@@ -239,26 +244,36 @@ onBeforeUnmount( function () {
|
||||
<label class="label is-small">{{ product.Twr_Nazwa }}</label>
|
||||
<div class="columns is-mobile">
|
||||
<div class="column" v-if="product.ChosenOption == product.Twr_JM">
|
||||
<div class="field">
|
||||
<input
|
||||
class="input is-small"
|
||||
type="text"
|
||||
placeholder="Kwota"
|
||||
v-model="product.Twr_Cena"
|
||||
v-bind:class="{ 'is-danger has-background-danger-soft': product.Twr_Cena != undefined && isNaN(Number(product.Twr_Cena)),'is-success has-background-success-soft': product.Quantity != undefined && product.Quantity as unknown as string != '' && !isNaN(Number(product.Quantity))}"
|
||||
/>
|
||||
<div class="field has-addons">
|
||||
<p class="control is-expanded">
|
||||
<input
|
||||
class="input is-small is-fullwidth"
|
||||
type="text"
|
||||
placeholder="Kwota"
|
||||
v-model="product.Twr_Cena"
|
||||
v-bind:class="{ 'is-danger has-background-danger-soft': product.Twr_Cena != undefined && (isNaN(Number(product.Twr_Cena)) || product.Twr_Cena == ''),'is-success has-background-success-soft': product.Quantity != undefined && product.Quantity as unknown as string != '' && !isNaN(Number(product.Quantity))}"
|
||||
/>
|
||||
</p>
|
||||
<p class="control">
|
||||
<button class="button is-small is-danger is-outlined" @click.prevent="product.Twr_Cena = product.BasePrice">X</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column" v-else-if="product.ChosenOption == product.Twr_JMZ">
|
||||
<div class="field">
|
||||
<input
|
||||
class="input is-small"
|
||||
type="text"
|
||||
placeholder="Kwota"
|
||||
v-model="product.Twr_CenaZ"
|
||||
v-bind:class="{ 'is-danger has-background-danger-soft': product.Twr_CenaZ != undefined && isNaN(Number(product.Twr_CenaZ)), 'is-success has-background-success-soft': product.Quantity != undefined && product.Quantity as unknown as string != '' && !isNaN(Number(product.Quantity))
|
||||
}"
|
||||
/>
|
||||
<div class="field has-addons">
|
||||
<p class="control is-expanded">
|
||||
<input
|
||||
class="input is-small"
|
||||
type="text"
|
||||
placeholder="Kwota"
|
||||
v-model="product.Twr_CenaZ"
|
||||
v-bind:class="{ 'is-danger has-background-danger-soft': product.Twr_CenaZ != undefined && isNaN(Number(product.Twr_CenaZ)), 'is-success has-background-success-soft': product.Quantity != undefined && product.Quantity as unknown as string != '' && !isNaN(Number(product.Quantity))
|
||||
}"
|
||||
/>
|
||||
</p>
|
||||
<p class="control">
|
||||
<button class="button is-small is-danger is-outlined" @click.prevent="product.Twr_CenaZ = product.BasePriceZ">X</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
|
||||
Reference in New Issue
Block a user