mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Autocomplete Feld Mitarbeiter für Bearbeiterlogik
This commit is contained in:
@@ -48,6 +48,7 @@ class Notiz extends FHC_Controller
|
||||
$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) ?: []);
|
||||
@@ -60,7 +61,10 @@ class Notiz extends FHC_Controller
|
||||
|
||||
public function addNewNotiz($id)
|
||||
{
|
||||
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
|
||||
$this->load->library('DmsLib');
|
||||
|
||||
//$this->load->library('form_validation');
|
||||
//$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
|
||||
@@ -69,52 +73,14 @@ class Notiz extends FHC_Controller
|
||||
/* $this->form_validation->set_rules('titel', 'titel', 'required');
|
||||
$this->form_validation->set_rules('text', 'Text', 'required');*/
|
||||
|
||||
//TODO(Manu) form validation - schon für type hier?,
|
||||
|
||||
//Speichern der Files
|
||||
$this->load->library('DmsLib');
|
||||
$uid = getAuthUID();
|
||||
|
||||
//multiple files
|
||||
$dms_id_arr = [];
|
||||
$notiz_id = null;
|
||||
foreach ($_FILES as $k => $file)
|
||||
{
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'notiz',
|
||||
'version' => 0,
|
||||
'name' => $file["name"],
|
||||
'mimetype' => $file["type"],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid
|
||||
);
|
||||
|
||||
$result = $this->dmslib->upload($dms, $k, array('pdf'));
|
||||
|
||||
if (isSuccess($result))
|
||||
{
|
||||
$dms_id_arr[] = $result->retval['dms_id'];
|
||||
}
|
||||
/* else {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
|
||||
//TODO(manu) error handling
|
||||
//feedback, dass ein File nicht erfolgreich gespeichert werden konnte
|
||||
//$this->outputJson($result);
|
||||
//$this->outputJsonError(['filetype nicht erlaubt' => getError($result)]);
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Speichern der Notiz mit Notizzuordnung
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
//TODO(Manu) form validation - schon für type hier?
|
||||
|
||||
//Speichern der Notiz und Notizzuordnung
|
||||
$uid = getAuthUID();
|
||||
$verfasser_uid = isset($_POST['verfasser_uid']) ? $_POST['verfasser_uid'] : $uid;
|
||||
$titel = $this->input->post('titel');
|
||||
$text = $this->input->post('text');
|
||||
$bearbeiter_uid = $this->input->post('bearbeiter_uid');
|
||||
$bearbeiter_uid = $this->input->post('bearbeiter');
|
||||
$erledigt = $this->input->post('erledigt');
|
||||
$type = $this->input->post('typeId');
|
||||
|
||||
@@ -130,21 +96,33 @@ class Notiz extends FHC_Controller
|
||||
}
|
||||
$notiz_id = $result->retval;
|
||||
|
||||
//Zuordnung speichern
|
||||
/* $result = $this->NotizzuordnungModel->insert(array('notiz_id' => $notiz_id, $type=> $id));
|
||||
if (isError($result))
|
||||
//Speichern der Files
|
||||
$dms_id_arr = [];
|
||||
foreach ($_FILES as $k => $file)
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}*/
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'notiz',
|
||||
'version' => 0,
|
||||
'name' => $file["name"],
|
||||
'mimetype' => $file["type"],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid
|
||||
);
|
||||
|
||||
$result = $this->dmslib->upload($dms, $k, array('pdf'));
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$dms_id_arr[] = $result->retval['dms_id'];
|
||||
}
|
||||
|
||||
//Eintrag in Notizdokument speichern
|
||||
if($dms_id_arr)
|
||||
{
|
||||
// Loads model Notizdokument_model
|
||||
$this->load->model('person/Notizdokument_model', 'NotizdokumentModel');
|
||||
//Todo(manu) change for multiple files
|
||||
foreach($dms_id_arr as $dms_id)
|
||||
{
|
||||
$result = $this->NotizdokumentModel->insert(array('notiz_id' => $notiz_id, 'dms_id' => $dms_id));
|
||||
@@ -154,17 +132,8 @@ class Notiz extends FHC_Controller
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//$result = $this->NotizModel->addNotizForType($type, $id, $titel, $text, $uid, $dms_id, $start, $ende, $erledigt, $verfasser_uid, $bearbeiter_uid);
|
||||
/*
|
||||
$result = $this->NotizModel->addNotizForPerson($id, $titel, $text, $erledigt, $verfasser_uid);
|
||||
if (isError($result))
|
||||
{
|
||||
//$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}*/
|
||||
return $this->outputJsonSuccess(true);
|
||||
}
|
||||
|
||||
@@ -228,8 +197,15 @@ class Notiz extends FHC_Controller
|
||||
|
||||
public function updateNotiz($notiz_id)
|
||||
{
|
||||
$uid = getAuthUID();
|
||||
var_dump("in function updateNotiz " . $notiz_id);
|
||||
//Loads Libraries
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('DmsLib');
|
||||
|
||||
// Loads models
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->load->model('person/Notizdokument_model', 'NotizdokumentModel');
|
||||
|
||||
//$_POST = json_decode($this->input->raw_input_stream, true);
|
||||
/* $this->form_validation->set_rules('titel', 'titel', 'required');
|
||||
$this->form_validation->set_rules('text', 'Text', 'required');
|
||||
@@ -239,25 +215,22 @@ class Notiz extends FHC_Controller
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}*/
|
||||
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
|
||||
if(!$notiz_id)
|
||||
{
|
||||
return $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
//update Notiz
|
||||
$uid = getAuthUID();
|
||||
$titel = $this->input->post('titel');
|
||||
$text = $this->input->post('text');
|
||||
$verfasser_uid = isset($_POST['verfasser_uid']) ? $_POST['verfasser_uid'] : null;
|
||||
$bearbeiter_uid = $uid;
|
||||
$bearbeiter_uid = isset($_POST['bearbeiter']) ? $_POST['bearbeiter'] : $uid;
|
||||
$erledigt = $this->input->post('erledigt');
|
||||
$type = $this->input->post('typeId');
|
||||
$start = $this->input->post(date('von'));
|
||||
$ende = $this->input->post(date('bis'));
|
||||
|
||||
|
||||
|
||||
$result = $this->NotizModel->update(
|
||||
[
|
||||
'notiz_id' => $notiz_id
|
||||
@@ -274,12 +247,40 @@ class Notiz extends FHC_Controller
|
||||
'erledigt' => $erledigt
|
||||
]
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
//neue Files speichern
|
||||
//Todo(manu) check, welche files neu sind..
|
||||
foreach ($_FILES as $k => $file)
|
||||
{
|
||||
$dms = array(
|
||||
'kategorie_kurzbz' => 'notiz',
|
||||
'version' => 0,
|
||||
'name' => $file["name"],
|
||||
'mimetype' => $file["type"],
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => $uid
|
||||
);
|
||||
|
||||
$result = $this->dmslib->upload($dms, $k, array('pdf'));
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$dms_id = $result->retval['dms_id'];
|
||||
|
||||
$result = $this->NotizdokumentModel->insert(array('notiz_id' => $notiz_id, 'dms_id' => $dms_id));
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
}
|
||||
return $this->outputJsonSuccess(true);
|
||||
}
|
||||
|
||||
@@ -374,4 +375,15 @@ class Notiz extends FHC_Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function getMitarbeiter($searchString)
|
||||
{
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$result = $this->MitarbeiterModel->searchMitarbeiter($searchString);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -202,4 +202,26 @@ class Mitarbeiter_model extends DB_Model
|
||||
}
|
||||
return success($kurzbz);
|
||||
}
|
||||
|
||||
public function searchMitarbeiter($filter)
|
||||
{
|
||||
$filter = strtoLower($filter);
|
||||
$qry = "
|
||||
SELECT
|
||||
ma.mitarbeiter_uid, CONCAT(p.nachname, ' ', p.vorname, ' (', ma.mitarbeiter_uid , ')') as mitarbeiter
|
||||
FROM
|
||||
public.tbl_mitarbeiter ma
|
||||
JOIN
|
||||
public.tbl_benutzer b on (ma.mitarbeiter_uid = b.uid)
|
||||
JOIN
|
||||
public.tbl_person p on (p.person_id = b.person_id)
|
||||
WHERE
|
||||
lower (p.nachname) LIKE '%". $this->db->escape_like_str($filter)."%'
|
||||
OR
|
||||
lower (p.vorname) LIKE '%". $this->db->escape_like_str($filter)."%'
|
||||
OR
|
||||
(ma.mitarbeiter_uid) LIKE '%". $this->db->escape_like_str($filter)."%'";
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
<span>
|
||||
<ul>
|
||||
<li v-for="(datei,index) in dateien">
|
||||
<button>{{datei.name}}</button><button class="text-danger" @click="deleteFile(index)">X</button>
|
||||
<button>{{datei.name}}</button><button class="text-danger" @click="deleteFile(index)"><i class="fa fa-remove"></i></button>
|
||||
</li>
|
||||
</ul>
|
||||
</span>
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import VueDatePicker from '../vueDatepicker.js.php';
|
||||
import PvAutoComplete from "../../../../index.ci.php/public/js/components/primevue/autocomplete/autocomplete.esm.min.js";
|
||||
import File from '../Form/Upload/File.js';
|
||||
import {CoreRESTClient} from "../../RESTClient";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
VueDatePicker,
|
||||
File
|
||||
File,
|
||||
PvAutoComplete
|
||||
},
|
||||
props: [
|
||||
'typeId',
|
||||
@@ -12,7 +15,7 @@ export default {
|
||||
'text',
|
||||
'von',
|
||||
'bis',
|
||||
'action',
|
||||
'statusNew',
|
||||
'document',
|
||||
'erledigt',
|
||||
'verfasser',
|
||||
@@ -23,7 +26,10 @@ export default {
|
||||
],
|
||||
data(){
|
||||
return {
|
||||
multiupload: true
|
||||
multiupload: true,
|
||||
mitarbeiter: [],
|
||||
filteredMitarbeiter: [],
|
||||
filteredFirmen: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -90,7 +96,12 @@ export default {
|
||||
return this.bearbeiter;
|
||||
},
|
||||
set(value) {
|
||||
this.$emit('update:bearbeiter', value);
|
||||
if(value)
|
||||
{
|
||||
this.$emit('update:bearbeiter', value.mitarbeiter_uid);
|
||||
}
|
||||
else
|
||||
this.$emit('update:bearbeiter', value);
|
||||
}
|
||||
},
|
||||
intAnhang: {
|
||||
@@ -109,11 +120,19 @@ export default {
|
||||
this.intAnhang = null;
|
||||
//this.$emit('update:anhang', []);
|
||||
},
|
||||
|
||||
search(event) {
|
||||
return CoreRESTClient
|
||||
.get('components/stv/Notiz/getMitarbeiter/' + event.query)
|
||||
.then(result => {
|
||||
//console.log(result);
|
||||
this.filteredMitarbeiter = CoreRESTClient.getData(result.data);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
template: `
|
||||
<div class="notiz-notiz">
|
||||
<!-- {{this.intAnhang}}-->
|
||||
<span v-for="(anhang,index) in intAnhang"> {{anhang.name}} {{index}}<br></span>
|
||||
<form ref="form" @submit.prevent class="row">
|
||||
<div>
|
||||
@@ -156,9 +175,9 @@ export default {
|
||||
</div>
|
||||
|
||||
<div v-if="showErweitert">
|
||||
<slot name="erweitert">
|
||||
<!-- <slot name="erweitert"> -->
|
||||
|
||||
<!-- <div class="row mb-3">
|
||||
<div class="row mb-3">
|
||||
<label for="bis" class="form-label col-sm-2">VerfasserIn</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" v-model="intVerfasser" class="form-control">
|
||||
@@ -169,10 +188,12 @@ export default {
|
||||
<div class="row mb-3">
|
||||
<label for="bis" class="form-label col-sm-2">BearbeiterIn</label>
|
||||
<div class="col-sm-7">
|
||||
<input type="text" v-model="intBearbeiter" class="form-control">
|
||||
<PvAutoComplete v-model="intBearbeiter" optionLabel="mitarbeiter" :suggestions="filteredMitarbeiter" @complete="search" minLength="3"/>
|
||||
<!-- <input type="text" v-model="intBearbeiter" class="form-control"> -->
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="von" class="form-label col-sm-2">von</label>
|
||||
<div class="col-sm-2">
|
||||
@@ -203,7 +224,7 @@ export default {
|
||||
<input type="checkbox" v-model="intErledigt">
|
||||
</div>
|
||||
</div>
|
||||
</slot>
|
||||
<!-- </slot>-->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export default {
|
||||
CoreRESTClient,
|
||||
CoreFilterCmpt,
|
||||
Notiz,
|
||||
BsModal,
|
||||
BsModal
|
||||
},
|
||||
props: {
|
||||
modelValue: Object
|
||||
@@ -32,7 +32,7 @@ export default {
|
||||
{title: "BearbeiterIn", field: "bearbeiter_uid", visible: false},
|
||||
{title: "Start", field: "start", visible: false},
|
||||
{title: "Ende", field: "ende", visible: false},
|
||||
/* {title: "Dokumente", field: "dms_id"},*/
|
||||
/* {title: "Dokumente", field: "dms_id"},*/
|
||||
{title: "Dokumente", field: "countdoc"},
|
||||
{title: "Erledigt", field: "erledigt"},
|
||||
{title: "Notiz_id", field: "notiz_id", visible: false},
|
||||
@@ -58,10 +58,11 @@ export default {
|
||||
},
|
||||
tabulatorEvents: [],
|
||||
notizen: [],
|
||||
filteredMitarbeiter: [],
|
||||
formData: {
|
||||
typeId: 'person_id',
|
||||
titel: null,
|
||||
action: 'Neue Notiz',
|
||||
statusNew: true,
|
||||
text: null,
|
||||
von: null,
|
||||
bis: null,
|
||||
@@ -73,7 +74,6 @@ export default {
|
||||
},
|
||||
showErweitert: true,
|
||||
showDocument: true,
|
||||
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
@@ -88,7 +88,7 @@ export default {
|
||||
this.loadNotiz(notiz_id).then(() => {
|
||||
if(this.notizen.notiz_id) {
|
||||
this.formData.titel = this.notizen.titel;
|
||||
this.formData.action = 'Notiz bearbeiten';
|
||||
this.formData.statusNew = false;
|
||||
this.formData.text = this.notizen.text;
|
||||
this.formData.von = this.notizen.start;
|
||||
this.formData.bis = this.notizen.ende;
|
||||
@@ -96,19 +96,22 @@ export default {
|
||||
this.formData.erledigt = this.notizen.erledigt;
|
||||
this.formData.verfasser = this.notizen.verfasser_uid;
|
||||
this.formData.bearbeiter = this.notizen.bearbeiter_uid;
|
||||
this.formData.anhang = this.notizen.anhang;
|
||||
if(this.notizen.dms_id){
|
||||
console.log("loadEntries");
|
||||
this.loadDocEntries(this.notizen.notiz_id);
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
if(this.notizen.dms_id){
|
||||
console.log("loadEntries with " + this.notizen.notiz_id);
|
||||
this.loadDocEntries(this.notizen.notiz_id);
|
||||
//console.log(this.formData.anhang);
|
||||
}
|
||||
})
|
||||
;
|
||||
},
|
||||
actionNewNotiz(){
|
||||
this.resetFormData();
|
||||
this.formData.typeId = 'person_id';
|
||||
this.formData.titel = '';
|
||||
this.formData.action = 'Neue Notiz';
|
||||
this.formData.statusNew = false;
|
||||
this.formData.text = null;
|
||||
this.formData.von = null;
|
||||
this.formData.bis = null;
|
||||
@@ -119,13 +122,13 @@ export default {
|
||||
this.formData.anhang = [];
|
||||
},
|
||||
addNewNotiz(notizData) {
|
||||
/* console.log("here: anhang noch empty");
|
||||
console.log(this.formData);*/
|
||||
/* console.log("here: anhang noch empty");
|
||||
console.log(this.formData);*/
|
||||
|
||||
const formData = new FormData();
|
||||
|
||||
//working with single files
|
||||
// Object.entries(this.formData).forEach(([k, v]) => formData.append(k, v));
|
||||
// Object.entries(this.formData).forEach(([k, v]) => formData.append(k, v));
|
||||
|
||||
//multiple files
|
||||
//console.log(this.formData.anhang);
|
||||
@@ -134,9 +137,9 @@ export default {
|
||||
formData.append(k, v);
|
||||
});
|
||||
Object.entries(this.formData.anhang).forEach(([k, v]) => formData.append(k, v));
|
||||
|
||||
/*
|
||||
console.log(this.formData);
|
||||
console.log(formData);
|
||||
console.log(formData);*/
|
||||
|
||||
CoreRESTClient.post('components/stv/Notiz/addNewNotiz/' + this.modelValue.person_id,
|
||||
formData,
|
||||
@@ -179,9 +182,11 @@ export default {
|
||||
return CoreRESTClient.get('components/stv/Notiz/loadDokumente/' + notiz_id)
|
||||
.then(
|
||||
result => {
|
||||
console.log(result.data);
|
||||
if(result.data.retval)
|
||||
//console.log(result.data);
|
||||
if(result.data.retval) {
|
||||
this.formData.anhang = result.data.retval;
|
||||
console.log(this.formData.anhang);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.formData.anhang = {};
|
||||
@@ -197,7 +202,7 @@ export default {
|
||||
result => {
|
||||
if(result.data.retval) {
|
||||
this.notizen = result.data.retval;
|
||||
|
||||
console.log(this.notizen);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -216,55 +221,59 @@ export default {
|
||||
//sicherstellen, dass über props nur leere felder übergeben werden
|
||||
this.formData = {
|
||||
typeId: 'person_id',
|
||||
titel: null,
|
||||
action: 'Neue Notiz',
|
||||
text: null,
|
||||
von: null,
|
||||
bis: null,
|
||||
document: null,
|
||||
erledigt: false,
|
||||
verfasser: null,
|
||||
bearbeiter: null,
|
||||
anhang: []
|
||||
titel: null,
|
||||
statusNew: true,
|
||||
text: null,
|
||||
von: null,
|
||||
bis: null,
|
||||
document: null,
|
||||
erledigt: false,
|
||||
verfasser: null,
|
||||
bearbeiter: null,
|
||||
anhang: []
|
||||
};
|
||||
},
|
||||
/* updateNotiz(notiz_id){
|
||||
CoreRESTClient.post('components/stv/Notiz/updateNotiz/' + notiz_id,
|
||||
this.formData
|
||||
).then(response => {
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Update erfolgreich');
|
||||
this.resetFormData();
|
||||
this.reload();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
const [key, value] = entry;
|
||||
this.$fhcAlert.alertError(value);
|
||||
/* updateNotiz(notiz_id){
|
||||
CoreRESTClient.post('components/stv/Notiz/updateNotiz/' + notiz_id,
|
||||
this.formData
|
||||
).then(response => {
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Update erfolgreich');
|
||||
this.resetFormData();
|
||||
this.reload();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
const [key, value] = entry;
|
||||
this.$fhcAlert.alertError(value);
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
this.statusMsg = 'Error in Catch';
|
||||
this.$fhcAlert.alertError('Fehler bei Updateroutine aufgetreten');
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
//this.reload();
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
this.statusMsg = 'Error in Catch';
|
||||
this.$fhcAlert.alertError('Fehler bei Updateroutine aufgetreten');
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
//this.reload();
|
||||
});
|
||||
},*/
|
||||
},*/
|
||||
updateNotiz(notiz_id){
|
||||
const formData = new FormData();
|
||||
|
||||
|
||||
Object.entries(this.formData).forEach(([k, v]) => {
|
||||
if(k!= 'anhang')
|
||||
formData.append(k, v);
|
||||
});
|
||||
Object.entries(this.formData.anhang).forEach(([k, v]) => formData.append(k, v));
|
||||
console.log(this.formData);
|
||||
|
||||
//warum geht das nicht analog? wie kann titel = null sein?
|
||||
CoreRESTClient.post('components/stv/Notiz/updateNotiz/' + notiz_id,
|
||||
formData,
|
||||
{ Headers: { "Content-Type": "multipart/form-data" } }
|
||||
).then(response => {
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Update von neuer Notiz erfolgreich');
|
||||
this.$fhcAlert.alertSuccess('Update von Notiz erfolgreich');
|
||||
this.resetFormData();
|
||||
this.reload();
|
||||
} else {
|
||||
@@ -318,7 +327,7 @@ export default {
|
||||
v-model:typeId="formData.typeId"
|
||||
v-model:titel="formData.titel"
|
||||
v-model:text="formData.text"
|
||||
v-model:action="formData.action"
|
||||
v-model:statusNew="formData.statusNew"
|
||||
v-model:von="formData.von"
|
||||
v-model:bis="formData.bis"
|
||||
v-model:document="formData.document"
|
||||
@@ -329,11 +338,12 @@ export default {
|
||||
>
|
||||
</Notiz>
|
||||
|
||||
<button v-if="formData.action === 'Neue Notiz'" type="button" class="btn btn-primary" @click="addNewNotiz()"> Neu anlegen </button>
|
||||
<button v-if="formData.statusNew" type="button" class="btn btn-primary" @click="addNewNotiz()"> Neu anlegen </button>
|
||||
<button v-else type="button" class="btn btn-primary" @click="updateNotiz(notizen.notiz_id)"> Speichern </button>
|
||||
|
||||
|
||||
<div>
|
||||
parent: {{formData.bearbeiter}}
|
||||
<!-- Parent: {{formData.title}} {{formData.anhang}} || {{formData.anhang.name}}
|
||||
<span v-for="(anhang,index) in formData.anhang"> {{anhang.name}} {{index}}<br></span> ref: {{formData.ref}}-->
|
||||
<!-- PARENT: {{formData.anhang}} {{formData.typeId}} | single: {{formData.anhang.name}} , multi: {{formData.anhang}} <span v-for="(anhang,index) in formData.anhang"> {{anhang.name}} {{index}}<br></span> ref: {{formData.ref}}-->
|
||||
|
||||
Reference in New Issue
Block a user