-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
`
};
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Konto.js b/public/js/components/Stv/Studentenverwaltung/Details/Konto.js
index 99bb85c87..b6b71f50b 100644
--- a/public/js/components/Stv/Studentenverwaltung/Details/Konto.js
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Konto.js
@@ -1,12 +1,15 @@
import {CoreFilterCmpt} from "../../../filter/Filter.js";
+import FormInput from "../../../Form/Input.js";
+import KontoEdit from "./Konto/Edit.js";
-// TODO(chris): filter
// TODO(chris): multi pers
// TODO(chris): new header(multi pers), edit/row, gegenb.(date) multi, löschen multi, best. multi(recht)
export default {
components: {
- CoreFilterCmpt
+ CoreFilterCmpt,
+ FormInput,
+ KontoEdit
},
props: {
modelValue: Object,
@@ -17,7 +20,8 @@ export default {
},
data() {
return {
- filter: 'alle'
+ filter: false,
+ studiengang_kz: false
};
},
computed: {
@@ -29,13 +33,133 @@ export default {
return '';
return values[0];
},
+ studiengang_kz_intern: {
+ get() {
+ if (this.stg_kz)
+ return this.studiengang_kz;
+ else
+ return false;
+ },
+ set(value) {
+ this.studiengang_kz = value;
+ }
+ },
+ tabulatorColumns() {
+ let columns = [];
+
+ if (Array.isArray(this.modelValue)) {
+ columns.push({
+ field: "person_id",
+ title: "Person ID"
+ });
+ columns.push({
+ field: "anrede",
+ title: "Anrede",
+ visible: false
+ });
+ columns.push({
+ field: "titelpost",
+ title: "Titelpost",
+ visible: false
+ });
+ columns.push({
+ field: "titelpre",
+ title: "Titelpre",
+ visible: false
+ });
+ columns.push({
+ field: "vorname",
+ title: "Vorname"
+ });
+ columns.push({
+ field: "vornamen",
+ title: "Vornamen",
+ visible: false
+ });
+ columns.push({
+ field: "nachname",
+ title: "Nachname"
+ });
+ }
+
+ columns = [...columns, ...[
+ {
+ field: "buchungsdatum",
+ title: "Buchungsdatum"
+ },
+ {
+ field: "buchungstext",
+ title: "Buchungstext"
+ },
+ {
+ field: "betrag",
+ title: "Betrag"
+ },
+ {
+ field: "studiensemester_kurzbz",
+ title: "StSem"
+ },
+ {
+ field: "buchungstyp_kurzbz",
+ title: "Typ",
+ visible: false
+ },
+ {
+ field: "buchungsnr",
+ title: "Buchungs Nr",
+ visible: false
+ },
+ {
+ field: "insertvon",
+ title: "Angelegt von",
+ visible: false
+ },
+ {
+ field: "insertamum",
+ title: "Anlagedatum",
+ visible: false
+ },
+ {
+ field: "kuerzel",
+ title: "Studiengang",
+ visible: false
+ },
+ {
+ field: "anmerkung",
+ title: "Anmerkung"
+ }
+ ]];
+
+ columns = [...columns, ...this.config.additionalCols];
+
+ columns.push({
+ title: 'Actions',
+ formatter: cell => {
+ let container = document.createElement('div');
+ container.className = "d-flex gap-2";
+
+ let button = document.createElement('button');
+ button.className = 'btn btn-outline-secondary';
+ button.innerHTML = '
';
+ button.addEventListener('click', () =>
+ this.$refs.edit.open(cell.getData())
+ );
+ container.append(button);
+
+ return container;
+ },
+ frozen: true
+ });
+ return columns;
+ },
tabulatorOptions() {
return {
- ajaxURL: 'api/frontend/v1/stv/konto/get/alle',
+ ajaxURL: 'api/frontend/v1/stv/konto/get',
ajaxParams: () => {
const params = {
person_id: this.modelValue.person_id || this.modelValue.map(e => e.person_id),
- only_open: (this.filter == 'offene')
+ only_open: this.filter,
+ studiengang_kz: this.studiengang_kz_intern ? this.stg_kz : ''
};
return params;
},
@@ -44,54 +168,8 @@ export default {
},
ajaxResponse: (url, params, response) => response.data,
dataTree: true,
- columns: [
- {
- field: "buchungsdatum",
- title: "Buchungsdatum"
- },
- {
- field: "buchungstext",
- title: "Buchungstext"
- },
- {
- field: "betrag",
- title: "Betrag"
- },
- {
- field: "studiensemester_kurzbz",
- title: "StSem"
- },
- {
- field: "buchungstyp_kurzbz",
- title: "Typ",
- visible: false
- },
- {
- field: "buchungsnr",
- title: "buchungs_nr",
- visible: false
- },
- {
- field: "insertvon",
- title: "Angelegt von",
- visible: false
- },
- {
- field: "insertamum",
- title: "Anlagedatum",
- visible: false
- },
- {
- field: "kuerzel",
- title: "Studiengang",
- visible: false
- },
- {
- field: "anmerkung",
- title: "Anmerkung"
- }
- ],
- index: 'buchungs_nr',
+ columns: this.tabulatorColumns,
+ index: 'buchungsnr',
};
}
},
@@ -103,23 +181,39 @@ export default {
methods: {
reload() {
this.$refs.table.reloadTable();
+ },
+ updateData(data) {
+ if (!data)
+ return this.reload();
+ this.$refs.table.tabulator.updateData(data);
}
},
+ created() {
+ // TODO(chris): persist filter + studiengang_kz
+ },
template: `
- {{config}}
-
-
-
+
+
+ $nextTick($refs.table.reloadTable)"
+ >
+
-
-
+
+ $nextTick($refs.table.reloadTable)"
+ >
+
+
`
};
\ No newline at end of file
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Konto/Edit.js b/public/js/components/Stv/Studentenverwaltung/Details/Konto/Edit.js
new file mode 100644
index 000000000..9e65df428
--- /dev/null
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Konto/Edit.js
@@ -0,0 +1,163 @@
+import BsModal from "../../../../Bootstrap/Modal.js";
+import CoreForm from "../../../../Form/Form.js";
+import FormValidation from "../../../../Form/Validation.js";
+import FormInput from "../../../../Form/Input.js";
+
+// TODO(chris): Phrasen
+
+export default {
+ components: {
+ BsModal,
+ CoreForm,
+ FormValidation,
+ FormInput
+ },
+ inject: {
+ lists: {
+ from: 'lists'
+ }
+ },
+ props: {
+ config: {
+ type: Object,
+ default: {}
+ }
+ },
+ data() {
+ return {
+ loading: false,
+ data: {}
+ };
+ },
+ methods: {
+ save() {
+ this.$refs.form.clearValidation();
+ this.loading = true;
+
+ this.$refs.form
+ .post('api/frontend/v1/stv/konto/update', this.data)
+ .then(result => {
+ this.$emit('saved', result.data);
+ this.loading = false;
+ this.$refs.modal.hide();
+ this.$fhcAlert.alertSuccess('Daten wurden gespeichert');
+ })
+ .catch(error => {console.log(error); // TODO(chris): check if working with current fhcApi
+ this.$fhcAlert.handleSystemError(error);
+ this.loading = false;
+ });
+ },
+ open(data) {
+ this.data = {...data};
+ this.$refs.modal.show();
+ },
+ preventCloseOnLoading(ev) {
+ if (this.loading)
+ ev.returnValue = false;
+ }
+ },
+ template: `
+
+
+
+
+
+
+
+ Edit Buchung #{{data.buchungsnr}}
+
+
+
+
+
+ `
+};
\ No newline at end of file
diff --git a/public/js/components/Stv/Studentenverwaltung/List/New.js b/public/js/components/Stv/Studentenverwaltung/List/New.js
index acc9781de..f23245b7c 100644
--- a/public/js/components/Stv/Studentenverwaltung/List/New.js
+++ b/public/js/components/Stv/Studentenverwaltung/List/New.js
@@ -600,7 +600,7 @@ export default {
name="studiengang_kz"
v-model="formDataStg"
>
-
+