From a5d443eade71bf5140fa9fbfc3495a61b2532bf6 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 30 Jun 2021 19:55:11 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 4 + ayanova/src/views/inv-purchase-order.vue | 161 ++++++++++++++++------- ayanova/src/views/svc-project.vue | 5 +- 3 files changed, 122 insertions(+), 48 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 437a9693..7006eb96 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -103,6 +103,9 @@ todo: grid position not preserved when open a record then track back i.e. go to last record in a multipage list, open something, go back and will see it's back to the start of the list losing the user's scroll position this is very important that it work correctly +todo: purchase order form should work more like workorder form, it's a but fucky YAGNI?? + Joyce has a case, technically it works but see what Joyce wrote + todo: custom required rules only apply to new records!! todo: inventory and other lists shows LT: because namefetcher postgres function returns it when it's not a named item @@ -1298,6 +1301,7 @@ Build 111 - User / Custom contact on create / duplicate now allows entry of new user options before first User save rather than previous behaviour of having to save new record first then edit and save user options - Customer user login now always shows in App notifications (Bell icon and list when clicked on) regardless of whether they can subscribe to any notifications (global settings) to allow for viewing direct notifications sent to them + (previously it was not shown if they had no available notification types allowed to subscribe) - Prevent double booking a tech case 3720 customer request global setting "Allow schedule conflicts" and if on will check if same tech is booked already within that time frame on update or new scheduled user record diff --git a/ayanova/src/views/inv-purchase-order.vue b/ayanova/src/views/inv-purchase-order.vue index eca3c80b..b5bdcc3d 100644 --- a/ayanova/src/views/inv-purchase-order.vue +++ b/ayanova/src/views/inv-purchase-order.vue @@ -232,6 +232,7 @@ { + z.id = 0; + z.concurrency = undefined; + z.quantityReceived = 0; + z.receivedCost = 0; + z.receivedDate = null; + z.purchaseOrderId = 0; + z.workorderItemPartRequestId = null; + z.partRequestedById = null; + }); + + setDirty = true; + } } window.$gz.form.setFormState({ vm: vm, - dirty: false, - valid: true + loading: false, + dirty: setDirty, + valid: setValid }); - + //---------------------------- generateMenu(vm); } catch (error) { window.$gz.errorHandler.handleFormError(error, vm); @@ -1550,42 +1610,53 @@ export default { window.$gz.errorHandler.handleFormError(error, vm); } }, - async duplicate() { - let vm = this; - if (!vm.canDuplicate || vm.$route.params.recordid == 0) { - return; - } - window.$gz.form.setFormState({ - vm: vm, - loading: true - }); - let url = API_BASE_URL + "duplicate/" + vm.$route.params.recordid; - - try { - window.$gz.form.deleteAllErrorBoxErrors(vm); - let res = await window.$gz.api.upsert(url); - if (res.error) { - vm.formState.serverError = res.error; - window.$gz.form.setErrorBoxErrors(vm); - } else { - //Navigate to new record - this.$router.push({ - name: "inv-purchase-order", - params: { - recordid: res.data.id, - obj: res.data // Pass data object to new form - } - }); + duplicate() { + //Navigate to new record + this.$router.push({ + name: "inv-purchase-order", + params: { + recordid: 0, + obj: this.obj } - } catch (ex) { - window.$gz.errorHandler.handleFormError(ex, vm); - } finally { - window.$gz.form.setFormState({ - vm: vm, - loading: false - }); - } + }); } + // , + // async duplicate() { + // let vm = this; + // if (!vm.canDuplicate || vm.$route.params.recordid == 0) { + // return; + // } + // window.$gz.form.setFormState({ + // vm: vm, + // loading: true + // }); + // let url = API_BASE_URL + "duplicate/" + vm.$route.params.recordid; + + // try { + // window.$gz.form.deleteAllErrorBoxErrors(vm); + // let res = await window.$gz.api.upsert(url); + // if (res.error) { + // vm.formState.serverError = res.error; + // window.$gz.form.setErrorBoxErrors(vm); + // } else { + // //Navigate to new record + // this.$router.push({ + // name: "inv-purchase-order", + // params: { + // recordid: res.data.id, + // obj: res.data // Pass data object to new form + // } + // }); + // } + // } catch (ex) { + // window.$gz.errorHandler.handleFormError(ex, vm); + // } finally { + // window.$gz.form.setFormState({ + // vm: vm, + // loading: false + // }); + // } + // } //end methods } }; diff --git a/ayanova/src/views/svc-project.vue b/ayanova/src/views/svc-project.vue index 752beef7..46726a9a 100644 --- a/ayanova/src/views/svc-project.vue +++ b/ayanova/src/views/svc-project.vue @@ -195,10 +195,9 @@ export default { vm.rights = window.$gz.role.getRights(window.$gz.type.Project); vm.formState.readOnly = !vm.rights.change; window.$gz.eventBus.$on("menu-click", clickHandler); - + //--------------------------------- let setDirty = false; let setValid = true; - //id 0 means create or duplicate to new if (vm.$route.params.recordid != 0) { //is there already an obj from a prior operation? @@ -220,13 +219,13 @@ export default { setDirty = true; } } - window.$gz.form.setFormState({ vm: vm, loading: false, dirty: setDirty, valid: setValid }); + //---------------------------- generateMenu(vm); } catch (error) { window.$gz.errorHandler.handleFormError(error, vm);