This commit is contained in:
2021-07-27 18:22:25 +00:00
parent e31787d05c
commit b1d8648add
2 changed files with 44 additions and 51 deletions

View File

@@ -391,54 +391,6 @@
></v-checkbox>
</v-col>
<v-col
v-if="
form().showMe(this, 'CopyWiki') &&
!(
value.userIsSubContractorFull ||
value.userIsSubContractorRestricted
)
"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-checkbox
v-model="value.copyWiki"
:readonly="formState.readOnly || value.userIsTechRestricted"
:label="$ay.t('CopyWiki')"
ref="copyWiki"
data-cy="copyWiki"
:error-messages="form().serverErrors(this, 'copyWiki')"
@change="fieldValueChanged('copyWiki')"
></v-checkbox>
</v-col>
<v-col
v-if="
form().showMe(this, 'CopyAttachments') &&
!(
value.userIsSubContractorFull ||
value.userIsSubContractorRestricted
)
"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-checkbox
v-model="value.copyAttachments"
:readonly="formState.readOnly || value.userIsTechRestricted"
:label="$ay.t('CopyAttachments')"
ref="copyAttachments"
data-cy="copyAttachments"
:error-messages="form().serverErrors(this, 'copyAttachments')"
@change="fieldValueChanged('copyAttachments')"
></v-checkbox>
</v-col>
<v-col
v-if="
form().showMe(this, 'Tags') &&

View File

@@ -35,8 +35,40 @@
:size="60"
></v-progress-circular>
</template>
<!-- ################################################################################-->
<!-- ########################## GENERATE WO DIALOG ###############################-->
<!-- ################################################################################-->
<template>
<v-row justify="center">
<v-dialog persistent max-width="600px" v-model="genDlg">
<v-card>
<v-card-title>{{ $ay.t("GenerateWorkOrder") }}</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="genDlg = 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>
</div>
<!-- :reset-selections="resetSelections" -->
</template>
<script>
@@ -242,7 +274,10 @@ 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
genDlg: false,
genCopyWiki: false,
genCopyAttachments: false
};
},
//WATCHERS
@@ -611,6 +646,12 @@ export default {
},
generateWorkOrder() {
let cp = JSON.parse(JSON.stringify(this.obj));
if (this.genCopyAttachments) {
cp.genCopyAttachments = true; //flag for later on success as need a object created to attach to
}
if (!this.genCopyWiki) {
cp.wiki = null; //already copied, need to remove it instead
}
cp.states = [];
cp.items.forEach(x => {
x.partRequests = [];
@@ -2241,7 +2282,7 @@ async function clickHandler(menuItem) {
});
break;
case "genwo":
m.vm.generateWorkOrder();
m.vm.genDlg = true;
break;
case "duplicate":
m.vm.duplicate();