This commit is contained in:
2021-02-23 19:27:54 +00:00
parent fe9bbc4018
commit e69e08852d

View File

@@ -510,27 +510,98 @@
</v-row>
</v-card-text>
<v-card-actions>
<v-btn
color="blue darken-1"
text
@click="editPoItemDialog = false"
>{{ $ay.t("Close") }}</v-btn
>
<v-spacer></v-spacer>
<v-btn
v-if="
obj.items[editPoItemIndex].quantityReceived <
obj.items[editPoItemIndex].quantityOrdered
"
color="blue darken-1"
text
@click="receive(obj.items[editPoItemIndex])"
><v-icon left> $ayiBoxOpen </v-icon
>{{ $ay.t("Receive") }}</v-btn
>
<v-btn color="blue darken-1" text @click="submit()">{{
$ay.t("Save")
}}</v-btn>
<template v-if="!$vuetify.breakpoint.xs">
<v-btn
color="red darken-1"
text
@click="deletePoItem(obj.items[editPoItemIndex])"
>{{ $ay.t("Delete") }}</v-btn
>
<v-spacer></v-spacer>
<v-btn
color="blue darken-1"
text
@click="editPoItemDialog = false"
>{{ $ay.t("Close") }}</v-btn
>
<v-btn
color="blue darken-1"
text
@click="newPOItem()"
class="ml-4"
>{{ $ay.t("New") }}</v-btn
>
<v-btn
v-if="
obj.items[editPoItemIndex].quantityReceived <
obj.items[editPoItemIndex].quantityOrdered
"
color="blue darken-1"
text
@click="receive(obj.items[editPoItemIndex])"
class="ml-4"
><v-icon left> $ayiBoxOpen </v-icon
>{{ $ay.t("Receive") }}</v-btn
>
<v-btn
color="blue darken-1"
text
@click="submit()"
class="ml-4"
>{{ $ay.t("Save") }}</v-btn
>
</template>
<template v-else>
<!-- MOBILE FORMAT -->
<v-row>
<v-btn
class="mt-4"
block
text
color="blue darken-1"
@click="submit()"
>{{ $ay.t("Save") }}</v-btn
>
<v-btn
class="mt-4"
block
text
color="blue darken-1"
@click="newPOItem()"
>{{ $ay.t("New") }}</v-btn
>
<v-btn
class="mt-4"
block
text
color="blue darken-1"
@click="editPoItemDialog = false"
>{{ $ay.t("Close") }}</v-btn
>
<v-btn
class="mt-4"
v-if="
obj.items[editPoItemIndex].quantityReceived <
obj.items[editPoItemIndex].quantityOrdered
"
color="blue darken-1"
block
text
@click="receive(obj.items[editPoItemIndex])"
><v-icon left> $ayiBoxOpen </v-icon
>{{ $ay.t("Receive") }}</v-btn
>
<v-btn
class="mt-8 mb-6"
block
text
color="red darken-1"
@click="deletePoItem(obj.items[editPoItemIndex])"
>{{ $ay.t("Delete") }}</v-btn
>
</v-row>
</template>
</v-card-actions>
</v-card>
</v-dialog>
@@ -915,6 +986,13 @@ export default {
this.editPoItemIndex = this.obj.items.length - 1;
this.editPoItemDialog = true;
this.formState.dirty = true;
},
deletePoItem: function(item) {
this.editPoItemDialog = false;
this.obj.items.splice(this.editPoItemIndex, 1);
this.editPoItemIndex = 0;
this.formState.dirty = true;
},
canSave: function() {
return this.formState.valid && this.formState.dirty;