This commit is contained in:
@@ -369,7 +369,7 @@ todo: strip all *viz fields from object before sending over the wire from client
|
||||
todo: mark for deletion with ONE record and no table?? how does that work?
|
||||
|
||||
TODO: test new from scratch wo regularly
|
||||
|
||||
todo: subrights test
|
||||
|
||||
|
||||
todo: Need a preset default for the workorder customization, right now it's just barfing up all fields
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<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>
|
||||
<v-icon large color="primary" class="mr-2">$ayiPlug</v-icon>
|
||||
{{ $ay.t("WorkOrderItemLoanList") }}
|
||||
<v-btn v-if="!parentDeleted" large icon v-bind="attrs" v-on="on">
|
||||
<v-icon small color="primary">$ayiEllipsisV</v-icon>
|
||||
@@ -68,6 +68,92 @@
|
||||
}}<v-icon right large>$ayiTrashRestoreAlt</v-icon></v-btn
|
||||
>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanUnit')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-pick-list
|
||||
:aya-type="$ay.ayt().LoanUnit"
|
||||
:show-edit-icon="true"
|
||||
v-model="
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex].loanUnitId
|
||||
"
|
||||
:readonly="formState.readOnly || isDeleted"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('WorkOrderItemLoanUnit')"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanUnitId`
|
||||
"
|
||||
data-cy="loans.loanUnitId"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanUnitId`
|
||||
)
|
||||
"
|
||||
@input="
|
||||
fieldValueChanged(
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanUnitId`
|
||||
)
|
||||
"
|
||||
@update:name="loanUnitChange"
|
||||
></gz-pick-list>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="
|
||||
form().showMe(
|
||||
this,
|
||||
'WorkOrderItemTaskWorkOrderItemTaskCompletionType'
|
||||
)
|
||||
"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<v-select
|
||||
v-model="value.items[activeWoItemIndex].loans[activeItemIndex].rate"
|
||||
:items="pvm.selectLists.loanUnitRateUnits"
|
||||
item-text="name"
|
||||
item-value="id"
|
||||
:readonly="formState.readOnly || isDeleted"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('WorkOrderItemTaskWorkOrderItemTaskCompletionType')"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].loans[
|
||||
${activeItemIndex}
|
||||
].rate`
|
||||
"
|
||||
data-cy="loanUnitRateUnit"
|
||||
:rules="[
|
||||
form().integerValid(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].loans[
|
||||
${activeItemIndex}
|
||||
].rate`
|
||||
)
|
||||
]"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].loans[
|
||||
${activeItemIndex}
|
||||
].rate`
|
||||
)
|
||||
"
|
||||
@input="
|
||||
fieldValueChanged(`Items[${activeWoItemIndex}].loans[
|
||||
${activeItemIndex}
|
||||
].rate`)
|
||||
"
|
||||
@change="loanUnitRateUnitChange"
|
||||
></v-select>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanQuantity')"
|
||||
cols="12"
|
||||
@@ -111,110 +197,103 @@
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanLoanID')"
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanOutDate')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-pick-list
|
||||
:aya-type="$ay.ayt().Loan"
|
||||
:show-edit-icon="true"
|
||||
<gz-date-time-picker
|
||||
:label="$ay.t('WorkOrderItemLoanOutDate')"
|
||||
v-model="
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex].loanId
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex].outDate
|
||||
"
|
||||
:readonly="formState.readOnly || isDeleted"
|
||||
:readonly="formState.readOnly"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('WorkOrderItemLoanLoanID')"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanId`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].outDate`
|
||||
"
|
||||
data-cy="loans.loanId"
|
||||
data-cy="loanUnitOutDate"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanId`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].outDate`
|
||||
)
|
||||
"
|
||||
@input="
|
||||
fieldValueChanged(
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanId`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].outDate`
|
||||
)
|
||||
"
|
||||
@update:name="loanChange"
|
||||
></gz-pick-list>
|
||||
></gz-date-time-picker>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanLoanWarehouseID')"
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanDueDate')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<gz-pick-list
|
||||
:aya-type="$ay.ayt().LoanWarehouse"
|
||||
:show-edit-icon="true"
|
||||
<gz-date-time-picker
|
||||
:label="$ay.t('WorkOrderItemLoanDueDate')"
|
||||
v-model="
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex]
|
||||
.loanWarehouseId
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex].dueDate
|
||||
"
|
||||
:readonly="formState.readOnly || isDeleted"
|
||||
:readonly="formState.readOnly"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('WorkOrderItemLoanLoanWarehouseID')"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanWarehouseId`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].dueDate`
|
||||
"
|
||||
data-cy="loans.loanWarehouseId"
|
||||
data-cy="loanUnitDueDate"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanWarehouseId`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].dueDate`
|
||||
)
|
||||
"
|
||||
@input="
|
||||
fieldValueChanged(
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanWarehouseId`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].dueDate`
|
||||
)
|
||||
"
|
||||
@update:name="warehouseChange"
|
||||
></gz-pick-list>
|
||||
></gz-date-time-picker>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanDescription')"
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanReturnDate')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
xl="3"
|
||||
>
|
||||
<v-text-field
|
||||
<gz-date-time-picker
|
||||
:label="$ay.t('WorkOrderItemLoanReturnDate')"
|
||||
v-model="
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex].description
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex].returnDate
|
||||
"
|
||||
:readonly="formState.readOnly || isDeleted"
|
||||
:readonly="formState.readOnly"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('WorkOrderItemLoanDescription')"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].description`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].returnDate`
|
||||
"
|
||||
data-cy="loanQuantity"
|
||||
data-cy="loanUnitReturnDate"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].description`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].returnDate`
|
||||
)
|
||||
"
|
||||
@input="
|
||||
fieldValueChanged(`Items[${activeWoItemIndex}].loans[
|
||||
${activeItemIndex}
|
||||
].description`)
|
||||
fieldValueChanged(
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].returnDate`
|
||||
)
|
||||
"
|
||||
></v-text-field>
|
||||
></gz-date-time-picker>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanTaxLoanSaleID')"
|
||||
v-if="form().showMe(this, 'WorkOrderItemLoanTaxCodeID')"
|
||||
cols="12"
|
||||
sm="6"
|
||||
lg="4"
|
||||
@@ -224,25 +303,24 @@
|
||||
:aya-type="$ay.ayt().TaxCode"
|
||||
:show-edit-icon="true"
|
||||
v-model="
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex]
|
||||
.taxLoanSaleId
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex].taxCodeId
|
||||
"
|
||||
:readonly="formState.readOnly || isDeleted"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('WorkOrderItemLoanTaxLoanSaleID')"
|
||||
:label="$ay.t('WorkOrderItemLoanTaxCodeID')"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].taxLoanSaleId`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].taxCodeId`
|
||||
"
|
||||
data-cy="loanTaxCodeSaleId"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].taxLoanSaleId`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].taxCodeId`
|
||||
)
|
||||
"
|
||||
@input="
|
||||
fieldValueChanged(
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].taxLoanSaleId`
|
||||
`Items[${activeWoItemIndex}].loans[${activeItemIndex}].taxCodeId`
|
||||
)
|
||||
"
|
||||
@update:name="taxCodeChange"
|
||||
@@ -289,32 +367,32 @@
|
||||
></gz-currency>
|
||||
</v-col>
|
||||
|
||||
<v-col v-if="form().showMe(this, 'WorkOrderItemLoanSerials')" cols="12">
|
||||
<v-col v-if="form().showMe(this, 'WorkOrderItemLoanNotes')" cols="12">
|
||||
<v-textarea
|
||||
v-model="
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex].serials
|
||||
value.items[activeWoItemIndex].loans[activeItemIndex].notes
|
||||
"
|
||||
:readonly="formState.readOnly"
|
||||
:disabled="isDeleted"
|
||||
:label="$ay.t('PurchaseOrderItemSerialNumbers')"
|
||||
:label="$ay.t('WorkOrderItemLoanNotes')"
|
||||
:error-messages="
|
||||
form().serverErrors(
|
||||
this,
|
||||
`Items[${activeWoItemIndex}].loans[
|
||||
${activeItemIndex}
|
||||
].serials`
|
||||
].notes`
|
||||
)
|
||||
"
|
||||
:ref="
|
||||
`Items[${activeWoItemIndex}].loans[
|
||||
${activeItemIndex}
|
||||
].serials`
|
||||
].notes`
|
||||
"
|
||||
data-cy="loanSerials"
|
||||
data-cy="loanUnitNotes"
|
||||
@input="
|
||||
fieldValueChanged(`Items[${activeWoItemIndex}].loans[
|
||||
${activeItemIndex}
|
||||
].serials`)
|
||||
].notes`)
|
||||
"
|
||||
auto-grow
|
||||
></v-textarea>
|
||||
@@ -334,7 +412,7 @@ l.Add(new FormField { TKey = "WorkOrderItemLoanOutDate", FieldKey = "WorkOrderIt
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLoanDueDate", FieldKey = "WorkOrderItemLoanDueDate", TKeySection = "WorkOrderItemLoans" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLoanReturnDate", FieldKey = "WorkOrderItemLoanReturnDate", TKeySection = "WorkOrderItemLoans" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLoanTaxCodeID", FieldKey = "WorkOrderItemLoanTaxCodeID", TKeySection = "WorkOrderItemLoans" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLoanTaxLoanSaleID", FieldKey = "WorkOrderItemLoanTaxLoanSaleID", TKeySection = "WorkOrderItemLoans" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLoanTaxCodeID", FieldKey = "WorkOrderItemLoanTaxCodeID", TKeySection = "WorkOrderItemLoans" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLoanUnit", FieldKey = "WorkOrderItemLoanUnit", TKeySection = "WorkOrderItemLoans" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLoanQuantity", FieldKey = "WorkOrderItemLoanQuantity", TKeySection = "WorkOrderItemLoans" });
|
||||
l.Add(new FormField { TKey = "WorkOrderItemLoanRate", FieldKey = "WorkOrderItemLoanRate", TKeySection = "WorkOrderItemLoans" });
|
||||
@@ -407,15 +485,17 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
warehouseChange(newName) {
|
||||
loanUnitRateUnitChange(newId) {
|
||||
this.value.items[this.activeWoItemIndex].loans[
|
||||
this.activeItemIndex
|
||||
].loanWarehouseViz = newName;
|
||||
].unitOfMeasureViz = this.pvm.selectLists.loanUnitRateUnits.find(
|
||||
s => s.id == newId
|
||||
).name;
|
||||
},
|
||||
loanChange(newName) {
|
||||
loanUnitChange(newName) {
|
||||
this.value.items[this.activeWoItemIndex].loans[
|
||||
this.activeItemIndex
|
||||
].loanViz = newName;
|
||||
].loanUnitViz = newName;
|
||||
},
|
||||
taxCodeChange(newName) {
|
||||
this.value.items[this.activeWoItemIndex].loans[
|
||||
@@ -434,7 +514,7 @@ export default {
|
||||
loanId: null,
|
||||
loanWarehouseId: null,
|
||||
quantity: 1,
|
||||
taxLoanSaleId: null,
|
||||
taxCodeId: null,
|
||||
price: 0,
|
||||
priceOverride: null,
|
||||
cost: 0,
|
||||
|
||||
@@ -472,7 +472,22 @@
|
||||
/>
|
||||
</v-col>
|
||||
|
||||
<!-- //todo WorkOrderItemLoanList here
|
||||
<v-col
|
||||
cols="12"
|
||||
v-if="
|
||||
pvm.subRights.expenses.visible &&
|
||||
form().showMe(this, 'WorkOrderItemLoanList')
|
||||
"
|
||||
>
|
||||
<GzWoItemLoans
|
||||
v-model="value"
|
||||
:pvm="pvm"
|
||||
:active-wo-item-index="activeItemIndex"
|
||||
data-cy="woItemLoans"
|
||||
@change="$emit('change')"
|
||||
/>
|
||||
</v-col>
|
||||
<!--
|
||||
//todo WorkOrderItemOutsideServiceList here -->
|
||||
</template>
|
||||
</v-row>
|
||||
@@ -489,6 +504,7 @@ 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";
|
||||
import GzWoItemLoans from "../components/work-order-item-loans.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -498,7 +514,8 @@ export default {
|
||||
GzWoItemTravels,
|
||||
GzWoItemTasks,
|
||||
GzWoItemParts,
|
||||
GzWoItemPartRequests
|
||||
GzWoItemPartRequests,
|
||||
GzWoItemLoans
|
||||
},
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
|
||||
@@ -183,7 +183,8 @@ export default {
|
||||
allowedwostatus: [],
|
||||
woItemPriorities: [],
|
||||
woItemStatus: [],
|
||||
woItemTaskCompletionTypes: []
|
||||
woItemTaskCompletionTypes: [],
|
||||
loanUnitRateUnits: []
|
||||
},
|
||||
subRights: {
|
||||
items: {
|
||||
@@ -1908,6 +1909,10 @@ async function populateSelectionLists(vm) {
|
||||
"WorkorderItemTaskCompletionType"
|
||||
);
|
||||
|
||||
await window.$gz.enums.fetchEnumList("LoanUnitRateUnit"); //prefetch
|
||||
vm.selectLists.loanUnitRateUnits = window.$gz.enums.getSelectionList(
|
||||
"LoanUnitRateUnit"
|
||||
);
|
||||
//---------
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user