From eb76007da186726a0a807fae5a3a4115d300ea35 Mon Sep 17 00:00:00 2001 From: DwCay Date: Tue, 2 May 2023 19:14:36 +0300 Subject: [PATCH] =?UTF-8?q?WIP=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B8=D1=82=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9=20=D0=B8=D0=BD=D1=84=D0=BE=D1=80?= =?UTF-8?q?=D0=BC=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/base/BaseInput.vue | 6 +- .../ConfidantForms/ConfidantForm.vue | 23 +++--- .../components/MedicalConfidantWrapper.vue | 14 +++- .../newMedicalCard/utils/gettersObjects.js | 3 +- src/shared/utils/wrapperRequestChangeData.js | 78 ++++++++++++++----- 5 files changed, 87 insertions(+), 37 deletions(-) diff --git a/src/components/base/BaseInput.vue b/src/components/base/BaseInput.vue index 8c2e7a4..5603dab 100644 --- a/src/components/base/BaseInput.vue +++ b/src/components/base/BaseInput.vue @@ -4,7 +4,7 @@ v-model="value", :name="name", :class="{'circle': circle, 'font-input': true}", - :input-style="{ color: textColor, borderColor: borderColor}", + :input-style="{ color: textColor, borderColor: borderColor, resize: resize}", :borderless="borderless", :placeholder="placeholder", :outlined="outlined", @@ -75,6 +75,10 @@ export default { type: String, default: "", }, + resize: { + type: String, + default: "none", + }, mask: String, debounce: [String, Number], width: Number, diff --git a/src/pages/newMedicalCard/components/ConfidantForms/ConfidantForm.vue b/src/pages/newMedicalCard/components/ConfidantForms/ConfidantForm.vue index c77b0f5..aa83182 100644 --- a/src/pages/newMedicalCard/components/ConfidantForms/ConfidantForm.vue +++ b/src/pages/newMedicalCard/components/ConfidantForms/ConfidantForm.vue @@ -133,6 +133,7 @@ export default { configData: confidantConfig, mapNetworks: mapNetworks, listPersons: [], + initPerson: null, }; }, props: { @@ -149,11 +150,13 @@ export default { }, methods: { choiceConfidant(e) { - const newConfidant = this.listPersons.find( - (el) => el.id === e.currentTarget.id - ); - this.confidants[this.index] = getConfidantObject(newConfidant); - this.isOpenListConfidant = false; + fetchWrapper + .get(`general/person/${e.currentTarget.id}/detail/`) + .then((res) => { + this.confidants[this.index] = getConfidantObject(res); + this.initPerson = res; + this.isOpenListConfidant = false; + }); }, saveNetwork() { if (this.newNetwork.username) { @@ -162,6 +165,7 @@ export default { username: this.newNetwork.username, }); this.isOpenPopupAdding = false; + this.isCheckChange = true; this.newNetwork = { kind: mapNetworks["TELEGRAM"], username: "", @@ -206,19 +210,14 @@ export default { this.confidants[this.index] = initData || getConfidantObject(); }, saveChange() { - const initConfidantData = this.initConfidant.find( - (el) => el.id === this.confidant.id - ); - const initPersonData = this.listPersons.find( - (el) => el.id === this.confidant.id - ); + const initConfidantData = this.initConfidant[this.index]; const form = this.$refs.formConfidant; form.validate().then((validate) => { if (validate) { getRequestConfidant( this.confidant, initConfidantData, - initPersonData + this.initPerson ).then(() => { this.$store.dispatch("getMedicalCardData"); this.isLoadingData = false; diff --git a/src/pages/newMedicalCard/components/MedicalConfidantWrapper.vue b/src/pages/newMedicalCard/components/MedicalConfidantWrapper.vue index 5dbbb2c..6e74eab 100644 --- a/src/pages/newMedicalCard/components/MedicalConfidantWrapper.vue +++ b/src/pages/newMedicalCard/components/MedicalConfidantWrapper.vue @@ -1,8 +1,8 @@