This commit is contained in:
@@ -35,6 +35,72 @@
|
||||
:size="60"
|
||||
></v-progress-circular>
|
||||
</template>
|
||||
<!-- ################################################################################-->
|
||||
<!-- ########################## GENERATE QUOTE DIALOG ###############################-->
|
||||
<!-- ################################################################################-->
|
||||
<template>
|
||||
<v-row justify="center">
|
||||
<v-dialog persistent max-width="600px" v-model="genQuoteDlg">
|
||||
<v-card>
|
||||
<v-card-title>{{ $ay.t("GenerateQuote") }}</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="genQuoteDlg = false" color="primary">{{
|
||||
$ay.t("Cancel")
|
||||
}}</v-btn>
|
||||
<v-spacer></v-spacer>
|
||||
|
||||
<v-btn color="primary" text @click="generateQuote()">{{
|
||||
$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("GeneratePM") }}</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()">{{
|
||||
$ay.t("OK")
|
||||
}}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</v-row>
|
||||
</template>
|
||||
</div>
|
||||
<!-- :reset-selections="resetSelections" -->
|
||||
</template>
|
||||
@@ -243,7 +309,11 @@ 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
|
||||
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,
|
||||
genCopyWiki: false,
|
||||
genCopyAttachments: false
|
||||
};
|
||||
},
|
||||
//WATCHERS
|
||||
@@ -613,6 +683,60 @@ 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;
|
||||
|
||||
//Navigate to new record
|
||||
this.$router.push({
|
||||
name: "quote-edit",
|
||||
params: {
|
||||
recordid: 0,
|
||||
obj: cp
|
||||
}
|
||||
});
|
||||
},
|
||||
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
|
||||
@@ -1719,6 +1843,12 @@ async function clickHandler(menuItem) {
|
||||
params: { recordid: 0 }
|
||||
});
|
||||
break;
|
||||
case "genpm":
|
||||
m.vm.genPMDlg = true;
|
||||
break;
|
||||
case "genquote":
|
||||
m.vm.genQuoteDlg = true;
|
||||
break;
|
||||
case "duplicate":
|
||||
m.vm.duplicate();
|
||||
break;
|
||||
@@ -1868,6 +1998,32 @@ function generateMenu(vm) {
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
vm.rights.change &&
|
||||
vm.$route.params.recordid != 0 &&
|
||||
!vm.obj.userIsRestrictedType
|
||||
) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "GenerateQuote",
|
||||
icon: "$ayiPencilAlt",
|
||||
key: FORM_KEY + ":genquote",
|
||||
vm: vm
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
vm.rights.change &&
|
||||
vm.$route.params.recordid != 0 &&
|
||||
!vm.obj.userIsRestrictedType
|
||||
) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "GeneratePM",
|
||||
icon: "$ayiBusinessTime",
|
||||
key: FORM_KEY + ":genpm",
|
||||
vm: vm
|
||||
});
|
||||
}
|
||||
|
||||
if (
|
||||
vm.rights.change &&
|
||||
vm.$route.params.recordid != 0 &&
|
||||
@@ -2194,7 +2350,9 @@ async function fetchTranslatedText(vm) {
|
||||
"ApplyUnitContract",
|
||||
"WorkOrderFromQuoteID",
|
||||
"WorkOrderFromPMID",
|
||||
"CustomerServiceRequest"
|
||||
"CustomerServiceRequest",
|
||||
"GenerateQuote",
|
||||
"GeneratePM"
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user