1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+
4+ < head >
5+ < meta charset ="UTF-8 ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < meta http-equiv ="X-UA-Compatible " content ="ie=edge ">
8+ < link rel ="manifest " href ="manifest.json " />
9+ < title > Storehouse</ title >
10+
11+ < link rel ="icon " href ="icon-256.png " sizes ="256x256 " />
12+ < link rel ="icon " href ="icon-128.png " sizes ="128x128 " />
13+ < link rel ="icon " href ="icon-96.png " sizes ="96x96 " />
14+
15+ < link rel ="apple-touch-icon " href ="apple-touch-icon.png ">
16+ < meta name ="apple-mobile-web-app-title " content ="Storehouse ">
17+ < meta name ="apple-mobile-web-app-capable " content ="yes ">
18+ < meta name ="apple-mobile-web-app-status-bar-style " content ="black ">
19+
20+ <!-- Fontawesome -->
21+ < script defer src ="https://use.fontawesome.com/releases/v5.0.8/js/solid.js " integrity ="sha384-+Ga2s7YBbhOD6nie0DzrZpJes+b2K1xkpKxTFFcx59QmVPaSA8c7pycsNaFwUK6l "
22+ crossorigin ="anonymous "> </ script >
23+ < script defer src ="https://use.fontawesome.com/releases/v5.0.8/js/fontawesome.js " integrity ="sha384-7ox8Q2yzO/uWircfojVuCQOZl+ZZBg2D2J5nkpLqzH1HY0C1dHlTKIbpRz/LG23c "
24+ crossorigin ="anonymous "> </ script >
25+
26+ <!-- Bootstrap -->
27+ < link rel ="stylesheet " href ="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css ">
28+ < script src ="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js "> </ script >
29+ < script src ="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js "> </ script >
30+ < script src ="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js "> </ script >
31+
32+ < script src ="moment.min.js "> </ script >
33+ < script src ="https://unpkg.com/vue/dist/vue.js "> </ script >
34+ </ head >
35+
36+ < body >
37+ < div id ="app " class ="container ">
38+ < h1 > Storehouse</ h1 >
39+
40+ < div class ="row ">
41+ < div class ="col-sm ">
42+ < ul class ="nav nav-tabs ">
43+ < li class ="nav-item ">
44+ < a class ="nav-link " v-bind:class ="[{ active: mode === 'storehouse' }] " href ="# " v-on:click ="mode = 'storehouse' "> Storehouse</ a >
45+ </ li >
46+ < li class ="nav-item ">
47+ < a class ="nav-link " v-bind:class ="[{ active: mode === 'store' }] " href ="# " v-on:click ="mode = 'store' "> Store</ a >
48+ </ li >
49+ < li class ="nav-item ">
50+ < a class ="nav-link " v-bind:class ="[{ active: mode === 'logs' }] " href ="# " v-on:click ="mode = 'logs' "> Logs</ a >
51+ </ li >
52+ </ ul >
53+
54+ < store-group v-if ="mode != 'logs' " v-for ="(group, index) in groups " :key ="group.id " :index ="index " :name ="group.name " :color ="group.color "
55+ :items ="group.items " :mode ="mode " v-on:add-item ="addNewItem " v-on:remove-group ="removeGroup " v-on:remove-item ="removeItem "
56+ v-on:increase-item ="increaseItem " v-on:decrease-item ="decreaseItem " v-on:change-item ="changeItem " v-on:product-changed ="productChanged "> </ store-group >
57+
58+ < button v-if ="mode === 'storehouse' " type ="button " class ="btn btn-primary btn-block " data-toggle ="modal " data-target ="#newGroupModal "> Add new group</ button >
59+
60+ < div v-if ="mode === 'logs' " class ="list-group ">
61+ < div class ="card mb-3 " v-for ="(log, index) in logs " :key ="log.id ">
62+ < div class ="card-header "> {{log.title}}</ div >
63+ < div class ="card-body "> {{log.message}}</ div >
64+ < div class ="card-footer "> {{getDate(log.date)}}</ div >
65+ </ div >
66+ </ div >
67+
68+ < button v-if ="mode === 'store' " type ="button " class ="btn btn-primary btn-block " v-on:click ="createProduct() " data-toggle ="modal "
69+ data-target ="#productModal "> Create product</ button >
70+
71+ <!-- Adding new group modal -->
72+ < div class ="modal fade " id ="newGroupModal ">
73+ < div class ="modal-dialog ">
74+ < div class ="modal-content ">
75+
76+ <!-- Modal Header -->
77+ < div class ="modal-header ">
78+ < h4 class ="modal-title "> Adding new group</ h4 >
79+ < button type ="button " class ="close " data-dismiss ="modal "> ×</ button >
80+ </ div >
81+
82+ <!-- Modal body -->
83+ < div class ="modal-body ">
84+ < div class ="form-group ">
85+ < label > Group name:</ label >
86+ < input type ="text " class ="form-control " v-model ="newGroupName ">
87+ </ div >
88+ </ div >
89+
90+ <!-- Modal footer -->
91+ < div class ="modal-footer ">
92+ < button type ="button " class ="btn btn-danger " data-dismiss ="modal "> Close</ button >
93+ < button type ="button " class ="btn btn-success " data-dismiss ="modal " :disabled ="newGroupName.length === 0 " v-on:click ="addNewGroup() "> Add</ button >
94+ </ div >
95+
96+ </ div >
97+ </ div >
98+ </ div >
99+ <!-- /Adding new group modal -->
100+
101+ <!-- Numeric modal -->
102+ < div class ="modal fade " id ="numericModal ">
103+ < div class ="modal-dialog ">
104+ < div class ="modal-content ">
105+
106+ <!-- Modal Header -->
107+ < div class ="modal-header ">
108+ < h4 class ="modal-title "> {{ numericModal.title }}</ h4 >
109+ < button type ="button " class ="close " data-dismiss ="modal "> ×</ button >
110+ </ div >
111+
112+ <!-- Modal body -->
113+ < div class ="modal-body ">
114+ < div class ="form-group ">
115+ < label > {{ numericModal.fieldName }}:</ label >
116+ < input type ="number " class ="form-control " v-model ="numericModal.value " min ="0 " step ="1 ">
117+ </ div >
118+ </ div >
119+
120+ <!-- Modal footer -->
121+ < div class ="modal-footer ">
122+ < button type ="button " class ="btn btn-danger " data-dismiss ="modal "> Cancel</ button >
123+ < button type ="button " class ="btn btn-success " data-dismiss ="modal " v-on:click ="numericModal.onSuccess() "> OK</ button >
124+ </ div >
125+
126+ </ div >
127+ </ div >
128+ </ div >
129+ <!-- /Numeric modal -->
130+
131+ <!-- YesNo modal -->
132+ < div class ="modal fade " id ="yesNoModal ">
133+ < div class ="modal-dialog ">
134+ < div class ="modal-content ">
135+
136+ <!-- Modal Header -->
137+ < div class ="modal-header ">
138+ < h4 class ="modal-title "> {{ yesNoModal.title }}</ h4 >
139+ < button type ="button " class ="close " data-dismiss ="modal "> ×</ button >
140+ </ div >
141+
142+ <!-- Modal body -->
143+ < div class ="modal-body ">
144+ < p v-html ="yesNoModal.message "> </ p >
145+ </ div >
146+
147+ <!-- Modal footer -->
148+ < div class ="modal-footer ">
149+ < button type ="button " class ="btn btn-danger " data-dismiss ="modal "> No</ button >
150+ < button type ="button " class ="btn btn-success " data-dismiss ="modal " v-on:click ="yesNoModal.onSuccess() "> Yes</ button >
151+ </ div >
152+
153+ </ div >
154+ </ div >
155+ </ div >
156+ <!-- YesNo modal -->
157+
158+ <!-- Adding/changing item modal -->
159+ < div class ="modal fade " id ="itemModal ">
160+ < div class ="modal-dialog ">
161+ < div class ="modal-content ">
162+
163+ <!-- Modal Header -->
164+ < div class ="modal-header ">
165+ < h4 class ="modal-title "> {{newItemModal.title}}</ h4 >
166+ < button type ="button " class ="close " data-dismiss ="modal "> ×</ button >
167+ </ div >
168+
169+ <!-- Modal body -->
170+ < div class ="modal-body ">
171+ < div class ="form-group ">
172+ < label > Item name:</ label >
173+ < input type ="text " class ="form-control " v-model ="newItemModal.name ">
174+ </ div >
175+ < div class ="form-group ">
176+ < label > Item price:</ label >
177+ < input type ="number " class ="form-control " v-model ="newItemModal.price ">
178+ </ div >
179+ < div class ="form-group ">
180+ < label > Item quantity:</ label >
181+ < input type ="number " class ="form-control " v-model ="newItemModal.quantity ">
182+ </ div >
183+ </ div >
184+
185+ <!-- Modal footer -->
186+ < div class ="modal-footer ">
187+ < button type ="button " class ="btn btn-danger " data-dismiss ="modal "> Close</ button >
188+ < button type ="button " class ="btn btn-success " data-dismiss ="modal " :disabled ="newItemModal.name.length === 0 " v-on:click ="newItemModal.onSuccess() "> {{newItemModal.actionName}}</ button >
189+ </ div >
190+
191+ </ div >
192+ </ div >
193+ </ div >
194+ <!-- /Adding new item modal -->
195+
196+ <!-- Create/change product modal -->
197+ < div class ="modal fade " id ="productModal ">
198+ < div class ="modal-dialog ">
199+ < div class ="modal-content ">
200+
201+ <!-- Modal Header -->
202+ < div class ="modal-header ">
203+ < h4 class ="modal-title "> {{productModal.title}}</ h4 >
204+ < button type ="button " class ="close " data-dismiss ="modal "> ×</ button >
205+ </ div >
206+
207+ <!-- Modal body -->
208+ < div class ="modal-body ">
209+ < p v-for ="item in productModal.items ">
210+ < span class ="badge badge-danger "> x{{item.quantity}}</ span > {{item.name}} by
211+ < span class ="badge badge-warning "> {{item.price}}</ span >
212+ </ p >
213+ < hr >
214+ < div class ="form-group ">
215+ < label > Items cost:</ label >
216+ < input type ="text " class ="form-control " v-model ="productModal.itemsCost " disabled >
217+ </ div >
218+ < div class ="form-group ">
219+ < label > Creational cost:</ label >
220+ < input type ="text " class ="form-control " v-model ="productModal.creationalCost ">
221+ </ div >
222+ < div class ="form-group ">
223+ < label > Delivery cost:</ label >
224+ < input type ="number " class ="form-control " v-model ="productModal.deliveryCost ">
225+ </ div >
226+ < div class ="form-group ">
227+ < label > Additional cost:</ label >
228+ < input type ="number " class ="form-control " v-model ="productModal.additionalCost ">
229+ </ div >
230+ < div class ="form-group ">
231+ < label > Comment:</ label >
232+ < textarea class ="form-control " rows ="3 " v-model ="productModal.comment "> </ textarea >
233+ </ div >
234+ < hr >
235+ < div class ="form-group ">
236+ < label > Total cost:</ label >
237+ < input type ="number " class ="form-control " v-model ="productTotalCost " disabled >
238+ </ div >
239+ </ div >
240+
241+ <!-- Modal footer -->
242+ < div class ="modal-footer ">
243+ < button type ="button " class ="btn btn-danger " data-dismiss ="modal "> Close</ button >
244+ < button type ="button " class ="btn btn-success " data-dismiss ="modal " :disabled ="productTotalCost === 0 " v-on:click ="productModal.onSuccess() "> {{productModal.actionName}}</ button >
245+ </ div >
246+
247+ </ div >
248+ </ div >
249+ </ div >
250+ <!-- /Adding new item modal -->
251+ </ div >
252+ < div class ="col-sm ">
253+ < p >
254+ Со склада можно забирать набор товаров, изделие. На склад могут поступать товары.
255+ < br > Цена товаров может изменяться в любое время. Изменения не должны влиять на изготовленные изделия.
256+ </ p >
257+ < p >
258+ Склад
259+ < br > --Название
260+ < br > --Группа (коллекция)
261+ < br > ----Цвет
262+ < br > ----Товар (коллекция)
263+ < br > ------Название
264+ < br > ------Цена
265+ < br > ------Количество
266+ < br > ----Количество товаров в группе
267+ < br > ----Стоимость товаров в группе
268+ < br > --Количество товаров на складе
269+ < br > --Стоимость товаров на складе
270+ < br > --Журнал
271+ < br > ----Запись о поступлении товаров (коллекция)
272+ < br > ----Запись об изготовлении изделия (коллекция)
273+ </ p >
274+ < p >
275+ Изделие
276+ < br > --Название
277+ < br > --Товар (коллекция)
278+ < br > ----Название
279+ < br > ----Цена
280+ < br > ----Количество
281+ < br > --Количество товаров
282+ < br > --Стоимость товаров
283+ < br > --Стоимость сборки
284+ < br > --Итоговая стоимость
285+ < br >
286+ </ p >
287+ </ div >
288+ </ div >
289+ </ div >
290+
291+ < script src ="script.js "> </ script >
292+ < script src ="serviceworker.js "> </ script >
293+ </ body >
294+
295+ </ html >
0 commit comments