This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
<v-progress-circular indeterminate :size="64" />
|
||||
</v-overlay>
|
||||
<!-- ################################################################################-->
|
||||
<!-- ########################## GENERATE WO DIALOG ###############################-->
|
||||
<!-- ########################## DUPLICATE DIALOG ###############################-->
|
||||
<!-- ################################################################################-->
|
||||
<template>
|
||||
<v-row justify="center">
|
||||
<v-dialog persistent max-width="600px" v-model="genWODlg">
|
||||
<v-dialog persistent max-width="600px" v-model="duplicateDlg">
|
||||
<v-card>
|
||||
<v-card-title>{{ $ay.t("DuplicateToWorkOrder") }}</v-card-title>
|
||||
<v-card-title>{{ duplicateDlgTitle }}</v-card-title>
|
||||
<v-card-text>
|
||||
<v-checkbox
|
||||
v-model="genCopyWiki"
|
||||
@@ -51,45 +51,12 @@
|
||||
></v-checkbox>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn text @click="genWODlg = false" color="primary">{{
|
||||
<v-btn text @click="duplicateDlg = false" color="primary">{{
|
||||
$ay.t("Cancel")
|
||||
}}</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn color="primary" text @click="generateWorkOrder()">{{
|
||||
$ay.t("OK")
|
||||
}}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-row>
|
||||
</template>
|
||||
<!-- ################################################################################-->
|
||||
<!-- ########################## GENERATE PM DIALOG ###############################-->
|
||||
<!-- ################################################################################-->
|
||||
<template>
|
||||
<v-row justify="center">
|
||||
<v-dialog persistent max-width="600px" v-model="genPMDlg">
|
||||
<v-card>
|
||||
<v-card-title>{{ $ay.t("DuplicateToPM") }}</v-card-title>
|
||||
<v-card-text>
|
||||
<v-checkbox
|
||||
v-model="genCopyWiki"
|
||||
:label="$ay.t('CopyWiki')"
|
||||
></v-checkbox>
|
||||
|
||||
<v-checkbox
|
||||
v-model="genCopyAttachments"
|
||||
:label="$ay.t('CopyAttachments')"
|
||||
></v-checkbox>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn text @click="genPMDlg = false" color="primary">{{
|
||||
$ay.t("Cancel")
|
||||
}}</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn color="primary" text @click="generatePM()">{{
|
||||
<v-btn color="primary" text @click="duplicateHandler()">{{
|
||||
$ay.t("OK")
|
||||
}}</v-btn>
|
||||
</v-card-actions>
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user