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

View File

@@ -172,6 +172,11 @@ export default {
selectItem: function(item) { selectItem: function(item) {
this.selectedRow = [item]; this.selectedRow = [item];
this.pvm.selectedItemIndex = item.index; 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() { form() {
return window.$gz.form; return window.$gz.form;

View File

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