This commit is contained in:
2021-04-09 14:35:48 +00:00
parent d474601ceb
commit 506b5ba5ce
3 changed files with 25 additions and 24 deletions

View File

@@ -97,16 +97,10 @@
></gz-decimal>
</v-col>
</template>
<!-- public long? UserId { get; set; }
public decimal EstimatedQuantity { get; set; }
public DateTime? StartDate { get; set; }
public DateTime? StopDate { get; set; }
public long? ServiceRateId { get; set; } -->
<!-- <h5 class="ml-12">WorkOrderItemScheduledUsers</h5>
<div v-if="pvm.hasSelectedWoItem">
{{ value.items[pvm.selectedItemIndex].scheduledUsers }}
</div> -->
<!-- {{ pvm.hasSelectedScheduledUserItem }}<br />
{{ pvm.hasSelectedWoItem }}<br />
{{ pvm.selectedScheduledUserItemIndex }}<br />
{{ value.items[pvm.selectedItemIndex].scheduledUsers }}<br /> -->
</div>
</template>
<script>
@@ -132,19 +126,22 @@ export default {
methods: {
newItem() {
//bugbug? add woitem, then this and save not showing but then turns up later confirm!!
this.pvm.selectedScheduledUserItemIndex =
this.value.items[this.pvm.selectedItemIndex].scheduledUsers.push({
id: 0,
concurrency: 0,
userId: null,
estimatedQuantity: 0,
startDate: null,
stopDate: null,
serviceRateId: null,
isDirty: true,
workOrderItemId: this.value.items[this.pvm.selectedItemIndex].id
}) - 1;
let newIndex = this.value.items[this.pvm.selectedItemIndex].scheduledUsers
.length;
this.value.items[this.pvm.selectedItemIndex].scheduledUsers.push({
id: 0,
concurrency: 0,
userId: null,
estimatedQuantity: 0,
startDate: null,
stopDate: null,
serviceRateId: null,
isDirty: true,
workOrderItemId: this.value.items[this.pvm.selectedItemIndex].id
});
this.pvm.selectedScheduledUserItemIndex = newIndex;
},
async deleteItem() {
if ((await window.$gz.dialog.confirmDelete()) != true) {

View File

@@ -172,6 +172,11 @@ export default {
selectItem: function(item) {
this.selectedRow = [item];
this.pvm.selectedItemIndex = item.index;
//select children if 1 record to expose edit form in place
//or select none if more than one so that data table shows instead for selection
let woitem = this.value.items[item.index];
this.pvm.selectedScheduledUserItemIndex =
woitem.scheduledUsers.length == 1 ? 0 : null;
},
form() {
return window.$gz.form;

View File

@@ -18,7 +18,6 @@
:pvm="this"
data-cy="woItems"
/>
{{ obj }}
</v-form>
</div>
<template v-if="!formState.ready">