This commit is contained in:
2021-07-08 23:44:31 +00:00
parent e951dd2c87
commit 225c5f182a
2 changed files with 65 additions and 0 deletions

View File

@@ -759,6 +759,43 @@ export default {
"Copy"
)}`;
setDirty = true;
} else {
//check for generate unit from part info on route params
//(set by workorder item part when user selects generate unit from part)
let gen = this.$route.params.genFromPart;
if (gen) {
/* genFromPart: {
customerId: this.value.customerId,
partId: thisPart.partId,
purchaseDate: this.value.serviceDate,
serial: thisPart.serials
}
/*
owner is workorder customer
Description is part name
purchased here is true
purchased date is service date of workorder
Serial number is part serial number if set
*/
//get the part then set the values accordingly
let res = await window.$gz.api.get(`part/${gen.partId}`);
if (res.error) {
window.$gz.eventBus.$emit(
"notify-warning",
window.$gz.errorHandler.errorToString(res, this)
);
} else {
let p = res.data;
this.obj.boughtHere = true;
this.obj.customerId = gen.customerId;
this.obj.serial = gen.serial;
this.obj.purchasedDate = gen.purchaseDate;
this.obj.description = p.partNumber + " " + p.name;
}
setDirty = true;
}
}
}