mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge remote-tracking branch 'origin/feature-30660/FHC4_StudierendenGUI_Prototyp' into feature-30660/FHC4_StudierendenGUI_Prototyp
This commit is contained in:
@@ -23,7 +23,7 @@ class Kontakt extends FHC_Controller
|
||||
public function getAdressen($person_id)
|
||||
{
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
//TODO(manu) check name: in Adresse und firma
|
||||
|
||||
$this->AdresseModel->addSelect('public.tbl_adresse.*');
|
||||
$this->AdresseModel->addSelect('t.*');
|
||||
$this->AdresseModel->addSelect('f.firma_id');
|
||||
@@ -42,10 +42,11 @@ class Kontakt extends FHC_Controller
|
||||
}
|
||||
}
|
||||
|
||||
//old version
|
||||
public function addNewAddress($person_id)
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
||||
$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
$this->form_validation->set_rules('plz', 'PLZ', 'required|numeric');
|
||||
|
||||
@@ -94,7 +95,6 @@ class Kontakt extends FHC_Controller
|
||||
|
||||
]
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
@@ -103,6 +103,63 @@ class Kontakt extends FHC_Controller
|
||||
return $this->outputJsonSuccess(true);
|
||||
}
|
||||
|
||||
//Version mit input->post() TODO(Manu) check mit Chris, not working
|
||||
/* public function addNewAddress($person_id)
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
//$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$data = [
|
||||
'insertvon' => $uid,
|
||||
'insertamum' => date('c'),
|
||||
'plz' => $this->input->post('plz'),
|
||||
'heimatadresse' => $this->input->post('heimatadresse'),
|
||||
'zustelladresse' => $this->input->post('zustelladresse'),
|
||||
'rechnungsadresse' => $this->input->post('rechnungsadresse')
|
||||
];
|
||||
|
||||
|
||||
$this->form_validation->set_rules('plz', 'PLZ', 'required|numeric');
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
|
||||
if ($this->input->post('co_name'))
|
||||
$data['co_name'] = $this->input->post('co_name');
|
||||
if ($this->input->post('strasse'))
|
||||
$data['strasse'] = $this->input->post('strasse');
|
||||
if ($this->input->post('ort'))
|
||||
$data['ort'] = $this->input->post('ort');
|
||||
if ($this->input->post('gemeinde'))
|
||||
$data['gemeinde'] = $this->input->post('gemeinde');
|
||||
if ($this->input->post('nation'))
|
||||
$data['nation'] = $this->input->post('nation');
|
||||
if ($this->input->post('name'))
|
||||
$data['name'] = $this->input->post('name');
|
||||
if ($this->input->post('typ'))
|
||||
$data['typ'] = $this->input->post('typ');
|
||||
if ($this->input->post('anmerkung'))
|
||||
$data['anmerkung'] = $this->input->post('anmerkung');
|
||||
if ($this->input->post('firma'))
|
||||
$data['firma_id'] = $this->input->post('firma_id');
|
||||
|
||||
$result = $this->AdresseModel->insert($data);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
return $this->outputJsonSuccess(true);
|
||||
}*/
|
||||
|
||||
public function updateAddress($address_id)
|
||||
{
|
||||
$uid = getAuthUID();
|
||||
@@ -140,9 +197,10 @@ class Kontakt extends FHC_Controller
|
||||
$typ = isset($_POST['typ']) ? $_POST['typ'] : null;
|
||||
$anmerkung = isset($_POST['anmerkung']) ? $_POST['anmerkung'] : null;
|
||||
|
||||
$result = $this->AdresseModel->update([
|
||||
$result = $this->AdresseModel->update(
|
||||
[
|
||||
'adresse_id' => $address_id
|
||||
],
|
||||
],
|
||||
[ 'person_id' => $person_id,
|
||||
'strasse' => $strasse,
|
||||
'updatevon' => $uid,
|
||||
@@ -159,7 +217,8 @@ class Kontakt extends FHC_Controller
|
||||
'name' => $name,
|
||||
'rechnungsadresse' => $_POST['rechnungsadresse'],
|
||||
'anmerkung' => $anmerkung
|
||||
]);
|
||||
]
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
@@ -218,22 +277,6 @@ class Kontakt extends FHC_Controller
|
||||
return $this->outputJsonSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
/* TODO Manu bereits in Address.ph*/
|
||||
public function getNations()
|
||||
{
|
||||
$this->load->model('codex/Nation_model', 'NationModel');
|
||||
|
||||
$this->NationModel->addOrder('kurztext');
|
||||
|
||||
$result = $this->NationModel->load();
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
} else {
|
||||
$this->outputJson(getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
|
||||
public function getAdressentypen()
|
||||
{
|
||||
$this->load->model('person/Adressentyp_model', 'AdressentypModel');
|
||||
@@ -269,82 +312,6 @@ class Kontakt extends FHC_Controller
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getFirmenliste($searchString) //TODO (manu) DEPRECATED
|
||||
{
|
||||
$this->load->model('ressource/firma_model', 'FirmaModel');
|
||||
|
||||
$result = $this->FirmaModel->load();
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
} else {
|
||||
$this->outputJson(getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Array of Names of Ortschaften having plz
|
||||
* @param string $plz Postleitzahl
|
||||
* @return array $result[]
|
||||
*/
|
||||
public function getOrtschaften($plz, $gemeinde=null)
|
||||
{
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
|
||||
//$ort = isset($ortschaft) ? $ortschaft : null;
|
||||
if(isset($gemeinde)) {var_dump($gemeinde);
|
||||
$gemeinde = urldecode($gemeinde);
|
||||
}
|
||||
else
|
||||
$gemeinde = null;
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules($plz, 'PLZ', 'numeric|less_than[10000]');
|
||||
if ($this->form_validation->run() == false) {
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
/* $this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
|
||||
return $this->outputJsonError($this->form_validation->error_array());*/
|
||||
}
|
||||
|
||||
$result = $this->AdresseModel->getOrtschaften($plz, $gemeinde);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson($result);
|
||||
}
|
||||
elseif (!hasData($result)) {
|
||||
$this->outputJson($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Array of Names of Gemeinden having plz
|
||||
* @param string $plz Postleitzahl
|
||||
* @return array $result[]
|
||||
*/
|
||||
function getGemeinden($plz)
|
||||
{
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
|
||||
$result = $this->AdresseModel->getGemeinden($plz);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson($result);
|
||||
}
|
||||
elseif (!hasData($result)) {
|
||||
$this->outputJson($result); //success mit Wert null
|
||||
// $this->outputJson(getData($result) ?: []);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
}
|
||||
|
||||
public function getKontakte($person_id)
|
||||
{
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
@@ -492,9 +459,10 @@ class Kontakt extends FHC_Controller
|
||||
$ext_id = isset($_POST['ext_id']) ? $_POST['ext_id'] : null;
|
||||
$person_id = isset($_POST['person_id']) ? $_POST['person_id'] : null;
|
||||
|
||||
$result = $this->KontaktModel->update([
|
||||
$result = $this->KontaktModel->update(
|
||||
[
|
||||
'kontakt_id' => $kontakt_id
|
||||
],
|
||||
],
|
||||
[
|
||||
'person_id' => $person_id,
|
||||
'kontakttyp' => $kontakttyp,
|
||||
@@ -505,7 +473,8 @@ class Kontakt extends FHC_Controller
|
||||
'insertamum' => date('c'),
|
||||
'standort_id' => $standort_id,
|
||||
'ext_id' => $ext_id
|
||||
]);
|
||||
]
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
@@ -529,7 +498,7 @@ class Kontakt extends FHC_Controller
|
||||
$this->outputJson($result);
|
||||
}
|
||||
elseif (!hasData($result)) {
|
||||
$this->outputJson($result); //success mit Wert null
|
||||
$this->outputJson($result);
|
||||
}
|
||||
return $this->outputJsonSuccess(current(getData($result)));
|
||||
}
|
||||
@@ -630,7 +599,6 @@ class Kontakt extends FHC_Controller
|
||||
|
||||
public function updateBankverbindung($bankverbindung_id)
|
||||
{
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
||||
|
||||
@@ -651,9 +619,10 @@ class Kontakt extends FHC_Controller
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$result = $this->BankverbindungModel->update([
|
||||
$result = $this->BankverbindungModel->update(
|
||||
[
|
||||
'bankverbindung_id' => $bankverbindung_id
|
||||
],
|
||||
],
|
||||
[
|
||||
'person_id' => $_POST['person_id'],
|
||||
'name' => $_POST['name'],
|
||||
@@ -669,7 +638,8 @@ class Kontakt extends FHC_Controller
|
||||
'ext_id' => $_POST['ext_id'],
|
||||
'oe_kurzbz' => $_POST['oe_kurzbz'],
|
||||
'orgform_kurzbz' => $_POST['orgform_kurzbz']
|
||||
]);
|
||||
]
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
@@ -693,11 +663,8 @@ class Kontakt extends FHC_Controller
|
||||
$this->outputJson($result);
|
||||
}
|
||||
elseif (!hasData($result)) {
|
||||
$this->outputJson($result); //success mit Wert null
|
||||
$this->outputJson($result);
|
||||
}
|
||||
return $this->outputJsonSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import {CoreRESTClient} from '../../../../RESTClient.js';
|
||||
import AddressList from "./Kontakt/Address.js";
|
||||
import ContactList from "./Kontakt/Contact.js";
|
||||
import BankaccountList from "./Kontakt/Bankaccount.js";
|
||||
@@ -10,8 +9,6 @@ export default {
|
||||
AddressList,
|
||||
ContactList,
|
||||
BankaccountList,
|
||||
PvToast,
|
||||
PvAutoComplete
|
||||
},
|
||||
props: {
|
||||
modelValue: Object
|
||||
@@ -23,58 +20,21 @@ export default {
|
||||
bankverbindungen: []
|
||||
}
|
||||
},
|
||||
created(){
|
||||
CoreRESTClient
|
||||
.get('components/stv/Kontakt/getAdressen/' + this.modelValue.person_id)
|
||||
.then(result => {
|
||||
this.adressen = result.data;
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err.response.data || err.message);
|
||||
});
|
||||
/* CoreRESTClient
|
||||
.get('components/stv/Kontakt/getKontakte/' + this.modelValue.person_id)
|
||||
.then(result => {
|
||||
this.kontakte = result.data;
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err.response.data || err.message);
|
||||
});
|
||||
CoreRESTClient
|
||||
.get('components/stv/Kontakt/getBankverbindung/' + this.modelValue.person_id)
|
||||
.then(result => {
|
||||
this.bankverbindungen = result.data;
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(err.response.data || err.message);
|
||||
});*/
|
||||
},
|
||||
template: `
|
||||
<div class="stv-details-details h-100 pb-3">
|
||||
<fieldset class="overflow-hidden">
|
||||
|
||||
|
||||
|
||||
<legend>Adressen</legend>
|
||||
<!-- {{this.adressen}}-->
|
||||
|
||||
<!--props notwendig, um auf Funktion in child zuzugreifen-->
|
||||
<!-- <button type="button" class="btn btn btn-outline-warning" @click="actionNewAdress()">new Adress</button>
|
||||
<button type="button" class="btn btn btn-outline-warning" @click="actionEditAdress(111444)">edit 111444</button>-->
|
||||
|
||||
<address-list ref="adressList" :uid="modelValue.person_id"></address-list>
|
||||
<legend>Adressen</legend>
|
||||
<address-list ref="adressList" :uid="student.person_id"></address-list>
|
||||
</fieldset>
|
||||
<br>
|
||||
<fieldset class="overflow-hidden">
|
||||
<legend>Kontakt</legend>
|
||||
<!-- {{this.kontakte}}-->
|
||||
<contact-list ref="contactList" :uid="modelValue.person_id"></contact-list>
|
||||
<contact-list ref="contactList" :uid="student.person_id"></contact-list>
|
||||
</fieldset>
|
||||
<br>
|
||||
<fieldset class="overflow-hidden">
|
||||
<legend>Bankverbindungen</legend>
|
||||
<!-- {{this.bankverbindungen}}-->
|
||||
<bankaccount-list ref="bankaccountList" :uid="modelValue.person_id"></bankaccount-list>
|
||||
<bankaccount-list ref="bankaccountList" :uid="student.person_id"></bankaccount-list>
|
||||
</fieldset>
|
||||
</div>`
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,10 +2,10 @@ import {CoreFilterCmpt} from "../../../../filter/Filter.js";
|
||||
import {CoreRESTClient} from "../../../../../RESTClient";
|
||||
import BsModal from "../../../../Bootstrap/Modal.js";
|
||||
|
||||
var editIcon = function(cell, formatterParams){ //plain text value
|
||||
var editIcon = function (cell, formatterParams) {
|
||||
return "<i class='fa fa-edit'></i>";
|
||||
};
|
||||
var deleteIcon = function(cell, formatterParams) { //plain text value
|
||||
var deleteIcon = function (cell, formatterParams) {
|
||||
return "<i class='fa fa-remove'></i>";
|
||||
};
|
||||
|
||||
@@ -17,9 +17,6 @@ export default{
|
||||
props: {
|
||||
uid: String
|
||||
},
|
||||
emits: [
|
||||
'update:selected'
|
||||
],
|
||||
data() {
|
||||
return{
|
||||
tabulatorOptions: {
|
||||
@@ -55,11 +52,9 @@ export default{
|
||||
{title:"Bankverbindung_id", field:"bankverbindung_id", visible:false},
|
||||
{formatter:editIcon, width:40, align:"center", cellClick: (e, cell) => {
|
||||
this.actionEditBankverbindung(cell.getData().bankverbindung_id);
|
||||
console.log(cell.getRow().getIndex(), cell.getData(), this);
|
||||
}, width:50, headerSort:false},
|
||||
{formatter:deleteIcon, width:40, align:"center", cellClick: (e, cell) => {
|
||||
this.actionDeleteBankverbindung(cell.getData().bankverbindung_id);
|
||||
console.log(cell.getRow().getIndex(), cell.getData(), this);
|
||||
}, width:50, headerSort:false },
|
||||
|
||||
],
|
||||
@@ -116,9 +111,6 @@ export default{
|
||||
this.statusMsg = response.data;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
this.statusCode = 0;
|
||||
this.statusMsg = 'Error in Catch';
|
||||
this.$fhcAlert.alertError('Fehler bei Speicherroutine aufgetreten');
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
@@ -126,10 +118,9 @@ export default{
|
||||
});
|
||||
},
|
||||
loadBankverbindung(bankverbindung_id){
|
||||
return CoreRESTClient.get('components/stv/Kontakt/loadBankverbindung/' + bankverbindung_id
|
||||
).then(
|
||||
return CoreRESTClient.get('components/stv/Kontakt/loadBankverbindung/' + bankverbindung_id)
|
||||
.then(
|
||||
result => {
|
||||
//console.log(this.bankverbindungData, result);
|
||||
if(!result.data.retval || result.data.retval.length < 1)
|
||||
{
|
||||
this.bankverbindungData = {};
|
||||
@@ -145,24 +136,20 @@ export default{
|
||||
},
|
||||
updateBankverbindung(bankverbindung_id){
|
||||
CoreRESTClient.post('components/stv/Kontakt/updateBankverbindung/' + bankverbindung_id,
|
||||
this.bankverbindungData
|
||||
).then(response => {
|
||||
//console.log(response);
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('editBankverbindungModal');
|
||||
this.resetModal();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
console.log(errorData);
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
const [key, value] = entry;
|
||||
this.$fhcAlert.alertError('Das Feld ' + key + ' ist erforderlich');
|
||||
});
|
||||
}
|
||||
this.bankverbindungData)
|
||||
.then(response => {
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('editBankverbindungModal');
|
||||
this.resetModal();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
const [key, value] = entry;
|
||||
this.$fhcAlert.alertError('Das Feld ' + key + ' ist erforderlich');
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
this.statusMsg = 'Error in Catch';
|
||||
console.log('Speichern nicht erfolgreich ' + this.errorData);
|
||||
this.$fhcAlert.alertError('Fehler bei Speicherroutine aufgetreten');
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
@@ -203,44 +190,44 @@ export default{
|
||||
<!--Modal: Add Bankverbindung-->
|
||||
<BsModal title="Bankverbindung anlegen" ref="newBankverbindungModal">
|
||||
<template #title>Bankverbindung anlegen</template>
|
||||
<form class="row g-3" ref="bankverbindungData">
|
||||
<form class="row g-3" ref="bankverbindungData">
|
||||
<div class="row mb-3">
|
||||
<label for="name" class="form-label col-sm-4">Name</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="name" v-model="bankverbindungData['name']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="row mb-3">
|
||||
<label for="anschrift" class="form-label col-sm-4">Anschrift</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="anschrift" v-model="bankverbindungData['anschrift']">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="row mb-3">
|
||||
<label for="iban" class="form-label col-sm-4">IBAN</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" required class="form-control" id="iban" v-model="bankverbindungData['iban']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="bic" class="form-label col-sm-4">BIC</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="bic" v-model="bankverbindungData['bic']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="kontonr" class="form-label col-sm-4">Kontonummer</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="kontonr" v-model="bankverbindungData['kontonr']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="blz" class="form-label col-sm-4">BLZ</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="blz" v-model="bankverbindungData['blz']">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="typ" class="form-label col-sm-4">Typ</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -249,15 +236,15 @@ export default{
|
||||
<option value="f">Firmenkonto</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="verrechnung" class="form-label col-sm-4">Verrechnung</label>
|
||||
<div class="col-sm-3">
|
||||
<div class="form-check">
|
||||
<div class="form-check">
|
||||
<input id="verrechnung" type="checkbox" class="form-check-input" value="1" v-model="bankverbindungData['verrechnung']">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
|
||||
@@ -266,9 +253,9 @@ export default{
|
||||
</BsModal>
|
||||
|
||||
<!--Modal: Edit Bankverbindung-->
|
||||
<BsModal ref="editBankverbindungModal" >
|
||||
<BsModal ref="editBankverbindungModal">
|
||||
<template #title>Bankverbindung bearbeiten</template>
|
||||
<form class="row g-3" ref="bankverbindungData" >
|
||||
<form class="row g-3" ref="bankverbindungData">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="name" class="form-label col-sm-4">Name</label>
|
||||
@@ -276,37 +263,36 @@ export default{
|
||||
<input type="text" :readonly="readonly" class="form-control" id="name" v-model="bankverbindungData['name']">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="row mb-3">
|
||||
<label for="anschrift" class="form-label col-sm-4">Anschrift</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="anschrift" v-model="bankverbindungData['anschrift']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="iban" class="form-label col-sm-4">IBAN</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" required class="form-control" id="iban" v-model="bankverbindungData['iban']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="bic" class="form-label col-sm-4">BIC</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="bic" v-model="bankverbindungData['bic']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="kontonr" class="form-label col-sm-4">Kontonummer</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="kontonr" v-model="bankverbindungData['kontonr']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="blz" class="form-label col-sm-4">BLZ</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="blz" v-model="bankverbindungData['blz']">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="typ" class="form-label col-sm-4">Typ</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -315,66 +301,45 @@ export default{
|
||||
<option value="f">Firmenkonto</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="verrechnung" class="form-label col-sm-4">Verrechnung</label>
|
||||
<div class="col-sm-3">
|
||||
<div class="form-check">
|
||||
<div class="form-check">
|
||||
<input id="verrechnung" type="checkbox" class="form-check-input" value="1" v-model="bankverbindungData['verrechnung']">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
<template #footer>
|
||||
<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>
|
||||
</template>
|
||||
</template>
|
||||
</BsModal>
|
||||
|
||||
<!--Modal: Delete Bankverbindung TODO(manu) Formatierung mit zuviel Abstand-->
|
||||
<BsModal ref="deleteBankverbindungModal" >
|
||||
<template #title>Bankverbindung löschen</template>
|
||||
<!--Modal: Delete Bankverbindung-->
|
||||
<BsModal ref="deleteBankverbindungModal">
|
||||
<template #title>Bankverbindung löschen</template>
|
||||
<template #default>
|
||||
<p>Bankverbindung wirklich löschen?</p>
|
||||
</template>
|
||||
<p>Bankverbindung wirklich löschen?</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<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="deleteBankverbindung(bankverbindungData.bankverbindung_id)">OK</button>
|
||||
</template>
|
||||
</template>
|
||||
</BsModal>
|
||||
|
||||
|
||||
<!-- <div ref="deleteBankverbindungModal" class="modal fade" id="deleteBankverbindungModal" tabindex="-1" aria-labelledby="deleteBankverbindungModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="deleteBankverbindungModalLabel">Kontakt löschen</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Bankverbindung wirklich löschen?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
|
||||
<button type="button" class="btn btn-primary" @click="deleteBankverbindung(bankverbindungData.bankverbindung_id)">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
new-btn-show
|
||||
new-btn-label="Neu"
|
||||
@click:new="actionNewBankverbindung"
|
||||
>
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
new-btn-show
|
||||
new-btn-label="Neu"
|
||||
@click:new="actionNewBankverbindung"
|
||||
>
|
||||
</core-filter-cmpt>
|
||||
</div>`
|
||||
};
|
||||
|
||||
};
|
||||
@@ -4,10 +4,10 @@ import BsModal from "../../../../Bootstrap/Modal.js";
|
||||
/*import PvToast from "../../../../../../../index.ci.php/public/js/components/primevue/toast/toast.esm.min.js";*/
|
||||
import PvAutoComplete from "../../../../../../../index.ci.php/public/js/components/primevue/autocomplete/autocomplete.esm.min.js";
|
||||
|
||||
var editIcon = function(cell, formatterParams){ //plain text value
|
||||
var editIcon = function (cell, formatterParams) {
|
||||
return "<i class='fa fa-edit'></i>";
|
||||
};
|
||||
var deleteIcon = function(cell, formatterParams){ //plain text value
|
||||
var deleteIcon = function (cell, formatterParams){
|
||||
return "<i class='fa fa-remove'></i>";
|
||||
};
|
||||
|
||||
@@ -20,9 +20,6 @@ export default{
|
||||
props: {
|
||||
uid: String
|
||||
},
|
||||
emits: [
|
||||
'update:selected'
|
||||
],
|
||||
data() {
|
||||
return{
|
||||
tabulatorOptions: {
|
||||
@@ -42,18 +39,13 @@ export default{
|
||||
{title:"Kontakt_id", field:"kontakt_id", visible:false},
|
||||
{title:"Standort_id", field:"standort_id", visible:false},
|
||||
{title:"letzte Änderung", field:"updateamum", visible:false},
|
||||
/* {title: "Actions",
|
||||
columns:[*/
|
||||
{formatter:editIcon, cellClick: (e, cell) => {
|
||||
this.actionEditContact(cell.getData().kontakt_id);
|
||||
console.log(cell.getRow().getIndex(), cell.getData(), this);
|
||||
}, width:50, headerSort:false, headerVisible:false},
|
||||
{formatter:deleteIcon, cellClick: (e, cell) => {
|
||||
this.actionDeleteContact(cell.getData().kontakt_id);
|
||||
console.log(cell.getRow().getIndex(), cell.getData(), this);
|
||||
}, width:50, headerSort:false, headerVisible:false },
|
||||
/* ],
|
||||
},*/
|
||||
{formatter:editIcon, cellClick: (e, cell) => {
|
||||
this.actionEditContact(cell.getData().kontakt_id);
|
||||
}, width:50, headerSort:false, headerVisible:false},
|
||||
{formatter:deleteIcon, cellClick: (e, cell) => {
|
||||
this.actionDeleteContact(cell.getData().kontakt_id);
|
||||
|
||||
}, width:50, headerSort:false, headerVisible:false},
|
||||
],
|
||||
layout: 'fitDataFill',
|
||||
layoutColumnsOnNewData: false,
|
||||
@@ -61,8 +53,7 @@ export default{
|
||||
selectable: true,
|
||||
index: 'kontakt_id'
|
||||
},
|
||||
tabulatorEvents: [
|
||||
],
|
||||
tabulatorEvents: [],
|
||||
lastSelected: null,
|
||||
contactData: {
|
||||
zustellung: true,
|
||||
@@ -81,12 +72,10 @@ export default{
|
||||
methods:{
|
||||
actionNewContact(){
|
||||
this.$refs.newContactModal.show();
|
||||
/* bootstrap.Modal.getOrCreateInstance(this.$refs.newContactModal).show();*/
|
||||
},
|
||||
actionEditContact(contact_id){
|
||||
this.loadContact(contact_id);
|
||||
this.$refs.editContactModal.show();
|
||||
|
||||
},
|
||||
actionDeleteContact(contact_id){
|
||||
this.loadContact(contact_id);
|
||||
@@ -94,25 +83,20 @@ export default{
|
||||
},
|
||||
addNewContact(formData) {
|
||||
CoreRESTClient.post('components/stv/Kontakt/addNewContact/' + this.uid,
|
||||
this.contactData
|
||||
).then(response => {
|
||||
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 => {
|
||||
const [key, value] = entry;
|
||||
//console.log(key, value);
|
||||
this.$fhcAlert.alertError(value);
|
||||
});
|
||||
}
|
||||
this.contactData)
|
||||
.then(response => {
|
||||
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 => {
|
||||
const [key, value] = entry;
|
||||
this.$fhcAlert.alertError(value);
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
this.statusCode = 0;
|
||||
this.statusMsg = 'Error in Catch';
|
||||
console.log('Speichern nicht erfolgreich ' + this.statusMsg);
|
||||
this.$fhcAlert.alertError('Fehler bei Speicherroutine aufgetreten');
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
@@ -120,42 +104,31 @@ export default{
|
||||
});
|
||||
},
|
||||
loadContact(contact_id){
|
||||
return CoreRESTClient.get('components/stv/Kontakt/loadContact/' + contact_id
|
||||
).then(
|
||||
result => {
|
||||
console.log(this.contactData, result);
|
||||
if(result.data.retval)
|
||||
this.contactData = result.data.retval;
|
||||
else
|
||||
{
|
||||
this.contactData = {};
|
||||
this.$fhcAlert.alertError('Kein Kontakt mit Id ' + contact_id + ' gefunden');
|
||||
return CoreRESTClient.get('components/stv/Kontakt/loadContact/' + contact_id)
|
||||
.then(
|
||||
result => {
|
||||
if(result.data.retval)
|
||||
this.contactData = result.data.retval;
|
||||
else
|
||||
{
|
||||
this.contactData = {};
|
||||
this.$fhcAlert.alertError('Kein Kontakt mit Id ' + contact_id + ' gefunden');
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
);
|
||||
},
|
||||
deleteContact(kontakt_id){
|
||||
CoreRESTClient.post('components/stv/Kontakt/deleteContact/' + kontakt_id)
|
||||
.then(response => {
|
||||
if (!response.data.error) {
|
||||
this.statusCode = 0;
|
||||
this.statusMsg = 'success';
|
||||
//console.log('Löschen erfolgreich: ' + this.statusMsg);
|
||||
this.$fhcAlert.alertSuccess('Löschen erfolgreich');
|
||||
} else {
|
||||
this.statusCode = 0;
|
||||
this.statusMsg = 'Error';
|
||||
console.log('Löschen nicht erfolgreich: ' + this.statusMsg);
|
||||
this.$fhcAlert.alertError('Keine Adresse mit Id ' + kontakt_id + ' gefunden');
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
this.statusCode = 0;
|
||||
this.statusMsg = 'Error in Catch';
|
||||
console.log('Löschen nicht erfolgreich ' + this.statusMsg);
|
||||
this.$fhcAlert.alertError('Fehler bei Löschroutine aufgetreten');
|
||||
})
|
||||
.catch(error => {
|
||||
this.$fhcAlert.alertError('Fehler bei Löschroutine aufgetreten');
|
||||
}).finally(()=> {
|
||||
window.scrollTo(0, 0);
|
||||
this.hideModal('deleteContactModal');
|
||||
@@ -165,13 +138,9 @@ export default{
|
||||
},
|
||||
updateContact(kontakt_id){
|
||||
CoreRESTClient.post('components/stv/Kontakt/updateContact/' + kontakt_id,
|
||||
this.contactData
|
||||
).then(response => {
|
||||
console.log(response);
|
||||
this.contactData).
|
||||
then(response => {
|
||||
if (!response.data.error) {
|
||||
this.statusCode = 0;
|
||||
this.statusMsg = 'success';
|
||||
console.log('Speichern erfolgreich: ' + this.statusMsg);
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('editContactModal');
|
||||
this.resetModal();
|
||||
@@ -180,19 +149,13 @@ export default{
|
||||
const errorData = response.data.retval;
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
const [key, value] = entry;
|
||||
console.log(key, value);
|
||||
this.$fhcAlert.alertError(value);
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
this.statusCode = 0;
|
||||
this.statusMsg = 'Error in Catch';
|
||||
console.log('Speichern nicht erfolgreich ' + this.statusMsg);
|
||||
this.$fhcAlert.alertError('Fehler bei Speicherroutine aufgetreten');
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
//hideModal();
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
@@ -205,8 +168,8 @@ export default{
|
||||
search(event) {
|
||||
return CoreRESTClient
|
||||
.get('components/stv/Kontakt/getStandorte/' + event.query)
|
||||
.then(result => {
|
||||
this.filteredStandorte = CoreRESTClient.getData(result.data);
|
||||
.then(result => {
|
||||
this.filteredStandorte = CoreRESTClient.getData(result.data);
|
||||
});
|
||||
},
|
||||
resetModal(){
|
||||
@@ -241,46 +204,45 @@ export default{
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="row mb-3">
|
||||
<label for="kontakt" class="form-label col-sm-4">Kontakt</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="kontakt" v-model="contactData['kontakt']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="anmerkung" class="form-label col-sm-4">Anmerkung</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="anmerkung" v-model="contactData['anmerkung']">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="zustellung" class="form-label col-sm-4">Zustellung</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-check">
|
||||
<div class="form-check">
|
||||
<input id="zustellung" type="checkbox" class="form-check-input" value="1" v-model="contactData['zustellung']">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="firma_name" class="form-label col-sm-4">Firma / Standort</label>
|
||||
<div class="col-sm-6">
|
||||
<PvAutoComplete v-model="contactData['standort']" optionLabel="kurzbz" :suggestions="filteredStandorte" @complete="search" minLength="3"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
|
||||
<button type="button" class="btn btn-primary" @click="addNewContact()">OK</button>
|
||||
</template>
|
||||
</BsModal>
|
||||
|
||||
|
||||
|
||||
<!--Modal: Edit Contact-->
|
||||
<BsModal ref="editContactModal">
|
||||
<template #title>Kontakt bearbeiten</template>
|
||||
<form class="row g-3" ref="contactData">
|
||||
<form class="row g-3" ref="contactData">
|
||||
<div class="row mb-3">
|
||||
<label for="kontakttyp" class="form-label col-sm-4">Typ</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -290,39 +252,39 @@ export default{
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="row mb-3">
|
||||
<label for="kontakt" class="form-label col-sm-4">Kontakt</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="kontakt" v-model="contactData['kontakt']">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="anmerkung" class="form-label col-sm-4">Anmerkung</label>
|
||||
<div class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="anmerkung" v-model="contactData['anmerkung']">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="zustellung" class="form-label col-sm-4">Zustellung</label>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-check">
|
||||
<div class="form-check">
|
||||
<input id="zustellung" type="checkbox" class="form-check-input" value="1" v-model="contactData['zustellung']">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<input type="hidden" :readonly="readonly" class="form-control" id="standort_id" v-model="contactData.standort_id">
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="standort" class="form-label col-sm-4">Firma / Standort</label>
|
||||
<div v-if="contactData.kurzbz" class="col-sm-3">
|
||||
<div v-if="contactData.kurzbz" class="col-sm-6">
|
||||
<input type="text" :readonly="readonly" class="form-control" id="name" v-model="contactData.kurzbz">
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="col-sm-3">
|
||||
<PvAutoComplete v-model="contactData['standort']" optionLabel="kurzbz" :suggestions="filteredStandorte" @complete="search" minLength="3"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="resetModal">Abbrechen</button>
|
||||
@@ -330,48 +292,29 @@ export default{
|
||||
</template>
|
||||
</BsModal>
|
||||
|
||||
<!-- Modal: Delete Contact TODO(manu) Formatierung-->
|
||||
<BsModal ref="deleteContactModal" >
|
||||
<!--Modal: Delete Contact-->
|
||||
<BsModal ref="deleteContactModal">
|
||||
<template #title>Kontakt löschen</template>
|
||||
<template #default>
|
||||
<p>Kontakt wirklich löschen?</p>
|
||||
<p>Kontakt wirklich löschen?</p>
|
||||
</template>
|
||||
<template #footer>
|
||||
<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="deleteContact(contactData.kontakt_id)">OK</button>
|
||||
</template>
|
||||
</template>
|
||||
</BsModal>
|
||||
|
||||
<!-- <div ref="deleteContactModal" class="modal fade" id="deleteContactModal" tabindex="-1" aria-labelledby="deleteContactModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="deleteContactModalLabel">Kontakt löschen</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Kontakt {{contactData.kontakt_id}} wirklich löschen?</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
|
||||
<button type="button" class="btn btn-primary" @click="deleteContact(contactData.kontakt_id)">OK</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
new-btn-show
|
||||
new-btn-label="Neu"
|
||||
@click:new="actionNewContact"
|
||||
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
new-btn-show
|
||||
new-btn-label="Neu"
|
||||
@click:new="actionNewContact"
|
||||
>
|
||||
</core-filter-cmpt>
|
||||
</div>`
|
||||
};
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user