This commit is contained in:
@@ -409,17 +409,79 @@ export default {
|
|||||||
"purchaseReceiptNumber":"139736",
|
"purchaseReceiptNumber":"139736",
|
||||||
"lifeTimeWarranty":false,
|
"lifeTimeWarranty":false,
|
||||||
"warrantyExpiryDate":"2019-04-12T09:37:52.930923Z",
|
"warrantyExpiryDate":"2019-04-12T09:37:52.930923Z",
|
||||||
"warrantyTerms":"Shipping parts and service"} */
|
"warrantyTerms":"Shipping parts and service"}
|
||||||
|
|
||||||
|
"UnitPurchasedDate": "Purchased Date",
|
||||||
|
"UnitPurchaseFromID": "Purchased From",
|
||||||
|
"UnitReceipt": "Receipt Number",
|
||||||
|
*/
|
||||||
|
const r = res.data;
|
||||||
|
|
||||||
|
let Warranty = `${this.$ay.t("Warranty")}:`;
|
||||||
|
let WarrantyExpiryInfo = "-";
|
||||||
|
if (r.lifeTimeWarranty) {
|
||||||
|
WarrantyExpiryInfo = this.$ay.t("UnitModelLifeTimeWarranty");
|
||||||
|
} else {
|
||||||
|
if (r.warrantyExpiryDate) {
|
||||||
|
WarrantyExpiryInfo = `${this.$ay.t(
|
||||||
|
"WarrantyExpires"
|
||||||
|
)}: ${window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
|
r.warrantyExpiryDate,
|
||||||
|
this.pvm.timeZoneName,
|
||||||
|
this.pvm.languageName,
|
||||||
|
this.pvm.hour12
|
||||||
|
)}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Warranty += WarrantyExpiryInfo;
|
||||||
|
|
||||||
|
let PurchasedFrom = "-";
|
||||||
|
if (r.purchaseFromVendorId) {
|
||||||
|
PurchasedFrom = `<a href="/vendors/${r.purchaseFromVendorId}"> ${r.purchaseFromVendor}</a>`;
|
||||||
|
}
|
||||||
|
let PurchasedDate = "-";
|
||||||
|
if (r.purchaseDate) {
|
||||||
|
PurchasedDate = window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
|
r.purchaseDate,
|
||||||
|
this.pvm.timeZoneName,
|
||||||
|
this.pvm.languageName,
|
||||||
|
this.pvm.hour12
|
||||||
|
);
|
||||||
|
}
|
||||||
|
let PurchaseInfo = `${this.$ay.t(
|
||||||
|
"UnitPurchaseFromID"
|
||||||
|
)}: ${PurchasedFrom}<br/>${this.$ay.t(
|
||||||
|
"UnitPurchasedDate"
|
||||||
|
)}: ${PurchasedDate}<br/>${this.$ay.t(
|
||||||
|
"UnitReceipt"
|
||||||
|
)}: ${r.purchaseReceiptNumber ?? "-"}`;
|
||||||
|
|
||||||
|
let RecentWorkOrderList = "";
|
||||||
|
if (r.recentWorkOrders.length > 0) {
|
||||||
|
RecentWorkOrderList += "<br/>";
|
||||||
|
r.recentWorkOrders.forEach(x => {
|
||||||
|
RecentWorkOrderList += `<a href="/svc-workorders/${x.id}"> ${
|
||||||
|
x.serial
|
||||||
|
}<span class='ml-5'>${window.$gz.locale.utcDateToShortDateAndTimeLocalized(
|
||||||
|
x.serviceDate,
|
||||||
|
this.pvm.timeZoneName,
|
||||||
|
this.pvm.languageName,
|
||||||
|
this.pvm.hour12
|
||||||
|
)}</span></a><br/>`;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
RecentWorkOrderList = "-";
|
||||||
|
}
|
||||||
|
|
||||||
|
let RecentWorkOrders = `${this.$ay.t(
|
||||||
|
"RecentWorkOrders"
|
||||||
|
)}:${RecentWorkOrderList}`;
|
||||||
|
|
||||||
|
let d = `<div>${Warranty}<br/>${PurchaseInfo}<br/>${RecentWorkOrders}</div>`;
|
||||||
|
|
||||||
this.value.items[this.activeWoItemIndex].units[
|
this.value.items[this.activeWoItemIndex].units[
|
||||||
this.activeItemIndex
|
this.activeItemIndex
|
||||||
].warrantyViz = `<div>${JSON.stringify(res.data)}</div>`;
|
].warrantyViz = d;
|
||||||
|
|
||||||
// console.log(
|
|
||||||
// "warrantyviz:",
|
|
||||||
// this.value.items[this.activeWoItemIndex].units[this.activeItemIndex]
|
|
||||||
// .warrantyViz
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showBulkUnitsDialog() {
|
showBulkUnitsDialog() {
|
||||||
|
|||||||
@@ -2177,7 +2177,14 @@ async function fetchTranslatedText(vm) {
|
|||||||
"CopyToWorkOrder",
|
"CopyToWorkOrder",
|
||||||
"WorkOrderConvertScheduledUserToLabor",
|
"WorkOrderConvertScheduledUserToLabor",
|
||||||
"AppendTasks",
|
"AppendTasks",
|
||||||
"UnitWarrantyInfo"
|
"UnitWarrantyInfo",
|
||||||
|
"UnitModelLifeTimeWarranty",
|
||||||
|
"Warranty",
|
||||||
|
"WarrantyExpires",
|
||||||
|
"UnitPurchaseFromID",
|
||||||
|
"UnitPurchasedDate",
|
||||||
|
"UnitReceipt",
|
||||||
|
"RecentWorkOrders"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user