mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
refactor Tab Contact
This commit is contained in:
@@ -26,9 +26,9 @@ class Kontakt extends FHCAPI_Controller
|
||||
'getKontakttypen' => ['admin:r', 'assistenz:r'],
|
||||
'getFirmen' => ['admin:r', 'assistenz:r'],
|
||||
'getStandorte' => ['admin:r', 'assistenz:r'],
|
||||
'getStandorteByFirma' => ['admin:r', 'assistenz:r'],
|
||||
'getKontakte' => ['admin:r', 'assistenz:r'],
|
||||
'getBankverbindung' => ['mitarbeiter/bankdaten:r', 'student/bankdaten:r'],
|
||||
|
||||
'getBankverbindung' => ['mitarbeiter/bankdaten:r', 'student/bankdaten:r']
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
@@ -40,12 +40,17 @@ class Kontakt extends FHCAPI_Controller
|
||||
'ui',
|
||||
'person'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
$this->load->model('organisation/standort_model', 'StandortModel');
|
||||
$this->load->model('ressource/firma_model', 'FirmaModel');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
|
||||
}
|
||||
|
||||
public function getAdressen($person_id)
|
||||
{
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
|
||||
$this->AdresseModel->addSelect('public.tbl_adresse.*');
|
||||
$this->AdresseModel->addSelect('t.*');
|
||||
$this->AdresseModel->addSelect('f.firma_id');
|
||||
@@ -79,8 +84,6 @@ class Kontakt extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
|
||||
$uid = getAuthUID();
|
||||
$co_name = isset($_POST['co_name']) ? $_POST['co_name'] : null;
|
||||
$strasse = isset($_POST['strasse']) ? $_POST['strasse'] : null;
|
||||
@@ -155,6 +158,10 @@ class Kontakt extends FHCAPI_Controller
|
||||
{
|
||||
$firma_id = $_POST['firma']['firma_id'];
|
||||
}
|
||||
elseif(isset($_POST['firma_id']))
|
||||
{
|
||||
$firma_id = $_POST['firma_id'];
|
||||
}
|
||||
else
|
||||
$firma_id = null;
|
||||
|
||||
@@ -291,18 +298,27 @@ class Kontakt extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($result ?: []);
|
||||
}
|
||||
|
||||
public function getStandorteByFirma($firma_id)
|
||||
{
|
||||
$this->load->model('organisation/standort_model', 'StandortModel');
|
||||
|
||||
$result = $this->StandortModel->getStandorteByFirma($firma_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getKontakte($person_id)
|
||||
{
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('organisation/standort_model', 'StandortModel');
|
||||
$this->KontaktModel->addSelect("*,
|
||||
$this->KontaktModel->addSelect("public.tbl_kontakt.*,
|
||||
TO_CHAR (CASE
|
||||
WHEN public.tbl_kontakt.updateamum >= public.tbl_kontakt.insertamum
|
||||
THEN public.tbl_kontakt.updateamum
|
||||
ELSE public.tbl_kontakt.insertamum
|
||||
END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate");
|
||||
END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate, st.bezeichnung, f.name");
|
||||
$this->StandortModel->addJoin('public.tbl_standort st', 'ON (public.tbl_kontakt.standort_id = st.standort_id)', 'LEFT');
|
||||
|
||||
$this->FirmaModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = st.firma_id)', 'LEFT');
|
||||
$result = $this->KontaktModel->loadWhere(
|
||||
array('person_id' => $person_id)
|
||||
);
|
||||
@@ -321,7 +337,9 @@ class Kontakt extends FHCAPI_Controller
|
||||
$result = $this->KontakttypModel->load();
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithSuccess(getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
@@ -330,9 +348,10 @@ class Kontakt extends FHCAPI_Controller
|
||||
{
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
|
||||
$this->KontaktModel->addSelect('public.tbl_kontakt.*');
|
||||
$this->KontaktModel->addSelect('*, public.tbl_kontakt.*');
|
||||
$this->KontaktModel->addSelect('st.kurzbz');
|
||||
$this->KontaktModel->addJoin('public.tbl_standort st', 'ON (public.tbl_kontakt.standort_id = st.standort_id)', 'LEFT');
|
||||
$this->FirmaModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = st.firma_id)', 'LEFT');
|
||||
|
||||
$this->KontaktModel->addLimit(1);
|
||||
|
||||
@@ -368,19 +387,13 @@ class Kontakt extends FHCAPI_Controller
|
||||
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
|
||||
if(isset($_POST['standort']))
|
||||
{
|
||||
$standort_id = $_POST['standort']['standort_id'];
|
||||
}
|
||||
else
|
||||
$standort_id = null;
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$kontakttyp = $this->input->post('kontakttyp');
|
||||
$anmerkung = $this->input->post('anmerkung');
|
||||
$kontakt = $this->input->post('kontakt');
|
||||
$ext_id = $this->input->post('ext_id');
|
||||
$standort_id = $this->input->post('standort_id');
|
||||
|
||||
$result = $this->KontaktModel->insert(
|
||||
[
|
||||
@@ -426,12 +439,12 @@ class Kontakt extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
if(isset($_POST['standort']))
|
||||
/* if(isset($_POST['standort']))
|
||||
{
|
||||
$standort_id = $_POST['standort']['standort_id'];
|
||||
}
|
||||
else
|
||||
$standort_id = null;
|
||||
$standort_id = null;*/
|
||||
|
||||
$uid = getAuthUID();
|
||||
$kontakttyp = $this->input->post('kontakttyp');
|
||||
@@ -439,6 +452,9 @@ class Kontakt extends FHCAPI_Controller
|
||||
$kontakt = $this->input->post('kontakt');
|
||||
$ext_id = $this->input->post('ext_id');
|
||||
$person_id = $this->input->post('person_id');
|
||||
$standort_id = $this->input->post('standort_id');
|
||||
|
||||
//return $this->terminateWithError("in update " . $standort_id, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->KontaktModel->update(
|
||||
[
|
||||
|
||||
@@ -28,5 +28,29 @@ class Standort_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
/* public function searchStandorteByFirma($filter)
|
||||
{
|
||||
$filter = strtoLower($filter);
|
||||
$qry = "
|
||||
SELECT
|
||||
s.kurzbz, s.standort_id
|
||||
FROM
|
||||
public.tbl_firma f
|
||||
LEFT JOIN
|
||||
public.tbl_standort s ON(f.firma_id = s.firma_id)
|
||||
WHERE
|
||||
f.firma_id = '". $this->db->escape_like_str($filter)."'";
|
||||
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}*/
|
||||
|
||||
public function getStandorteByFirma($firma_id)
|
||||
{
|
||||
$this->addSelect("DISTINCT ON (standort_id) bezeichnung, standort_id");
|
||||
|
||||
return $this->loadWhere(array("firma_id" => $firma_id));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,13 +154,7 @@ export default{
|
||||
typ: 'h',
|
||||
nation: 'A'
|
||||
},
|
||||
initData: {
|
||||
zustelladresse: true,
|
||||
heimatadresse: true,
|
||||
rechnungsadresse: false,
|
||||
typ: 'h',
|
||||
nation: 'A'
|
||||
},
|
||||
statusNew: true,
|
||||
places: [],
|
||||
suggestions: {},
|
||||
nations: [],
|
||||
@@ -192,14 +186,15 @@ export default{
|
||||
methods:{
|
||||
actionNewAdress() {
|
||||
this.resetModal();
|
||||
this.$refs.newAdressModal.show();
|
||||
this.$refs.adressModal.show();
|
||||
},
|
||||
actionEditAdress(adress_id) {
|
||||
this.statusNew = false;
|
||||
this.loadAdress(adress_id).then(() => {
|
||||
if(this.addressData.adresse_id)
|
||||
{
|
||||
this.loadPlaces(this.addressData.plz);
|
||||
this.$refs.editAdressModal.show();
|
||||
this.$refs.adressModal.show();
|
||||
|
||||
}
|
||||
});
|
||||
@@ -218,7 +213,7 @@ export default{
|
||||
this.addressData
|
||||
).then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.hideModal('newAdressModal');
|
||||
this.hideModal('adressModal');
|
||||
this.resetModal();
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
@@ -230,6 +225,7 @@ export default{
|
||||
this.$refs.table.reloadTable();
|
||||
},
|
||||
loadAdress(adress_id) {
|
||||
this.statusNew = false;
|
||||
return this.$fhcApi.get('api/frontend/v1/stv/kontakt/loadAddress/' + adress_id)
|
||||
.then(result => {
|
||||
this.addressData = result.data;
|
||||
@@ -242,7 +238,7 @@ export default{
|
||||
this.addressData
|
||||
).then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.hideModal('editAdressModal');
|
||||
this.hideModal('adressModal');
|
||||
this.resetModal();
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
@@ -294,7 +290,20 @@ export default{
|
||||
},
|
||||
resetModal() {
|
||||
this.addressData = {};
|
||||
this.addressData = this.initData;
|
||||
|
||||
this.addressData.strasse = null;
|
||||
this.addressData.zustelladresse = true;
|
||||
this.addressData.heimatadresse = true;
|
||||
this.addressData.rechnungsadresse = false;
|
||||
this.addressData.co_name = null;
|
||||
this.addressData.firma_id = null;
|
||||
this.addressData.name = null;
|
||||
this.addressData.anmerkung = null;
|
||||
this.addressData.typ = 'h';
|
||||
this.addressData.nation = 'A';
|
||||
this.addressData.plz = null;
|
||||
|
||||
this.statusNew = true;
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -314,139 +323,130 @@ export default{
|
||||
template: `
|
||||
<div class="stv-details-kontakt-address h-100 pt-3">
|
||||
|
||||
<!--Modal: Add Address-->
|
||||
<bs-modal ref="newAdressModal">
|
||||
<template #title>{{$p.t('person', 'adresse_new')}}</template>
|
||||
<form-form class="row g-3" ref="addressData">
|
||||
<!--Modal: AddressModal-->
|
||||
<bs-modal ref="adressModal">
|
||||
<template #title>
|
||||
<p v-if="statusNew" class="fw-bold mt-3">{{$p.t('person', 'adresse_new')}}</p>
|
||||
<p v-else class="fw-bold mt-3">{{$p.t('person', 'adresse_edit')}}</p>
|
||||
</template>
|
||||
<form-form class="row g-3 mt-2" ref="addressData">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="adressentyp" class="form-label col-sm-4">{{$p.t('global', 'typ')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="select"
|
||||
name="adressentyp"
|
||||
v-model="addressData.typ"
|
||||
<form-input
|
||||
type="select"
|
||||
name="adressentyp"
|
||||
:label="$p.t('global/typ')"
|
||||
v-model="addressData.typ"
|
||||
>
|
||||
<option
|
||||
v-for="typ in adressentypen"
|
||||
:key="typ.adressentyp_kurzbz"
|
||||
:value="typ.adressentyp_kurzbz"
|
||||
>
|
||||
<option
|
||||
v-for="typ in adressentypen"
|
||||
:key="typ.adressentyp_kurzbz"
|
||||
:value="typ.adressentyp_kurzbz"
|
||||
>
|
||||
{{typ.bezeichnung}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
{{typ.bezeichnung}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="strasse" class="form-label col-sm-4">{{$p.t('person', 'strasse')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="strasse"
|
||||
:label="$p.t('person/strasse')"
|
||||
v-model="addressData.strasse"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="nation" class="form-label col-sm-4">{{$p.t('person', 'nation')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="select"
|
||||
name="nation"
|
||||
v-model="addressData.nation"
|
||||
<form-input
|
||||
type="select"
|
||||
name="nation"
|
||||
:label="$p.t('person/nation')"
|
||||
v-model="addressData.nation"
|
||||
>
|
||||
<option
|
||||
v-for="nation in nations"
|
||||
:key="nation.nation_code"
|
||||
:value="nation.nation_code"
|
||||
:disabled="nation.sperre"
|
||||
>
|
||||
<option
|
||||
v-for="nation in nations"
|
||||
:key="nation.nation_code"
|
||||
:value="nation.nation_code"
|
||||
:disabled="nation.sperre"
|
||||
>
|
||||
{{nation.kurztext}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
{{nation.kurztext}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="plz" class="required form-label col-sm-4" >{{$p.t('person', 'plz')}}<sup>*</sup></label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="plz"
|
||||
v-model="addressData.plz"
|
||||
required
|
||||
@input="loadPlaces"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<form-input
|
||||
type="text"
|
||||
name="plz"
|
||||
:label="$p.t('person/plz') + ' *'"
|
||||
v-model="addressData.plz"
|
||||
required
|
||||
@input="loadPlaces"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="gemeinde" class="form-label col-sm-4">{{$p.t('person', 'gemeinde')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
v-if="addressData.nation == 'A'"
|
||||
type="select"
|
||||
name="gemeinde"
|
||||
v-model="addressData.gemeinde"
|
||||
<form-input
|
||||
v-if="addressData.nation == 'A'"
|
||||
type="select"
|
||||
name="gemeinde"
|
||||
:label="$p.t('person/gemeinde')"
|
||||
v-model="addressData.gemeinde"
|
||||
>
|
||||
<option v-if="!gemeinden.length" disabled>{{$p.t('ui', 'bittePlzWaehlen')}}</option>
|
||||
<option
|
||||
v-for="gemeinde in gemeinden"
|
||||
:key="gemeinde.name"
|
||||
:value="gemeinde.name"
|
||||
>
|
||||
<option v-if="!gemeinden.length" disabled>{{$p.t('ui', 'bittePlzWaehlen')}}</option>
|
||||
<option
|
||||
v-for="gemeinde in gemeinden"
|
||||
:key="gemeinde.name"
|
||||
:value="gemeinde.name"
|
||||
>
|
||||
{{gemeinde.name}}
|
||||
</option>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-else
|
||||
type="text"
|
||||
name="addressData.gemeinde"
|
||||
v-model="addressData.gemeinde"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
{{gemeinde.name}}
|
||||
</option>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-else
|
||||
type="text"
|
||||
name="addressData.gemeinde"
|
||||
v-model="addressData.gemeinde"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="Ort" class="form-label col-sm-4">{{$p.t('person', 'ort')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
v-if="addressData.nation == 'A'"
|
||||
type="select"
|
||||
<form-input
|
||||
v-if="addressData.nation == 'A'"
|
||||
type="select"
|
||||
name="ort"
|
||||
:label="$p.t('person/ort')"
|
||||
v-model="addressData.ort"
|
||||
>
|
||||
<option v-if="!orte.length" disabled>{{$p.t('ui', 'bitteGemeindeWaehlen')}}</option>
|
||||
<option
|
||||
v-for="ort in orte"
|
||||
:key="ort.ortschaftsname"
|
||||
:value="ort.ortschaftsname"
|
||||
>
|
||||
{{ort.ortschaftsname}}
|
||||
</option>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-else
|
||||
type="text"
|
||||
name="ort"
|
||||
v-model="addressData.ort"
|
||||
>
|
||||
<option v-if="!orte.length" disabled>{{$p.t('ui', 'bitteGemeindeWaehlen')}}</option>
|
||||
<option
|
||||
v-for="ort in orte"
|
||||
:key="ort.ortschaftsname"
|
||||
:value="ort.ortschaftsname"
|
||||
>
|
||||
{{ort.ortschaftsname}}
|
||||
</option>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-else
|
||||
type="text"
|
||||
name="ort"
|
||||
v-model="addressData.ort"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="heimatadresse" class="form-label col-sm-4">{{$p.t('person', 'heimatadresse')}}</label>
|
||||
<div class="col-sm-4">
|
||||
<form-input
|
||||
container-class="form-check"
|
||||
type="checkbox"
|
||||
name="heimatadresse"
|
||||
:label="$p.t('person/heimatadresse')"
|
||||
v-model="addressData.heimatadresse"
|
||||
>
|
||||
</form-input>
|
||||
@@ -454,12 +454,12 @@ export default{
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="zustelladresse" class="form-label col-sm-4">{{$p.t('person', 'zustelladresse')}}</label>
|
||||
<div class="col-sm-4">
|
||||
<form-input
|
||||
container-class="form-check"
|
||||
type="checkbox"
|
||||
name="zustelladresse"
|
||||
:label="$p.t('person/zustelladresse')"
|
||||
v-model="addressData.zustelladresse"
|
||||
>
|
||||
</form-input>
|
||||
@@ -467,239 +467,63 @@ export default{
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="co_name" class="form-label col-sm-4">{{$p.t('person', 'co_name')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="co_name"
|
||||
v-model="addressData.co_name"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<form-input
|
||||
type="text"
|
||||
name="co_name"
|
||||
:label="$p.t('person/co_name')"
|
||||
v-model="addressData.co_name"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="rechnungsadresse" class="form-label col-sm-4">{{$p.t('person', 'rechnungsadresse')}}</label>
|
||||
<div class="col-sm-4">
|
||||
<form-input
|
||||
container-class="form-check"
|
||||
type="checkbox"
|
||||
name="rechnungsadresse"
|
||||
:label="$p.t('person/rechnungsadresse')"
|
||||
v-model="addressData.rechnungsadresse"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="firma_name" class="form-label col-sm-4">{{$p.t('person', 'firma')}}</label>
|
||||
<div class="col-sm-3">
|
||||
<PvAutoComplete v-model="addressData.firma" optionLabel="name" :suggestions="filteredFirmen" @complete="search" :min-length="3"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="name" class="form-label col-sm-4">{{$p.t('person', 'firma_zusatz')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="firma_zusatz"
|
||||
v-model="addressData.name"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="anmerkung" class="form-label col-sm-4">{{$p.t('global', 'anmerkung')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="anmerkung"
|
||||
v-model="addressData.anmerkung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form-form>
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button type="button" class="btn btn-primary" @click="addNewAddress()">OK</button>
|
||||
</template>
|
||||
</bs-modal>
|
||||
|
||||
<!--Modal: Edit Address-->
|
||||
<bs-modal ref="editAdressModal">
|
||||
<template #title>{{$p.t('person', 'adresse_edit')}}</template>
|
||||
<form-form class="row g-3" ref="addressData">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="adressentyp" class="form-label col-sm-4">{{$p.t('global', 'typ')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="select"
|
||||
name="adressentyp"
|
||||
v-model="addressData.typ"
|
||||
>
|
||||
<option
|
||||
v-for="typ in adressentypen"
|
||||
:key="typ.adressentyp_kurzbz"
|
||||
:value="typ.adressentyp_kurzbz"
|
||||
>
|
||||
{{typ.bezeichnung}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="strasse" class="form-label col-sm-4">{{$p.t('person', 'strasse')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="strasse"
|
||||
v-model="addressData.strasse"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="nation" class="form-label col-sm-4">{{$p.t('person', 'nation')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="select"
|
||||
name="nation"
|
||||
v-model="addressData.nation"
|
||||
>
|
||||
<option
|
||||
v-for="nation in nations"
|
||||
:key="nation.nation_code"
|
||||
:value="nation.nation_code"
|
||||
:disabled="nation.sperre"
|
||||
>
|
||||
{{nation.kurztext}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="plz" class="required form-label col-sm-4" >{{$p.t('person', 'plz')}}<sup>*</sup></label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="plz"
|
||||
v-model="addressData.plz"
|
||||
required
|
||||
@input="loadPlaces"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="gemeinde" class="form-label col-sm-4">{{$p.t('person', 'gemeinde')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
v-if="addressData.gemeinde"
|
||||
type="select"
|
||||
name="addressData.gemeinde"
|
||||
v-model="addressData.gemeinde"
|
||||
>
|
||||
<option v-if="!gemeinden.length" disabled>{{$p.t('ui', 'bittePlzWaehlen')}}</option>
|
||||
<option
|
||||
v-for="gemeinde in gemeinden"
|
||||
:key="gemeinde.name"
|
||||
:value="gemeinde.name"
|
||||
>
|
||||
{{gemeinde.name}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="Ort" class="form-label col-sm-4">{{$p.t('person', 'ort')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
v-if="addressData.ort"
|
||||
type="select"
|
||||
name="ort"
|
||||
v-model="addressData.ort"
|
||||
>
|
||||
<option v-if="!orte.length" disabled>{{$p.t('ui', 'bitteGemeindeWaehlen')}}</option>
|
||||
<option
|
||||
v-for="ort in orte"
|
||||
:key="ort.ortschaftsname"
|
||||
:value="ort.ortschaftsname"
|
||||
>
|
||||
{{ort.ortschaftsname}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="heimatadresse" class="form-label col-sm-4">{{$p.t('person', 'heimatadresse')}}</label>
|
||||
<div class="col-sm-4">
|
||||
<form-input
|
||||
container-class="form-check"
|
||||
type="checkbox"
|
||||
name="heimatadresse"
|
||||
v-model="addressData.heimatadresse"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="zustelladresse" class="form-label col-sm-4">{{$p.t('person', 'zustelladresse')}}</label>
|
||||
<div class="col-sm-4">
|
||||
<form-input
|
||||
container-class="form-check"
|
||||
type="checkbox"
|
||||
name="zustelladresse"
|
||||
v-model="addressData.zustelladresse"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="co_name" class="form-label col-sm-4">{{$p.t('person', 'co_name')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="co_name"
|
||||
v-model="addressData.co_name"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="rechnungsadresse" class="form-label col-sm-4">{{$p.t('person', 'rechnungsadresse')}}</label>
|
||||
<div class="col-sm-4">
|
||||
<form-input
|
||||
container-class="form-check"
|
||||
type="checkbox"
|
||||
name="rechnungsadresse"
|
||||
v-model="addressData.rechnungsadresse"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="firma_name" class="form-label col-sm-4">{{$p.t('person', 'firma')}}</label>
|
||||
<div v-if="addressData.firmenname" class="col-sm-6">
|
||||
<input type="text" class="form-control" id="name" v-model="addressData.firmenname">
|
||||
</div>
|
||||
<div v-else class="col-sm-6">
|
||||
<PvAutoComplete v-model="addressData.firma" optionLabel="name" :suggestions="filteredFirmen" @complete="search" :min-length="3"/>
|
||||
</div>
|
||||
<div v-if="statusNew" class="row mb-3">
|
||||
<form-input
|
||||
type="autocomplete"
|
||||
:label="$p.t('person/firma')"
|
||||
name="firma_name"
|
||||
v-model="addressData.firma"
|
||||
optionLabel="name"
|
||||
:suggestions="filteredFirmen"
|
||||
@complete="search"
|
||||
:min-length="3"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div v-else class="row mb-3">
|
||||
<form-input
|
||||
v-if="addressData.firmenname"
|
||||
type="text"
|
||||
name="name"
|
||||
:label="$p.t('person/firma')"
|
||||
v-model="addressData.firmenname"
|
||||
>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-else
|
||||
type="autocomplete"
|
||||
:label="$p.t('person/firma')"
|
||||
name="firma_name"
|
||||
v-model="addressData.firma"
|
||||
optionLabel="name"
|
||||
:suggestions="filteredFirmen"
|
||||
@complete="search"
|
||||
:min-length="3"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
@@ -707,33 +531,31 @@ export default{
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="name" class="form-label col-sm-4">{{$p.t('person', 'firma_zusatz')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="firma_zusatz"
|
||||
v-model="addressData.name"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<form-input
|
||||
type="text"
|
||||
name="firma_zusatz"
|
||||
:label="$p.t('person/firma_zusatz')"
|
||||
v-model="addressData.name"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="anmerkung" class="form-label col-sm-4">{{$p.t('global', 'anmerkung')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="anmerkung"
|
||||
:label="$p.t('global/anmerkung')"
|
||||
v-model="addressData.anmerkung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
</form-form>
|
||||
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="resetModal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button ref="Close" type="button" class="btn btn-primary" @click="updateAddress(addressData.adresse_id)">OK</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button v-if="statusNew" type="button" class="btn btn-primary" @click="addNewAddress()">OK</button>
|
||||
<button v-else type="button" class="btn btn-primary" @click="updateAddress(addressData.adresse_id)">OK</button>
|
||||
</template>
|
||||
</bs-modal>
|
||||
|
||||
@@ -745,7 +567,7 @@ export default{
|
||||
</template>
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="resetModal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button ref="Close" type="button" class="btn btn-primary" @click="deleteAddress(addressData.adresse_id)">OK</button>
|
||||
<button type="button" class="btn btn-primary" @click="deleteAddress(addressData.adresse_id)">OK</button>
|
||||
</template>
|
||||
</bs-modal>
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ export default{
|
||||
layoutColumnsOnNewData: false,
|
||||
height: 'auto',
|
||||
selectable: true,
|
||||
index: 'bankverbindung_id',
|
||||
index: 'bankverbindung_id'
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
@@ -118,6 +118,7 @@ export default{
|
||||
verrechnung: true,
|
||||
typ: 'p'
|
||||
},
|
||||
statusNew: true
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -128,12 +129,13 @@ export default{
|
||||
methods:{
|
||||
actionNewBankverbindung(){
|
||||
this.resetModal();
|
||||
this.$refs.newBankverbindungModal.show();
|
||||
this.$refs.bankverbindungModal.show();
|
||||
},
|
||||
actionEditBankverbindung(bankverbindung_id){
|
||||
this.statusNew = false;
|
||||
this.loadBankverbindung(bankverbindung_id).then(() => {
|
||||
if(this.bankverbindungData.bankverbindung_id)
|
||||
this.$refs.editBankverbindungModal.show();
|
||||
this.$refs.bankverbindungModal.show();
|
||||
});
|
||||
},
|
||||
actionDeleteBankverbindung(bankverbindung_id){
|
||||
@@ -147,7 +149,7 @@ export default{
|
||||
this.bankverbindungData
|
||||
).then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.hideModal('newBankverbindungModal');
|
||||
this.hideModal('bankverbindungModal');
|
||||
this.resetModal();
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
@@ -156,6 +158,7 @@ export default{
|
||||
});
|
||||
},
|
||||
loadBankverbindung(bankverbindung_id){
|
||||
this.statusNew = false;
|
||||
return this.$fhcApi.get('api/frontend/v1/stv/kontakt/loadBankverbindung/' + bankverbindung_id)
|
||||
.then(
|
||||
result => {
|
||||
@@ -169,7 +172,7 @@ export default{
|
||||
this.bankverbindungData)
|
||||
.then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.hideModal('editBankverbindungModal');
|
||||
this.hideModal('bankverbindungModal');
|
||||
this.resetModal();
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
@@ -206,13 +209,114 @@ export default{
|
||||
this.bankverbindungData.bic = "";
|
||||
this.bankverbindungData.verrechnung = true;
|
||||
this.bankverbindungData.typ = 'p';
|
||||
|
||||
this.statusNew = true;
|
||||
},
|
||||
},
|
||||
template: `
|
||||
<div class="stv-list h-100 pt-3">
|
||||
|
||||
<!--Modal: Bankverbindung-->
|
||||
<BsModal title="Bankverbindung anlegen" ref="bankverbindungModal">
|
||||
<template #title>
|
||||
<p v-if="statusNew" class="fw-bold mt-3">{{$p.t('person', 'bankvb_new')}}</p>
|
||||
<p v-else class="fw-bold mt-3">{{$p.t('person', 'bankvb_edit')}}</p>
|
||||
</template>
|
||||
|
||||
<form-form class="row g-3" ref="bankverbindungData">
|
||||
|
||||
<div class="row my-3">
|
||||
<form-input
|
||||
type="text"
|
||||
name="name"
|
||||
label="Name"
|
||||
v-model="bankverbindungData.name"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
name="anschrift"
|
||||
:label="$p.t('person/anschrift')"
|
||||
v-model="bankverbindungData.anschrift"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
name="iban"
|
||||
label="IBAN *"
|
||||
v-model="bankverbindungData.iban"
|
||||
required
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
name="bic"
|
||||
label="BIC"
|
||||
v-model="bankverbindungData.bic"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
name="kontonr"
|
||||
:label="$p.t('person/kontonr')"
|
||||
v-model="bankverbindungData.kontonr"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
name="blz"
|
||||
:label="$p.t('person/blz')"
|
||||
v-model="bankverbindungData.blz"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="select"
|
||||
name="typ"
|
||||
:label="$p.t('global/typ')"
|
||||
v-model="bankverbindungData.typ"
|
||||
required
|
||||
>
|
||||
<option value="p">{{$p.t('person', 'privatkonto')}}</option>
|
||||
<option value="f">{{$p.t('person', 'firmenkonto')}}</option>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
container-class="form-check"
|
||||
type="checkbox"
|
||||
name="verrechnung"
|
||||
:label="$p.t('person/verrechnung')"
|
||||
v-model="bankverbindungData.verrechnung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</form-form>
|
||||
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button v-if="statusNew" type="button" class="btn btn-primary" @click="addNewBankverbindung()">OK</button>
|
||||
<button v-else type="button" class="btn btn-primary" @click="updateBankverbindung(bankverbindungData.bankverbindung_id)">OK</button>
|
||||
</template>
|
||||
|
||||
</BsModal>
|
||||
|
||||
<!--Modal: Add Bankverbindung-->
|
||||
<BsModal title="Bankverbindung anlegen" ref="newBankverbindungModal">
|
||||
<!-- <BsModal title="Bankverbindung anlegen" ref="newBankverbindungModal">
|
||||
|
||||
<template #title>{{$p.t('person', 'bankvb_new')}}</template>
|
||||
<form-form class="row g-3" ref="bankverbindungData">
|
||||
@@ -315,10 +419,10 @@ export default{
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button type="button" class="btn btn-primary" @click="addNewBankverbindung()">OK</button>
|
||||
</template>
|
||||
</BsModal>
|
||||
</BsModal>-->
|
||||
|
||||
<!--Modal: Edit Bankverbindung-->
|
||||
<BsModal ref="editBankverbindungModal">
|
||||
<!-- <BsModal ref="editBankverbindungModal">
|
||||
<template #title>{{$p.t('person', 'bankvb_edit')}}</template>
|
||||
<form-form class="row g-3" ref="bankverbindungData">
|
||||
|
||||
@@ -420,7 +524,7 @@ export default{
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="resetModal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button ref="Close" type="button" class="btn btn-primary" @click="updateBankverbindung(bankverbindungData.bankverbindung_id)">OK</button>
|
||||
</template>
|
||||
</BsModal>
|
||||
</BsModal>-->
|
||||
|
||||
<!--Modal: Delete Bankverbindung-->
|
||||
<BsModal ref="deleteBankverbindungModal">
|
||||
|
||||
@@ -35,7 +35,8 @@ export default{
|
||||
}
|
||||
},
|
||||
{title:"Anmerkung", field:"anmerkung"},
|
||||
{title:"Firma", field:"kurzbz", visible:false},
|
||||
{title:"Firma", field:"name", visible:false},
|
||||
{title:"Standort", field:"bezeichnung", visible:false},
|
||||
{title:"Firma_id", field:"firma_id", visible:false},
|
||||
{title:"Person_id", field:"person_id", visible:false},
|
||||
{title:"Kontakt_id", field:"kontakt_id", visible:false},
|
||||
@@ -94,43 +95,53 @@ export default{
|
||||
cm.getColumnByField('anmerkung').component.updateDefinition({
|
||||
title: this.$p.t('global', 'anmerkung')
|
||||
});
|
||||
cm.getColumnByField('kurzbz').component.updateDefinition({
|
||||
title: this.$p.t('person', 'firma')
|
||||
});
|
||||
|
||||
cm.getColumnByField('lastupdate').component.updateDefinition({
|
||||
title: this.$p.t('notiz', 'letzte_aenderung')
|
||||
});
|
||||
}
|
||||
}
|
||||
cm.getColumnByField('name').component.updateDefinition({
|
||||
title: this.$p.t('person', 'firma')
|
||||
});
|
||||
cm.getColumnByField('bezeichnung').component.updateDefinition({
|
||||
title: this.$p.t('person', 'standort')
|
||||
});
|
||||
}}
|
||||
],
|
||||
lastSelected: null,
|
||||
contactData: {
|
||||
zustellung: true,
|
||||
kontakttyp: 'email'
|
||||
},
|
||||
initData: {
|
||||
zustellung: true,
|
||||
kontakttyp: 'email'
|
||||
kontakttyp: 'email',
|
||||
firma_id: null
|
||||
},
|
||||
statusNew: true,
|
||||
kontakttypen: [],
|
||||
standorte: [],
|
||||
selectedStandort: null,
|
||||
filteredStandorte: null
|
||||
firmen: [],
|
||||
filteredFirmen: [],
|
||||
filteredOrte: null,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
uid(){
|
||||
uid() {
|
||||
this.$refs.table.tabulator.setData('api/frontend/v1/stv/Kontakt/getKontakte/' + this.uid);
|
||||
},
|
||||
contactData: {
|
||||
handler(newVal) {
|
||||
if (newVal.firma && newVal.firma.firma_id !== null && typeof newVal.firma.firma_id !== 'undefined') {
|
||||
this.loadStandorte(this.contactData.firma.firma_id);
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
actionNewContact(){
|
||||
this.resetModal();
|
||||
this.$refs.newContactModal.show();
|
||||
this.$refs.contactModal.show();
|
||||
},
|
||||
actionEditContact(contact_id){
|
||||
this.statusNew = false;
|
||||
this.loadContact(contact_id);
|
||||
this.$refs.editContactModal.show();
|
||||
this.$refs.contactModal.show();
|
||||
},
|
||||
actionDeleteContact(contact_id){
|
||||
this.loadContact(contact_id);
|
||||
@@ -141,7 +152,7 @@ export default{
|
||||
this.contactData)
|
||||
.then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.hideModal("newContactModal");
|
||||
this.hideModal("contactModal");
|
||||
this.resetModal();
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
@@ -150,6 +161,9 @@ export default{
|
||||
});
|
||||
},
|
||||
loadContact(contact_id){
|
||||
this.statusNew = false;
|
||||
if(this.contactData.firma_id)
|
||||
this.loadStandorte(this.contactData.firma_id);
|
||||
return this.$fhcApi.get('api/frontend/v1/stv/kontakt/loadContact/' + contact_id)
|
||||
.then(
|
||||
result => {
|
||||
@@ -176,7 +190,7 @@ export default{
|
||||
this.contactData).
|
||||
then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.hideModal('editContactModal');
|
||||
this.hideModal('contactModal');
|
||||
this.resetModal();
|
||||
this.reload();
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
@@ -185,22 +199,39 @@ export default{
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
|
||||
hideModal(modalRef){
|
||||
this.$refs[modalRef].hide();
|
||||
},
|
||||
reload(){
|
||||
this.$refs.table.reloadTable();
|
||||
},
|
||||
search(event) {
|
||||
searchFirma(event) {
|
||||
return this.$fhcApi
|
||||
.get('api/frontend/v1/stv/kontakt/getStandorte/' + event.query)
|
||||
.then(result => {
|
||||
this.filteredStandorte = result.data.retval;
|
||||
.get('api/frontend/v1/stv/kontakt/getFirmen/' + event.query)
|
||||
.then(result => {
|
||||
this.filteredFirmen = result.data.retval;
|
||||
});
|
||||
},
|
||||
loadStandorte(firmen_id) {
|
||||
return this.$fhcApi
|
||||
.get('api/frontend/v1/stv/kontakt/getStandorteByFirma/' + firmen_id)
|
||||
.then(result => {
|
||||
this.filteredOrte = result.data;
|
||||
});
|
||||
},
|
||||
resetModal(){
|
||||
this.contactData = {};
|
||||
this.contactData = this.initData;
|
||||
this.contactData.zustellung = true;
|
||||
this.contactData.kontakttyp = 'email';
|
||||
this.contactData.kontakt = '';
|
||||
this.contactData.anmerkung = null;
|
||||
this.contactData.firma_id = null;
|
||||
this.contactData.name = null;
|
||||
this.contactData.standort_id = null;
|
||||
this.contactData.bezeichnung = null;
|
||||
|
||||
this.statusNew = true;
|
||||
},
|
||||
},
|
||||
created(){
|
||||
@@ -213,159 +244,140 @@ export default{
|
||||
},
|
||||
template: `
|
||||
<div class="stv-list h-100 pt-3">
|
||||
|
||||
<!--Modal: new Contact-->
|
||||
<BsModal ref="newContactModal">
|
||||
<template #title>{{$p.t('person', 'kontakt_new')}}</template>
|
||||
|
||||
<!--Modal: contactModal-->
|
||||
<BsModal ref="contactModal">
|
||||
<template #title>
|
||||
<p v-if="statusNew" class="fw-bold mt-3">{{$p.t('person', 'kontakt_new')}}</p>
|
||||
<p v-else class="fw-bold mt-3">{{$p.t('person', 'kontakt_edit')}}</p>
|
||||
</template>
|
||||
|
||||
<form-form class="row g-3" ref="contactData">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="kontakttyp" class="form-label col-sm-4">{{$p.t('global', 'typ')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="select"
|
||||
name="typ"
|
||||
v-model="contactData.kontakttyp">
|
||||
>
|
||||
<option value="">keine Auswahl</option>
|
||||
<option v-for="typ in kontakttypen" :key="typ.kontakttyp_kurzbz" :value="typ.kontakttyp" >{{typ.kontakttyp}}</option>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="kontakt" class="form-label col-sm-4">{{$p.t('global', 'kontakt')}}<sup>*</sup></label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="kontakt"
|
||||
v-model="contactData.kontakt">
|
||||
required
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="anmerkung" class="form-label col-sm-4">{{$p.t('global', 'anmerkung')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="anmerkung"
|
||||
v-model="contactData.anmerkung">
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="zustellung" class="form-label col-sm-4">{{$p.t('person', 'zustellung')}}</label>
|
||||
<div class="col-sm-4">
|
||||
<form-input
|
||||
container-class="form-check"
|
||||
type="checkbox"
|
||||
name="zustellung"
|
||||
v-model="contactData.zustellung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="firma_name" class="form-label col-sm-4">{{$p.t('person', 'firma')}} / {{$p.t('person', 'standort')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<PvAutoComplete v-model="contactData['standort']" optionLabel="kurzbz" :suggestions="filteredStandorte" @complete="search" :min-length="3"/>
|
||||
</div>
|
||||
</div>
|
||||
</form-form>
|
||||
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button type="button" class="btn btn-primary" @click="addNewContact()">OK</button>
|
||||
</template>
|
||||
</BsModal>
|
||||
|
||||
<!--Modal: Edit Contact-->
|
||||
<BsModal ref="editContactModal">
|
||||
|
||||
<template #title>{{$p.t('person', 'kontakt_edit')}}</template>
|
||||
|
||||
<form-form class="row g-3" ref="contactData">
|
||||
<div class="row mb-3">
|
||||
<label for="kontakttyp" class="form-label col-sm-4">{{$p.t('global', 'typ')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<select id="kontakttyp" class="form-control" v-model="contactData.kontakttyp">
|
||||
<option value="">-- keine Auswahl --</option>
|
||||
<option v-for="typ in kontakttypen" :key="typ.kontakttyp_kurzbz" :value="typ.kontakttyp" >{{typ.kontakttyp}}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="row my-3">
|
||||
|
||||
<form-input
|
||||
type="select"
|
||||
name="typ"
|
||||
:label="$p.t('global/typ')"
|
||||
v-model="contactData.kontakttyp">
|
||||
>
|
||||
<option value="">keine Auswahl</option>
|
||||
<option v-for="typ in kontakttypen" :key="typ.kontakttyp_kurzbz" :value="typ.kontakttyp" >{{typ.kontakttyp}}</option>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
name="kontakt"
|
||||
:label="$p.t('global/kontakt')+ ' *'"
|
||||
v-model="contactData.kontakt">
|
||||
required
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="kontakt" class="form-label col-sm-4">{{$p.t('global', 'kontakt')}}<sup>*</sup></label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="kontakt"
|
||||
v-model="contactData.kontakt">
|
||||
required
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="anmerkung" class="form-label col-sm-4">{{$p.t('global', 'anmerkung')}}</label>
|
||||
<div class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="anmerkung"
|
||||
v-model="contactData.anmerkung">
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<form-input
|
||||
type="text"
|
||||
name="anmerkung"
|
||||
:label="$p.t('global/anmerkung')"
|
||||
v-model="contactData.anmerkung">
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="zustellung" class="form-label col-sm-4">{{$p.t('person', 'zustellung')}}</label>
|
||||
<div class="col-sm-4">
|
||||
<form-input
|
||||
container-class="form-check"
|
||||
type="checkbox"
|
||||
name="zustellung"
|
||||
:label="$p.t('person/zustellung')"
|
||||
v-model="contactData.zustellung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<input type="hidden" class="form-control" id="standort_id" v-model="contactData.standort_id">
|
||||
<div v-if="statusNew" class="row mb-3">
|
||||
<form-input
|
||||
type="autocomplete"
|
||||
:label="$p.t('person/firma')"
|
||||
name="firma_name"
|
||||
v-model="contactData.firma"
|
||||
optionLabel="name"
|
||||
:suggestions="filteredFirmen"
|
||||
@complete="searchFirma"
|
||||
:min-length="3"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div v-else class="row mb-3">
|
||||
<form-input
|
||||
v-if="contactData.name"
|
||||
type="text"
|
||||
name="name"
|
||||
:label="$p.t('person/firma')"
|
||||
v-model="contactData.name"
|
||||
>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-else
|
||||
type="autocomplete"
|
||||
:label="$p.t('person/firma')"
|
||||
name="firma_name"
|
||||
v-model="contactData.firma"
|
||||
optionLabel="name"
|
||||
:suggestions="filteredFirmen"
|
||||
@complete="searchFirma"
|
||||
:min-length="3"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="standort" class="form-label col-sm-4">{{$p.t('person', 'firma')}} / {{$p.t('person', 'standort')}}</label>
|
||||
<div v-if="contactData.kurzbz" class="col-sm-6">
|
||||
<form-input
|
||||
type="text"
|
||||
name="name"
|
||||
v-model="contactData.kurzbz"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div v-else class="col-sm-3">
|
||||
<PvAutoComplete v-model="contactData['standort']" optionLabel="kurzbz" :suggestions="filteredStandorte" @complete="search" :min-length="3"/>
|
||||
</div>
|
||||
</div>
|
||||
</form-form>
|
||||
<input type="hidden" class="form-control" id="firma_id" v-model="contactData.firma_id">
|
||||
|
||||
<input type="hidden" class="form-control" id="standort_id" v-model="contactData.standort_id">
|
||||
|
||||
<div class="row mb-3" v-if="contactData.standort_id || filteredOrte">
|
||||
<form-input
|
||||
v-if="contactData.name"
|
||||
type="text"
|
||||
name="name"
|
||||
:label="$p.t('person/firma') + ' / ' + $p.t('person/standort')"
|
||||
v-model="contactData.bezeichnung"
|
||||
>
|
||||
</form-input>
|
||||
<form-input
|
||||
v-else
|
||||
type="select"
|
||||
name="ort"
|
||||
:label="$p.t('person/standort')"
|
||||
v-model="contactData.standort_id"
|
||||
>
|
||||
<option v-if="filteredOrte" disabled>{{$p.t('ui', 'bitteStandortWaehlen')}}</option>
|
||||
<option
|
||||
v-for="ort in filteredOrte"
|
||||
:key="ort.standort_id"
|
||||
:value="ort.standort_id"
|
||||
>
|
||||
{{ort.bezeichnung}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
</form-form>
|
||||
|
||||
<template #footer>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="resetModal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button type="button" class="btn btn-primary" @click="updateContact(contactData.kontakt_id)">OK</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button v-if="statusNew" type="button" class="btn btn-primary" @click="addNewContact()">OK</button>
|
||||
<button v-else type="button" class="btn btn-primary" @click="updateContact(contactData.kontakt_id)">OK</button>
|
||||
</template>
|
||||
</BsModal>
|
||||
|
||||
|
||||
<!--Modal: Delete Contact-->
|
||||
<BsModal ref="deleteContactModal">
|
||||
<template #title>{{$p.t('person', 'kontakt_delete')}}</template>
|
||||
|
||||
@@ -28162,6 +28162,26 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'bitteStandortWaehlen',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Bitte Standort wählen',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Please select location',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user