This commit is contained in:
2021-07-07 18:17:40 +00:00
parent 2944254403
commit cd601c5935
4 changed files with 37 additions and 81 deletions

View File

@@ -426,14 +426,6 @@ CURRENTLY DOING:
TODO 2 (all 2's): V7 features on wo I haven't coded yet
WOItem selected
3374 - be able to move woitem to any customer's open workorders not just the same customer.
not sure of the use of this, it's couched like a template issue which is what template is for, but since we no longer force
a fixed customer per workorder there's no reason I can see not to do this when implementing the Move woItem feature
Move woitem to new wo
Copy woitem to new wo
Sched user selected
Convert sched user to labor

View File

@@ -21,6 +21,14 @@
</v-list-item-icon>
<v-list-item-title>{{ $ay.t("New") }}</v-list-item-title>
</v-list-item>
<v-list-item v-if="hasSelection" @click="convertToLabor">
<v-list-item-icon>
<v-icon>$ayiHammer</v-icon>
</v-list-item-icon>
<v-list-item-title>{{
$ay.t("WorkOrderConvertScheduledUserToLabor")
}}</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>
@@ -332,6 +340,32 @@ export default {
}
},
methods: {
convertToLabor() {
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");
},
userChange(newName) {
this.value.items[this.activeWoItemIndex].scheduledUsers[
this.activeItemIndex

View File

@@ -876,82 +876,11 @@ export default {
//Self copy to current workorder??
if (this.copyItemWoNumber == this.value.serial) {
let newIndex = this.value.items.length;
// let wi = window.$gz.util.deepCopy(
// this.value.items[this.activeItemIndex]
// );
let wi = JSON.parse(
JSON.stringify(this.value.items[this.activeItemIndex])
);
// //deep copy all children
// wi.expenses.forEach(x => {
// x.id = 0;
// x.workOrderItemId = 0;
// x.concurrency = undefined;
// x.isDirty = true;
// });
// wi.labors.forEach(x => {
// x.id = 0;
// x.workOrderItemId = 0;
// x.concurrency = undefined;
// x.isDirty = true;
// });
// wi.loans.forEach(x => {
// x.id = 0;
// x.workOrderItemId = 0;
// x.concurrency = undefined;
// x.isDirty = true;
// x.cost = 0;
// x.listPrice = 0;
// });
// wi.parts.forEach(x => {
// x.id = 0;
// x.workOrderItemId = 0;
// x.concurrency = undefined;
// x.isDirty = true;
// x.cost = 0;
// x.listPrice = 0;
// });
// wi.scheduledUsers.forEach(x => {
// x.id = 0;
// x.workOrderItemId = 0;
// x.concurrency = undefined;
// x.isDirty = true;
// });
// wi.tasks.forEach(x => {
// x.id = 0;
// x.workOrderItemId = 0;
// x.concurrency = undefined;
// x.isDirty = true;
// });
// wi.travels.forEach(x => {
// x.id = 0;
// x.workOrderItemId = 0;
// x.concurrency = undefined;
// x.isDirty = true;
// });
// wi.units.forEach(x => {
// x.id = 0;
// x.workOrderItemId = 0;
// x.concurrency = undefined;
// x.isDirty = true;
// });
// wi.outsideServices.forEach(x => {
// x.id = 0;
// x.workOrderItemId = 0;
// x.concurrency = undefined;
// x.isDirty = true;
// });
console.log(
"wi equals source",
wi === this.value.items[this.activeItemIndex]
);
console.log(
"wi.labors[0] equals source.labors[0]",
wi.labors[0] === this.value.items[this.activeItemIndex].labors[0]
);
this.pvm.washWorkOrderItem(wi);
wi.workOrderId = this.value.id;
wi.sequence = newIndex + 1;

View File

@@ -2172,7 +2172,8 @@ async function fetchTranslatedText(vm) {
"PartAssembly",
"PartSerialNumbersAvailable",
"AddMultipleUnits",
"CopyToWorkOrder"
"CopyToWorkOrder",
"WorkOrderConvertScheduledUserToLabor"
]);
}