This commit is contained in:
@@ -23,18 +23,6 @@
|
||||
<v-list-item-title>{{ $ay.t("New") }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item
|
||||
v-if="hasData && hasSelection && canAdd"
|
||||
@click="copyItemDialog = true"
|
||||
>
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiCopy</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>{{
|
||||
$ay.t("CopyToWorkOrder")
|
||||
}}</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>
|
||||
@@ -622,45 +610,6 @@
|
||||
</v-col>
|
||||
</template>
|
||||
</v-row>
|
||||
<!-- ################################################################################-->
|
||||
<!-- ########################## COPY WOITEM DIALOG ###############################-->
|
||||
<!-- ################################################################################-->
|
||||
<template>
|
||||
<v-row justify="center">
|
||||
<v-dialog v-model="copyItemDialog" max-width="600px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="text-h5">{{ $ay.t("CopyToWorkOrder") }}</span>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model="copyItemWoNumber"
|
||||
:label="$ay.t('WorkOrder')"
|
||||
autofocus
|
||||
required
|
||||
type="number"
|
||||
></v-text-field>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="copyItemDialog = false"
|
||||
>{{ $ay.t("Cancel") }}</v-btn
|
||||
>
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="copyItemToWorkOrder()"
|
||||
:disabled="!copyItemWoNumber"
|
||||
>{{ $ay.t("OK") }}</v-btn
|
||||
>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-row>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -705,9 +654,7 @@ export default {
|
||||
gotoTaskIndex: null,
|
||||
gotoScheduledUserIndex: null,
|
||||
gotoTravelIndex: null,
|
||||
gotoUnitIndex: null,
|
||||
copyItemDialog: false,
|
||||
copyItemWoNumber: null
|
||||
gotoUnitIndex: null
|
||||
};
|
||||
},
|
||||
props: {
|
||||
@@ -874,53 +821,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async copyItemToWorkOrder() {
|
||||
if (!this.copyItemWoNumber) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Self copy to current workorder??
|
||||
if (this.copyItemWoNumber == this.value.serial) {
|
||||
let newIndex = this.value.items.length;
|
||||
|
||||
let wi = JSON.parse(
|
||||
JSON.stringify(this.value.items[this.activeItemIndex])
|
||||
);
|
||||
|
||||
this.pvm.washWorkOrderItem(wi);
|
||||
wi.quoteId = this.value.id;
|
||||
wi.sequence = newIndex + 1;
|
||||
this.value.items.push(wi);
|
||||
this.$emit("change");
|
||||
this.selectedRow = [{ index: newIndex }];
|
||||
this.activeItemIndex = newIndex;
|
||||
} else {
|
||||
if (this.pvm.formState.dirty) {
|
||||
if ((await window.$gz.dialog.confirmLeaveUnsaved()) !== true) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
//get id from number then push open
|
||||
let res = await window.$gz.api.get(
|
||||
"workorder/id-from-number/" + this.copyItemWoNumber
|
||||
);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
window.$gz.errorHandler.errorToString(res, this)
|
||||
);
|
||||
return;
|
||||
}
|
||||
this.$router.push({
|
||||
name: "workorder-edit",
|
||||
params: {
|
||||
recordid: res.data,
|
||||
copyItem: this.value.items[this.activeItemIndex]
|
||||
}
|
||||
});
|
||||
}
|
||||
this.copyItemDialog = false;
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items.length;
|
||||
|
||||
@@ -1068,31 +968,6 @@ export default {
|
||||
return this.value.items[this.activeItemIndex].deleted === true;
|
||||
},
|
||||
headerList: function() {
|
||||
/*
|
||||
public uint Concurrency { get; set; }
|
||||
public string Notes { get; set; }//Was Summary
|
||||
public string Wiki { get; set; }
|
||||
public string CustomFields { get; set; }
|
||||
public List<string> Tags { get; set; } = new List<string>();
|
||||
|
||||
[Required]
|
||||
public long WorkOrderId { get; set; }
|
||||
public string TechNotes { get; set; }
|
||||
public long? WorkorderItemStatusId { get; set; }
|
||||
public long? WorkorderItemPriorityId { get; set; }
|
||||
public DateTime RequestDate { get; set; }
|
||||
public bool WarrantyService { get; set; } = false;
|
||||
|
||||
|
||||
IN ORDER: notes, status, date, priority, warranty, tags
|
||||
|
||||
except they will not prefill at server but will be set here since the wo differs from the po in that there is no instant update with new viz fields to populate from server
|
||||
and it's probably not a big list to fill anyway
|
||||
|
||||
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemSequence")) {
|
||||
@@ -1163,9 +1038,6 @@ and it's probably not a big list to fill anyway
|
||||
value: "tags"
|
||||
});
|
||||
}
|
||||
|
||||
// headers.push({ text: "", value: "actions" });
|
||||
|
||||
return headers;
|
||||
},
|
||||
itemList: function() {
|
||||
|
||||
Reference in New Issue
Block a user