kaoshaos commited on
Commit
0c47432
·
verified ·
1 Parent(s): 74e1ba8

сделай сайт для учета сделок по продажам, додумай сам как сделать лучше, реализуй с помощью веб-технологий вроде HTML, CSS, JavaScript, PHPи базой данный SQL на первой странице должны быть представлены общая сумма на затраты на закупки, общая сумма продаж, маржинальность сделок, информация по сделками краткий список последних сделок, график статистики по продажам, сделки должны иметь собственный номер которые начинаются с MT сделки должны иметь статусы активные, в ожидании, завершены, отменены. В системе должен быть реализован поиск по сделками клиентам и поставщикам. В системе должна быть возможность учитывать клиентов поставщиков и сделки продаж по ним. при создании сделок должно открываться новое окно в котором будет табличная форма с редактируемыми полями "порядковый номер", "наименование товара", "количество", "цена за единицу с ндс 5%", "общая стоимость с ндс 5%", "накрутка в процентах", "наименование товара закупки", "цена закупки за шт.", "общая цена закупки за шт.", "поставщик товара", Столбец цена за единицу с ндс 5% должна зависеть от цена закупки за шт. и увеличиваться на процент указанный в столбике накрутка в процентах, при этом должна быть возможность менять цены в столбике "цена за единицу с ндс 5%" вручную если необходимо, должна быть возможность массовой работы с товарами на пример все проставить накрутку 30%, должна быть возможность указать что товар доставлен поставив галочку, должна быть возможность массовой загрузки товаров в таблицу с помощью excel, должен быть доступен импорт товаров путем скачивания таблицы excel на компьютер, должна быть возможность указывать поставщиков для каждой сделки, должна быть возможность добавлять множество сделок клиенту, у каждого клиента должна быть карточка в которой будет указаны какие сделки с ним совершались и какие товары он покупал, должна быть взаимосвязь между сделками клиентами и поставщиками, должна быть возможность хранить и заполнять данные о клиенте и поставщике такие как контактные данные почта телефон лицо для связи, должно быть место куда можно записать какие то комментарии, все расчеты должны быть в рублях, язык интерфейса русский

Browse files
components/deal-modal.js CHANGED
@@ -38,7 +38,7 @@ class CustomDealModal extends HTMLElement {
38
  </svg>
39
  </button>
40
  </div>
41
- <div class="modal-body">
42
  <div class="grid grid-cols-1 gap-4 mb-6">
43
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
44
  <div>
@@ -50,11 +50,11 @@ class CustomDealModal extends HTMLElement {
50
  <option>Wayne Enterprises</option>
51
  <option>Stark Industries</option>
52
  </select>
53
- </div>
54
  <div>
55
  <label for="dealDate" class="block text-sm font-medium text-gray-700">Дата сделки</label>
56
  <input type="date" id="dealDate" class="form-input mt-1" required>
57
- </div>
58
  </div>
59
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
60
  <div>
@@ -66,7 +66,7 @@ class CustomDealModal extends HTMLElement {
66
  <option>Hardware World</option>
67
  <option>Component King</option>
68
  </select>
69
- </div>
70
  <div>
71
  <label for="status" class="block text-sm font-medium text-gray-700">Статус</label>
72
  <select id="status" class="form-input mt-1" required>
@@ -76,34 +76,39 @@ class CustomDealModal extends HTMLElement {
76
  <option>Завершена</option>
77
  <option>Отменена</option>
78
  </select>
79
- </div>
80
  </div>
81
  <div>
82
  <label for="notes" class="block text-sm font-medium text-gray-700">Примечания</label>
83
  <textarea id="notes" rows="3" class="form-input mt-1" placeholder="Дополнительная информация"></textarea>
84
- </div>
85
  </div>
86
 
87
  <div class="border-t border-b border-gray-200 py-4 mb-4">
88
  <div class="flex justify-between items-center">
89
- <h4 class="text-lg font-medium text-gray-900">Items</h4>
90
  <div class="flex space-x-2">
91
- <button onclick="importExcel()" class="btn-secondary">
92
- <i data-feather="upload" class="w-4 h-4 mr-2"></i> Импорт
93
- </button>
94
- <button onclick="exportExcel()" class="btn-secondary">
95
- <i data-feather="download" class="w-4 h-4 mr-2"></i> Экспорт
96
- </button>
97
- <button onclick="createNewDeal()" class="btn-primary">
98
- <i data-feather="save" class="w-4 h-4 mr-2"></i> Сохранить сделку
99
- </button>
100
- </div>
101
  </div>
102
  </div>
103
 
104
- <div class="overflow-x-auto">
105
- <table class="min-w-full divide-y divide-gray-200">
106
- <thead class="bg-gray-50">
107
- <tr>
108
- <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">#</th>
109
- <th scope="col" class="px-6 py-3 text
 
 
 
 
 
 
38
  </svg>
39
  </button>
40
  </div>
41
+ <div class="modal-body">
42
  <div class="grid grid-cols-1 gap-4 mb-6">
43
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
44
  <div>
 
50
  <option>Wayne Enterprises</option>
51
  <option>Stark Industries</option>
52
  </select>
53
+ </div>
54
  <div>
55
  <label for="dealDate" class="block text-sm font-medium text-gray-700">Дата сделки</label>
56
  <input type="date" id="dealDate" class="form-input mt-1" required>
57
+ </div>
58
  </div>
59
  <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
60
  <div>
 
66
  <option>Hardware World</option>
67
  <option>Component King</option>
68
  </select>
69
+ </div>
70
  <div>
71
  <label for="status" class="block text-sm font-medium text-gray-700">Статус</label>
72
  <select id="status" class="form-input mt-1" required>
 
76
  <option>Завершена</option>
77
  <option>Отменена</option>
78
  </select>
79
+ </div>
80
  </div>
81
  <div>
82
  <label for="notes" class="block text-sm font-medium text-gray-700">Примечания</label>
83
  <textarea id="notes" rows="3" class="form-input mt-1" placeholder="Дополнительная информация"></textarea>
84
+ </div>
85
  </div>
86
 
87
  <div class="border-t border-b border-gray-200 py-4 mb-4">
88
  <div class="flex justify-between items-center">
89
+ <h4 class="text-lg font-medium text-gray-900">Товары</h4>
90
  <div class="flex space-x-2">
91
+ <button onclick="importExcel()" class="btn-secondary">
92
+ <i data-feather="upload" class="w-4 h-4 mr-2"></i> Импорт
93
+ </button>
94
+ <button onclick="exportExcel()" class="btn-secondary">
95
+ <i data-feather="download" class="w-4 h-4 mr-2"></i> Экспорт
96
+ </button>
97
+ <button onclick="createNewDeal()" class="btn-primary">
98
+ <i data-feather="save" class="w-4 h-4 mr-2"></i> Сохранить сделку
99
+ </button>
100
+ </div>
101
  </div>
102
  </div>
103
 
104
+ <slot></slot>
105
+ </div>
106
+ </div>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ `;
111
+ }
112
+ }
113
+
114
+ customElements.define('custom-deal-modal', CustomDealModal);
components/deal-table.js CHANGED
@@ -23,12 +23,12 @@ class CustomDealTable extends HTMLElement {
23
  <table class="table">
24
  <thead>
25
  <tr>
26
- <th>Deal ID</th>
27
- <th>Client</th>
28
- <th>Date</th>
29
- <th>Total</th>
30
- <th>Status</th>
31
- <th>Actions</th>
32
  </tr>
33
  </thead>
34
  <tbody class="bg-white divide-y divide-gray-200">
@@ -37,21 +37,21 @@ class CustomDealTable extends HTMLElement {
37
  <div class="text-sm font-medium text-gray-900">MT-2023-0425</div>
38
  </td>
39
  <td class="px-6 py-4">
40
- <div class="text-sm text-gray-900">Acme Corporation</div>
41
- <div class="text-sm text-gray-500">John Doe</div>
42
  </td>
43
  <td class="px-6 py-4">
44
- <div class="text-sm text-gray-900">2023-04-25</div>
45
  </td>
46
  <td class="px-6 py-4">
47
- <div class="text-sm font-medium text-gray-900">€2,480</div>
48
  </td>
49
  <td class="px-6 py-4">
50
- <span class="status-badge status-active">Active</span>
51
  </td>
52
  <td class="px-6 py-4 text-right text-sm font-medium">
53
- <a href="deal-detail.html" class="text-blue-600 hover:text-blue-900 mr-3">View</a>
54
- <a href="#" class="text-indigo-600 hover:text-indigo-900">Edit</a>
55
  </td>
56
  </tr>
57
  <tr>
@@ -60,20 +60,20 @@ class CustomDealTable extends HTMLElement {
60
  </td>
61
  <td class="px-6 py-4">
62
  <div class="text-sm text-gray-900">Globex Inc</div>
63
- <div class="text-sm text-gray-500">Jane Smith</div>
64
  </td>
65
  <td class="px-6 py-4">
66
- <div class="text-sm text-gray-900">2023-04-24</div>
67
  </td>
68
  <td class="px-6 py-4">
69
- <div class="text-sm font-medium text-gray-900">€3,750</div>
70
  </td>
71
  <td class="px-6 py-4">
72
- <span class="status-badge status-completed">Completed</span>
73
  </td>
74
  <td class="px-6 py-4 text-right text-sm font-medium">
75
- <a href="deal-detail.html" class="text-blue-600 hover:text-blue-900 mr-3">View</a>
76
- <a href="#" class="text-indigo-600 hover:text-indigo-900">Edit</a>
77
  </td>
78
  </tr>
79
  <tr>
@@ -82,64 +82,20 @@ class CustomDealTable extends HTMLElement {
82
  </td>
83
  <td class="px-6 py-4">
84
  <div class="text-sm text-gray-900">Wayne Enterprises</div>
85
- <div class="text-sm text-gray-500">Bruce Wayne</div>
86
  </td>
87
  <td class="px-6 py-4">
88
- <div class="text-sm text-gray-900">2023-04-23</div>
89
  </td>
90
  <td class="px-6 py-4">
91
- <div class="text-sm font-medium text-gray-900">€1,920</div>
92
  </td>
93
  <td class="px-6 py-4">
94
- <span class="status-badge status-pending">Pending</span>
95
  </td>
96
  <td class="px-6 py-4 text-right text-sm font-medium">
97
- <a href="deal-detail.html" class="text-blue-600 hover:text-blue-900 mr-3">View</a>
98
- <a href="#" class="text-indigo-600 hover:text-indigo-900">Edit</a>
99
- </td>
100
- </tr>
101
- <tr>
102
- <td class="px-6 py-4">
103
- <div class="text-sm font-medium text-gray-900">MT-2023-0422</div>
104
- </td>
105
- <td class="px-6 py-4">
106
- <div class="text-sm text-gray-900">Stark Industries</div>
107
- <div class="text-sm text-gray-500">Tony Stark</div>
108
- </td>
109
- <td class="px-6 py-4">
110
- <div class="text-sm text-gray-900">2023-04-22</div>
111
- </td>
112
- <td class="px-6 py-4">
113
- <div class="text-sm font-medium text-gray-900">€5,600</div>
114
- </td>
115
- <td class="px-6 py-4">
116
- <span class="status-badge status-cancelled">Cancelled</span>
117
- </td>
118
- <td class="px-6 py-4 text-right text-sm font-medium">
119
- <a href="deal-detail.html" class="text-blue-600 hover:text-blue-900 mr-3">View</a>
120
- <a href="#" class="text-indigo-600 hover:text-indigo-900">Edit</a>
121
- </td>
122
- </tr>
123
- <tr>
124
- <td class="px-6 py-4">
125
- <div class="text-sm font-medium text-gray-900">MT-2023-0421</div>
126
- </td>
127
- <td class="px-6 py-4">
128
- <div class="text-sm text-gray-900">Umbrella Corp</div>
129
- <div class="text-sm text-gray-500">Albert Wesker</div>
130
- </td>
131
- <td class="px-6 py-4">
132
- <div class="text-sm text-gray-900">2023-04-21</div>
133
- </td>
134
- <td class="px-6 py-4">
135
- <div class="text-sm font-medium text-gray-900">€4,250</div>
136
- </td>
137
- <td class="px-6 py-4">
138
- <span class="status-badge status-completed">Completed</span>
139
- </td>
140
- <td class="px-6 py-4 text-right text-sm font-medium">
141
- <a href="deal-detail.html" class="text-blue-600 hover:text-blue-900 mr-3">View</a>
142
- <a href="#" class="text-indigo-600 hover:text-indigo-900">Edit</a>
143
  </td>
144
  </tr>
145
  </tbody>
 
23
  <table class="table">
24
  <thead>
25
  <tr>
26
+ <th>ID Сделки</th>
27
+ <th>Клиент</th>
28
+ <th>Дата</th>
29
+ <th>Сумма</th>
30
+ <th>Статус</th>
31
+ <th>Действия</th>
32
  </tr>
33
  </thead>
34
  <tbody class="bg-white divide-y divide-gray-200">
 
37
  <div class="text-sm font-medium text-gray-900">MT-2023-0425</div>
38
  </td>
39
  <td class="px-6 py-4">
40
+ <div class="text-sm text-gray-900">Компания Acme</div>
41
+ <div class="text-sm text-gray-500">Иван Иванов</div>
42
  </td>
43
  <td class="px-6 py-4">
44
+ <div class="text-sm text-gray-900">25.04.2023</div>
45
  </td>
46
  <td class="px-6 py-4">
47
+ <div class="text-sm font-medium text-gray-900">24 800 ₽</div>
48
  </td>
49
  <td class="px-6 py-4">
50
+ <span class="status-badge status-active">Активна</span>
51
  </td>
52
  <td class="px-6 py-4 text-right text-sm font-medium">
53
+ <a href="deal-detail.html" class="text-blue-600 hover:text-blue-900 mr-3">Просмотр</a>
54
+ <a href="#" class="text-indigo-600 hover:text-indigo-900">Редакт.</a>
55
  </td>
56
  </tr>
57
  <tr>
 
60
  </td>
61
  <td class="px-6 py-4">
62
  <div class="text-sm text-gray-900">Globex Inc</div>
63
+ <div class="text-sm text-gray-500">Мария Петрова</div>
64
  </td>
65
  <td class="px-6 py-4">
66
+ <div class="text-sm text-gray-900">24.04.2023</div>
67
  </td>
68
  <td class="px-6 py-4">
69
+ <div class="text-sm font-medium text-gray-900">37 500 ₽</div>
70
  </td>
71
  <td class="px-6 py-4">
72
+ <span class="status-badge status-completed">Завершена</span>
73
  </td>
74
  <td class="px-6 py-4 text-right text-sm font-medium">
75
+ <a href="deal-detail.html" class="text-blue-600 hover:text-blue-900 mr-3">Просмотр</a>
76
+ <a href="#" class="text-indigo-600 hover:text-indigo-900">Редакт.</a>
77
  </td>
78
  </tr>
79
  <tr>
 
82
  </td>
83
  <td class="px-6 py-4">
84
  <div class="text-sm text-gray-900">Wayne Enterprises</div>
85
+ <div class="text-sm text-gray-500">Алексей Смирнов</div>
86
  </td>
87
  <td class="px-6 py-4">
88
+ <div class="text-sm text-gray-900">23.04.2023</div>
89
  </td>
90
  <td class="px-6 py-4">
91
+ <div class="text-sm font-medium text-gray-900">19 200 ₽</div>
92
  </td>
93
  <td class="px-6 py-4">
94
+ <span class="status-badge status-pending">В ожидании</span>
95
  </td>
96
  <td class="px-6 py-4 text-right text-sm font-medium">
97
+ <a href="deal-detail.html" class="text-blue-600 hover:text-blue-900 mr-3">Просмотр</a>
98
+ <a href="#" class="text-indigo-600 hover:text-indigo-900">Редакт.</a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  </td>
100
  </tr>
101
  </tbody>
components/navbar.js CHANGED
@@ -4,13 +4,32 @@ class CustomNavbar extends HTMLElement {
4
  this.shadowRoot.innerHTML = `
5
  <style>
6
  nav {
7
- background: white;
8
- padding: 1rem;
9
- box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 
 
 
 
 
 
 
 
 
 
 
10
  }
11
  </style>
12
  <nav>
13
- <h2 class="text-xl font-bold">DealFlow Tracker</h2>
 
 
 
 
 
 
 
 
14
  </nav>
15
  `;
16
  }
 
4
  this.shadowRoot.innerHTML = `
5
  <style>
6
  nav {
7
+ @apply bg-white shadow-sm fixed w-full z-10;
8
+ height: 60px;
9
+ }
10
+ .navbar-container {
11
+ @apply flex items-center justify-between h-full px-4;
12
+ }
13
+ .logo {
14
+ @apply text-xl font-bold text-gray-800;
15
+ }
16
+ .user-menu {
17
+ @apply flex items-center space-x-4;
18
+ }
19
+ .user-avatar {
20
+ @apply h-8 w-8 rounded-full bg-gray-200 flex items-center justify-center;
21
  }
22
  </style>
23
  <nav>
24
+ <div class="navbar-container">
25
+ <div class="logo">DealFlow Tracker</div>
26
+ <div class="user-menu">
27
+ <div class="text-sm font-medium">Администратор</div>
28
+ <div class="user-avatar">
29
+ <i data-feather="user"></i>
30
+ </div>
31
+ </div>
32
+ </div>
33
  </nav>
34
  `;
35
  }
components/product-table.js CHANGED
@@ -1,92 +1,11 @@
 
1
  class CustomProductTable extends HTMLElement {
2
- connectedCallback() {
3
- this.attachShadow({ mode: 'open' });
4
- this.shadowRoot.innerHTML = `
5
- <style>
6
- .table-container {
7
- @apply overflow-x-auto mb-4;
8
- }
9
- .table {
10
- @apply min-w-full divide-y divide-gray-200;
11
- }
12
- .table th {
13
- @apply px-4 py-2 bg-gray-50 text-left text-xs font-medium text-gray-500 uppercase tracking-wider;
14
- }
15
- .table td {
16
- @apply px-4 py-2 whitespace-nowrap text-sm text-gray-500;
17
- }
18
- .table input, .table select {
19
- @apply w-full border border-gray-300 rounded px-2 py-1 text-sm;
20
- }
21
- .table tr:hover {
22
- @apply bg-gray-50;
23
- }
24
- .actions-toolbar {
25
- @apply flex justify-between items-center mb-4;
26
- }
27
- </style>
28
- <div>
29
- <div class="actions-toolbar">
30
- <div class="space-x-2">
31
- <button class="btn-secondary" id="addRow">
32
- <i data-feather="plus" class="w-4 h-4 mr-2"></i> Добавить строку
33
- </button>
34
- <button class="btn-secondary" id="applyMargin">
35
- <i data-feather="percent" class="w-4 h-4 mr-2"></i> Применить наценку
36
- </button>
37
- </div>
38
- <div class="space-x-2">
39
- <button class="btn-secondary" id="importExcel">
40
- <i data-feather="upload" class="w-4 h-4 mr-2"></i> Импорт
41
- </button>
42
- <button class="btn-secondary" id="exportExcel">
43
- <i data-feather="download" class="w-4 h-4 mr-2"></i> Экспорт
44
- </button>
45
- </div>
46
- </div>
47
-
48
- <div class="table-container">
49
- <table class="table" id="productTable">
50
- <thead>
51
- <tr>
52
- <th>№</th>
53
- <th>Наименование товара</th>
54
- <th>Кол-во</th>
55
- <th>Цена закупки (₽)</th>
56
- <th>Сумма закупки (₽)</th>
57
- <th>Накрутка %</th>
58
- <th>Цена с НДС 5% (₽)</th>
59
- <th>Сумма с НДС 5% (₽)</th>
60
- <th>Поставщик</th>
61
- <th>Доставлено</th>
62
- <th>Действия</th>
63
- </tr>
64
- </thead>
65
- <tbody class="bg-white divide-y divide-gray-200">
66
- <tr>
67
- <td>1</td>
68
- <td><input type="text" value="Ноутбук Lenovo IdeaPad 3"></td>
69
- <td><input type="number" value="5" class="qty"></td>
70
- <td><input type="number" value="45000" class="purchase-price"></td>
71
- <td>225 000 ₽</td>
72
- <td><input type="number" value="20" class="margin"></td>
73
- <td><input type="number" value="56700" class="sale-price"></td>
74
- <td>283 500 ₽</td>
75
- <td>
76
- <select>
77
- <option>ООО "Техносила"</option>
78
- <option>ИП Петров</option>
79
- <option>Компьютерный мир</option>
80
- </select>
81
- </td>
82
- <td><input type="checkbox"></td>
83
- <td><button class="text-red-500 hover:text-red-700"><i data-feather="trash-2" class="w-4 h-4"></i></button></td>
84
- </tr>
85
- </tbody>
86
- </table>
87
- </div>
88
- </div>
89
- `;
90
- }
91
- }
92
- customElements.define('custom-product-table', CustomProductTable);
 
1
+ ```javascript
2
  class CustomProductTable extends HTMLElement {
3
+ connectedCallback() {
4
+ this.attachShadow({ mode: 'open' });
5
+ this.shadowRoot.innerHTML = `
6
+ <style>
7
+ .table-container {
8
+ @apply overflow-x-auto mb-4;
9
+ }
10
+ .table {
11
+ @apply min-w
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
components/quick-stats.js CHANGED
@@ -24,43 +24,43 @@ class CustomQuickStats extends HTMLElement {
24
  </style>
25
  <div class="grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-4">
26
  <div class="stat-card">
27
- <h3 class="stat-title">Total Purchases</h3>
28
- <p class="stat-value">€24,780</p>
29
  <p class="mt-2 flex items-baseline">
30
  <span class="stat-change negative">
31
- <i data-feather="arrow-down" class="w-3 h-3 mr-1"></i> 2.5%
32
  </span>
33
- <span class="ml-2 text-sm text-gray-500">vs last month</span>
34
  </p>
35
  </div>
36
  <div class="stat-card">
37
- <h3 class="stat-title">Total Sales</h3>
38
- <p class="stat-value">€38,450</p>
39
  <p class="mt-2 flex items-baseline">
40
  <span class="stat-change positive">
41
  <i data-feather="arrow-up" class="w-3 h-3 mr-1"></i> 12.8%
42
  </span>
43
- <span class="ml-2 text-sm text-gray-500">vs last month</span>
44
  </p>
45
  </div>
46
  <div class="stat-card">
47
- <h3 class="stat-title">Gross Margin</h3>
48
- <p class="stat-value">35.2%</p>
49
  <p class="mt-2 flex items-baseline">
50
  <span class="stat-change positive">
51
- <i data-feather="arrow-up" class="w-3 h-3 mr-1"></i> 1.6%
52
  </span>
53
- <span class="ml-2 text-sm text-gray-500">vs last month</span>
54
  </p>
55
  </div>
56
  <div class="stat-card">
57
- <h3 class="stat-title">Active Deals</h3>
58
  <p class="stat-value">18</p>
59
  <p class="mt-2 flex items-baseline">
60
  <span class="stat-change positive">
61
  <i data-feather="arrow-up" class="w-3 h-3 mr-1"></i> 3
62
  </span>
63
- <span class="ml-2 text-sm text-gray-500">since last week</span>
64
  </p>
65
  </div>
66
  </div>
 
24
  </style>
25
  <div class="grid grid-cols-1 gap-5 sm:grid-cols-2 lg:grid-cols-4">
26
  <div class="stat-card">
27
+ <h3 class="stat-title">Общие затраты на закупки</h3>
28
+ <p class="stat-value">1 245 000 ₽</p>
29
  <p class="mt-2 flex items-baseline">
30
  <span class="stat-change negative">
31
+ <i data-feather="arrow-down" class="w-3 h-3 mr-1"></i> 5.2%
32
  </span>
33
+ <span class="ml-2 text-sm text-gray-500">за прошлый месяц</span>
34
  </p>
35
  </div>
36
  <div class="stat-card">
37
+ <h3 class="stat-title">Общий объем продаж</h3>
38
+ <p class="stat-value">1 856 000 ₽</p>
39
  <p class="mt-2 flex items-baseline">
40
  <span class="stat-change positive">
41
  <i data-feather="arrow-up" class="w-3 h-3 mr-1"></i> 12.8%
42
  </span>
43
+ <span class="ml-2 text-sm text-gray-500">за прошлый месяц</span>
44
  </p>
45
  </div>
46
  <div class="stat-card">
47
+ <h3 class="stat-title">Маржинальность</h3>
48
+ <p class="stat-value">32.8%</p>
49
  <p class="mt-2 flex items-baseline">
50
  <span class="stat-change positive">
51
+ <i data-feather="arrow-up" class="w-3 h-3 mr-1"></i> 2.1%
52
  </span>
53
+ <span class="ml-2 text-sm text-gray-500">за прошлый месяц</span>
54
  </p>
55
  </div>
56
  <div class="stat-card">
57
+ <h3 class="stat-title">Активные сделки</h3>
58
  <p class="stat-value">18</p>
59
  <p class="mt-2 flex items-baseline">
60
  <span class="stat-change positive">
61
  <i data-feather="arrow-up" class="w-3 h-3 mr-1"></i> 3
62
  </span>
63
+ <span class="ml-2 text-sm text-gray-500">за прошлую неделю</span>
64
  </p>
65
  </div>
66
  </div>
components/recent-deals.js CHANGED
@@ -15,11 +15,11 @@ class CustomRecentDeals extends HTMLElement {
15
  <div class="flex items-center justify-between">
16
  <div>
17
  <p class="text-sm font-medium text-gray-900">MT-2023-0425</p>
18
- <p class="text-sm text-gray-500">Acme Corporation</p>
19
  </div>
20
  <div class="flex items-center">
21
- <span class="status-badge status-active mr-4">Active</span>
22
- <span class="text-sm font-medium text-gray-900">€2,480</span>
23
  </div>
24
  </div>
25
  </div>
@@ -30,8 +30,8 @@ class CustomRecentDeals extends HTMLElement {
30
  <p class="text-sm text-gray-500">Globex Inc</p>
31
  </div>
32
  <div class="flex items-center">
33
- <span class="status-badge status-completed mr-4">Completed</span>
34
- <span class="text-sm font-medium text-gray-900">€3,750</span>
35
  </div>
36
  </div>
37
  </div>
@@ -42,8 +42,8 @@ class CustomRecentDeals extends HTMLElement {
42
  <p class="text-sm text-gray-500">Wayne Enterprises</p>
43
  </div>
44
  <div class="flex items-center">
45
- <span class="status-badge status-pending mr-4">Pending</span>
46
- <span class="text-sm font-medium text-gray-900">€1,920</span>
47
  </div>
48
  </div>
49
  </div>
@@ -54,20 +54,8 @@ class CustomRecentDeals extends HTMLElement {
54
  <p class="text-sm text-gray-500">Stark Industries</p>
55
  </div>
56
  <div class="flex items-center">
57
- <span class="status-badge status-cancelled mr-4">Cancelled</span>
58
- <span class="text-sm font-medium text-gray-900">€5,600</span>
59
- </div>
60
- </div>
61
- </div>
62
- <div class="deal-item">
63
- <div class="flex items-center justify-between">
64
- <div>
65
- <p class="text-sm font-medium text-gray-900">MT-2023-0421</p>
66
- <p class="text-sm text-gray-500">Umbrella Corp</p>
67
- </div>
68
- <div class="flex items-center">
69
- <span class="status-badge status-completed mr-4">Completed</span>
70
- <span class="text-sm font-medium text-gray-900">€4,250</span>
71
  </div>
72
  </div>
73
  </div>
 
15
  <div class="flex items-center justify-between">
16
  <div>
17
  <p class="text-sm font-medium text-gray-900">MT-2023-0425</p>
18
+ <p class="text-sm text-gray-500">Компания Acme</p>
19
  </div>
20
  <div class="flex items-center">
21
+ <span class="status-badge status-active mr-4">Активна</span>
22
+ <span class="text-sm font-medium text-gray-900">24 800 ₽</span>
23
  </div>
24
  </div>
25
  </div>
 
30
  <p class="text-sm text-gray-500">Globex Inc</p>
31
  </div>
32
  <div class="flex items-center">
33
+ <span class="status-badge status-completed mr-4">Завершена</span>
34
+ <span class="text-sm font-medium text-gray-900">37 500 ₽</span>
35
  </div>
36
  </div>
37
  </div>
 
42
  <p class="text-sm text-gray-500">Wayne Enterprises</p>
43
  </div>
44
  <div class="flex items-center">
45
+ <span class="status-badge status-pending mr-4">В ожидании</span>
46
+ <span class="text-sm font-medium text-gray-900">19 200 ₽</span>
47
  </div>
48
  </div>
49
  </div>
 
54
  <p class="text-sm text-gray-500">Stark Industries</p>
55
  </div>
56
  <div class="flex items-center">
57
+ <span class="status-badge status-cancelled mr-4">Отменена</span>
58
+ <span class="text-sm font-medium text-gray-900">56 000 ₽</span>
 
 
 
 
 
 
 
 
 
 
 
 
59
  </div>
60
  </div>
61
  </div>
components/sidebar.js CHANGED
@@ -23,25 +23,25 @@ class CustomSidebar extends HTMLElement {
23
  <div class="sidebar" id="sidebar">
24
  <nav class="px-2 py-4">
25
  <a href="index.html" class="nav-link active">
26
- <i data-feather="home"></i> Dashboard
27
  </a>
28
  <a href="deals.html" class="nav-link">
29
- <i data-feather="dollar-sign"></i> Deals
30
  </a>
31
  <a href="clients.html" class="nav-link">
32
- <i data-feather="users"></i> Clients
33
  </a>
34
  <a href="suppliers.html" class="nav-link">
35
- <i data-feather="truck"></i> Suppliers
36
  </a>
37
  <a href="reports.html" class="nav-link">
38
- <i data-feather="pie-chart"></i> Reports
39
  </a>
40
  <div class="px-4 py-2 mt-6">
41
- <h3 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Settings</h3>
42
  </div>
43
  <a href="settings.html" class="nav-link">
44
- <i data-feather="settings"></i> System Settings
45
  </a>
46
  </nav>
47
  </div>
 
23
  <div class="sidebar" id="sidebar">
24
  <nav class="px-2 py-4">
25
  <a href="index.html" class="nav-link active">
26
+ <i data-feather="home"></i> Главная
27
  </a>
28
  <a href="deals.html" class="nav-link">
29
+ <i data-feather="dollar-sign"></i> Сделки
30
  </a>
31
  <a href="clients.html" class="nav-link">
32
+ <i data-feather="users"></i> Клиенты
33
  </a>
34
  <a href="suppliers.html" class="nav-link">
35
+ <i data-feather="truck"></i> Поставщики
36
  </a>
37
  <a href="reports.html" class="nav-link">
38
+ <i data-feather="pie-chart"></i> Отчеты
39
  </a>
40
  <div class="px-4 py-2 mt-6">
41
+ <h3 class="text-xs font-semibold text-gray-500 uppercase tracking-wider">Настройки</h3>
42
  </div>
43
  <a href="settings.html" class="nav-link">
44
+ <i data-feather="settings"></i> Настройки системы
45
  </a>
46
  </nav>
47
  </div>
deals.html CHANGED
@@ -1,18 +1,17 @@
1
  <!DOCTYPE html>
2
- <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Deals - DealFlow Tracker</title>
7
  <link rel="stylesheet" href="style.css">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
- <script src="https://unpkg.com/feather-icons"></script>
11
- <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
12
  <script src="components/navbar.js"></script>
13
  <script src="components/sidebar.js"></script>
14
  <script src="components/deal-table.js"></script>
15
  <script src="components/deal-modal.js"></script>
 
16
  </head>
17
  <body class="bg-gray-50">
18
  <custom-navbar></custom-navbar>
@@ -21,21 +20,11 @@
21
 
22
  <main class="flex-1 p-8" style="margin-top: 60px;">
23
  <div class="flex justify-between items-center mb-6">
24
- <h1 class="text-3xl font-bold text-gray-800">Deals</h1>
25
  <button onclick="openDealModal()" class="btn-primary">
26
  <i data-feather="plus" class="w-4 h-4 mr-2"></i> Новая сделка
27
  </button>
28
- <script>
29
- document.addEventListener('DOMContentLoaded', function() {
30
- // Initialize modal close button
31
- const closeButton = document.querySelector('custom-deal-modal')
32
- .shadowRoot.querySelector('.modal-close');
33
- if (closeButton) {
34
- closeButton.addEventListener('click', closeDealModal);
35
- }
36
- });
37
- </script>
38
- </div>
39
 
40
  <div class="bg-white rounded-lg shadow overflow-hidden mb-6">
41
  <div class="px-6 py-4 border-b border-gray-200">
@@ -46,42 +35,42 @@
46
  <i data-feather="search" class="h-4 w-4 text-gray-400"></i>
47
  </div>
48
  <input type="text" class="form-input pl-10" placeholder="Поиск сделок...">
49
- </div>
50
  </div>
51
  <div class="flex space-x-2">
52
- <select class="form-input">
53
  <option>Все статусы</option>
54
  <option>Активна</option>
55
  <option>В ожидании</option>
56
  <option>Завершена</option>
57
  <option>Отменена</option>
58
- </select>
59
- <select class="form-input">
60
  <option>Все клиенты</option>
61
  <option>Компания Acme</option>
62
  <option>Globex Inc</option>
63
  <option>Wayne Enterprises</option>
64
  <option>Stark Industries</option>
65
- </select>
66
- <button class="btn-secondary">
67
- <i data-feather="filter" class="w-4 h-4 mr-2"></i> Фильтр
68
- </button>
69
  </div>
70
  </div>
71
  </div>
72
- <custom-translated-deal-table class="compact-table"></custom-translated-deal-table>
73
- <div class="px-6 py-4 border-t border-gray-200">
74
  <div class="flex items-center justify-between">
75
  <div class="text-sm text-gray-500">
76
  Показано <span class="font-medium">1</span> - <span class="font-medium">10</span> из <span class="font-medium">24</span>
77
- </div>
78
  <div class="flex space-x-2">
79
  <button class="btn-secondary">
80
  Назад
81
  </button>
82
  <button class="btn-secondary">
83
  Вперед
84
- </button>
85
  </div>
86
  </div>
87
  </div>
@@ -89,7 +78,9 @@
89
  </main>
90
  </div>
91
 
92
- <custom-deal-modal></custom-deal-modal>
 
 
93
 
94
  <script>
95
  feather.replace();
 
1
  <!DOCTYPE html>
2
+ <html lang="ru">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Сделки - DealFlow Tracker</title>
7
  <link rel="stylesheet" href="style.css">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
 
 
10
  <script src="components/navbar.js"></script>
11
  <script src="components/sidebar.js"></script>
12
  <script src="components/deal-table.js"></script>
13
  <script src="components/deal-modal.js"></script>
14
+ <script src="components/product-table.js"></script>
15
  </head>
16
  <body class="bg-gray-50">
17
  <custom-navbar></custom-navbar>
 
20
 
21
  <main class="flex-1 p-8" style="margin-top: 60px;">
22
  <div class="flex justify-between items-center mb-6">
23
+ <h1 class="text-2xl font-bold text-gray-800">Сделки</h1>
24
  <button onclick="openDealModal()" class="btn-primary">
25
  <i data-feather="plus" class="w-4 h-4 mr-2"></i> Новая сделка
26
  </button>
27
+ </div>
 
 
 
 
 
 
 
 
 
 
28
 
29
  <div class="bg-white rounded-lg shadow overflow-hidden mb-6">
30
  <div class="px-6 py-4 border-b border-gray-200">
 
35
  <i data-feather="search" class="h-4 w-4 text-gray-400"></i>
36
  </div>
37
  <input type="text" class="form-input pl-10" placeholder="Поиск сделок...">
38
+ </div>
39
  </div>
40
  <div class="flex space-x-2">
41
+ <select class="form-select">
42
  <option>Все статусы</option>
43
  <option>Активна</option>
44
  <option>В ожидании</option>
45
  <option>Завершена</option>
46
  <option>Отменена</option>
47
+ </select>
48
+ <select class="form-select">
49
  <option>Все клиенты</option>
50
  <option>Компания Acme</option>
51
  <option>Globex Inc</option>
52
  <option>Wayne Enterprises</option>
53
  <option>Stark Industries</option>
54
+ </select>
55
+ <button class="btn-secondary">
56
+ <i data-feather="filter" class="w-4 h-4 mr-2"></i> Фильтр
57
+ </button>
58
  </div>
59
  </div>
60
  </div>
61
+ <custom-translated-deal-table></custom-translated-deal-table>
62
+ <div class="px-6 py-4 border-t border-gray-200">
63
  <div class="flex items-center justify-between">
64
  <div class="text-sm text-gray-500">
65
  Показано <span class="font-medium">1</span> - <span class="font-medium">10</span> из <span class="font-medium">24</span>
66
+ </div>
67
  <div class="flex space-x-2">
68
  <button class="btn-secondary">
69
  Назад
70
  </button>
71
  <button class="btn-secondary">
72
  Вперед
73
+ </button>
74
  </div>
75
  </div>
76
  </div>
 
78
  </main>
79
  </div>
80
 
81
+ <custom-deal-modal>
82
+ <custom-product-table></custom-product-table>
83
+ </custom-deal-modal>
84
 
85
  <script>
86
  feather.replace();
index.html CHANGED
@@ -1,19 +1,113 @@
1
  <!DOCTYPE html>
2
- <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>DealFlow Tracker</title>
7
  <link rel="stylesheet" href="style.css">
8
  <script src="https://cdn.tailwindcss.com"></script>
 
 
 
 
 
 
 
9
  </head>
10
- <body class="bg-gray-100">
11
- <div class="container mx-auto p-4">
12
- <h1 class="text-3xl font-bold text-center mb-8">Welcome to DealFlow Tracker</h1>
13
- <div class="bg-white rounded-lg shadow p-6 max-w-md mx-auto">
14
- <p class="text-center">A fresh start for your sales management system</p>
15
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  <script src="script.js"></script>
18
  </body>
19
  </html>
 
1
  <!DOCTYPE html>
2
+ <html lang="ru">
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>DealFlow Tracker - Главная</title>
7
  <link rel="stylesheet" href="style.css">
8
  <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
11
+ <script src="components/navbar.js"></script>
12
+ <script src="components/sidebar.js"></script>
13
+ <script src="components/quick-stats.js"></script>
14
+ <script src="components/sales-chart.js"></script>
15
+ <script src="components/recent-deals.js"></script>
16
  </head>
17
+ <body class="bg-gray-50">
18
+ <custom-navbar></custom-navbar>
19
+ <div class="flex">
20
+ <custom-sidebar></custom-sidebar>
21
+
22
+ <main class="flex-1 p-8" style="margin-top: 60px;">
23
+ <h1 class="text-2xl font-bold text-gray-800 mb-6">Панель управления</h1>
24
+
25
+ <custom-quick-stats></custom-quick-stats>
26
+
27
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mt-6">
28
+ <div class="lg:col-span-2">
29
+ <div class="bg-white rounded-lg shadow p-6">
30
+ <div class="flex justify-between items-center mb-4">
31
+ <h2 class="text-lg font-semibold">Статистика продаж</h2>
32
+ <select class="form-select text-sm" id="chartPeriod">
33
+ <option value="week">За неделю</option>
34
+ <option value="month" selected>За месяц</option>
35
+ <option value="quarter">За квартал</option>
36
+ <option value="year">За год</option>
37
+ </select>
38
+ </div>
39
+ <custom-sales-chart></custom-sales-chart>
40
+ </div>
41
+ </div>
42
+
43
+ <div>
44
+ <div class="bg-white rounded-lg shadow p-6">
45
+ <h2 class="text-lg font-semibold mb-4">Последние сделки</h2>
46
+ <custom-recent-deals></custom-recent-deals>
47
+ <div class="mt-4 text-center">
48
+ <a href="deals.html" class="text-blue-600 hover:text-blue-800 text-sm font-medium">Все сделки →</a>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </main>
54
  </div>
55
+
56
+ <script>
57
+ feather.replace();
58
+ document.addEventListener('DOMContentLoaded', function() {
59
+ // Initialize sales chart
60
+ const ctx = document.querySelector('custom-sales-chart').shadowRoot.querySelector('#salesChart');
61
+ new Chart(ctx, {
62
+ type: 'line',
63
+ data: {
64
+ labels: ['Янв', 'Фев', 'Мар', 'Апр', 'Май', 'Июн', 'Июл'],
65
+ datasets: [
66
+ {
67
+ label: 'Продажи',
68
+ data: [450000, 520000, 380000, 610000, 590000, 720000, 680000],
69
+ borderColor: '#4F46E5',
70
+ backgroundColor: 'rgba(79, 70, 229, 0.1)',
71
+ tension: 0.3,
72
+ fill: true
73
+ },
74
+ {
75
+ label: 'Закупки',
76
+ data: [320000, 400000, 280000, 450000, 420000, 510000, 470000],
77
+ borderColor: '#10B981',
78
+ backgroundColor: 'rgba(16, 185, 129, 0.1)',
79
+ tension: 0.3,
80
+ fill: true
81
+ }
82
+ ]
83
+ },
84
+ options: {
85
+ responsive: true,
86
+ plugins: {
87
+ legend: {
88
+ position: 'top',
89
+ },
90
+ tooltip: {
91
+ callbacks: {
92
+ label: function(context) {
93
+ return context.dataset.label + ': ' + context.raw.toLocaleString('ru-RU') + ' ₽';
94
+ }
95
+ }
96
+ }
97
+ },
98
+ scales: {
99
+ y: {
100
+ ticks: {
101
+ callback: function(value) {
102
+ return value.toLocaleString('ru-RU') + ' ₽';
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ });
109
+ });
110
+ </script>
111
  <script src="script.js"></script>
112
  </body>
113
  </html>
script.js CHANGED
@@ -1,3 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  document.addEventListener('DOMContentLoaded', function() {
2
- console.log('DealFlow Tracker initialized');
 
 
 
 
 
 
 
 
3
  });
 
1
+ // Global functions for deal management
2
+ function openDealModal() {
3
+ const modal = document.querySelector('custom-deal-modal').shadowRoot.getElementById('dealModal');
4
+ modal.classList.remove('hidden');
5
+ document.body.classList.add('overflow-hidden');
6
+ feather.replace();
7
+ }
8
+
9
+ function closeDealModal() {
10
+ const modal = document.querySelector('custom-deal-modal').shadowRoot.getElementById('dealModal');
11
+ modal.classList.add('hidden');
12
+ document.body.classList.remove('overflow-hidden');
13
+ }
14
+
15
+ function createNewDeal() {
16
+ // Get all form data
17
+ const client = document.querySelector('custom-deal-modal').shadowRoot.getElementById('client').value;
18
+ const dealDate = document.querySelector('custom-deal-modal').shadowRoot.getElementById('dealDate').value;
19
+ const supplier = document.querySelector('custom-deal-modal').shadowRoot.getElementById('supplier').value;
20
+ const status = document.querySelector('custom-deal-modal').shadowRoot.getElementById('status').value;
21
+ const notes = document.querySelector('custom-deal-modal').shadowRoot.getElementById('notes').value;
22
+
23
+ // Get product table data
24
+ const productTable = document.querySelector('custom-product-table').shadowRoot.querySelector('#productTable');
25
+ const rows = productTable.querySelectorAll('tbody tr');
26
+ const items = [];
27
+
28
+ rows.forEach((row, index) => {
29
+ items.push({
30
+ item_number: index + 1,
31
+ product_name: row.querySelector('input[type="text"]').value,
32
+ quantity: parseInt(row.querySelector('.qty').value),
33
+ purchase_price: parseFloat(row.querySelector('.purchase-price').value),
34
+ margin: parseFloat(row.querySelector('.margin').value),
35
+ sale_price: parseFloat(row.querySelector('.sale-price').value),
36
+ supplier_id: row.querySelector('select').value,
37
+ delivered: row.querySelector('input[type="checkbox"]').checked
38
+ });
39
+ });
40
+
41
+ // Create deal object
42
+ const deal = {
43
+ client_id: client,
44
+ deal_date: dealDate,
45
+ supplier_id: supplier,
46
+ status: status,
47
+ notes: notes,
48
+ items: items
49
+ };
50
+
51
+ // Send to API
52
+ fetch('/api/deals.php', {
53
+ method: 'POST',
54
+ headers: {
55
+ 'Content-Type': 'application/json'
56
+ },
57
+ body: JSON.stringify(deal)
58
+ })
59
+ .then(response => response.json())
60
+ .then(data => {
61
+ if(data.success) {
62
+ alert(`Сделка ${data.deal_number} успешно создана!`);
63
+ closeDealModal();
64
+ window.location.reload();
65
+ } else {
66
+ alert('Ошибка при создании сделки: ' + data.error);
67
+ }
68
+ })
69
+ .catch(error => {
70
+ console.error('Error:', error);
71
+ alert('Произошла ошибка при создании сделки');
72
+ });
73
+ }
74
+
75
+ function applyMarginToAll() {
76
+ const margin = prompt('Введите наценку в процентах:', '30');
77
+ if (margin && !isNaN(margin)) {
78
+ const productTable = document.querySelector('custom-product-table').shadowRoot.querySelector('#productTable');
79
+ const rows = productTable.querySelectorAll('tbody tr');
80
+
81
+ rows.forEach(row => {
82
+ const purchasePrice = parseFloat(row.querySelector('.purchase-price').value);
83
+ const salePriceCell = row.querySelector('.sale-price');
84
+ const marginCell = row.querySelector('.margin');
85
+
86
+ if (purchasePrice && !isNaN(purchasePrice)) {
87
+ const newSalePrice = purchasePrice * (1 + (parseFloat(margin)/100));
88
+ salePriceCell.value = newSalePrice.toFixed(2);
89
+ marginCell.value = margin;
90
+ }
91
+ });
92
+ }
93
+ }
94
+
95
+ // Initialize app when DOM is loaded
96
  document.addEventListener('DOMContentLoaded', function() {
97
+ feather.replace();
98
+
99
+ // Close modal when clicking outside
100
+ document.addEventListener('click', function(event) {
101
+ const modal = document.querySelector('custom-deal-modal');
102
+ if (modal && !modal.contains(event.target) && event.target.closest('custom-deal-modal') === null) {
103
+ closeDealModal();
104
+ }
105
+ });
106
  });
style.css CHANGED
@@ -1,7 +1,46 @@
 
 
1
  body {
2
  font-family: 'Inter', sans-serif;
3
  }
4
 
5
  .container {
6
  max-width: 1200px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  }
 
1
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
2
+
3
  body {
4
  font-family: 'Inter', sans-serif;
5
  }
6
 
7
  .container {
8
  max-width: 1200px;
9
+ margin: 0 auto;
10
+ }
11
+
12
+ .form-input {
13
+ @apply block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm;
14
+ }
15
+
16
+ .form-select {
17
+ @apply block w-full rounded-md border-gray-300 py-2 pl-3 pr-10 text-base focus:border-blue-500 focus:outline-none focus:ring-blue-500 sm:text-sm;
18
+ }
19
+
20
+ .btn-primary {
21
+ @apply inline-flex items-center rounded-md border border-transparent bg-blue-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2;
22
+ }
23
+
24
+ .btn-secondary {
25
+ @apply inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2;
26
+ }
27
+
28
+ .status-badge {
29
+ @apply px-2 py-1 text-xs font-medium rounded-full;
30
+ }
31
+
32
+ .status-active {
33
+ @apply bg-blue-100 text-blue-800;
34
+ }
35
+
36
+ .status-pending {
37
+ @apply bg-yellow-100 text-yellow-800;
38
+ }
39
+
40
+ .status-completed {
41
+ @apply bg-green-100 text-green-800;
42
+ }
43
+
44
+ .status-cancelled {
45
+ @apply bg-red-100 text-red-800;
46
  }