HUGE REFACTOR / CLEANUP
if there is a issue it's probably something in here that was changed
This commit is contained in:
@@ -344,10 +344,6 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/* XXXeslint-disable */
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
export default {
|
||||
created() {
|
||||
this.setDefaultView();
|
||||
@@ -444,7 +440,7 @@ export default {
|
||||
if (!id || id == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`unit/work-order-info/${id}`);
|
||||
const res = await window.$gz.api.get(`unit/work-order-info/${id}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -469,7 +465,7 @@ export default {
|
||||
.t("ApplyUnitContract")
|
||||
.replace("{0}", res.data.name);
|
||||
|
||||
let dialogResult = await window.$gz.dialog.confirmGenericPreTranslated(
|
||||
const dialogResult = await window.$gz.dialog.confirmGenericPreTranslated(
|
||||
prompt,
|
||||
"question"
|
||||
);
|
||||
@@ -493,27 +489,13 @@ export default {
|
||||
if (!id || id == 0) {
|
||||
return;
|
||||
}
|
||||
let res = await window.$gz.api.get(`unit/service-warranty-info/${id}`);
|
||||
const res = await window.$gz.api.get(`unit/service-warranty-info/${id}`);
|
||||
if (res.error) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
window.$gz.errorHandler.errorToString(res, this)
|
||||
);
|
||||
} else {
|
||||
/* {
|
||||
"recentWorkOrders":[{"serial":10,"id":10,"serviceDate":"2021-01-19T22:00:00Z"},{"serial":8,"id":8,"serviceDate":"2021-04-08T22:00:00Z"},{"serial":7,"id":7,"serviceDate":"2021-04-18T20:00:00Z"}],
|
||||
"purchaseDate":"2019-03-12T09:37:52.930923Z",
|
||||
"purchasedFromVendor":null,
|
||||
"purchaseFromVendorId":null,
|
||||
"purchaseReceiptNumber":"139736",
|
||||
"lifeTimeWarranty":false,
|
||||
"warrantyExpiryDate":"2019-04-12T09:37:52.930923Z",
|
||||
"warrantyTerms":"Shipping parts and service"}
|
||||
|
||||
"UnitPurchasedDate": "Purchased Date",
|
||||
"UnitPurchaseFromID": "Purchased From",
|
||||
"UnitReceipt": "Receipt Number",
|
||||
*/
|
||||
const r = res.data;
|
||||
|
||||
let WarrantyInfo = `${this.$ay.t("Warranty")}: `;
|
||||
@@ -547,7 +529,7 @@ export default {
|
||||
this.pvm.hour12
|
||||
);
|
||||
}
|
||||
let PurchaseInfo = `${this.$ay.t(
|
||||
const PurchaseInfo = `${this.$ay.t(
|
||||
"UnitPurchaseFromID"
|
||||
)}: ${PurchasedFrom}<br/>${this.$ay.t(
|
||||
"UnitPurchasedDate"
|
||||
@@ -572,11 +554,11 @@ export default {
|
||||
RecentWorkOrderList = "-";
|
||||
}
|
||||
|
||||
let RecentWorkOrderInfo = `${this.$ay.t(
|
||||
const RecentWorkOrderInfo = `${this.$ay.t(
|
||||
"RecentWorkOrders"
|
||||
)}:${RecentWorkOrderList}`;
|
||||
|
||||
let d = `<div>${WarrantyInfo}<br/>${PurchaseInfo}<br/>${RecentWorkOrderInfo}</div>`;
|
||||
const d = `<div>${WarrantyInfo}<br/>${PurchaseInfo}<br/>${RecentWorkOrderInfo}</div>`;
|
||||
|
||||
this.value.items[this.activeWoItemIndex].units[
|
||||
this.activeItemIndex
|
||||
@@ -597,7 +579,7 @@ export default {
|
||||
this.selectedBulkUnits.splice(0);
|
||||
this.availableBulkUnits.splice(0);
|
||||
|
||||
let res = await window.$gz.api.post(`unit/bulk-add-selection-list`, {
|
||||
const res = await window.$gz.api.post(`unit/bulk-add-selection-list`, {
|
||||
tags: this.selectedBulkUnitTags,
|
||||
restrictToCustomerId: this.selectedBulkUnitCustomer
|
||||
});
|
||||
@@ -646,21 +628,7 @@ export default {
|
||||
await this.handleUnitChange();
|
||||
},
|
||||
newItem() {
|
||||
let newIndex = this.value.items[this.activeWoItemIndex].units.length;
|
||||
// {
|
||||
// "0": {
|
||||
// "id": 53,
|
||||
// "concurrency": 9586762,
|
||||
// "notes": "Aut modi molestias molestiae ipsa id.",
|
||||
// "wiki": null,
|
||||
// "customFields": null,
|
||||
// "tags": [],
|
||||
// "unitId": 4,
|
||||
// "unitViz": "83429560",
|
||||
// "workOrderItemId": 22
|
||||
// }
|
||||
// }
|
||||
|
||||
const newIndex = this.value.items[this.activeWoItemIndex].units.length;
|
||||
this.value.items[this.activeWoItemIndex].units.push({
|
||||
id: 0,
|
||||
concurrency: 0,
|
||||
@@ -735,11 +703,6 @@ export default {
|
||||
this.activeItemIndex
|
||||
].isDirty = true;
|
||||
window.$gz.form.fieldValueChanged(this.pvm, ref);
|
||||
|
||||
// //set viz if applicable
|
||||
// if(ref==""){
|
||||
// let selectedPartWarehouse = vm.$refs.partWarehouseId.getFullSelectionValue();
|
||||
// }
|
||||
}
|
||||
},
|
||||
itemRowClasses: function(item) {
|
||||
@@ -781,11 +744,7 @@ export default {
|
||||
},
|
||||
|
||||
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 = [];
|
||||
const headers = [];
|
||||
|
||||
if (this.form().showMe(this, "WorkOrderItemUnit")) {
|
||||
headers.push({
|
||||
|
||||
Reference in New Issue
Block a user