This commit is contained in:
@@ -24,10 +24,10 @@
|
|||||||
</v-list>
|
</v-list>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<!--
|
||||||
<span class="text-caption"
|
<span class="text-caption"
|
||||||
>[selected su_index: {{ pvm.selectedScheduledUserItemIndex }}]</span
|
>[selected su_index: {{ pvm.selectedScheduledUserItemIndex }}]</span
|
||||||
>
|
> -->
|
||||||
<template v-if="pvm.scheduledUserItemCount > 1">
|
<template v-if="pvm.scheduledUserItemCount > 1">
|
||||||
<!-- ################################ SCHEDULED USERS TABLE ############################### -->
|
<!-- ################################ SCHEDULED USERS TABLE ############################### -->
|
||||||
<v-col cols="12">
|
<v-col cols="12">
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
disable-filtering
|
disable-filtering
|
||||||
disable-sort
|
disable-sort
|
||||||
hide-default-footer
|
hide-default-footer
|
||||||
data-cy="itemsTable"
|
data-cy="scheduledUsersTable"
|
||||||
dense
|
dense
|
||||||
:item-class="itemRowClasses"
|
:item-class="itemRowClasses"
|
||||||
@click:row="selectItem"
|
@click:row="selectItem"
|
||||||
@@ -94,6 +94,9 @@ export default {
|
|||||||
newItem() {
|
newItem() {
|
||||||
console.log("STUB: NEW ITEM");
|
console.log("STUB: NEW ITEM");
|
||||||
},
|
},
|
||||||
|
selectItem: function(item) {
|
||||||
|
this.pvm.selectedScheduledUserItemIndex = item.index;
|
||||||
|
},
|
||||||
form() {
|
form() {
|
||||||
return window.$gz.form;
|
return window.$gz.form;
|
||||||
},
|
},
|
||||||
@@ -101,9 +104,110 @@ export default {
|
|||||||
if (!this.formState.loading && !this.formState.readonly) {
|
if (!this.formState.loading && !this.formState.readonly) {
|
||||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
itemRowClasses: function(item) {
|
||||||
|
if (this.form().childRowHasError(this, "ScheduledUsers", item.index)) {
|
||||||
|
return "font-weight-black font-italic error--text";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
headerList: function() {
|
||||||
|
/*
|
||||||
|
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; }
|
||||||
|
|
||||||
|
|
||||||
|
IN ORDER: start, stop, quantity, user, rate
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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,
|
||||||
|
"ScheduledUsers.WorkOrderItemScheduledUserStartDate"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
headers.push({
|
||||||
|
text: this.$ay.t("WorkOrderItemScheduledUserStartDate"),
|
||||||
|
align: "right",
|
||||||
|
value: "startDate"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
this.form().showMe(
|
||||||
|
this,
|
||||||
|
"ScheduledUsers.WorkOrderItemScheduledUserStopDate"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
headers.push({
|
||||||
|
text: this.$ay.t("WorkOrderItemScheduledUserStopDate"),
|
||||||
|
align: "right",
|
||||||
|
value: "stopDate"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
this.form().showMe(
|
||||||
|
this,
|
||||||
|
"ScheduledUsers.WorkOrderItemScheduledUserEstimatedQuantity"
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
headers.push({
|
||||||
|
text: this.$ay.t("WorkOrderItemScheduledUserEstimatedQuantity"),
|
||||||
|
align: "right",
|
||||||
|
value: "quantity"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
headers.push({
|
||||||
|
text: this.$ay.t("WorkOrderItemScheduledUserUserID"),
|
||||||
|
align: "left",
|
||||||
|
value: "userViz"
|
||||||
|
});
|
||||||
|
|
||||||
|
headers.push({
|
||||||
|
text: this.$ay.t("WorkOrderItemScheduledUserServiceRateID"),
|
||||||
|
align: "left",
|
||||||
|
value: "rateViz"
|
||||||
|
});
|
||||||
|
// headers.push({ text: "", value: "actions" });
|
||||||
|
|
||||||
|
return headers;
|
||||||
|
},
|
||||||
|
itemList: function() {
|
||||||
|
return this.value.items.map((x, i) => {
|
||||||
|
return {
|
||||||
|
index: i,
|
||||||
|
id: x.id,
|
||||||
|
startDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
|
x.startDate,
|
||||||
|
this.pvm.timeZoneName,
|
||||||
|
this.pvm.languageName,
|
||||||
|
this.pvm.hour12
|
||||||
|
),
|
||||||
|
|
||||||
|
stopDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
|
x.stopDate,
|
||||||
|
this.pvm.timeZoneName,
|
||||||
|
this.pvm.languageName,
|
||||||
|
this.pvm.hour12
|
||||||
|
),
|
||||||
|
userViz: x.userViz,
|
||||||
|
rateViz: x.rateViz
|
||||||
|
};
|
||||||
|
});
|
||||||
|
},
|
||||||
formState: function() {
|
formState: function() {
|
||||||
return this.pvm.formState;
|
return this.pvm.formState;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -154,48 +154,48 @@ and it's probably not a big list to fill anyway
|
|||||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||||
*/
|
*/
|
||||||
let headers = [];
|
let headers = [];
|
||||||
let vm = this;
|
|
||||||
headers.push({
|
headers.push({
|
||||||
text: vm.$ay.t("WorkOrderItemSummary"), //mandatory not hidden
|
text: this.$ay.t("WorkOrderItemSummary"), //mandatory not hidden
|
||||||
align: "left",
|
align: "left",
|
||||||
value: "notes"
|
value: "notes"
|
||||||
});
|
});
|
||||||
|
|
||||||
if (vm.form().showMe(vm, "Items.WorkOrderItemWorkOrderStatusID")) {
|
if (this.form().showMe(this, "Items.WorkOrderItemWorkOrderStatusID")) {
|
||||||
headers.push({
|
headers.push({
|
||||||
text: vm.$ay.t("WorkOrderItemWorkOrderStatusID"),
|
text: this.$ay.t("WorkOrderItemWorkOrderStatusID"),
|
||||||
align: "left",
|
align: "left",
|
||||||
value: "status"
|
value: "status"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm.form().showMe(vm, "Items.RequestDate")) {
|
if (this.form().showMe(this, "Items.RequestDate")) {
|
||||||
headers.push({
|
headers.push({
|
||||||
text: vm.$ay.t("WorkOrderItemRequestDate"),
|
text: this.$ay.t("WorkOrderItemRequestDate"),
|
||||||
align: "right",
|
align: "right",
|
||||||
value: "requestDate"
|
value: "requestDate"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm.form().showMe(vm, "Items.WorkOrderItemPriorityID")) {
|
if (this.form().showMe(this, "Items.WorkOrderItemPriorityID")) {
|
||||||
headers.push({
|
headers.push({
|
||||||
text: vm.$ay.t("WorkOrderItemPriorityID"),
|
text: this.$ay.t("WorkOrderItemPriorityID"),
|
||||||
align: "left",
|
align: "left",
|
||||||
value: "priority"
|
value: "priority"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm.form().showMe(vm, "Items.WorkOrderItemWarrantyService")) {
|
if (this.form().showMe(this, "Items.WorkOrderItemWarrantyService")) {
|
||||||
headers.push({
|
headers.push({
|
||||||
text: vm.$ay.t("WorkOrderItemWarrantyService"),
|
text: this.$ay.t("WorkOrderItemWarrantyService"),
|
||||||
align: "center",
|
align: "center",
|
||||||
value: "warranty"
|
value: "warranty"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vm.form().showMe(vm, "Items.Tags")) {
|
if (this.form().showMe(this, "Items.Tags")) {
|
||||||
headers.push({
|
headers.push({
|
||||||
text: vm.$ay.t("Tags"),
|
text: this.$ay.t("Tags"),
|
||||||
align: "left",
|
align: "left",
|
||||||
value: "tags"
|
value: "tags"
|
||||||
});
|
});
|
||||||
@@ -206,22 +206,21 @@ and it's probably not a big list to fill anyway
|
|||||||
return headers;
|
return headers;
|
||||||
},
|
},
|
||||||
itemList: function() {
|
itemList: function() {
|
||||||
let vm = this;
|
return this.value.items.map((x, i) => {
|
||||||
return vm.value.items.map((x, i) => {
|
|
||||||
return {
|
return {
|
||||||
index: i,
|
index: i,
|
||||||
id: x.id,
|
id: x.id,
|
||||||
notes: x.notes,
|
notes: x.notes,
|
||||||
quantityReceived: window.$gz.locale.decimalLocalized(
|
quantityReceived: window.$gz.locale.decimalLocalized(
|
||||||
x.quantityReceived,
|
x.quantityReceived,
|
||||||
vm.languageName
|
this.pvm.languageName
|
||||||
),
|
),
|
||||||
status: x.workorderItemStatusId, //todo: get real status name etc here
|
status: x.workorderItemStatusId, //todo: get real status name etc here
|
||||||
requestDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
requestDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
x.requestDate,
|
x.requestDate,
|
||||||
vm.timeZoneName,
|
this.pvm.timeZoneName,
|
||||||
vm.languageName,
|
this.pvm.languageName,
|
||||||
vm.hour12
|
this.pvm.hour12
|
||||||
),
|
),
|
||||||
priority: x.workorderItemPriorityId, //todo: get actual priority, color etc here
|
priority: x.workorderItemPriorityId, //todo: get actual priority, color etc here
|
||||||
warranty: x.warrantyService,
|
warranty: x.warrantyService,
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export default {
|
|||||||
valid: true
|
valid: true
|
||||||
});
|
});
|
||||||
|
|
||||||
//If there is a single woitem then select it otherwise keep it clean and empty by not selecting thus not showing
|
//If there is a single woitem then select it otherwise keep it clean and empty by not selecting thus not showing
|
||||||
//edit form as per design
|
//edit form as per design
|
||||||
if (vm.obj.items.length > 0) {
|
if (vm.obj.items.length > 0) {
|
||||||
if (vm.obj.items.length == 1) {
|
if (vm.obj.items.length == 1) {
|
||||||
@@ -190,6 +190,10 @@ export default {
|
|||||||
},
|
},
|
||||||
rights: window.$gz.role.defaultRightsObject(), //overall workorder rights, supersedes subrights
|
rights: window.$gz.role.defaultRightsObject(), //overall workorder rights, supersedes subrights
|
||||||
ayaType: window.$gz.type.WorkOrder,
|
ayaType: window.$gz.type.WorkOrder,
|
||||||
|
currencyName: window.$gz.locale.getCurrencyName(),
|
||||||
|
timeZoneName: window.$gz.locale.getResolvedTimeZoneName(),
|
||||||
|
languageName: window.$gz.locale.getResolvedLanguage(),
|
||||||
|
hour12: window.$gz.locale.getHour12(),
|
||||||
selectedItemIndex: null,
|
selectedItemIndex: null,
|
||||||
selectedScheduledUserItemIndex: null,
|
selectedScheduledUserItemIndex: null,
|
||||||
selectLists: {
|
selectLists: {
|
||||||
|
|||||||
Reference in New Issue
Block a user