This commit is contained in:
2021-07-28 23:16:42 +00:00
parent 1ee05ce284
commit a6dc3bc35b
4 changed files with 199 additions and 55 deletions

View File

@@ -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:

View File

@@ -40,7 +40,7 @@
<!-- ################################################################################-->
<template>
<v-row justify="center">
<v-dialog persistent max-width="600px" v-model="genDlg">
<v-dialog persistent max-width="600px" v-model="genWODlg">
<v-card>
<v-card-title>{{ $ay.t("DuplicateToWorkOrder") }}</v-card-title>
<v-card-text>
@@ -55,7 +55,7 @@
></v-checkbox>
</v-card-text>
<v-card-actions>
<v-btn text @click="genDlg = false" color="primary">{{
<v-btn text @click="genWODlg = false" color="primary">{{
$ay.t("Cancel")
}}</v-btn>
<v-spacer></v-spacer>
@@ -68,6 +68,39 @@
</v-dialog>
</v-row>
</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("DuplicateToQuote") }}</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>
</div>
</template>
@@ -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",

View File

@@ -40,7 +40,7 @@
<!-- ################################################################################-->
<template>
<v-row justify="center">
<v-dialog persistent max-width="600px" v-model="genDlg">
<v-dialog persistent max-width="600px" v-model="genWODlg">
<v-card>
<v-card-title>{{ $ay.t("DuplicateToWorkOrder") }}</v-card-title>
<v-card-text>
@@ -55,7 +55,7 @@
></v-checkbox>
</v-card-text>
<v-card-actions>
<v-btn text @click="genDlg = false" color="primary">{{
<v-btn text @click="genWODlg = false" color="primary">{{
$ay.t("Cancel")
}}</v-btn>
<v-spacer></v-spacer>
@@ -68,6 +68,39 @@
</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()">{{
$ay.t("OK")
}}</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
</template>
</div>
</template>
@@ -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",

View File

@@ -102,7 +102,6 @@
</v-row>
</template>
</div>
<!-- :reset-selections="resetSelections" -->
</template>
<script>
@@ -701,6 +700,14 @@ export default {
});
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",
@@ -1998,6 +2005,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 &&
@@ -2024,19 +2044,6 @@ 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
});
}
//--- /show all ---
if (!vm.obj.userIsRestrictedType) {