diff --git a/ayanova/src/views/svc-quote.vue b/ayanova/src/views/svc-quote.vue
index 612654fd..24743df7 100644
--- a/ayanova/src/views/svc-quote.vue
+++ b/ayanova/src/views/svc-quote.vue
@@ -672,6 +672,7 @@ export default {
cp.wiki = null; //already copied, need to remove it instead
}
cp.states = [];
+ cp.lastStatusId = undefined;
cp.items.forEach(x => {
x.partRequests = [];
});
diff --git a/ayanova/src/views/svc-workorder.vue b/ayanova/src/views/svc-workorder.vue
index e626ec4b..71bcf956 100644
--- a/ayanova/src/views/svc-workorder.vue
+++ b/ayanova/src/views/svc-workorder.vue
@@ -31,15 +31,14 @@
-
-
+
-
+
- {{ $ay.t("DuplicateToQuote") }}
+ {{ duplicateDlgTitle }}
- {{
+ {{
$ay.t("Cancel")
}}
- {{
- $ay.t("OK")
- }}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ $ay.t("DuplicateToPM") }}
-
-
-
-
-
-
- {{
- $ay.t("Cancel")
- }}
-
-
- {{
+ {{
$ay.t("OK")
}}
@@ -306,8 +272,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
- genPMDlg: false,
- genQuoteDlg: false,
+ duplicateDlg: false,
+ duplicateDlgTitle: null,
+ duplicateTo: null, //"pm","wo" or "quote"
genCopyWiki: false,
genCopyAttachments: false
};
@@ -669,13 +636,47 @@ export default {
window.$gz.errorHandler.handleFormError(error, vm);
}
},
+ // duplicate() {
+ // //Navigate to new record
+ // this.$router.push({
+ // name: "workorder-edit",
+ // params: {
+ // recordid: 0,
+ // obj: this.obj
+ // }
+ // });
+ // },
+ duplicateHandler() {
+ switch (this.duplicateTo) {
+ case "pm":
+ this.generatePM();
+ break;
+ case "wo":
+ this.duplicate();
+ 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.WorkOrder,
+ 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: "workorder-edit",
params: {
recordid: 0,
- obj: this.obj
+ obj: cp
}
});
},
@@ -692,6 +693,7 @@ export default {
cp.wiki = null; //already copied, need to remove it instead
}
cp.states = [];
+ cp.lastStatusId = undefined;
cp.items.forEach(x => {
x.partRequests = [];
});
@@ -1858,14 +1860,20 @@ async function clickHandler(menuItem) {
params: { recordid: 0 }
});
break;
- case "genpm":
- m.vm.genPMDlg = true;
+ case "duplicate":
+ m.vm.duplicateDlgTitle = m.vm.$ay.t("DuplicateToWorkOrder");
+ m.vm.duplicateTo = "wo";
+ m.vm.duplicateDlg = true;
break;
case "genquote":
- m.vm.genQuoteDlg = true;
+ m.vm.duplicateDlgTitle = m.vm.$ay.t("DuplicateToQuote");
+ m.vm.duplicateTo = "quote";
+ m.vm.duplicateDlg = true;
break;
- case "duplicate":
- m.vm.duplicate();
+ case "genpm":
+ m.vm.duplicateDlgTitle = m.vm.$ay.t("DuplicateToPM");
+ m.vm.duplicateTo = "pm";
+ m.vm.duplicateDlg = true;
break;
case "report":
if (m.id != null) {