This commit is contained in:
@@ -379,12 +379,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
doRequest() {
|
||||
//todo: remove the requestAmountViz and error on edit of partid, warehouse or quantity to prevent ordering the wrong part here if they click on the button after editing those things
|
||||
|
||||
const requestQuantity = this.value.items[this.activeWoItemIndex].parts[
|
||||
this.activeItemIndex
|
||||
].requestAmountViz;
|
||||
].requestAmountViz; //set in svc-workorder.vue on save of part with insufficient qty
|
||||
if (requestQuantity != null && requestQuantity > 0) {
|
||||
//Get names for UI for request record so user knows it's the right one
|
||||
let selectedPartWarehouse = this.$refs[
|
||||
`Items[${this.activeWoItemIndex}].parts[${this.activeItemIndex}].partWarehouseId`
|
||||
].getFullSelectionValue();
|
||||
@@ -402,14 +401,14 @@ export default {
|
||||
selectedPart = selectedPart.name;
|
||||
}
|
||||
|
||||
//change the partquantity
|
||||
//change the part quantity to the balance in stock
|
||||
this.value.items[this.activeWoItemIndex].parts[
|
||||
this.activeItemIndex
|
||||
].quantity =
|
||||
this.value.items[this.activeWoItemIndex].parts[this.activeItemIndex]
|
||||
.quantity - requestQuantity;
|
||||
//add a request record
|
||||
|
||||
//add a request record
|
||||
this.value.items[this.activeWoItemIndex].partRequests.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -426,6 +425,7 @@ export default {
|
||||
workOrderItemId: this.value.items[this.activeWoItemIndex].id,
|
||||
uid: Date.now() //used for error tracking / display
|
||||
});
|
||||
|
||||
this.$emit("change");
|
||||
|
||||
//clear the error but leave dirty and let user save it
|
||||
|
||||
Reference in New Issue
Block a user