This commit is contained in:
@@ -456,10 +456,14 @@ CURRENTLY DOING: more misc stuff below to complete workorder!!!
|
||||
|
||||
CASES TODO:
|
||||
Some initial workorder cases to do
|
||||
583 1: add unit address fields to viz populate but only show them when reportdata selected as UI doesn't consume them
|
||||
sb under the unit I guess as unit address *viz
|
||||
|
||||
|
||||
1362 2: convert scheduled user to labor (case is to do en-masse but also I need to implement this individually as well)
|
||||
need transkey: "WorkOrderConvertAllScheduledUsersToLabor"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1467 2: text1,text2 etc to show in "Warranty" area of Unit display info (however I have not coded or even thought of / decided on any v7 style warranty info section yet so double case here)
|
||||
1908 1: set new durationtocompleted field on wo header upon setting to a closed status, also show it in the main data list
|
||||
|
||||
@@ -32,6 +32,17 @@
|
||||
$ay.t("WorkOrderConvertScheduledUserToLabor")
|
||||
}}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="hasSelection && !formState.readOnly && hasMultipleItems"
|
||||
@click="convertAllToLabor"
|
||||
>
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiHammer</v-icon>
|
||||
</v-list-item-icon>
|
||||
<v-list-item-title>{{
|
||||
$ay.t("WorkOrderConvertAllScheduledUsersToLabor")
|
||||
}}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="canDelete && isDeleted" @click="unDeleteItem">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiTrashRestoreAlt</v-icon>
|
||||
@@ -349,6 +360,33 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
convertAllToLabor() {
|
||||
todo:code this efficiently in conjunction with below
|
||||
const s = this.value.items[this.activeWoItemIndex].scheduledUsers[
|
||||
this.activeItemIndex
|
||||
];
|
||||
this.value.items[this.activeWoItemIndex].labors.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
userId: s.userId,
|
||||
serviceStartDate: s.startDate,
|
||||
serviceStopDate: s.stopDate,
|
||||
serviceRateId: s.serviceRateId,
|
||||
serviceDetails: null,
|
||||
serviceRateQuantity: s.estimatedQuantity,
|
||||
noChargeQuantity: 0,
|
||||
taxCodeSaleId: null,
|
||||
price: 0,
|
||||
priceOverride: null,
|
||||
isDirty: true,
|
||||
workOrderItemId: this.value.items[this.activeWoItemIndex].id,
|
||||
uid: Date.now(),
|
||||
userViz: s.userViz,
|
||||
serviceRateViz: s.serviceRateViz,
|
||||
taxCodeViz: null
|
||||
});
|
||||
this.$emit("change");
|
||||
},
|
||||
convertToLabor() {
|
||||
const s = this.value.items[this.activeWoItemIndex].scheduledUsers[
|
||||
this.activeItemIndex
|
||||
@@ -681,6 +719,9 @@ export default {
|
||||
},
|
||||
canDeleteAll: function() {
|
||||
return this.pvm.rights.change && !this.value.userIsRestrictedType;
|
||||
},
|
||||
hasMultipleItems: function() {
|
||||
return this.value.items[this.activeWoItemIndex].scheduledUsers.length > 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user