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

@@ -166,7 +166,7 @@
><v-btn icon @click="addContractPartOverrideItem()">
<v-icon color="primary">$ayiPlus</v-icon>
</v-btn>
<v-simple-table>
<v-simple-table dense>
<template v-slot:default>
<thead>
<tr>
@@ -224,7 +224,7 @@
><v-btn icon @click="addContractServiceRateOverrideItem()">
<v-icon color="primary">$ayiPlus</v-icon>
</v-btn>
<v-simple-table>
<v-simple-table dense>
<template v-slot:default>
<thead>
<tr>
@@ -282,7 +282,7 @@
><v-btn icon @click="addContractTravelRateOverrideItem()">
<v-icon color="primary">$ayiPlus</v-icon>
</v-btn>
<v-simple-table>
<v-simple-table dense>
<template v-slot:default>
<thead>
<tr>
@@ -337,8 +337,61 @@
<v-col cols="12" class="mt-5">
<span class="text-h5"> {{ $ay.t("ContractRateList") }}</span>
</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 />
travel rate table here
travel rate table here -->
<v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox
v-model="obj.active"
@@ -1247,6 +1300,21 @@ export default {
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() {
return this.formState.valid && this.formState.dirty;
},
@@ -1627,6 +1695,8 @@ async function fetchTranslatedText(vm) {
"PartList",
"ServiceRateList",
"TravelRateList",
"ServiceRate",
"TravelRate",
"ContractRateList",
"ContractCustom1",
"ContractCustom2",