case 1690

This commit is contained in:
2021-11-24 23:22:29 +00:00
parent 672ca0e3c5
commit 1844e70dc9
2 changed files with 19 additions and 6 deletions

View File

@@ -69,11 +69,6 @@ function initNavPanel() {
}
//WORKORDERS subitem
console.log(
"Can open workorder role:",
window.$gz.role.canOpen(window.$gz.type.WorkOrder)
);
if (window.$gz.store.state.customerRights.wo == true) {
sub.push({
title: "WorkOrderList",

View File

@@ -401,7 +401,25 @@ export default {
showAddUnitDialog: function() {
this.addUnitDialog = true;
},
addUnit: function() {},
async addUnit() {
const vm = this;
try {
const res = await window.$gz.api.upsert(
"unit/customerunit/",
vm.unitObj
);
if (res.error) {
window.$gz.errorHandler.handleFormError(res.error); //no vm passed here so that it displays as a dialog rather than in the form
} else {
if (res.data.id) {
//SUCCESS
this.addUnitDialog = false;
}
}
} catch (ex) {
window.$gz.errorHandler.handleFormError(ex); //no vm passed here so that it displays as a dialog rather than in the form
}
},
unitListVariant: function() {
return `customerid: ${this.obj.customerId}`;
},