From a6dc3bc35bae7b6d4f747f56d204bec8e5835fc3 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 28 Jul 2021 23:16:42 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 29 +-------- ayanova/src/views/svc-pm.vue | 99 +++++++++++++++++++++++++++-- ayanova/src/views/svc-quote.vue | 91 ++++++++++++++++++++++++-- ayanova/src/views/svc-workorder.vue | 35 ++++++---- 4 files changed, 199 insertions(+), 55 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 4fd11d49..6e4f4cd3 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -525,46 +525,21 @@ CURRENTLY DOING: PM stuff: PM TODO: - case 3349 implement all possible grandchild collections in PM (same as quote) - case 3344 wo to pm generator (was a case, didn't realize had thought of it already) + + case 3583 ensure sufficient inventory (user want's it to look at all *upcoming* pm's and then alert parts are low or something, might be a notification type in there) decided this is self fulfilling because server will generate wo from pm simulating when client does it and accepting the part requests which will then trigger notification if set up and alert people that parts are required / taken from inventory up to them the timing of how far in advance to do it to ensure sufficient time Perhaps change this to a notification v.next case and still implement as planned which will partially solve this problem - case 3624 / block *out* certain days rather than block IN certain days for pm generation - also touches on holidays customer request to block out, for now let's let them figure that part out themselves but I've made a case to add a closed days feature that can tie into this and that other thing Joyce brought up which I forget now PM and QUOTE BIZ - all the notifications are probably fucked as copied directly from wo fix and add their own special ones - todo: replace "Generate ..." text to "Duplicate to ..." text in trans keys - "Generate work order" sounds like the PM automatic generation system, is this confusing? - need to disambiguate these things because the word generate is used for pm generation to wo - but what we are really doing is creating a work order from something or copy to new WorkOrder / Quote / PM? - No, "Copy" sounds like copying to an existing one..hmmm.. - Maybe "Duplicate to Quote" or etc!!!! - todo: should be able to directly duplicate to from any *order to any other *order iow no, it's not enough to have wo be the pivot object for a quote to PM, it should be direct -New plan: a way to generate any form of order from any other directly: - Generate WO or pm from quote - Generate quote or pm from wo - Generate PM from wo or quote - - - Click on generate, dialog pops up querying if want to also copy attachments / wiki as checkboxes - Does it's thing - -TODO: - X quote to workorder "QuoteGenerateServiceWorkOrder" - WO to PM "PMGenerateServiceWorkOrder" - WO to Quote - PM to WO (manual generation outside automatic) - - todo MISC: diff --git a/ayanova/src/views/svc-pm.vue b/ayanova/src/views/svc-pm.vue index 8b301f24..64f935c3 100644 --- a/ayanova/src/views/svc-pm.vue +++ b/ayanova/src/views/svc-pm.vue @@ -40,7 +40,7 @@ + + + + @@ -270,7 +303,8 @@ export default { lastGetContractId: -1, //note: -1 so that a new record updates lastGetCustomerId: -1, goto: null, //{type:ayatype,id:wodescendant id} picked up by woitem when set non-null to trigger navigate to the item in question - genDlg: false, + genWODlg: false, + genQuoteDlg: false, genCopyWiki: false, genCopyAttachments: false }; @@ -626,7 +660,41 @@ export default { } }); }, + generateQuote() { + let cp = JSON.parse(JSON.stringify(this.obj)); + if (this.genCopyAttachments) { + //this property set will trigger server to copy attachments + cp.genCopyAttachmentsFrom = { + sAType: window.$gz.type.WorkOrder, + sId: this.obj.id + }; + } + if (!this.genCopyWiki) { + cp.wiki = null; //already copied, need to remove it instead + } + cp.states = []; + cp.items.forEach(x => { + x.partRequests = []; + }); + cp.id = 0; + //set quote specific fields + cp.preparedById = window.$gz.store.state.userId; + cp.introduction = null; + cp.requested = window.$gz.locale.nowUTC8601String(); + cp.validUntil = null; + cp.submitted = null; + cp.approved = null; + + //Navigate to new record + this.$router.push({ + name: "quote-edit", + params: { + recordid: 0, + obj: cp + } + }); + }, ///////////////////////////////////////////////////////// // Clean woitem and children so it's // savable as a new record @@ -1624,7 +1692,10 @@ async function clickHandler(menuItem) { }); break; case "genwo": - m.vm.genDlg = true; + m.vm.genWODlg = true; + break; + case "genquote": + m.vm.genQuoteDlg = true; break; case "duplicate": m.vm.duplicate(); @@ -1775,6 +1846,19 @@ function generateMenu(vm) { }); } + if ( + vm.rights.change && + vm.$route.params.recordid != 0 && + !vm.obj.userIsRestrictedType + ) { + menuOptions.menuItems.push({ + title: "Duplicate", + icon: "$ayiClone", + key: FORM_KEY + ":duplicate", + vm: vm + }); + } + if ( vm.rights.change && vm.$route.params.recordid != 0 && @@ -1794,9 +1878,9 @@ function generateMenu(vm) { !vm.obj.userIsRestrictedType ) { menuOptions.menuItems.push({ - title: "Duplicate", - icon: "$ayiClone", - key: FORM_KEY + ":duplicate", + title: "DuplicateToQuote", + icon: "$ayiPencilAlt", + key: FORM_KEY + ":genquote", vm: vm }); } @@ -1855,6 +1939,7 @@ async function fetchTranslatedText(vm) { "PMSerialNumber", "WorkOrderSummary", "DuplicateToWorkOrder", + "DuplicateToQuote", "Contract", "Project", "WorkOrderCustomerContactName", diff --git a/ayanova/src/views/svc-quote.vue b/ayanova/src/views/svc-quote.vue index 4498c4c1..514fff39 100644 --- a/ayanova/src/views/svc-quote.vue +++ b/ayanova/src/views/svc-quote.vue @@ -40,7 +40,7 @@ + + + + @@ -268,7 +301,8 @@ export default { lastGetContractId: -1, //note: -1 so that a new record updates lastGetCustomerId: -1, goto: null, //{type:ayatype,id:wodescendant id} picked up by woitem when set non-null to trigger navigate to the item in question - genDlg: false, + genWODlg: false, + genPMDlg: false, genCopyWiki: false, genCopyAttachments: false }; @@ -665,7 +699,33 @@ export default { } }); }, + generatePM() { + let cp = JSON.parse(JSON.stringify(this.obj)); + if (this.genCopyAttachments) { + //this property set will trigger server to copy attachments + cp.genCopyAttachmentsFrom = { + sAType: window.$gz.type.WorkOrder, + sId: this.obj.id + }; + } + if (!this.genCopyWiki) { + cp.wiki = null; //already copied, need to remove it instead + } + cp.states = []; + cp.items.forEach(x => { + x.partRequests = []; + }); + cp.id = 0; + //Navigate to new record + this.$router.push({ + name: "pm-edit", + params: { + recordid: 0, + obj: cp + } + }); + }, ///////////////////////////////////////////////////////// // Clean woitem and children so it's // savable as a new record @@ -1697,7 +1757,10 @@ async function clickHandler(menuItem) { }); break; case "genwo": - m.vm.genDlg = true; + m.vm.genWODlg = true; + break; + case "genpm": + m.vm.genPMDlg = true; break; case "duplicate": m.vm.duplicate(); @@ -1848,6 +1911,19 @@ function generateMenu(vm) { }); } + if ( + vm.rights.change && + vm.$route.params.recordid != 0 && + !vm.obj.userIsRestrictedType + ) { + menuOptions.menuItems.push({ + title: "Duplicate", + icon: "$ayiClone", + key: FORM_KEY + ":duplicate", + vm: vm + }); + } + if ( vm.rights.change && vm.$route.params.recordid != 0 && @@ -1867,9 +1943,9 @@ function generateMenu(vm) { !vm.obj.userIsRestrictedType ) { menuOptions.menuItems.push({ - title: "Duplicate", - icon: "$ayiClone", - key: FORM_KEY + ":duplicate", + title: "DuplicateToPM", + icon: "$ayiBusinessTime", + key: FORM_KEY + ":genpm", vm: vm }); } @@ -1934,6 +2010,7 @@ async function fetchTranslatedText(vm) { "QuoteSerialNumber", "WorkOrderSummary", "DuplicateToWorkOrder", + "DuplicateToPM", "Contract", "Project", "WorkOrderCustomerContactName", diff --git a/ayanova/src/views/svc-workorder.vue b/ayanova/src/views/svc-workorder.vue index 66e5c07d..a2dc58c9 100644 --- a/ayanova/src/views/svc-workorder.vue +++ b/ayanova/src/views/svc-workorder.vue @@ -102,7 +102,6 @@ -