Заменил селекты на BaseSelect
This commit is contained in:
@@ -21,12 +21,10 @@ export default {
|
||||
return {
|
||||
left: this.parentSize.left + "px",
|
||||
top: this.parentSize.top + this.parentSize.height + "px",
|
||||
minWidth: this.parentSize.width + "px",
|
||||
};
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.parentSize);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
.placeholder.text-base {{ itemsMap[value] || placeholder }}
|
||||
span.icon-down-arrow.open-icon(:class="{'open': open }")
|
||||
base-menu(v-if="open")
|
||||
.items-container(@click="open = false", @mouseleave="fasdfasd")
|
||||
.items-container(@click="open = false", @mouseleave="leaveSelect")
|
||||
.item(v-for="item in items", :key="item.id" @click="clickItem(item.id)") {{ item.label }}
|
||||
</template>
|
||||
|
||||
@@ -49,13 +49,10 @@ export default {
|
||||
clickItem(id) {
|
||||
this.value = id;
|
||||
},
|
||||
fasdfasd() {
|
||||
leaveSelect() {
|
||||
this.open = false;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.$.appContext.app._container);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -22,6 +22,7 @@ import ClientsTableHat from "@/pages/clients/components/ClientsTableHat";
|
||||
import ClientsTableRow from "@/pages/clients/components/ClientsTableRow";
|
||||
import ClientsTableCheckbox from "@/pages/clients/components/ClientsTableCheckbox";
|
||||
import ClientsFormCreate from "@/pages/clients/components/ClientsFormCreate";
|
||||
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||
export default {
|
||||
name: "ClientsTable",
|
||||
components: {
|
||||
@@ -51,8 +52,9 @@ export default {
|
||||
this.dataClients = data.results;
|
||||
},
|
||||
fetchDataClients() {
|
||||
// eslint-disable-next-line
|
||||
fetch("http://45.84.227.122:8080/general/person/").then((res) => res.json()).then((data) => this.saveDataClients(data))
|
||||
fetchWrapper
|
||||
.get("general/person/")
|
||||
.then((data) => this.saveDataClients(data));
|
||||
},
|
||||
selectedCheck(e) {
|
||||
if (e.target.id === "checkbox") {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
.grid.grid-cols-2.gap-x-4.gap-y-6.px-4
|
||||
.flex.flex-col(class="gap-y-1.5")
|
||||
span.text-sm Приоритет
|
||||
base-select(:list-data="priorityList" :option-data="basicInfo.priority" placeholder="Приоритет клиента" :for-networks="false" :style-border="true" :choose-option="choosePriority" :size-input="22" disabled)
|
||||
base-select(:items="priorityList" placeholder="Приоритет клиента" v-model="basicInfo.priority")
|
||||
.flex.flex-col(class="gap-y-1.5")
|
||||
span.text-sm Дата рождения
|
||||
span.obligatory *
|
||||
@@ -30,15 +30,15 @@
|
||||
import BaseButton from "@/components/base/BaseButton";
|
||||
import BaseInput from "@/components/base/BaseInput";
|
||||
import BaseAddingNetwork from "@/components/base/BaseAddingNetwork";
|
||||
import BaseSelect from "@/components/base/OldBaseSelect";
|
||||
import { column } from "@/pages/clients/utils/tableConfig";
|
||||
import BaseSelect from "@/components/base/BaseSelect";
|
||||
export default {
|
||||
name: "FormCreateBasicInfo",
|
||||
components: {
|
||||
BaseInput,
|
||||
BaseAddingNetwork,
|
||||
BaseSelect,
|
||||
BaseButton,
|
||||
BaseSelect,
|
||||
},
|
||||
props: {
|
||||
choosePriority: Function,
|
||||
|
||||
@@ -4,20 +4,21 @@
|
||||
.dot.w-2.h-2(:style="{ backgroundColor : settings.settings.find((el) => el.priority == value).color }")
|
||||
span.text-sm(:style="{ color : settings.settings.find((el) => el.priority == value).color }") {{settings.settings.find((el) => el.priority == value).text}}
|
||||
.flex.gap-x-2.text-sm
|
||||
base-select(v-if="isOpenChange" :size-input="10" :option-data="getOption" :list-data="selectData" :style-border="true" :choose-option="choosePriority" disabled)
|
||||
old-base-select(v-if="isOpenChange" :size-input="10" :option-data="getOption" :list-data="selectData" :style-border="true" :choose-option="choosePriority" disabled)
|
||||
base-select(v-if="isOpenChange" :items="getPriorityList" v-model="getOption")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { column } from "@/pages/clients/utils/tableConfig";
|
||||
import BaseSelect from "@/components/base/OldBaseSelect";
|
||||
import OldBaseSelect from "@/components/base/OldBaseSelect";
|
||||
import BaseSelect from "@/components/base/BaseSelect";
|
||||
export default {
|
||||
name: "TableCellBodyPriority",
|
||||
props: ["value", "width", "isOpenChange", "choosePriority"],
|
||||
components: { BaseSelect },
|
||||
components: { OldBaseSelect, BaseSelect },
|
||||
data() {
|
||||
return {
|
||||
settings: column.find((el) => el.name === "priority"),
|
||||
selectData: ["Высокий", "Средний", "Низкий", "-"],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -25,6 +26,11 @@ export default {
|
||||
return this.settings.settings.find((el) => el.priority == this.value)
|
||||
.text;
|
||||
},
|
||||
getPriorityList() {
|
||||
return this.settings.settings.map((el) => {
|
||||
return { label: el.text, id: el.id };
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -22,21 +22,25 @@ export const column = [
|
||||
settings: [
|
||||
{
|
||||
priority: 1,
|
||||
id: "1",
|
||||
text: "Высокий",
|
||||
color: "#FF6F6F",
|
||||
},
|
||||
{
|
||||
priority: 2,
|
||||
id: "2",
|
||||
text: "Средний",
|
||||
color: "#FFC75B",
|
||||
},
|
||||
{
|
||||
priority: 3,
|
||||
id: "3",
|
||||
text: "Низкий",
|
||||
color: "#81ACFF",
|
||||
},
|
||||
{
|
||||
priority: null,
|
||||
id: "4",
|
||||
text: "-",
|
||||
color: "#9294A7",
|
||||
},
|
||||
|
||||
@@ -62,7 +62,7 @@ function del(url, headers, attempts = 3) {
|
||||
return handleRequest("DELETE", url, headers, attempts, null);
|
||||
}
|
||||
|
||||
function post(url, headers, body, attempts = 3) {
|
||||
function post(url, body, headers, attempts = 3) {
|
||||
return handleRequest("POST", url, headers, attempts, null, body);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user