This commit is contained in:
@@ -258,7 +258,7 @@
|
||||
}}</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item @click="restockSelectDialog = true">
|
||||
<v-list-item @click="showRestockSelectDialog()">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiClipboardList</v-icon>
|
||||
</v-list-item-icon>
|
||||
@@ -267,8 +267,7 @@
|
||||
}}</v-list-item-title>
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item @click="restockSelectDialog = true">
|
||||
<!-- MIGRATE_OUTSTANDING workorderitempartrequest -->
|
||||
<v-list-item @click="showRequestSelectDialog()">
|
||||
<v-list-item-icon>
|
||||
<v-icon>$ayiParachuteBox</v-icon>
|
||||
</v-list-item-icon>
|
||||
@@ -728,7 +727,22 @@
|
||||
<v-dialog v-model="restockSelectDialog">
|
||||
<v-card>
|
||||
<v-card-title> restock title here </v-card-title>
|
||||
<v-card-text> select items here </v-card-text>
|
||||
<v-card-text>
|
||||
<v-col cols="12">
|
||||
<v-data-table
|
||||
:headers="restockHeaderList"
|
||||
:items="restockItemList"
|
||||
class="elevation-1"
|
||||
disable-pagination
|
||||
disable-filtering
|
||||
show-select
|
||||
hide-default-footer
|
||||
data-cy="restockTable"
|
||||
dense
|
||||
>
|
||||
</v-data-table>
|
||||
</v-col>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
@@ -748,6 +762,35 @@
|
||||
</v-dialog>
|
||||
</v-row>
|
||||
</template>
|
||||
<!-- ########################## WORKORDER ITEM PART REQUEST SELECTION DIALOG ###############################-->
|
||||
<!-- MIGRATE_OUTSTANDING workorderitempartrequest -->
|
||||
<template>
|
||||
<v-row justify="center">
|
||||
<v-dialog v-model="requestSelectDialog">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
underconstruction request select title here
|
||||
</v-card-title>
|
||||
<v-card-text> select requested items here </v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="requestSelectDialog = false"
|
||||
>{{ $ay.t("Close") }}</v-btn
|
||||
>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="blue darken-1"
|
||||
text
|
||||
@click="requestSelectDialog = false"
|
||||
>{{ $ay.t("Save") }}</v-btn
|
||||
>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-row>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -824,6 +867,8 @@ export default {
|
||||
editPoItemDialog: false,
|
||||
editPoItemIndex: 0,
|
||||
restockSelectDialog: false,
|
||||
restockItems: [],
|
||||
requestSelectDialog: false,
|
||||
selectLists: {
|
||||
status: []
|
||||
},
|
||||
@@ -1086,9 +1131,118 @@ export default {
|
||||
)
|
||||
};
|
||||
});
|
||||
},
|
||||
restockHeaderList: function() {
|
||||
let headers = [];
|
||||
let vm = this;
|
||||
headers.push({
|
||||
text: vm.$ay.t("Part"),
|
||||
align: "left",
|
||||
value: "partnumber"
|
||||
});
|
||||
|
||||
if (vm.obj.hasSelectableWarehouses) {
|
||||
headers.push({
|
||||
text: vm.$ay.t("PartWarehouse"),
|
||||
align: "left",
|
||||
value: "displayWarehouse"
|
||||
});
|
||||
}
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("PartByWarehouseInventoryMinStockLevel"),
|
||||
align: "right",
|
||||
value: "minimumQuantity"
|
||||
});
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("PartInventoryBalance"),
|
||||
align: "right",
|
||||
value: "balance"
|
||||
});
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("PartByWarehouseInventoryQuantityOnOrder"),
|
||||
align: "right",
|
||||
value: "onOrderQuantity"
|
||||
});
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("PartByWarehouseInventoryReorderQuantity"),
|
||||
align: "right",
|
||||
value: "requiredQuantity"
|
||||
});
|
||||
|
||||
return headers;
|
||||
},
|
||||
restockItemList: function() {
|
||||
/**
|
||||
*
|
||||
* {"data":[{"partId":2,"partWarehouseId":1,"partNumber":"249986","displayWarehouse":"Default","manufacturerId":2,
|
||||
* "displayManufacturer":"Ryan - Legros","wholesalerId":6,"displayWholesaler":"Emmerich and Sons","alternativeWholesalerId":9,
|
||||
* "displayAlternativeWholesaler":"O'Connell - MacGyver","minimumQuantity":6.0000,"balance":4.0000,"onOrderQuantity":0.0,"requiredQuantity":2.0000}]}
|
||||
*/
|
||||
let vm = this;
|
||||
return vm.restockItems.map((x, i) => {
|
||||
return {
|
||||
index: i,
|
||||
partId: x.partId,
|
||||
partWarehouseId: x.partWarehouseId,
|
||||
partNumber: x.partNumber,
|
||||
displayWarehouse: x.displayWarehouse,
|
||||
|
||||
minimumQuantity: window.$gz.locale.decimalLocalized(
|
||||
x.minimumQuantity,
|
||||
vm.languageName
|
||||
),
|
||||
balance: window.$gz.locale.decimalLocalized(
|
||||
x.balance,
|
||||
vm.languageName
|
||||
),
|
||||
onOrderQuantity: window.$gz.locale.decimalLocalized(
|
||||
x.onOrderQuantity,
|
||||
vm.languageName
|
||||
),
|
||||
requiredQuantity: window.$gz.locale.decimalLocalized(
|
||||
x.requiredQuantity,
|
||||
vm.languageName
|
||||
)
|
||||
};
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async showRestockSelectDialog() {
|
||||
let vm = this;
|
||||
|
||||
let url = API_BASE_URL + "restock-by-vendor/" + vm.obj.vendorId;
|
||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||
try {
|
||||
let res = await window.$gz.api.get(url);
|
||||
|
||||
if (res.error) {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
} else {
|
||||
//process add url dl token and id
|
||||
if (res.data) {
|
||||
vm.restockItems = res.data;
|
||||
} else {
|
||||
vm.restockItems = [];
|
||||
}
|
||||
vm.restockSelectDialog = true;
|
||||
}
|
||||
} catch (error) {
|
||||
window.$gz.form.setFormState({
|
||||
vm: vm,
|
||||
loading: false
|
||||
});
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
}
|
||||
},
|
||||
showRequestSelectDialgo() {
|
||||
requestSelectDialog = true;
|
||||
},
|
||||
poItemsRowClasses: function(item) {
|
||||
if (this.form().childRowHasError(this, "Items", item.index)) {
|
||||
return "font-weight-black font-italic error--text";
|
||||
@@ -1587,6 +1741,10 @@ async function fetchTranslatedText(vm) {
|
||||
"JobCompleted",
|
||||
"ConfirmUpdatePartCost",
|
||||
"PurchaseOrderUIRestockList",
|
||||
"PartByWarehouseInventoryMinStockLevel",
|
||||
"PartInventoryBalance",
|
||||
"PartByWarehouseInventoryQuantityOnOrder",
|
||||
"PartByWarehouseInventoryReorderQuantity",
|
||||
"WorkOrderItemPartRequestList",
|
||||
"PurchaseOrderCustom1",
|
||||
"PurchaseOrderCustom2",
|
||||
|
||||
Reference in New Issue
Block a user