mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
reset Modals
This commit is contained in:
@@ -84,6 +84,13 @@ export default{
|
||||
typ: 'h',
|
||||
nation: 'A'
|
||||
},
|
||||
initData: {
|
||||
zustelladresse: true,
|
||||
heimatadresse: true,
|
||||
rechnungsadresse: false,
|
||||
typ: 'h',
|
||||
nation: 'A'
|
||||
},
|
||||
nations: [],
|
||||
adressentypen: [],
|
||||
firmen: [],
|
||||
@@ -121,6 +128,7 @@ export default{
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('newAdressModal');
|
||||
this.resetModal();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
@@ -168,6 +176,7 @@ export default{
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('editAdressModal');
|
||||
this.resetModal();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
@@ -258,6 +267,11 @@ export default{
|
||||
hideModal(modalRef){
|
||||
bootstrap.Modal.getOrCreateInstance(this.$refs[modalRef]).hide();
|
||||
},
|
||||
resetModal(){
|
||||
this.formData = {};
|
||||
this.formData = this.initData;
|
||||
this.addressData = {};
|
||||
},
|
||||
},
|
||||
created(){
|
||||
CoreRESTClient
|
||||
|
||||
@@ -73,7 +73,12 @@ export default{
|
||||
tabulatorEvents: [],
|
||||
lastSelected: null,
|
||||
bankverbindungData: {
|
||||
verrechnung: true
|
||||
verrechnung: true,
|
||||
typ: 'p'
|
||||
},
|
||||
initData: {
|
||||
verrechnung: true,
|
||||
typ: 'p'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -100,7 +105,7 @@ export default{
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('newBankverbindungModal');
|
||||
this.reload();
|
||||
this.resetModal();
|
||||
} else {
|
||||
//console.log(response.data.retval);
|
||||
const errorData = response.data.retval;
|
||||
@@ -120,6 +125,7 @@ export default{
|
||||
this.$fhcAlert.alertError('Fehler bei Speicherroutine aufgetreten');
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
loadBankverbindung(bankverbindung_id){
|
||||
@@ -148,7 +154,7 @@ export default{
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('editBankverbindungModal');
|
||||
this.reload();
|
||||
this.resetModal();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
console.log(errorData);
|
||||
@@ -163,6 +169,7 @@ export default{
|
||||
this.$fhcAlert.alertError('Fehler bei Speicherroutine aufgetreten');
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
deleteBankverbindung(bankverbindung_id){
|
||||
@@ -188,17 +195,15 @@ export default{
|
||||
reload(){
|
||||
this.$refs.table.reloadTable();
|
||||
},
|
||||
resetData(){ //Todo(manu) check
|
||||
bankverbindungData: [];
|
||||
}
|
||||
resetModal(){
|
||||
this.bankverbindungData = {};
|
||||
this.bankverbindungData = this.initData;
|
||||
},
|
||||
},
|
||||
template: `
|
||||
<div class="stv-list h-100 pt-3">
|
||||
|
||||
<!-- <button type="button" class="btn btn btn-outline-warning" class="col-sm-2" @click="actionDeleteBankverbindung(8796)">delete 8796</button>
|
||||
<button type="button" class="btn btn btn-outline-warning" class="col-sm-2" @click="actionEditBankverbindung(8796)">edit 8796</button>
|
||||
<button type="button" class="btn btn btn-outline-warning" class="col-sm-2" @click="reload">reload</button>-->
|
||||
|
||||
|
||||
<!--Modal: new Bankverbindung-->
|
||||
<div ref="newBankverbindungModal" class="modal fade" id="newBankverbindungModal" tabindex="-1" aria-labelledby="newBankverbindungModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
@@ -282,7 +287,7 @@ export default{
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="editBankverbindungModalLabel">Bankverbindung bearbeiten</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @click="resetModal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form ref="bankverbindungData">
|
||||
@@ -347,7 +352,7 @@ export default{
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="resetModal">Abbrechen</button>
|
||||
<button ref="Close" type="button" class="btn btn-primary" @click="updateBankverbindung(bankverbindungData.bankverbindung_id)">OK</button>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -67,6 +67,10 @@ export default{
|
||||
zustellung: true,
|
||||
kontakttyp: 'email'
|
||||
},
|
||||
initData: {
|
||||
zustellung: true,
|
||||
kontakttyp: 'email'
|
||||
},
|
||||
kontakttypen: [],
|
||||
standorte: [],
|
||||
selectedStandort: null,
|
||||
@@ -97,6 +101,7 @@ export default{
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal("newContactModal");
|
||||
this.resetModal();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
@@ -171,6 +176,7 @@ export default{
|
||||
console.log('Speichern erfolgreich: ' + this.statusMsg);
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('editContactModal');
|
||||
this.resetModal();
|
||||
this.reload();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
@@ -205,6 +211,10 @@ export default{
|
||||
this.filteredStandorte = CoreRESTClient.getData(result.data);
|
||||
});
|
||||
},
|
||||
resetModal(){
|
||||
this.contactData = {};
|
||||
this.contactData = this.initData;
|
||||
},
|
||||
},
|
||||
created(){
|
||||
CoreRESTClient
|
||||
@@ -228,8 +238,7 @@ export default{
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form ref="contactData">
|
||||
{{contactData}}
|
||||
<form ref="contactData">
|
||||
<div class="row mb-3">
|
||||
<label for="kontakttyp" class="form-label col-sm-4">Typ</label>
|
||||
<div class="col-sm-5">
|
||||
@@ -285,10 +294,10 @@ export default{
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="editContactModalLabel">Kontakt bearbeiten</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" @click="resetModal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form ref="contactData">{{contactData}}
|
||||
<form ref="contactData">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="kontakttyp" class="form-label col-sm-4">Typ</label>
|
||||
@@ -322,7 +331,7 @@ export default{
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<input type="text" :readonly="readonly" class="form-control-sm" id="standort_id" v-model="contactData.standort_id">
|
||||
<input type="hidden" :readonly="readonly" class="form-control-sm" id="standort_id" v-model="contactData.standort_id">
|
||||
</div>
|
||||
|
||||
<!-- <div class="row mb-3">
|
||||
@@ -345,7 +354,7 @@ export default{
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="resetModal">Abbrechen</button>
|
||||
<button ref="Close" type="button" class="btn btn-primary" @click="updateContact(contactData.kontakt_id)">OK</button>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user