This commit is contained in:
2021-05-17 22:55:16 +00:00
parent ac3fc49fc4
commit e5f1923c94
3 changed files with 30 additions and 13 deletions

View File

@@ -341,10 +341,7 @@ todo: many biz objects are not using new PUT methodology
CURRENTLY DOING: labors
todo: any change of contract should trigger a full refresh not just manually changing the contract
client requests new record when *it* detects a change of contract on the normal save of header (direct contract change route already handled, this is for customer change)
and in future Unit change may trigger this as well so make it re-usable
Once this is in place, perhaps don't need the whole contract control stuff anymore since it should just handle it...right?
todo: Once this is in place, perhaps don't need the whole contract control stuff anymore since it should just handle it...right?
todo: address setting - rather than setting it *at* the client automatically shouldn't it set at the server automatically?
this would remove some weight from the client and with a forcefullrefresh system in place that will help with this as well.

View File

@@ -95,7 +95,7 @@
></gz-date-time-picker>
</v-col>
<v-col
<!-- <v-col
v-if="form().showMe(this, 'Contract')"
cols="12"
sm="6"
@@ -110,6 +110,26 @@
:pvm="pvm"
data-cy="woContract"
/>
</v-col> -->
<v-col
v-if="form().showMe(this, 'Contract')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list
:aya-type="$ay.ayt().Contract"
:show-edit-icon="true"
v-model="value.contractId"
:readonly="formState.readOnly"
:label="$ay.t('Contract')"
ref="contractId"
data-cy="contractId"
:error-messages="form().serverErrors(this, 'contractId')"
@input="fieldValueChanged('contractId')"
></gz-pick-list>
</v-col>
<v-col
@@ -292,12 +312,12 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////
import GzWoState from "./work-order-state.vue";
import GzWoAddress from "./work-order-address.vue";
import GzWoContract from "./work-order-contract.vue";
//import GzWoContract from "./work-order-contract.vue";
export default {
components: {
GzWoState,
GzWoAddress,
GzWoContract
GzWoAddress
//, GzWoContract
},
data() {
return {

View File

@@ -260,7 +260,8 @@ export default {
saveResult: {
fatal: false, //fatal error, further save is pointless, bail early and report
errors: null //contains error objects from save
}
},
lastGetContractId: null
};
},
//WATCHERS
@@ -369,6 +370,7 @@ export default {
window.$gz.form.setErrorBoxErrors(vm);
} else {
vm.obj = res.data;
vm.lastGetContractId = vm.obj.contractId; //preserve for triggering full update if something changes it later
//assign opening UID's
vm.obj.items.forEach((z, index) => {
@@ -453,8 +455,6 @@ export default {
//some ops require a full refresh like ones that trigger contract changes
let forceFullRefresh = false;
let contractIdBeforeSave = vm.obj.contractId;
console.log("ContractIdBeforeSave=", contractIdBeforeSave);
//reset error object
this.saveResult.fatal = false;
@@ -525,8 +525,8 @@ export default {
});
} else {
//check if full refresh is necessary
console.log("ContractIdAfterSave=", vm.obj.contractId);
if (vm.obj.contractId != contractIdBeforeSave) {
if (vm.obj.contractId != vm.obj.lastGetContractId) {
//there may be others which is why I'm doing it this way with the extra variable
forceFullRefresh = true;
}