mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-24 23:49:28 +00:00
update reload functions, adapt delete contract, add watcher in unassignedList
This commit is contained in:
@@ -306,7 +306,66 @@ class Vertraege extends FHCAPI_Controller
|
||||
|
||||
public function deleteContract($vertrag_id)
|
||||
{
|
||||
//TODO(Manu) validations,
|
||||
//TODO(Manu) validations
|
||||
|
||||
//TODO(manu) use private function
|
||||
$this->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
|
||||
|
||||
//check if attached Lehrauftrag
|
||||
$resultLehrauftrag = $this->LehreinheitmitarbeiterModel->load([
|
||||
'vertrag_id' => $vertrag_id
|
||||
]);
|
||||
|
||||
if(hasData($resultLehrauftrag))
|
||||
{
|
||||
$resultLehrauftrag = getData($resultLehrauftrag);
|
||||
foreach($resultLehrauftrag as $lehrauftrag)
|
||||
{
|
||||
$result = $this->LehreinheitmitarbeiterModel->update(
|
||||
[
|
||||
'lehreinheit_id' => $lehrauftrag->lehreinheit_id,
|
||||
'mitarbeiter_uid' => $lehrauftrag->mitarbeiter_uid,
|
||||
'vertrag_id' => $vertrag_id
|
||||
],
|
||||
[
|
||||
'vertrag_id' => null
|
||||
]);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//if attached Betreuung
|
||||
$this->load->model('education/Projektbetreuer_model', 'Projektbetreuermodel');
|
||||
|
||||
//if attached Betreuung
|
||||
$resultBetreuung = $this->Projektbetreuermodel->load([
|
||||
'vertrag_id' => $vertrag_id
|
||||
]);
|
||||
|
||||
if(hasData($resultBetreuung))
|
||||
{
|
||||
$resultBetreuung = getData($resultBetreuung);
|
||||
foreach($resultBetreuung as $betreuung)
|
||||
{
|
||||
$result = $this->Projektbetreuermodel->update(
|
||||
[
|
||||
'person_id' => $betreuung->person_id,
|
||||
'projektarbeit_id' => $betreuung->projektarbeit_id,
|
||||
'betreuerart_kurzbz' => $betreuung->betreuerart_kurzbz,
|
||||
'vertrag_id' => $vertrag_id
|
||||
],
|
||||
[
|
||||
'vertrag_id' => null
|
||||
]);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$result = $this->VertragvertragsstatusModel->load([
|
||||
'vertrag_id' => $vertrag_id
|
||||
]);
|
||||
|
||||
@@ -318,10 +318,7 @@ export default{
|
||||
@saved="reload"
|
||||
>
|
||||
</status-modal>
|
||||
TEST1: Anzahl Students:
|
||||
{{modelValue.length}}
|
||||
|
||||
|
||||
|
||||
<core-filter-cmpt
|
||||
v-if="!this.modelValue.length"
|
||||
ref="table"
|
||||
@@ -333,10 +330,7 @@ export default{
|
||||
new-btn-show
|
||||
new-btn-label="Status"
|
||||
@click:new="actionNewStatus"
|
||||
>
|
||||
|
||||
TEST 2
|
||||
|
||||
>
|
||||
<template #actions="{updateData2}">
|
||||
<!-- SingleSelectButton-->
|
||||
<status-dropdown
|
||||
|
||||
@@ -148,17 +148,18 @@ export default {
|
||||
template: `
|
||||
<!--TODO(Manu) nicht anzeigen, wenn keine vorhanden ? check css, design -->
|
||||
|
||||
<div class="core-vertraege h-50 d-flex flex-column w-100">
|
||||
<div class="core-vertraege-details h-50 d-flex flex-column w-100">
|
||||
<br>
|
||||
|
||||
<div>
|
||||
<!-- Tabulator-Container -->
|
||||
<!-- <div>
|
||||
<!– Tabulator-Container –>
|
||||
<div ref="table"></div>
|
||||
|
||||
<!-- Ausgabe der Daten -->
|
||||
<!– Ausgabe der Daten –>
|
||||
<div v-for="row in tableData" :key="row.id">
|
||||
<p>{{ row.name }} - {{ row.value }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<h4>Vertragdetails</h4>
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ export default {
|
||||
},
|
||||
template: `
|
||||
<!--TODO(Manu) check filter (akzeptiert, neu, erteilt?), design -->
|
||||
<div class="core-vertraege h-50 d-flex flex-column w-100">
|
||||
<div class="core-vertraege-status h-50 d-flex flex-column w-100">
|
||||
<br>
|
||||
<h4>Vertragsstatus</h4>
|
||||
|
||||
|
||||
@@ -93,6 +93,10 @@ export default {
|
||||
console.log("data changed");
|
||||
this.$refs.table.tabulator.setData('api/frontend/v1/vertraege/vertraege/getAllContractsNotAssigned/' + this.person_id);
|
||||
},
|
||||
clickedRows() {
|
||||
console.log("clicked rows changed");
|
||||
this.$refs.table.tabulator.setData('api/frontend/v1/vertraege/vertraege/getAllContractsNotAssigned/' + this.person_id);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
toggleRowClick(rowData){
|
||||
@@ -131,10 +135,11 @@ export default {
|
||||
// Emit ein Event und übergebe clickedRows an die Parent-Komponente
|
||||
this.$emit('saveClickedRows', this.clickedRows);
|
||||
},
|
||||
reload() {
|
||||
reloadUnassigned() {
|
||||
this.$refs.table.reloadTable();
|
||||
this.$emit('reload');
|
||||
this.clickedRows = {};
|
||||
this.$emit('reloadUnassigned');
|
||||
this.clickedRows = [];
|
||||
// console.log("clickedRows", this.clickedRows);
|
||||
},
|
||||
handleSumUp() {
|
||||
//this.localValue += 1; // Increment the local value
|
||||
|
||||
@@ -147,10 +147,12 @@ export default {
|
||||
methods: {
|
||||
actionNewContract() {
|
||||
this.resetModal();
|
||||
this.$refs.unassignedLehrauftraege.reloadUnassigned();
|
||||
this.$refs.contractModal.show();
|
||||
},
|
||||
actionEditContract(vertrag_id) {
|
||||
this.statusNew = false;
|
||||
this.$refs.unassignedLehrauftraege.reloadUnassigned();
|
||||
this.loadContract(vertrag_id)
|
||||
.then(this.$refs.contractModal.show);
|
||||
},
|
||||
@@ -184,7 +186,7 @@ export default {
|
||||
this.$refs.contractModal.hide();
|
||||
this.resetModal();
|
||||
//this.$refs.contractdetails.reload(); //TOOD(Manu) check why error
|
||||
this.$refs.unassignedLehrauftraege.reload();
|
||||
this.$refs.unassignedLehrauftraege.reloadUnassigned();
|
||||
this.reload();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
@@ -205,7 +207,7 @@ export default {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.$refs.contractModal.hide();
|
||||
this.resetModal();
|
||||
this.$refs.unassignedLehrauftraege.reload();
|
||||
this.$refs.unassignedLehrauftraege.reloadUnassigned();
|
||||
this.reload();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
@@ -272,7 +274,7 @@ export default {
|
||||
//window.scrollTo(0, 0);
|
||||
this.resetModal();
|
||||
this.$refs.contractdetails.reload();
|
||||
this.$refs.unassignedLehrauftraege.reload();
|
||||
this.$refs.unassignedLehrauftraege.reloadUnassigned();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
@@ -290,7 +292,7 @@ export default {
|
||||
|
||||
//window.scrollTo(0, 0);
|
||||
this.$refs.contractdetails.reload();
|
||||
this.$refs.unassignedLehrauftraege.reload();
|
||||
this.$refs.unassignedLehrauftraege.reloadUnassigned();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
@@ -441,7 +443,7 @@ export default {
|
||||
|
||||
<core-form class="row g-3" ref="unassignedData">
|
||||
|
||||
{{formData}}
|
||||
<!-- {{formData}}-->
|
||||
|
||||
<!--TODO(Manu) wenn einer gelöscht wird, wird er auch nicht sofort angezeigt
|
||||
Auswirkung von Vertragdetails of UnassignedList-->
|
||||
|
||||
Reference in New Issue
Block a user