diff --git a/ayanova/src/views/svc-pm.vue b/ayanova/src/views/svc-pm.vue
index dc9a9692..d9746fd3 100644
--- a/ayanova/src/views/svc-pm.vue
+++ b/ayanova/src/views/svc-pm.vue
@@ -598,17 +598,6 @@ export default {
break;
}
},
-
- // duplicate() {
- // //Navigate to new record
- // this.$router.push({
- // name: "pm-edit",
- // params: {
- // recordid: 0,
- // obj: this.obj
- // }
- // });
- // },
duplicate() {
let cp = JSON.parse(JSON.stringify(this.obj));
if (this.genCopyAttachments) {
@@ -674,7 +663,7 @@ export default {
if (this.genCopyAttachments) {
//this property set will trigger server to copy attachments
cp.genCopyAttachmentsFrom = {
- sAType: window.$gz.type.WorkOrder,
+ sAType: window.$gz.type.PM,
sId: this.obj.id
};
}
diff --git a/ayanova/src/views/svc-quote.vue b/ayanova/src/views/svc-quote.vue
index 0e4bce3b..c6cc5a49 100644
--- a/ayanova/src/views/svc-quote.vue
+++ b/ayanova/src/views/svc-quote.vue
@@ -32,13 +32,13 @@
-
+
-
+
- {{ $ay.t("DuplicateToWorkOrder") }}
+ {{ duplicateDlgTitle }}
- {{
+ {{
$ay.t("Cancel")
}}
- {{
- $ay.t("OK")
- }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $ay.t("DuplicateToPM") }}
-
-
-
-
-
-
- {{
- $ay.t("Cancel")
- }}
-
-
- {{
+ {{
$ay.t("OK")
}}
@@ -297,8 +264,9 @@ 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
- genWODlg: false,
- genPMDlg: false,
+ duplicateDlg: false,
+ duplicateDlgTitle: null,
+ duplicateTo: null, //"pm","wo" or "quote"
genCopyWiki: false,
genCopyAttachments: false
};
@@ -657,13 +625,37 @@ export default {
window.$gz.errorHandler.handleFormError(error, vm);
}
},
+ duplicateHandler() {
+ switch (this.duplicateTo) {
+ case "pm":
+ this.duplicate();
+ break;
+ case "wo":
+ this.generateWorkOrder();
+ break;
+ case "quote":
+ this.generateQuote();
+ break;
+ }
+ },
duplicate() {
+ 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.Quote,
+ sId: this.obj.id
+ };
+ }
+ if (!this.genCopyWiki) {
+ cp.wiki = null; //already copied, need to remove it instead
+ }
//Navigate to new record
this.$router.push({
name: "quote-edit",
params: {
recordid: 0,
- obj: this.obj
+ obj: cp
}
});
},
@@ -1776,13 +1768,19 @@ async function clickHandler(menuItem) {
});
break;
case "genwo":
- m.vm.genWODlg = true;
+ m.vm.duplicateDlgTitle = m.vm.$ay.t("DuplicateToWorkOrder");
+ m.vm.duplicateTo = "wo";
+ m.vm.duplicateDlg = true;
break;
- case "genpm":
- m.vm.genPMDlg = true;
+ case "genquote":
+ m.vm.duplicateDlgTitle = m.vm.$ay.t("DuplicateToQuote");
+ m.vm.duplicateTo = "quote";
+ m.vm.duplicateDlg = true;
break;
case "duplicate":
- m.vm.duplicate();
+ m.vm.duplicateDlgTitle = m.vm.$ay.t("DuplicateToPM");
+ m.vm.duplicateTo = "pm";
+ m.vm.duplicateDlg = true;
break;
case "report":
if (m.id != null) {