reload Vertragsstatus if change of mitarbeiter

This commit is contained in:
ma0068
2025-07-02 11:54:32 +02:00
parent 56e8a34d68
commit 411b97fa14
5 changed files with 26 additions and 7 deletions
@@ -75,8 +75,20 @@ class Vertraege extends FHCAPI_Controller
$this->terminateWithSuccess((getData($result) ?: []));
}
public function getStatiOfContract($vertrag_id)
public function getStatiOfContract($person_id, $vertrag_id)
{
//check if vertrag_id corresponds with person_id and return null if not
$result = $this->VertragModel->loadWhere(
array(
'vertrag_id' => $vertrag_id,
'person_id' => $person_id
)
);
if(!hasData($result))
{
$this->terminateWithSuccess([]);
}
$result = $this->VertragModel->getStatiOfContract($vertrag_id);
if (isError($result)) {
+2 -2
View File
@@ -40,10 +40,10 @@ export default {
url: 'api/frontend/v1/vertraege/Vertraege/getAllContractTypes/'
};
},
getStatiOfContract(vertrag_id){
getStatiOfContract(person_id, vertrag_id){
return {
method: 'get',
url: 'api/frontend/v1/vertraege/Vertraege/getStatiOfContract/' + vertrag_id
url: 'api/frontend/v1/vertraege/Vertraege/getStatiOfContract/' + person_id + '/' + vertrag_id
};
},
configPrintDocument() {
@@ -198,7 +198,7 @@ export default {
<!-- <div class="core-contracts-details vv">-->
<br>
<h5>{{$p.t('vertrag', 'vertragDetails')}}</h5>
<core-filter-cmpt
ref="table"
:tabulator-options="tabulatorOptions"
@@ -18,6 +18,10 @@ export default {
},
},
props: {
person_id: {
type: [Number],
required: true
},
vertrag_id: {
type: [Number],
required: true
@@ -40,7 +44,7 @@ export default {
tabulatorOptions: {
ajaxURL: 'dummy',
ajaxRequestFunc: () => this.$api.call(
this.endpoint.getStatiOfContract(this.vertrag_id)
this.endpoint.getStatiOfContract(this.person_id, this.vertrag_id)
),
ajaxResponse: (url, params, response) => response.data,
columns: [
@@ -199,9 +203,11 @@ export default {
}
},
watch: {
person_id() {
this.$refs.table.tabulator.setData('api/frontend/v1/vertraege/vertraege/getStatiOfContract/' + this.person_id + '/' + this.vertrag_id);
},
vertrag_id() {
//this.reloadTable();
this.$refs.table.tabulator.setData('api/frontend/v1/vertraege/vertraege/getStatiOfContract/' + this.vertrag_id);
this.$refs.table.tabulator.setData('api/frontend/v1/vertraege/vertraege/getStatiOfContract/' + this.person_id + '/' + this.vertrag_id);
},
formDataParent: {
handler(newVal, oldVal) {
@@ -601,6 +601,7 @@ export default {
<!-- ContractStati -->
<div class="md-4" v-if="contractSelected.vertrag_id !=null">
<contract-stati
:person_id="person_id"
:vertrag_id="contractSelected.vertrag_id"
:listContractStati="listContractStati"
:formDataParent="contractFormData"