Заменил селекты на BaseSelect
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
:save-client="saveClient"
|
||||
:choose-option="chooseOptionNetworks"
|
||||
:choose-priority="choosePriority"
|
||||
:priority-list="priorityList"
|
||||
:priority-list="getPriorityList"
|
||||
)
|
||||
.flex(:style="{display :'none'}" ref="doc")
|
||||
form-create-identity-documents(:identity-document="infoClient.identity_document" :save-client="saveClient")
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
<script>
|
||||
import { column } from "@/pages/clients/utils/tableConfig";
|
||||
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||
import FormCreateBasicInfo from "@/pages/clients/components/FormCreateBasicInfo";
|
||||
import FormCreateIdentityDocuments from "@/pages/clients/components/FormCreateIdentityDocuments";
|
||||
import FormCreateAddresses from "@/pages/clients/components/FormCreateAddresses";
|
||||
@@ -132,54 +133,55 @@ export default {
|
||||
active: false,
|
||||
},
|
||||
],
|
||||
priorityOption: "Приоритет",
|
||||
priorityList: ["Высокий", "Средний", "Низкий", "-"],
|
||||
priorityList: [
|
||||
{
|
||||
id: "1",
|
||||
label: "Высокий",
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
label: "Средний",
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
label: "Низкий",
|
||||
},
|
||||
{
|
||||
id: "4",
|
||||
label: "-",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
getPriorityList() {
|
||||
return this.prioritySettings.settings.map((el) => {
|
||||
return { label: el.text, id: el.id };
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
createIdentityDocument(id) {
|
||||
fetch("http://45.84.227.122:8080/general/identity_document/create/", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Accept: "*/*",
|
||||
"Content-Type": "application/json;charset=utf-8",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
...this.filterDataEmptyProperty(
|
||||
this.infoClient.identity_document.pass
|
||||
),
|
||||
person_id: id,
|
||||
}),
|
||||
fetchWrapper.post("general/identity_document/create/", {
|
||||
...this.filterDataEmptyProperty(this.infoClient.identity_document.pass),
|
||||
person_id: id,
|
||||
});
|
||||
},
|
||||
createAddress(id) {
|
||||
fetch("http://45.84.227.122:8080/general/address/create/", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Accept: "*/*",
|
||||
"Content-Type": "application/json;charset=utf-8",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
...this.filterDataEmptyProperty(this.infoClient.addresses),
|
||||
person_id: id,
|
||||
}),
|
||||
fetchWrapper.post("general/address/create/", {
|
||||
...this.filterDataEmptyProperty(this.infoClient.addresses),
|
||||
person_id: id,
|
||||
});
|
||||
},
|
||||
postNewClient() {
|
||||
fetch("http://45.84.227.122:8080/general/person/create/", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
Accept: "*/*",
|
||||
"Content-Type": "application/json;charset=utf-8",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
fetchWrapper
|
||||
.post("general/person/create/", {
|
||||
full_name: this.infoClient.basic.full_name,
|
||||
birth_date: this.infoClient.basic.birth_date,
|
||||
priority: this.prioritySettings.settings.find(
|
||||
(el) => el.text === this.infoClient.basic.priority
|
||||
).priority,
|
||||
}),
|
||||
})
|
||||
})
|
||||
.then((res) => res.json())
|
||||
.then((result) => {
|
||||
this.createIdentityDocument(result.id);
|
||||
|
||||
Reference in New Issue
Block a user