14
package-lock.json
generated
14
package-lock.json
generated
@@ -9,6 +9,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
|
"v-click-outside": "^3.2.0",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
"vue-router": "^4.1.5",
|
"vue-router": "^4.1.5",
|
||||||
"vuex": "^4.0.2"
|
"vuex": "^4.0.2"
|
||||||
@@ -13201,6 +13202,14 @@
|
|||||||
"uuid": "dist/bin/uuid"
|
"uuid": "dist/bin/uuid"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/v-click-outside": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/v-click-outside/-/v-click-outside-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-QD0bDy38SHJXQBjgnllmkI/rbdiwmq9RC+/+pvrFjYJKTn8dtp7Penf9q1lLBta280fYG2q53mgLhQ+3l3z74w==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/validate-npm-package-license": {
|
"node_modules/validate-npm-package-license": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||||
@@ -24242,6 +24251,11 @@
|
|||||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"v-click-outside": {
|
||||||
|
"version": "3.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/v-click-outside/-/v-click-outside-3.2.0.tgz",
|
||||||
|
"integrity": "sha512-QD0bDy38SHJXQBjgnllmkI/rbdiwmq9RC+/+pvrFjYJKTn8dtp7Penf9q1lLBta280fYG2q53mgLhQ+3l3z74w=="
|
||||||
|
},
|
||||||
"validate-npm-package-license": {
|
"validate-npm-package-license": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
|
"v-click-outside": "^3.2.0",
|
||||||
"vue": "^3.2.13",
|
"vue": "^3.2.13",
|
||||||
"vue-router": "^4.1.5",
|
"vue-router": "^4.1.5",
|
||||||
"vuex": "^4.0.2"
|
"vuex": "^4.0.2"
|
||||||
|
|||||||
@@ -1,13 +1,21 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.header-wrapper.flex.justify-center.box-border.py-2.pl-4_75px.pr-6
|
.header-wrapper.relative.flex.justify-center.box-border.py-2.pl-4_75px.pr-6
|
||||||
|
base-client-form-create.right-6(v-if="isOpenCreate", @blure="isOpenCreate=false", :close-form="closeFormCreate")
|
||||||
.flex.items-center.box-border.cursor-pointer.mr-auto
|
.flex.items-center.box-border.cursor-pointer.mr-auto
|
||||||
img.logo-img.mr-29_25px(src="@/assets/images/logo.svg", alt="Logo")
|
img.logo-img.mr-29_25px(src="@/assets/images/logo.svg", alt="Logo")
|
||||||
header-inputs
|
header-inputs
|
||||||
//- .charge-person-container
|
//- .charge-person-container
|
||||||
//- header-active-client-panel(:info="chargePersonInfo")
|
//- header-active-client-panel(:info="chargePersonInfo")
|
||||||
.flex.ml-auto
|
.flex.ml-auto
|
||||||
base-button.mr-9(left-icon="icon-plus", :icon-left-size="10", :size="40", right-icon="icon-person", :icon-right-size="18")
|
base-button.mr-9(
|
||||||
button.header-buttons.flex.justify-center.items-center.mr-8.p-0(@click="logout")
|
left-icon="icon-plus",
|
||||||
|
:icon-left-size="10",
|
||||||
|
:size="40",
|
||||||
|
right-icon="icon-person",
|
||||||
|
:icon-right-size="18",
|
||||||
|
@click="isOpenCreate=true"
|
||||||
|
)
|
||||||
|
button.header-buttons.flex.justify-center.items-center.mr-8.p-0
|
||||||
.icon-bell.text-xxl
|
.icon-bell.text-xxl
|
||||||
.flex.justify-centflexer.items-center
|
.flex.justify-centflexer.items-center
|
||||||
base-avatar.mr-2(:size="32")
|
base-avatar.mr-2(:size="32")
|
||||||
@@ -22,9 +30,10 @@ import chargePersonAvatar from "@/assets/images/charge-person-avatar.svg";
|
|||||||
import HeaderInputs from "./HeaderInputs.vue";
|
import HeaderInputs from "./HeaderInputs.vue";
|
||||||
import BaseAvatar from "@/components/base/BaseAvatar";
|
import BaseAvatar from "@/components/base/BaseAvatar";
|
||||||
import BaseButton from "@/components/base/BaseButton.vue";
|
import BaseButton from "@/components/base/BaseButton.vue";
|
||||||
|
import BaseClientFormCreate from "@/components/base/BaseClientFormCreate";
|
||||||
export default {
|
export default {
|
||||||
name: "TheHeader",
|
name: "TheHeader",
|
||||||
components: { HeaderInputs, BaseAvatar, BaseButton },
|
components: { HeaderInputs, BaseAvatar, BaseButton, BaseClientFormCreate },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
avatarSrc: img,
|
avatarSrc: img,
|
||||||
@@ -32,9 +41,12 @@ export default {
|
|||||||
avatarSrc: chargePersonAvatar,
|
avatarSrc: chargePersonAvatar,
|
||||||
name: "Гордеев Николай Степанович",
|
name: "Гордеев Николай Степанович",
|
||||||
},
|
},
|
||||||
|
isOpenCreate: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
closeFormCreate() {
|
||||||
|
this.isOpenCreate = false;
|
||||||
logout() {
|
logout() {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
this.$router.push("/login");
|
this.$router.push("/login");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.wrapper-create.flex.flex-col.absolute.top-28.right-0.px-4.py-7.gap-y-8
|
.wrapper-create.flex.flex-col.absolute.top-28.px-4.py-7.gap-y-8
|
||||||
.icon-cancel.close.absolute.top-5.right-5.cursor-pointer(@click="closeForm")
|
.icon-cancel.close.absolute.top-5.right-5.cursor-pointer(@click="closeForm")
|
||||||
span.title.text-xl.font-bold.px-4 Создание клиента
|
span.title.text-xl.font-bold.px-4 Создание клиента
|
||||||
.flex.gap-x-4.h-fit.px-4
|
.flex.gap-x-4.h-fit.px-4
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
:save-client="saveClient"
|
:save-client="saveClient"
|
||||||
:choose-option="chooseOptionNetworks"
|
:choose-option="chooseOptionNetworks"
|
||||||
:choose-priority="choosePriority"
|
:choose-priority="choosePriority"
|
||||||
:priority-list="priorityList"
|
:priority-list="getPriorityList"
|
||||||
)
|
)
|
||||||
.flex(:style="{display :'none'}" ref="doc")
|
.flex(:style="{display :'none'}" ref="doc")
|
||||||
form-create-identity-documents(:identity-document="infoClient.identity_document" :save-client="saveClient")
|
form-create-identity-documents(:identity-document="infoClient.identity_document" :save-client="saveClient")
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { column } from "@/pages/clients/utils/tableConfig";
|
import { column } from "@/pages/clients/utils/tableConfig";
|
||||||
|
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||||
import FormCreateBasicInfo from "@/pages/clients/components/FormCreateBasicInfo";
|
import FormCreateBasicInfo from "@/pages/clients/components/FormCreateBasicInfo";
|
||||||
import FormCreateIdentityDocuments from "@/pages/clients/components/FormCreateIdentityDocuments";
|
import FormCreateIdentityDocuments from "@/pages/clients/components/FormCreateIdentityDocuments";
|
||||||
import FormCreateAddresses from "@/pages/clients/components/FormCreateAddresses";
|
import FormCreateAddresses from "@/pages/clients/components/FormCreateAddresses";
|
||||||
@@ -40,7 +41,7 @@ import BaseInput from "@/components/base/BaseInput";
|
|||||||
import BaseSelect from "@/components/base/OldBaseSelect";
|
import BaseSelect from "@/components/base/OldBaseSelect";
|
||||||
import BaseButton from "@/components/base/BaseButton";
|
import BaseButton from "@/components/base/BaseButton";
|
||||||
export default {
|
export default {
|
||||||
name: "ClientsFormCreate",
|
name: "BaseClientFormClient",
|
||||||
components: {
|
components: {
|
||||||
BaseInput,
|
BaseInput,
|
||||||
BaseSelect,
|
BaseSelect,
|
||||||
@@ -82,7 +83,6 @@ export default {
|
|||||||
},
|
},
|
||||||
identity_document: {
|
identity_document: {
|
||||||
pass: {
|
pass: {
|
||||||
kind: "Паспорт",
|
|
||||||
series_number: "",
|
series_number: "",
|
||||||
issued_by_org: "",
|
issued_by_org: "",
|
||||||
issued_by_date: "",
|
issued_by_date: "",
|
||||||
@@ -104,7 +104,7 @@ export default {
|
|||||||
street: "",
|
street: "",
|
||||||
house_number: "",
|
house_number: "",
|
||||||
apartment_number: "",
|
apartment_number: "",
|
||||||
index_of_address: "",
|
zip_code: "",
|
||||||
},
|
},
|
||||||
additional: [
|
additional: [
|
||||||
{
|
{
|
||||||
@@ -132,55 +132,63 @@ export default {
|
|||||||
active: false,
|
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: {
|
methods: {
|
||||||
createIdentityDocument(id) {
|
createIdentityDocument(id) {
|
||||||
fetch("http://45.84.227.122:8080/general/identity_document/create/", {
|
Object.keys(
|
||||||
method: "POST",
|
this.filterDataEmptyProperty(this.infoClient.identity_document.pass)
|
||||||
headers: {
|
).length > 0 &&
|
||||||
Accept: "*/*",
|
fetchWrapper.post("general/identity_document/create/", {
|
||||||
"Content-Type": "application/json;charset=utf-8",
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
...this.filterDataEmptyProperty(
|
...this.filterDataEmptyProperty(
|
||||||
this.infoClient.identity_document.pass
|
this.infoClient.identity_document.pass
|
||||||
),
|
),
|
||||||
person_id: id,
|
person_id: id,
|
||||||
}),
|
kind: "Паспорт",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
createAddress(id) {
|
createAddress(id) {
|
||||||
fetch("http://45.84.227.122:8080/general/address/create/", {
|
Object.keys(this.filterDataEmptyProperty(this.infoClient.addresses))
|
||||||
method: "POST",
|
.length > 0 &&
|
||||||
headers: {
|
fetchWrapper.post("general/address/create/", {
|
||||||
Accept: "*/*",
|
|
||||||
"Content-Type": "application/json;charset=utf-8",
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
...this.filterDataEmptyProperty(this.infoClient.addresses),
|
...this.filterDataEmptyProperty(this.infoClient.addresses),
|
||||||
person_id: id,
|
person_id: id,
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
postNewClient() {
|
postNewClient() {
|
||||||
fetch("http://45.84.227.122:8080/general/person/create/", {
|
fetchWrapper
|
||||||
method: "POST",
|
.post("general/person/create/", {
|
||||||
headers: {
|
|
||||||
Accept: "*/*",
|
|
||||||
"Content-Type": "application/json;charset=utf-8",
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
full_name: this.infoClient.basic.full_name,
|
full_name: this.infoClient.basic.full_name,
|
||||||
birth_date: this.infoClient.basic.birth_date,
|
birth_date: this.infoClient.basic.birth_date,
|
||||||
priority: this.prioritySettings.settings.find(
|
priority: this.prioritySettings.settings.find(
|
||||||
(el) => el.text === this.infoClient.basic.priority
|
(el) => el.text === this.infoClient.basic.priority
|
||||||
).priority,
|
).priority,
|
||||||
}),
|
|
||||||
})
|
})
|
||||||
.then((res) => res.json())
|
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
this.createIdentityDocument(result.id);
|
this.createIdentityDocument(result.id);
|
||||||
this.createAddress(result.id);
|
this.createAddress(result.id);
|
||||||
@@ -21,12 +21,10 @@ export default {
|
|||||||
return {
|
return {
|
||||||
left: this.parentSize.left + "px",
|
left: this.parentSize.left + "px",
|
||||||
top: this.parentSize.top + this.parentSize.height + "px",
|
top: this.parentSize.top + this.parentSize.height + "px",
|
||||||
|
minWidth: this.parentSize.width + "px",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
console.log(this.parentSize);
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.base-select(@click="open = !open", :class="{'open': open }")
|
.base-select(@click="open = !open", :class="{'open': open }")
|
||||||
.placeholder.text-base {{ itemsMap[value] || placeholder }}
|
.placeholder.text-base {{ value || placeholder }}
|
||||||
span.icon-down-arrow.open-icon(:class="{'open': open }")
|
span.icon-down-arrow.open-icon(:class="{'open': open }")
|
||||||
base-menu(v-if="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 }}
|
.item(v-for="item in items", :key="item.id" @click="clickItem(item.label)") {{ item.label }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -35,27 +35,15 @@ export default {
|
|||||||
this.$emit("update:modelValue", value);
|
this.$emit("update:modelValue", value);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
itemsMap() {
|
|
||||||
return this.items.reduce(
|
|
||||||
(acc, item) => ({
|
|
||||||
...acc,
|
|
||||||
[item.id]: item.label,
|
|
||||||
}),
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
clickItem(id) {
|
clickItem(id) {
|
||||||
this.value = id;
|
this.value = id;
|
||||||
},
|
},
|
||||||
fasdfasd() {
|
leaveSelect() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
console.log(this.$.appContext.app._container);
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { createApp } from "vue";
|
|||||||
import App from "./App.vue";
|
import App from "./App.vue";
|
||||||
import router from "./router";
|
import router from "./router";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
|
import vClickOutside from "v-click-outside";
|
||||||
import "./assets/sass/fonts.sass";
|
import "./assets/sass/fonts.sass";
|
||||||
import "./assets/sass/tailwind.sass";
|
import "./assets/sass/tailwind.sass";
|
||||||
import "./assets/sass/variables.sass";
|
import "./assets/sass/variables.sass";
|
||||||
@@ -14,4 +15,4 @@ if (process.env.NODE_ENV === "development") {
|
|||||||
|
|
||||||
moment.locale("ru");
|
moment.locale("ru");
|
||||||
|
|
||||||
createApp(App).use(router, moment).mount("#app");
|
createApp(App).use(router, vClickOutside, moment).mount("#app");
|
||||||
|
|||||||
@@ -15,17 +15,16 @@
|
|||||||
.flex.flex-col(v-for="(item, key) in sectionInfo" class="gap-y-1.5")
|
.flex.flex-col(v-for="(item, key) in sectionInfo" class="gap-y-1.5")
|
||||||
span.title-section.font-semibold.text-xs(v-if="settings[section].options") {{settings[section].options[key]}}
|
span.title-section.font-semibold.text-xs(v-if="settings[section].options") {{settings[section].options[key]}}
|
||||||
span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}}
|
span.title-section.font-semibold.text-xs(v-if="item.header") {{item.header}}
|
||||||
client-detail-input.text-sm.text-sm.w-max-fit(v-if="isChange" :style="{fontWeight:key === 'numba'&&600}" v-model:value="sectionInfo[key]" :width="settings[section].width")
|
client-detail-input.text-sm.text-sm.w-max-fit(v-if="section!=='docs' && isChange" :style="{fontWeight:key === 'numba'&&600}" v-model:value="sectionInfo[key]" :width="settings[section].width")
|
||||||
.copy.icon-copy.cursor-pointer(v-if="item.copy" @click="() => copyValue(item)")
|
.copy.icon-copy.cursor-pointer(v-if="item.copy" @click="() => copyValue(item)")
|
||||||
.flex(v-if="settings[section].options && !isChange")
|
.flex(v-if="settings[section].options && !isChange")
|
||||||
span.text-sm.w-fit(:style="{fontWeight:key === 'numba'&&600}") {{item}}
|
span.text-sm.w-fit(:style="{fontWeight:key === 'numba'&&600}") {{item}}
|
||||||
.copy.icon-copy.cursor-pointer.pl-4(v-if="key === 'numba'" @click="() => copyValue(item)")
|
.copy.icon-copy.cursor-pointer.pl-4(v-if="key === 'numba'" @click="() => copyValue(item)")
|
||||||
.flex(v-if="item.value && !isChange")
|
.flex(v-if="item.name && !isChange")
|
||||||
span.text-sm.w-fit {{item.value}}
|
span.text-sm.w-fit {{item.title}}
|
||||||
.flex.items-center(v-if="item.name")
|
.flex.items-center(v-if="item.title")
|
||||||
.icon-cancel.cancel.cursor-pointer.pr-3.text-xsm(v-if="isChange" :id="item.name" @click="(e) => deleteDoc(e, section)")
|
.icon-cancel.cancel.cursor-pointer.pr-3.text-xsm(v-if="isChange" :id="item.id" @click="(e) => deleteDoc(e)")
|
||||||
.icon-files.cursor-pointer.pr-3.text-xl(:style="{color:settings.docsColor[item.type]}")
|
span.text-sm {{item.title}}
|
||||||
span.text-sm {{item.name}}
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.w-full.h-fit.pt-4.flex.gap-x-4(class="px-[52px] pb-[30px]")
|
.w-full.h-fit.pt-4.flex.gap-x-4(class="px-[52px] pb-[30px]")
|
||||||
client-detail-info-section(v-model:section-info="dataDocument" section="pass")
|
client-detail-info-section(v-model:section-info="dataDocument" section="pass")
|
||||||
.flex.flex-col.gap-y-2
|
.flex.flex-col
|
||||||
client-detail-info-section(:section-info="dataAddress" section="addresses")
|
client-detail-info-section(:section-info="dataAddress" section="addresses")
|
||||||
|
.flex.flex-col
|
||||||
|
client-detail-info-section(:section-info="dataAttachments" section="docs" :save-new-doc="saveNewDoc" :delete-doc="deleteDoc")
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -13,6 +15,7 @@ export default {
|
|||||||
props: {
|
props: {
|
||||||
dataDetail: Object,
|
dataDetail: Object,
|
||||||
dataAddress: Object,
|
dataAddress: Object,
|
||||||
|
dataAttachments: Array,
|
||||||
saveNewDoc: Function,
|
saveNewDoc: Function,
|
||||||
deleteDoc: Function,
|
deleteDoc: Function,
|
||||||
dataDocument: Object,
|
dataDocument: Object,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.wrapper-table.relative.flex.flex-col.gap-y-8.px-6.py-6.h-full.w-full
|
.wrapper-table.relative.flex.flex-col.gap-y-8.px-6.py-6.h-full.w-full
|
||||||
clients-form-create(v-if="isOpenFormCreate" :close-form="closeFormCreateClient")
|
base-client-form-create.right-0(v-if="isOpenFormCreate" :close-form="closeFormCreateClient")
|
||||||
clients-table-hat(:is-open-actions="marked.length" :open-form-create="openFormCreateClient")
|
clients-table-hat(:is-open-actions="marked.length" :open-form-create="openFormCreateClient")
|
||||||
.flex.flex-col.h-full.gap-y-2.table-container
|
.flex.flex-col.h-full.gap-y-2.table-container
|
||||||
clients-table-header(:check="selectedCheck" :is-check="selectAll")
|
clients-table-header(:check="selectedCheck" :is-check="selectAll")
|
||||||
@@ -22,7 +22,8 @@ import ClientsTableHeader from "@/pages/clients/components/ClientsTableHeader";
|
|||||||
import ClientsTableHat from "@/pages/clients/components/ClientsTableHat";
|
import ClientsTableHat from "@/pages/clients/components/ClientsTableHat";
|
||||||
import ClientsTableRow from "@/pages/clients/components/ClientsTableRow";
|
import ClientsTableRow from "@/pages/clients/components/ClientsTableRow";
|
||||||
import ClientsTableCheckbox from "@/pages/clients/components/ClientsTableCheckbox";
|
import ClientsTableCheckbox from "@/pages/clients/components/ClientsTableCheckbox";
|
||||||
import ClientsFormCreate from "@/pages/clients/components/ClientsFormCreate";
|
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||||
|
import BaseClientFormCreate from "@/components/base/BaseClientFormCreate";
|
||||||
export default {
|
export default {
|
||||||
name: "ClientsTable",
|
name: "ClientsTable",
|
||||||
components: {
|
components: {
|
||||||
@@ -30,7 +31,7 @@ export default {
|
|||||||
ClientsTableRow,
|
ClientsTableRow,
|
||||||
ClientsTableHat,
|
ClientsTableHat,
|
||||||
ClientsTableHeader,
|
ClientsTableHeader,
|
||||||
ClientsFormCreate,
|
BaseClientFormCreate,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -52,8 +53,9 @@ export default {
|
|||||||
this.dataClients = data.results;
|
this.dataClients = data.results;
|
||||||
},
|
},
|
||||||
fetchDataClients() {
|
fetchDataClients() {
|
||||||
// eslint-disable-next-line
|
fetchWrapper
|
||||||
fetchWrapper.get("general/person/").then((data) => this.saveDataClients(data))
|
.get("general/person/")
|
||||||
|
.then((data) => this.saveDataClients(data));
|
||||||
},
|
},
|
||||||
selectedCheck(e) {
|
selectedCheck(e) {
|
||||||
if (e.target.id === "checkbox") {
|
if (e.target.id === "checkbox") {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
.icon-ok.text-xsm(class="pt-[3px]")
|
.icon-ok.text-xsm(class="pt-[3px]")
|
||||||
.relative.dots-button.icon-dots.cursor-pointer.leading-6.text-center(v-show="!isOpenChange" :tabindex="1" @click="(e) => openPopup(e)" @blur="handleUnFocusPopup")
|
.relative.dots-button.icon-dots.cursor-pointer.leading-6.text-center(v-show="!isOpenChange" :tabindex="1" @click="(e) => openPopup(e)" @blur="handleUnFocusPopup")
|
||||||
clients-action-popup(v-if="isOpenPopup" :open-change-data="openChangeData")
|
clients-action-popup(v-if="isOpenPopup" :open-change-data="openChangeData")
|
||||||
client-detail-info-wrapper(v-if="isOpenDetailInfo" :data-address="dataAddress" :data-detail="dataDetail" :data-document="dataIdentityDocument" :save-new-doc="saveNewDoc" :delete-doc="deleteDoc")
|
client-detail-info-wrapper(v-if="isOpenDetailInfo" :data-address="dataAddress" :data-detail="dataDetail" :data-attachments="dataAttachments" :data-document="dataIdentityDocument" :save-new-doc="saveNewDoc" :delete-doc="deleteDoc")
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -30,6 +30,7 @@ import ClientsActionPopup from "@/pages/clients/components/ClientsActionPopup";
|
|||||||
import ClientsTableCheckbox from "@/pages/clients/components/ClientsTableCheckbox";
|
import ClientsTableCheckbox from "@/pages/clients/components/ClientsTableCheckbox";
|
||||||
import ClientDetailInfoWrapper from "@/pages/clients/components/ClientDetailInfoWrapper";
|
import ClientDetailInfoWrapper from "@/pages/clients/components/ClientDetailInfoWrapper";
|
||||||
import BaseButton from "@/components/base/BaseButton";
|
import BaseButton from "@/components/base/BaseButton";
|
||||||
|
import { fetchWrapper } from "@/shared/fetchWrapper";
|
||||||
import { column } from "@/pages/clients/utils/tableConfig";
|
import { column } from "@/pages/clients/utils/tableConfig";
|
||||||
export default {
|
export default {
|
||||||
name: "ClientsTableRow",
|
name: "ClientsTableRow",
|
||||||
@@ -51,10 +52,12 @@ export default {
|
|||||||
return {
|
return {
|
||||||
dataIdentityDocument: {},
|
dataIdentityDocument: {},
|
||||||
dataAddress: {},
|
dataAddress: {},
|
||||||
|
dataAttachments: [],
|
||||||
dataDetail: {},
|
dataDetail: {},
|
||||||
isOpenDetailInfo: false,
|
isOpenDetailInfo: false,
|
||||||
isOpenPopup: false,
|
isOpenPopup: false,
|
||||||
columnBody: column,
|
columnBody: column,
|
||||||
|
prioritySettings: column.find((el) => el.name === "priority"),
|
||||||
isOpenChange: false,
|
isOpenChange: false,
|
||||||
dataClient: {},
|
dataClient: {},
|
||||||
};
|
};
|
||||||
@@ -73,7 +76,9 @@ export default {
|
|||||||
this.client.first_name || ""
|
this.client.first_name || ""
|
||||||
} ${this.client.patronymic || ""}`,
|
} ${this.client.patronymic || ""}`,
|
||||||
age: this.client.birth_date || "",
|
age: this.client.birth_date || "",
|
||||||
priority: this.client.priority,
|
priority: this.prioritySettings.settings.find(
|
||||||
|
(el) => el.priority === this.client.priority
|
||||||
|
).text,
|
||||||
phone: {
|
phone: {
|
||||||
id: this.client.contacts.find((el) => el.kind === "PHONE")?.id || "",
|
id: this.client.contacts.find((el) => el.kind === "PHONE")?.id || "",
|
||||||
kind: "PHONE",
|
kind: "PHONE",
|
||||||
@@ -95,21 +100,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
postUpdateClient() {
|
postUpdateClient() {
|
||||||
fetch(
|
fetchWrapper.post(`general/person/${this.client.id}/update/`, {
|
||||||
`http://45.84.227.122:8080/general/person/${this.client.id}/update/`,
|
|
||||||
{
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
Accept: "*/*",
|
|
||||||
"Content-Type": "application/json;charset=utf-8",
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
full_name: this.dataClient.fullName,
|
full_name: this.dataClient.fullName,
|
||||||
birth_date: this.dataClient.age,
|
birth_date: this.dataClient.age,
|
||||||
priority: this.dataClient.priority,
|
priority: this.dataClient.priority,
|
||||||
}),
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
postContactsClient() {
|
postContactsClient() {
|
||||||
let contacts = [...this.dataClient.contacts];
|
let contacts = [...this.dataClient.contacts];
|
||||||
@@ -154,37 +149,21 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
postCreateContact(contact) {
|
postCreateContact(contact) {
|
||||||
fetch("http://45.84.227.122:8080/general/contact/create/", {
|
fetchWrapper.post("general/contact/create/", {
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
Accept: "*/*",
|
|
||||||
"Content-Type": "application/json;charset=utf-8",
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
kind: contact.kind,
|
kind: contact.kind,
|
||||||
username: contact.username,
|
username: contact.username,
|
||||||
person_id: this.client.id,
|
person_id: this.client.id,
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
postUpdateContact(contact) {
|
postUpdateContact(contact) {
|
||||||
fetch(`http://45.84.227.122:8080/general/contact/${contact.id}/update/`, {
|
fetchWrapper.post(`general/contact/${contact.id}/update/`, {
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
Accept: "*/*",
|
|
||||||
"Content-Type": "application/json;charset=utf-8",
|
|
||||||
},
|
|
||||||
body: JSON.stringify({
|
|
||||||
kind: contact.kind,
|
kind: contact.kind,
|
||||||
username: contact.username,
|
username: contact.username,
|
||||||
person_id: this.client.id,
|
person_id: this.client.id,
|
||||||
}),
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
postDeleteContact(contact) {
|
postDeleteContact(contact) {
|
||||||
fetch(`http://45.84.227.122:8080/general/contact/${contact.id}/delete/`, {
|
fetchWrapper.del(`general/contact/${contact.id}/delete/`);
|
||||||
method: "DELETE",
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
addNetwork(network) {
|
addNetwork(network) {
|
||||||
this.dataClient.contacts.push(network);
|
this.dataClient.contacts.push(network);
|
||||||
@@ -208,14 +187,16 @@ export default {
|
|||||||
this.isOpenChange = true;
|
this.isOpenChange = true;
|
||||||
},
|
},
|
||||||
fetchClientDetail(id) {
|
fetchClientDetail(id) {
|
||||||
// eslint-disable-next-line
|
fetchWrapper
|
||||||
fetch(`http://45.84.227.122:8080/general/person/${id}/detail`).then((res) => res.json()).then((data) => this.saveClientDetail(data))
|
.get(`general/person/${id}/detail/`)
|
||||||
|
.then((data) => this.saveClientDetail(data));
|
||||||
},
|
},
|
||||||
saveClientDetail(data) {
|
saveClientDetail(data) {
|
||||||
this.saveIdentityDocument(
|
this.saveIdentityDocument(
|
||||||
data.identity_documents.find((el) => el.kind === "Паспорт")
|
data.identity_documents.find((el) => el.kind === "Паспорт")
|
||||||
);
|
);
|
||||||
this.saveAddress(data.address[0]);
|
this.saveAddress(data.address[0]);
|
||||||
|
this.saveAttachments([...data.attachments]);
|
||||||
},
|
},
|
||||||
saveIdentityDocument(data) {
|
saveIdentityDocument(data) {
|
||||||
this.dataIdentityDocument = {
|
this.dataIdentityDocument = {
|
||||||
@@ -227,9 +208,12 @@ export default {
|
|||||||
},
|
},
|
||||||
saveAddress(data) {
|
saveAddress(data) {
|
||||||
this.dataAddress = {
|
this.dataAddress = {
|
||||||
join_address: data?.join_address || "-",
|
join_adress: data?.join_adress || "-",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
saveAttachments(data) {
|
||||||
|
this.dataAttachments = [...data];
|
||||||
|
},
|
||||||
openPopup(e) {
|
openPopup(e) {
|
||||||
e.target.focus();
|
e.target.focus();
|
||||||
this.isOpenPopup = !this.isOpenPopup;
|
this.isOpenPopup = !this.isOpenPopup;
|
||||||
@@ -241,19 +225,12 @@ export default {
|
|||||||
handleUnFocusPopup() {
|
handleUnFocusPopup() {
|
||||||
this.isOpenPopup = false;
|
this.isOpenPopup = false;
|
||||||
},
|
},
|
||||||
saveNewDoc(section, data) {
|
saveNewDoc(data) {
|
||||||
this.dataDetail[section] = [...this.dataDetail[section], ...data];
|
this.dataAttachments = [...this.dataDetail, ...data];
|
||||||
},
|
},
|
||||||
deleteDoc(e, section) {
|
deleteDoc(e) {
|
||||||
if (section === "additional") {
|
this.dataAttachments = this.dataAttachments.filter(
|
||||||
this.dataDetail[section].forEach((el, index) => {
|
(el) => el.id !== e.target.id
|
||||||
if (el.name === e.target.id) {
|
|
||||||
delete this.dataDetail[section][index].name;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.dataDetail[section] = this.dataDetail[section].filter(
|
|
||||||
(el) => el.name !== e.target.id
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -4,11 +4,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ClientsFormCreate from "@/pages/clients/components/ClientsFormCreate";
|
|
||||||
import ClientsTable from "@/pages/clients/components/ClientsTable";
|
import ClientsTable from "@/pages/clients/components/ClientsTable";
|
||||||
export default {
|
export default {
|
||||||
name: "ClientsWrapper",
|
name: "ClientsWrapper",
|
||||||
components: { ClientsTable, ClientsFormCreate },
|
components: { ClientsTable },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isOpenForm: false,
|
isOpenForm: false,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
base-input.input-info(v-model:value="addresses.apartment_number" placeholder="Номер квартиры")
|
base-input.input-info(v-model:value="addresses.apartment_number" placeholder="Номер квартиры")
|
||||||
.flex.flex-col(class="gap-y-1.5")
|
.flex.flex-col(class="gap-y-1.5")
|
||||||
span.text-sm.font-semibold Индекс
|
span.text-sm.font-semibold Индекс
|
||||||
base-input.input-info(v-model:value="addresses.index_of_address" placeholder="000000")
|
base-input.input-info(v-model:value="addresses.zip_code" placeholder="000000")
|
||||||
.px-4
|
.px-4
|
||||||
base-button(@click="saveClient" :size="40")
|
base-button(@click="saveClient" :size="40")
|
||||||
span.font-semibold Создать клиента
|
span.font-semibold Создать клиента
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
.grid.grid-cols-2.gap-x-4.gap-y-6.px-4
|
.grid.grid-cols-2.gap-x-4.gap-y-6.px-4
|
||||||
.flex.flex-col(class="gap-y-1.5")
|
.flex.flex-col(class="gap-y-1.5")
|
||||||
span.text-sm Приоритет
|
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")
|
.flex.flex-col(class="gap-y-1.5")
|
||||||
span.text-sm Дата рождения
|
span.text-sm Дата рождения
|
||||||
span.obligatory *
|
span.obligatory *
|
||||||
@@ -30,15 +30,15 @@
|
|||||||
import BaseButton from "@/components/base/BaseButton";
|
import BaseButton from "@/components/base/BaseButton";
|
||||||
import BaseInput from "@/components/base/BaseInput";
|
import BaseInput from "@/components/base/BaseInput";
|
||||||
import BaseAddingNetwork from "@/components/base/BaseAddingNetwork";
|
import BaseAddingNetwork from "@/components/base/BaseAddingNetwork";
|
||||||
import BaseSelect from "@/components/base/OldBaseSelect";
|
|
||||||
import { column } from "@/pages/clients/utils/tableConfig";
|
import { column } from "@/pages/clients/utils/tableConfig";
|
||||||
|
import BaseSelect from "@/components/base/BaseSelect";
|
||||||
export default {
|
export default {
|
||||||
name: "FormCreateBasicInfo",
|
name: "FormCreateBasicInfo",
|
||||||
components: {
|
components: {
|
||||||
BaseInput,
|
BaseInput,
|
||||||
BaseAddingNetwork,
|
BaseAddingNetwork,
|
||||||
BaseSelect,
|
|
||||||
BaseButton,
|
BaseButton,
|
||||||
|
BaseSelect,
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
choosePriority: Function,
|
choosePriority: Function,
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<template lang="pug">
|
<template lang="pug">
|
||||||
.flex.box-border.px-4.items-center.w-full.gap-x-2(:style="{ minWidth : width + 'px' }")
|
.flex.box-border.px-4.items-center.w-full.gap-x-2(:style="{ minWidth : width + 'px' }")
|
||||||
.flex.gap-x-2.items-center(v-if="!isOpenChange")
|
.flex.gap-x-2.items-center(v-if="!isOpenChange")
|
||||||
.dot.w-2.h-2(:style="{ backgroundColor : settings.settings.find((el) => el.priority == value).color }")
|
.dot.w-2.h-2(:style="{ backgroundColor : settings.settings.find((el) => el.text == value).color }")
|
||||||
span.text-sm(:style="{ color : settings.settings.find((el) => el.priority == value).color }") {{settings.settings.find((el) => el.priority == value).text}}
|
span.text-sm(:style="{ color : settings.settings.find((el) => el.text == value).color }") {{value}}
|
||||||
.flex.gap-x-2.text-sm
|
.flex.gap-x-2.text-sm(class="w-[164px]")
|
||||||
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="value")
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { column } from "@/pages/clients/utils/tableConfig";
|
import { column } from "@/pages/clients/utils/tableConfig";
|
||||||
import BaseSelect from "@/components/base/OldBaseSelect";
|
import BaseSelect from "@/components/base/BaseSelect";
|
||||||
export default {
|
export default {
|
||||||
name: "TableCellBodyPriority",
|
name: "TableCellBodyPriority",
|
||||||
props: ["value", "width", "isOpenChange", "choosePriority"],
|
props: ["value", "width", "isOpenChange", "choosePriority"],
|
||||||
@@ -17,13 +17,13 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
settings: column.find((el) => el.name === "priority"),
|
settings: column.find((el) => el.name === "priority"),
|
||||||
selectData: ["Высокий", "Средний", "Низкий", "-"],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
getOption() {
|
getPriorityList() {
|
||||||
return this.settings.settings.find((el) => el.priority == this.value)
|
return this.settings.settings.map((el) => {
|
||||||
.text;
|
return { label: el.text, id: el.id };
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,21 +22,25 @@ export const column = [
|
|||||||
settings: [
|
settings: [
|
||||||
{
|
{
|
||||||
priority: 1,
|
priority: 1,
|
||||||
|
id: "1",
|
||||||
text: "Высокий",
|
text: "Высокий",
|
||||||
color: "#FF6F6F",
|
color: "#FF6F6F",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
priority: 2,
|
priority: 2,
|
||||||
|
id: "2",
|
||||||
text: "Средний",
|
text: "Средний",
|
||||||
color: "#FFC75B",
|
color: "#FFC75B",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
priority: 3,
|
priority: 3,
|
||||||
|
id: "3",
|
||||||
text: "Низкий",
|
text: "Низкий",
|
||||||
color: "#81ACFF",
|
color: "#81ACFF",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
priority: null,
|
priority: null,
|
||||||
|
id: "4",
|
||||||
text: "-",
|
text: "-",
|
||||||
color: "#9294A7",
|
color: "#9294A7",
|
||||||
},
|
},
|
||||||
@@ -133,7 +137,7 @@ export const detail = {
|
|||||||
addresses: {
|
addresses: {
|
||||||
title: "Адреса",
|
title: "Адреса",
|
||||||
options: {
|
options: {
|
||||||
join_address: "Полный адрес",
|
join_adress: "Полный адрес",
|
||||||
},
|
},
|
||||||
width: 292,
|
width: 292,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ function del(url, headers, attempts = 3) {
|
|||||||
return handleRequest("DELETE", url, headers, attempts, null);
|
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);
|
return handleRequest("POST", url, headers, attempts, body);
|
||||||
}
|
}
|
||||||
|
|
||||||
function put(url, headers, body, attempts = 3) {
|
function put(url, headers, body, attempts = 3) {
|
||||||
|
|||||||
Reference in New Issue
Block a user