This commit is contained in:
@@ -125,7 +125,7 @@ todo: tax values and totals need to be calced at server and returned with record
|
||||
|
||||
todo: dynamically hide worequest columns if found to not be included
|
||||
todo: maybe also insert a showwarehouses return nonmapped value with po and remove the fetch if can just hide column headers anyway
|
||||
|
||||
todo: change phrase "Actual cost" in translation to "Received cost"
|
||||
PO UI for items:
|
||||
Use ops-backup form list of backups as concept, it uses a v-data-table
|
||||
It adapts to mobile view with horizontal card so perfect for that and will work for what I need.
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
</v-btn> -->
|
||||
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:headers="headerList"
|
||||
:items="itemList"
|
||||
class="elevation-1"
|
||||
disable-pagination
|
||||
@@ -461,16 +461,81 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
headerList: function() {
|
||||
/*
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
let headers = [];
|
||||
let vm = this;
|
||||
headers.push({
|
||||
text: vm.$ay.t("Part"),
|
||||
align: "left",
|
||||
value: "displayPartNumber"
|
||||
});
|
||||
|
||||
if (vm.showWarehouses) {
|
||||
headers.push({
|
||||
text: vm.$ay.t("PartWarehouse"),
|
||||
align: "left",
|
||||
value: "displayWarehouse"
|
||||
});
|
||||
}
|
||||
headers.push({
|
||||
text: vm.$ay.t("PurchaseOrderItemQuantityOrdered"),
|
||||
align: "right",
|
||||
value: "quantityOrdered"
|
||||
});
|
||||
headers.push({
|
||||
text: vm.$ay.t("PurchaseOrderItemQuantityReceived"),
|
||||
align: "right",
|
||||
value: "quantityReceived"
|
||||
});
|
||||
headers.push({
|
||||
text: vm.$ay.t("PurchaseOrderReceiptReceivedDate"),
|
||||
align: "right",
|
||||
value: "receivedDate"
|
||||
});
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("PurchaseOrderItemPurchaseOrderCost"),
|
||||
align: "right",
|
||||
value: "purchaseOrderCost"
|
||||
});
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("PurchaseOrderReceiptItemReceiptCost"),
|
||||
align: "right",
|
||||
value: "receivedCost"
|
||||
});
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("TaxCode"),
|
||||
align: "left",
|
||||
value: "displayTaxCode"
|
||||
});
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("PurchaseOrderItemVendorPartNumber"),
|
||||
align: "left",
|
||||
value: "vendorPartNumber"
|
||||
});
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("PurchaseOrderItemPartRequestedByID"),
|
||||
align: "left",
|
||||
value: "displayRequestUser"
|
||||
});
|
||||
|
||||
headers.push({
|
||||
text: vm.$ay.t("PurchaseOrderItemWorkOrderNumber"),
|
||||
align: "left",
|
||||
value: "displayRequestWorkorder"
|
||||
});
|
||||
return headers;
|
||||
},
|
||||
itemList: function() {
|
||||
let vm = this;
|
||||
// let ret = [];
|
||||
// ret.push(...vm.obj.items);
|
||||
// return ret;
|
||||
// kvArray.map(obj => {
|
||||
// let rObj = {}
|
||||
// rObj[obj.key] = obj.value
|
||||
// return rObj
|
||||
// })
|
||||
/*[
|
||||
{ "id": 1, "concurrency": 7262944, "purchaseOrderId": 1, "partId": 8, "partWarehouseId": 2, "quantityOrdered": 24,
|
||||
"quantityReceived": 24, "purchaseOrderCost": 2.0518, "receivedCost": 10, "receivedDate": "2020-11-03T11:39:07.594439Z",
|
||||
@@ -563,6 +628,7 @@ export default {
|
||||
vm.obj = res.data;
|
||||
//modify the menu as necessary
|
||||
generateMenu(vm);
|
||||
await createTableHeaders(vm);
|
||||
//Update the form status
|
||||
window.$gz.form.setFormState({
|
||||
vm: vm,
|
||||
@@ -901,6 +967,8 @@ async function createTableHeaders(vm) {
|
||||
If the column is a text, left-align it
|
||||
If the column is a number or number + unit, (or date) right-align it (like excel)
|
||||
*/
|
||||
vm.headers = [];
|
||||
|
||||
vm.headers.push({
|
||||
text: vm.$ay.t("Part"),
|
||||
align: "left",
|
||||
|
||||
Reference in New Issue
Block a user