This commit is contained in:
2021-07-20 15:43:42 +00:00
parent 9fa8703571
commit b9dd8cc113

View File

@@ -33,7 +33,7 @@
}}</v-list-item-title> }}</v-list-item-title>
</v-list-item> </v-list-item>
<v-list-item <v-list-item
v-if="hasSelection && !formState.readOnly && hasMultipleItems" v-if="!formState.readOnly && hasMultipleItems"
@click="convertAllToLabor" @click="convertAllToLabor"
> >
<v-list-item-icon> <v-list-item-icon>
@@ -360,37 +360,19 @@ export default {
} }
}, },
methods: { methods: {
convertAllToLabor() { convertAllToLabor() {
todo:code this efficiently in conjunction with below this.value.items[this.activeWoItemIndex].scheduledUsers.forEach(z => {
const s = this.value.items[this.activeWoItemIndex].scheduledUsers[ this.doConvertToLabor(z);
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() { convertToLabor() {
const s = this.value.items[this.activeWoItemIndex].scheduledUsers[ this.doConvertToLabor(
this.activeItemIndex this.value.items[this.activeWoItemIndex].scheduledUsers[
]; this.activeItemIndex
]
);
},
doConvertToLabor(s) {
this.value.items[this.activeWoItemIndex].labors.push({ this.value.items[this.activeWoItemIndex].labors.push({
id: 0, id: 0,
concurrency: 0, concurrency: 0,