This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
}}</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item
|
||||
v-if="hasSelection && !formState.readOnly && hasMultipleItems"
|
||||
v-if="!formState.readOnly && hasMultipleItems"
|
||||
@click="convertAllToLabor"
|
||||
>
|
||||
<v-list-item-icon>
|
||||
@@ -360,37 +360,19 @@ 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
|
||||
convertAllToLabor() {
|
||||
this.value.items[this.activeWoItemIndex].scheduledUsers.forEach(z => {
|
||||
this.doConvertToLabor(z);
|
||||
});
|
||||
this.$emit("change");
|
||||
},
|
||||
convertToLabor() {
|
||||
const s = this.value.items[this.activeWoItemIndex].scheduledUsers[
|
||||
this.activeItemIndex
|
||||
];
|
||||
this.doConvertToLabor(
|
||||
this.value.items[this.activeWoItemIndex].scheduledUsers[
|
||||
this.activeItemIndex
|
||||
]
|
||||
);
|
||||
},
|
||||
doConvertToLabor(s) {
|
||||
this.value.items[this.activeWoItemIndex].labors.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
|
||||
Reference in New Issue
Block a user