This commit is contained in:
@@ -5,20 +5,16 @@
|
||||
<v-menu offset-y>
|
||||
<template v-slot:activator="{ on, attrs }">
|
||||
<div class="text-h6">
|
||||
<v-icon large color="primary" class="mr-2">$ayiBoxes</v-icon>
|
||||
{{ $ay.t("WorkOrderItemPartList") }}
|
||||
<v-icon large color="primary" class="mr-2"
|
||||
>$ayiParachuteBox</v-icon
|
||||
>
|
||||
{{ $ay.t("WorkOrderItemPartRequestList") }}
|
||||
<v-btn v-if="!parentDeleted" large icon v-bind="attrs" v-on="on">
|
||||
<v-icon small color="primary">$ayiEllipsisV</v-icon>
|
||||
</v-btn>
|
||||
</div>
|
||||
</template>
|
||||
<v-list>
|
||||
<v-list-item v-if="canAdd" @click="newItem">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiPlus</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>{{ $ay.t("New") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="canDelete && !isDeleted" @click="deleteItem">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiTrashAlt</v-icon>
|
||||
@@ -146,39 +142,39 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
warehouseChange(newName) {
|
||||
this.value.items[this.activeWoItemIndex].partRequests[
|
||||
this.activeItemIndex
|
||||
].partWarehouseViz = newName;
|
||||
},
|
||||
partChange(newName) {
|
||||
this.value.items[this.activeWoItemIndex].partRequests[
|
||||
this.activeItemIndex
|
||||
].partViz = newName;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].partRequests
|
||||
.length;
|
||||
// warehouseChange(newName) {
|
||||
// this.value.items[this.activeWoItemIndex].partRequests[
|
||||
// this.activeItemIndex
|
||||
// ].partWarehouseViz = newName;
|
||||
// },
|
||||
// partChange(newName) {
|
||||
// this.value.items[this.activeWoItemIndex].partRequests[
|
||||
// this.activeItemIndex
|
||||
// ].partViz = newName;
|
||||
// },
|
||||
// newItem() {
|
||||
// let newIndex = this.value.items[this.activeWoItemIndex].partRequests
|
||||
// .length;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].partRequests.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
userId: null,
|
||||
description: null,
|
||||
serials: null,
|
||||
partId: null,
|
||||
partWarehouseId: null,
|
||||
quantity: 1,
|
||||
received: null,
|
||||
purchaseOrderItemId: null,
|
||||
isDirty: true,
|
||||
workOrderItemId: this.value.items[this.activeWoItemIndex].id,
|
||||
uid: Date.now() //used for error tracking / display
|
||||
});
|
||||
this.$emit("change");
|
||||
this.selectedRow = [{ index: newIndex }];
|
||||
this.activeItemIndex = newIndex;
|
||||
},
|
||||
// this.value.items[this.activeWoItemIndex].partRequests.push({
|
||||
// id: 0,
|
||||
// concurrency: 0,
|
||||
// userId: null,
|
||||
// description: null,
|
||||
// serials: null,
|
||||
// partId: null,
|
||||
// partWarehouseId: null,
|
||||
// quantity: 1,
|
||||
// received: null,
|
||||
// purchaseOrderItemId: null,
|
||||
// isDirty: true,
|
||||
// workOrderItemId: this.value.items[this.activeWoItemIndex].id,
|
||||
// uid: Date.now() //used for error tracking / display
|
||||
// });
|
||||
// this.$emit("change");
|
||||
// this.selectedRow = [{ index: newIndex }];
|
||||
// this.activeItemIndex = newIndex;
|
||||
// },
|
||||
unDeleteItem() {
|
||||
this.value.items[this.activeWoItemIndex].partRequests[
|
||||
this.activeItemIndex
|
||||
@@ -209,15 +205,15 @@ export default {
|
||||
form() {
|
||||
return window.$gz.form;
|
||||
},
|
||||
fieldValueChanged(ref) {
|
||||
if (!this.formState.loading && !this.formState.readonly) {
|
||||
//flag this record dirty so it gets picked up by save
|
||||
this.value.items[this.activeWoItemIndex].partRequests[
|
||||
this.activeItemIndex
|
||||
].isDirty = true;
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
}
|
||||
},
|
||||
// fieldValueChanged(ref) {
|
||||
// if (!this.formState.loading && !this.formState.readonly) {
|
||||
// //flag this record dirty so it gets picked up by save
|
||||
// this.value.items[this.activeWoItemIndex].partRequests[
|
||||
// this.activeItemIndex
|
||||
// ].isDirty = true;
|
||||
// window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
// }
|
||||
// },
|
||||
itemRowClasses: function(item) {
|
||||
let ret = "";
|
||||
const isDeleted =
|
||||
@@ -386,9 +382,9 @@ export default {
|
||||
showTable: function() {
|
||||
return this.value.items[this.activeWoItemIndex].partRequests.length > 1;
|
||||
},
|
||||
canAdd: function() {
|
||||
return this.pvm.rights.change && this.pvm.subRights.partRequests.create;
|
||||
},
|
||||
// canAdd: function() {
|
||||
// return this.pvm.rights.change && this.pvm.subRights.partRequests.create;
|
||||
// },
|
||||
canDelete: function() {
|
||||
return (
|
||||
this.activeItemIndex != null &&
|
||||
|
||||
@@ -396,7 +396,7 @@
|
||||
<v-col
|
||||
cols="12"
|
||||
v-if="
|
||||
pvm.subRights.tasks.visible &&
|
||||
pvm.subRights.parts.visible &&
|
||||
form().showMe(this, 'WorkOrderItemPartList')
|
||||
"
|
||||
>
|
||||
@@ -409,7 +409,21 @@
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<!-- //todo WorkOrderItemPartRequestList here -->
|
||||
<v-col
|
||||
cols="12"
|
||||
v-if="
|
||||
pvm.subRights.partRequests.visible &&
|
||||
form().showMe(this, 'WorkOrderItemPartRequestList')
|
||||
"
|
||||
>
|
||||
<GzWoItemPartRequests
|
||||
v-model="value"
|
||||
:pvm="pvm"
|
||||
:active-wo-item-index="activeItemIndex"
|
||||
data-cy="woItemPartRequests"
|
||||
@change="$emit('change')"
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
cols="12"
|
||||
@@ -473,6 +487,7 @@ import GzWoItemTravels from "../components/work-order-item-travels.vue";
|
||||
import GzWoItemExpenses from "../components/work-order-item-expenses.vue";
|
||||
import GzWoItemTasks from "../components/work-order-item-tasks.vue";
|
||||
import GzWoItemParts from "../components/work-order-item-parts.vue";
|
||||
import GzWoItemPartRequests from "../components/work-order-item-part-requests.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -481,7 +496,8 @@ export default {
|
||||
GzWoItemLabors,
|
||||
GzWoItemTravels,
|
||||
GzWoItemTasks,
|
||||
GzWoItemParts
|
||||
GzWoItemParts,
|
||||
GzWoItemPartRequests
|
||||
},
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
|
||||
Reference in New Issue
Block a user