This commit is contained in:
2021-03-07 19:06:20 +00:00
parent 9ece179c76
commit d4f376ad0c
2 changed files with 80 additions and 5 deletions

View File

@@ -191,9 +191,14 @@ todo: Changes to allow in place updates of server:
CURRENTLY DOING: Contract form CURRENTLY DOING: Contract form - rates list and restrict to rates checkbox etc
dupe the tagged part adjustments for service and travel then on to the limited rates, also need restrict to rates checkbox, then help docs and then done dupe the tagged part adjustments for service and travel then on to the limited rates, also need restrict to rates checkbox, then help docs and then done
todo: service rates contract list
sb display viz
add via form even though only one item, more efficient
edit / remove via form
todo: might want to put more fields in the contractdatalist, it's very sparse adn the old v7 had pretty much all the fields as well todo: might want to put more fields in the contractdatalist, it's very sparse adn the old v7 had pretty much all the fields as well

View File

@@ -166,7 +166,7 @@
><v-btn icon @click="addContractPartOverrideItem()"> ><v-btn icon @click="addContractPartOverrideItem()">
<v-icon color="primary">$ayiPlus</v-icon> <v-icon color="primary">$ayiPlus</v-icon>
</v-btn> </v-btn>
<v-simple-table> <v-simple-table dense>
<template v-slot:default> <template v-slot:default>
<thead> <thead>
<tr> <tr>
@@ -224,7 +224,7 @@
><v-btn icon @click="addContractServiceRateOverrideItem()"> ><v-btn icon @click="addContractServiceRateOverrideItem()">
<v-icon color="primary">$ayiPlus</v-icon> <v-icon color="primary">$ayiPlus</v-icon>
</v-btn> </v-btn>
<v-simple-table> <v-simple-table dense>
<template v-slot:default> <template v-slot:default>
<thead> <thead>
<tr> <tr>
@@ -282,7 +282,7 @@
><v-btn icon @click="addContractTravelRateOverrideItem()"> ><v-btn icon @click="addContractTravelRateOverrideItem()">
<v-icon color="primary">$ayiPlus</v-icon> <v-icon color="primary">$ayiPlus</v-icon>
</v-btn> </v-btn>
<v-simple-table> <v-simple-table dense>
<template v-slot:default> <template v-slot:default>
<thead> <thead>
<tr> <tr>
@@ -337,8 +337,61 @@
<v-col cols="12" class="mt-5"> <v-col cols="12" class="mt-5">
<span class="text-h5"> {{ $ay.t("ContractRateList") }}</span> <span class="text-h5"> {{ $ay.t("ContractRateList") }}</span>
</v-col> </v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<span class="text-h6"> {{ $ay.t("ServiceRateList") }}</span
><v-btn icon @click="addServiceRateItem()">
<v-icon color="primary">$ayiPlus</v-icon>
</v-btn>
<v-simple-table dense>
<template v-slot:default>
<thead>
<tr>
<th class="text-left">
{{ $ay.t("ServiceRate") }}
</th>
<th class="text-right">
<!-- CONTROL PANEL -->
</th>
</tr>
</thead>
<tbody>
<tr
v-for="(item, index) in obj.serviceRateItems"
:key="item.Id"
>
<td class="text-right">
<gz-pick-list
:allow-no-selection="false"
:can-clear="false"
:aya-type="ayaTypes().ServiceRate"
:show-edit-icon="false"
v-model="item.serviceRateId"
></gz-pick-list>
</td>
<td class="text-right">
<v-btn
@click="removeServiceRateItem(index)"
icon
class="ml-4"
>
<v-icon>
$ayiTrashAlt
</v-icon>
</v-btn>
</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-col>
<!--
service rate table here<br /> service rate table here<br />
travel rate table here travel rate table here -->
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox <v-checkbox
v-model="obj.active" v-model="obj.active"
@@ -1247,6 +1300,21 @@ export default {
this.formState.dirty = true; this.formState.dirty = true;
}, },
addServiceRateItem: function() {
this.obj.serviceRateItems.push({
id: 0,
contractId: this.obj.id,
serviceRateId: null
});
this.formState.dirty = true;
},
removeServiceRateItem: function(index) {
this.obj.serviceRateItems.splice(index, 1);
this.formState.dirty = true;
},
canSave: function() { canSave: function() {
return this.formState.valid && this.formState.dirty; return this.formState.valid && this.formState.dirty;
}, },
@@ -1627,6 +1695,8 @@ async function fetchTranslatedText(vm) {
"PartList", "PartList",
"ServiceRateList", "ServiceRateList",
"TravelRateList", "TravelRateList",
"ServiceRate",
"TravelRate",
"ContractRateList", "ContractRateList",
"ContractCustom1", "ContractCustom1",
"ContractCustom2", "ContractCustom2",