From df32fa5da6cce0eea4818167012f8f760301a654 Mon Sep 17 00:00:00 2001 From: DwCay Date: Fri, 21 Oct 2022 20:43:17 +0300 Subject: [PATCH] =?UTF-8?q?WIP=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=8C=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=B5=D1=82=D0=B0?= =?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=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 352 ++++++++++++------ src/assets/sass/variables.sass | 3 + src/components/base/buttons/BaseButtonOk.vue | 45 +++ .../base/buttons/BaseButtonPlus.vue | 29 +- .../components/ClientDetailInfoSection.vue | 75 +++- .../components/ClientDetailInfoWrapper.vue | 4 +- .../clients/components/ClientDetailInput.vue | 27 ++ src/pages/clients/components/ClientsTable.vue | 4 +- .../clients/components/ClientsTableHat.vue | 2 +- .../clients/components/ClientsTableRow.vue | 10 +- src/pages/clients/utils/tableConfig.js | 34 +- 11 files changed, 423 insertions(+), 162 deletions(-) create mode 100644 src/components/base/buttons/BaseButtonOk.vue create mode 100644 src/pages/clients/components/ClientDetailInput.vue diff --git a/server.js b/server.js index 0f5cf7f..fb25cb1 100644 --- a/server.js +++ b/server.js @@ -3,138 +3,260 @@ import { createServer } from "miragejs"; const dataClients = [ { id: "1", - fullName: "Вильгейльм Арнольд Витальевич", - age: "34", - jobTitle: "Менеджер", - priority: "Высокий", - phone: "+7 (915) 657–21–14", - email: "Superboyband@yandex.ru", - networks: [], - meeting: { - date: "02.06.22", - time: "18:30–19:30", + last_name: "Вильгейльм", + first_name: "Арнольд", + patronymic: "Витальевич", + identity_document_to_person: { + pass: { + number: { + value: "5261 918732", + copy: true, + }, + issuedBy: { + value: "Отделом УФМС России по рязанской области", + }, + divisionCode: { + value: "426–234", + }, + dateIssue: { + value: "02.04.2022", + }, + }, + }, + note_to_person: { + basic_info: { + age: "34", + jobTitle: "Менеджер", + priority: "Высокий", + phone: "+7 (915) 657–21–14", + email: "Superboyband@yandex.ru", + networks: [], + meeting: { + date: "02.06.22", + time: "18:30–19:30", + }, + }, + additional_info: { + snils: { + number: { + value: "812–183–139 21", + copy: true, + }, + }, + inn: { + number: { + value: "138291382731", + copy: true, + }, + }, + birthday: { + date: { + value: "21.04.1999", + }, + }, + addresses: { + registrationPlace: { + value: + "371311, Московская обл., г. Москва, ул. Комсомольская, д.6, кв. 13", + }, + actualPlace: { + value: + "371311, Московская обл., г. Москва, ул. Комсомольская, д.6, кв. 13", + }, + }, + docs: [ + { + name: "Договор оферты.pdf", + type: "application/pdf", + }, + { + name: "Договор о долевом строительстве.pdf", + type: "application/pdf", + }, + { + name: "Какое-то очень очень очень очень длинное название.doc", + type: "application/msword", + }, + { + name: "Договор об оплате.doc", + type: "application/msword", + }, + { + name: "Коммерческое предложение.xls", + type: "application/vnd.ms-excel", + }, + { + name: "Таблица заказов.xls", + type: "application/vnd.ms-excel", + }, + ], + additional: [ + { + header: "Предпочтения", + value: "Разговор на “Вы”\nТолько по делу\nТолько официальный стиль", + name: "", + type: "", + }, + { + header: "Доп.документы", + value: "", + name: "Памятка с вопросами на созвоне.pdf", + type: "application/pdf", + }, + { + header: "Его должность", + value: "Вроде бы важная шишка, пусть будет – Гуру в дизайне", + name: "", + type: "", + }, + { + header: "Чтобы не забыть", + value: "Не забудь!", + name: "", + type: "", + }, + ], + }, }, }, { id: "2", - fullName: "Астафоркина Екатерина Геннадьевна", - age: "54", - jobTitle: "Менеджер", - priority: "-", - phone: "+7 (574) 364–53–36", - email: "antimag@gmail.com", - networks: [], - meeting: { - date: "14.07.22", - time: "17:30–21:30", - }, - }, -]; - -const clientsDetail = [ - { - id: "5", - idClient: "1", - pass: { - number: { - value: "5261 918732", - copy: true, - }, - issuedBy: { - value: "Отделом УФМС России по рязанской области", - }, - divisionCode: { - value: "426–234", - }, - dateIssue: { - value: "02.04.2022", + last_name: "Астафоркина", + first_name: "Екатерина", + patronymic: "Геннадьевна", + identity_document_to_person: { + pass: { + number: { + value: "1324 103496", + copy: true, + }, + issuedBy: { + value: "Отделом УФМС России по владимирской области", + }, + divisionCode: { + value: "675–901", + }, + dateIssue: { + value: "01.01.2011", + }, }, }, - snils: { - number: { - value: "812–183–139 21", - copy: true, + note_to_person: { + basic_info: { + age: "54", + jobTitle: "Менеджер", + priority: "-", + phone: "+7 (574) 364–53–36", + email: "antimag@gmail.com", + networks: [], + meeting: { + date: "14.07.22", + time: "17:30–21:30", + }, }, - }, - inn: { - number: { - value: "138291382731", - copy: true, + additional_info: { + snils: { + number: { + value: "834–001–555 35", + copy: true, + }, + }, + inn: { + number: { + value: "371942327342", + copy: true, + }, + }, + birthday: { + date: { + value: "07.12.1993", + }, + }, + addresses: { + registrationPlace: { + value: + "371311, Московская обл., г. Владимир, ул. Гагарина, д.12, кв. 24", + }, + actualPlace: { + value: + "371311, Московская обл., г. Владимир, ул. Гагарина, д.12, кв. 24", + }, + }, + docs: [ + { + name: "Договор покупки.pdf", + type: "application/pdf", + }, + { + name: "Договор о оптовых поставках.pdf", + type: "application/pdf", + }, + { + name: "Договор о предоставлении услуг.pdf", + type: "application/pdf", + }, + { + name: "Какое-то очень очень очень очень короткое название.doc", + type: "application/msword", + }, + { + name: "Документация.doc", + type: "application/msword", + }, + { + name: "Отчет.xls", + type: "application/vnd.ms-excel", + }, + { + name: "Заказы.xls", + type: "application/vnd.ms-excel", + }, + ], + additional: [ + { + header: "По каким вопросам обращатся", + value: "Обращатся только по вопросам закупок", + name: "", + type: "", + }, + { + header: "Доп.документы", + value: "Ответственные за работу", + name: "Список ответсвенных.xls", + type: "application/vnd.ms-excel", + }, + { + header: "Портфолио", + value: "Информация о клиенте", + name: "Портфолио.doc", + type: "application/msword", + }, + ], }, }, - birthday: { - date: { - value: "21.04.1999", - }, - }, - addresses: { - registrationPlace: { - value: - "371311, Московская обл., г. Москва, ул. Комсомольская, д.6, кв. 13", - }, - actualPlace: { - value: - "371311, Московская обл., г. Москва, ул. Комсомольская, д.6, кв. 13", - }, - }, - docs: { - info: [ - { - value: "Договор оферты.pdf", - }, - { - value: "Договор о долевом строительстве.pdf", - }, - { - value: "Какое-то очень очень очень очень длинное название.doc", - }, - { - value: "Договор об оплате.doc", - }, - { - value: "Коммерческое предложение.xls", - }, - { - value: "Таблица заказов.xls", - }, - ], - }, - additional: { - info: [ - { - name: "Предпочтения", - value: "Разговор на “Вы”\nТолько по делу\nТолько официальный стиль", - file: "", - }, - { - name: "Доп.документы", - value: "", - file: "Памятка с вопросами на созвоне.pdf", - }, - { - name: "Его должность", - value: "Вроде бы важная шишка, пусть будет – Гуру в дизайне", - file: "", - }, - { - name: "Чтобы не забыть", - value: "Не забудь!", - file: "", - }, - ], - }, }, ]; export function clientsServer() { createServer({ routes() { - this.get("/api/clients", () => ({ - dataClients, - })); + this.get("/api/clients", () => { + return dataClients.map((el) => ({ + ...el.note_to_person.basic_info, + id: el.id, + last_name: el.last_name, + first_name: el.first_name, + patronymic: el.patronymic, + })); + }); this.passthrough("http://45.84.227.122:8080/**"); this.get("/api/detail/:id", (schema, request) => { let id = request.params.id; - return clientsDetail.find((el) => el.idClient === id); + let client = dataClients.find((el) => el.id === id); + return { + ...client.note_to_person.additional_info, + id: client.id, + pass: client.identity_document_to_person.pass, + }; }); }, }); diff --git a/src/assets/sass/variables.sass b/src/assets/sass/variables.sass index 6d60274..7b18a9e 100644 --- a/src/assets/sass/variables.sass +++ b/src/assets/sass/variables.sass @@ -20,3 +20,6 @@ --btn-red-color: #ff6f6f --time-indicator-color: #e93131 --font-obligatory-color: #ff0000 + --light-grey-bg-color: #f8f9fa + --btn-green-color: rgba(60, 217, 75, 1) + --btn-light-green-color: rgba(60, 217, 75, 0.2) diff --git a/src/components/base/buttons/BaseButtonOk.vue b/src/components/base/buttons/BaseButtonOk.vue new file mode 100644 index 0000000..dad1ec5 --- /dev/null +++ b/src/components/base/buttons/BaseButtonOk.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/src/components/base/buttons/BaseButtonPlus.vue b/src/components/base/buttons/BaseButtonPlus.vue index cde6574..24971ab 100644 --- a/src/components/base/buttons/BaseButtonPlus.vue +++ b/src/components/base/buttons/BaseButtonPlus.vue @@ -1,10 +1,23 @@ @@ -12,10 +25,14 @@ export default { .button-plus outline: none border: none - width: 24px - height: 24px - max-height: 24px color: var(--btn-blue-color) - background-color: var(--bg-ligth-blue-color) border-radius: 50% +.change + background-color: var(--btn-blue-color-0) + color: var(--btn-blue-color) + border: 1.5px solid var(--btn-blue-color) + &:hover + border: none + background-color: var(--btn-blue-color) + color: var(--default-white) diff --git a/src/pages/clients/components/ClientDetailInfoSection.vue b/src/pages/clients/components/ClientDetailInfoSection.vue index 945a245..2509942 100644 --- a/src/pages/clients/components/ClientDetailInfoSection.vue +++ b/src/pages/clients/components/ClientDetailInfoSection.vue @@ -1,30 +1,56 @@ @@ -33,13 +59,32 @@ export default { border: 1px solid var(--border-light-grey-color) border-radius: 4px color: var(--font-dark-blue-color) - &.flex-row - flex-direction: row + &.click + background-color: var(--light-grey-bg-color) .section-header + min-height: 44px border-bottom: 1px solid var(--border-light-grey-color) - &.style-border - border-bottom: none - border-right: 1px solid var(--border-light-grey-color) +.small + border-bottom: none + border-right: 1px solid var(--border-light-grey-color) + min-width: 180px .title-section color: var(--font-grey-color) +.copy + color: var(--btn-blue-color) + opacity: 0.6 +.section-body + overflow-y: auto + &::-webkit-scrollbar + width: 4px + &::-webkit-scrollbar-track + background-color: rgba(211, 212, 220, 0.5) + border-radius: 8px + &::-webkit-scrollbar-thumb + border-radius: 8px + background-color: var(--btn-blue-color) +.edit + color: var(--btn-blue-color) + &:hover + opacity: 0.6 diff --git a/src/pages/clients/components/ClientDetailInfoWrapper.vue b/src/pages/clients/components/ClientDetailInfoWrapper.vue index c9a0bdc..a7f0230 100644 --- a/src/pages/clients/components/ClientDetailInfoWrapper.vue +++ b/src/pages/clients/components/ClientDetailInfoWrapper.vue @@ -1,12 +1,14 @@ + + diff --git a/src/pages/clients/components/ClientsTable.vue b/src/pages/clients/components/ClientsTable.vue index de46158..5a892e9 100644 --- a/src/pages/clients/components/ClientsTable.vue +++ b/src/pages/clients/components/ClientsTable.vue @@ -10,7 +10,7 @@ :id="client.id" :is-check="marked.includes(client.id)" :check="selectedCheck" - :full-name="client.fullName" + :full-name="`${client.last_name} ${client.first_name} ${client.patronymic}`" :age="client.age" :job-title="client.jobTitle" :priority="client.priority" @@ -46,7 +46,7 @@ export default { }, methods: { saveDataClients(data) { - this.dataClients = data.dataClients; + this.dataClients = data; }, fetchDataClients() { // eslint-disable-next-line diff --git a/src/pages/clients/components/ClientsTableHat.vue b/src/pages/clients/components/ClientsTableHat.vue index 40f4c1e..9155cc5 100644 --- a/src/pages/clients/components/ClientsTableHat.vue +++ b/src/pages/clients/components/ClientsTableHat.vue @@ -18,7 +18,7 @@ import BaseCreateButton from "@/components/base/buttons/BaseCreateButton"; import BassExportButton from "@/components/base/buttons/BassExportButton"; import BaseInput from "@/components/base/BaseInput"; export default { - name: "ClientsTAbleHeader", + name: "ClientsTableHat", components: { BaseInput, BassExportButton, diff --git a/src/pages/clients/components/ClientsTableRow.vue b/src/pages/clients/components/ClientsTableRow.vue index c972622..77680b7 100644 --- a/src/pages/clients/components/ClientsTableRow.vue +++ b/src/pages/clients/components/ClientsTableRow.vue @@ -1,6 +1,6 @@