a broker system for Supercredit
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

343 lines
9.1KB

  1. var layout= {
  2. id: 'summary_layout',
  3. css: 'summary_layout',
  4. "rows": [
  5. {
  6. view: "toolbar", id:"topMenu", elements:[
  7. {
  8. view: "icon", icon: "mdi mdi-menu",
  9. click: function(){
  10. return ; //disable side menu
  11. if( $$("menu").config.hidden){
  12. $$("menu").show();
  13. }
  14. else
  15. $$("menu").hide();
  16. }
  17. },
  18. {
  19. view: "label",
  20. label: "Supercredit Transactions"
  21. }
  22. ]
  23. },
  24. { id:"workspace", rows:[
  25. { template:"loading ...." }
  26. ]},
  27. { "view": "template", id:"footer", css: "footer", "template": "", "role": "placeholder", "height": 20 }
  28. ]
  29. }
  30. //main area
  31. webix.ui(layout)
  32. //side menu
  33. webix.ready(function(){
  34. webix.ui({
  35. view: "sidemenu",
  36. id: "menu",
  37. width: 200,
  38. position: "left",
  39. state:function(state){
  40. var toolbarHeight = $$("header").$height;
  41. state.top = toolbarHeight;
  42. state.height -= toolbarHeight;
  43. },
  44. css: "my_menu",
  45. body:{
  46. view:"list",
  47. borderless:true,
  48. scroll: false,
  49. template: "<span class='webix_icon mdi mdi-#icon#'></span> #value#",
  50. data:[
  51. {id: 1, value: "All", icon: "briefcase-account"},
  52. {id: 2, value: "upfront", icon: "account-arrow-left"},
  53. {id: 3, value: "Trail", icon: "account"},
  54. {id: 4, value: "Procesing", icon: "cube"},
  55. {id: 5, value: "App in Progress", icon: "chart-bar"},
  56. {id: 6, value: "Approved", icon: "database"},
  57. {id: 7, value: "Settled", icon: "cash-usd"},
  58. {id: 8, value: "Finished", icon: "cogs"}
  59. ],
  60. select:true,
  61. type:{
  62. height: 40
  63. }
  64. }
  65. });
  66. initTopMenu($$('summary_layout'), $$('topMenu'));
  67. });
  68. //summary data
  69. var summary_graph = {
  70. "cols": [
  71. {
  72. "width": 200,
  73. "css" : "Label",
  74. "rows": [
  75. { "padding": { "left": 10 },
  76. "cols": [
  77. { "view": "label", "label": "Brokers" },
  78. { "view": "icon", "icon": "wxi-search" }
  79. ]
  80. },
  81. { "view": "list", "url": "data/staff.json", "select": "true" }
  82. ]
  83. },
  84. {
  85. "rows": [
  86. {
  87. "view":"timeline",
  88. "layout": "x",
  89. "height": 200,
  90. "data": demo_summary_loan_counts,
  91. "scroll": false
  92. },
  93. {
  94. "cols": [
  95. { "view": "chart", "width": 400, "pieInnerText": "#value#", "label": "#month#", "url": "data/demo_chart.json" },
  96. { "view": "chart", "type": "spline", "xAxis": { "template": "#value#", "lines": false },
  97. "yAxis": {},
  98. "url": "data/demo_chart.json"
  99. },
  100. { "view": "chart", "type": "barH", "yAxis": { "template": "#value#" },
  101. "xAxis": {},
  102. "color": "#color#",
  103. "url": "data/demo_chart.json"
  104. }
  105. ]
  106. },
  107. {
  108. "view": "datatable",
  109. "columns": [
  110. { "id": "title", "header": "Loan description", "fillspace": true, "sort": "string" },
  111. { "id": "year", "header": "Date", "sort": "string" },
  112. { "id": "votes", "header": "Loan Amount", "sort": "string" },
  113. { "id": "rating", "header": "Upfront", "sort": "string" },
  114. { "id": "rank", "header": "Tail paid", "sort": "string" },
  115. { "id": "category", "header": "Lender", "sort": "string", "width": 200 }
  116. ],
  117. "url": "data/demo_table.json"
  118. }
  119. ]
  120. }
  121. ]
  122. }
  123. webix.ready(function(){
  124. menu_show_summary();
  125. });
  126. function subview(v) {
  127. webix.ui(v, $$('summary_layout').getChildViews()[1]);
  128. }
  129. function menu_show_summary() {
  130. subview(summary_graph);
  131. }
  132. var list_loans = {
  133. "width":0 ,
  134. "rows" : [
  135. {
  136. "id" : "loan_list",
  137. "view": "datatable",
  138. click: menu_loan_add,
  139. "columns": [
  140. { "id": "funder", "header": "Funder", "fillspace": true, "sort": "string" },
  141. { "id": "customer", "header": "Customers", "sort": "string", "width": 200 },
  142. { "id": "settlement", "header": "Settlement date", "sort": "string" },
  143. { "id": "loanamount", "header": "Loan Amount", "sort": "string" },
  144. {
  145. "id": "commission",
  146. "header": "Commission Margin",
  147. "sort": "string",
  148. "width": 200,
  149. "fillspace": false,
  150. "hidden": false,
  151. "css": "{'text-align':'center'}"
  152. },
  153. {
  154. "id": "net",
  155. "header": "Net Amount",
  156. "sort": "string",
  157. "width": 150,
  158. "fillspace": false,
  159. "hidden": false
  160. },
  161. { "id": "gst", "header": "GST", "fillspace": false, "hidden": false },
  162. { "id": "gross", "header": "Gross Amount", "fillspace": false, "hidden": false },
  163. { "id": "pay2broker", "header": "Pay to Broker", "width": 200, "fillspace": false, "hidden": false }
  164. ],
  165. "select": true,
  166. "scrollX": false,
  167. "url" : "data/loan.json",
  168. "width": 0
  169. },
  170. {
  171. "view": "datatable",
  172. "sort": false,
  173. "scroll" : false,
  174. "columns": [
  175. { "id": "funder", "header": "", "fillspace": true, "sort": "string" },
  176. { "id": "customer", "header": "", "sort": "string", "width": 200 },
  177. { "id": "settlement", "header": " ", "sort": "string" },
  178. { "id": "loanamount", "header": " ", "sort": "string" },
  179. {
  180. "id": "commission",
  181. "header": " ",
  182. "sort": "string",
  183. "width": 200,
  184. "fillspace": false,
  185. "hidden": false,
  186. "css": "{'text-align':'center'}"
  187. },
  188. {
  189. "id": "net",
  190. "header": " ",
  191. "sort": "string",
  192. "width": 100,
  193. "fillspace": false,
  194. "hidden": false
  195. },
  196. { "id": "gst", "header": "", "fillspace": false, "hidden": false },
  197. { "id": "gross", "header": "", "fillspace": false, "hidden": false },
  198. { "id": "pay2broker", "header": "Total", "width": 200, "fillspace": false, "hidden": false }
  199. ],
  200. "height": 100,
  201. "url" : "data/loan_total.json"
  202. }
  203. ]
  204. };
  205. function menu_loan_add() {
  206. loan_add_popup.show();
  207. }
  208. function menu_loan_list_all() {
  209. subview(list_loans);
  210. webix.ui({
  211. view:"contextmenu", id:"loan_list_cm",
  212. data: ["Add", "Edit", "Delete", "Properties"],
  213. master:$$("loan_list") // component object
  214. });
  215. }
  216. function menu_export_loans() {
  217. export_loans_popup.show();
  218. $$("export_loan_gage").setValue(0);
  219. setInterval(function(){
  220. $$("export_loan_gage").setValue(100);
  221. }, 100)
  222. }
  223. var search_loans = {
  224. "cols": [
  225. {
  226. "rows": [
  227. {
  228. "css": "webix_dark",
  229. "view": "toolbar",
  230. "cols": [
  231. { "view": "label", "label": "Search Loan Transactions" },
  232. { "view": "button", "label": "Close", "autowidth": true }
  233. ]
  234. },
  235. {
  236. "autoheight": false,
  237. "view": "form",
  238. "rows": [
  239. {
  240. "cols": [
  241. { "view": "text", "name": "name" },
  242. { "view": "button", "css": "webix_primary", "label": "Search", "height": 38, "width": 100 }
  243. ]
  244. },
  245. {
  246. "id": "search_loan_result",
  247. "view": "datatable",
  248. "columns": [
  249. { "id": "funder", "header": "Funder", "fillspace": true, "sort": "string" },
  250. { "id": "customer", "header": "Customers", "sort": "string", "width": 200 },
  251. { "id": "settlement", "header": "Settlement date", "sort": "string" },
  252. { "id": "loanamount", "header": "Loan Amount", "sort": "string" },
  253. {
  254. "id": "commission",
  255. "header": "Commission Margin",
  256. "sort": "string",
  257. "width": 200,
  258. "fillspace": false,
  259. "hidden": false,
  260. "css": "{'text-align':'center'}"
  261. },
  262. {
  263. "id": "net",
  264. "header": "Net Amount",
  265. "sort": "string",
  266. "width": 150,
  267. "fillspace": false,
  268. "hidden": false
  269. },
  270. { "id": "gst", "header": "GST", "fillspace": false, "hidden": false },
  271. { "id": "gross", "header": "Gross Amount", "fillspace": false, "hidden": false },
  272. { "id": "pay2broker", "header": "Pay to Broker", "width": 200, "fillspace": false, "hidden": false }
  273. ],
  274. "select": true,
  275. "scrollX": false,
  276. "url" : "data/loan.json",
  277. "width": 0
  278. },
  279. ]
  280. }
  281. ]
  282. }
  283. ]
  284. };
  285. function menu_search_loans() {
  286. subview(search_loans);
  287. }
  288. function menu_list_trails() {
  289. trail_popup.show();
  290. }
  291. function menu_import_trail() {
  292. uploader_popup.show();
  293. }
  294. function menu_add_client() {
  295. client_form_popup.show();
  296. }
  297. function menu_list_clients() {
  298. alert("working...");
  299. }
  300. function menu_search_clients() {
  301. alert("working...");
  302. }
  303. function menu_broadcast_clients() {
  304. broadcast_popup.show();
  305. }
  306. function menu_add_broker() {
  307. broker_form_popup.show();
  308. }
  309. function menu_list_brokers() {
  310. alert("working...");
  311. }
  312. function menu_search_brokers() {
  313. alert("working...");
  314. }
  315. function menu_broadcast_brokers() {
  316. broadcast_popup.show();
  317. }
  318. function menu_list_unpaid_brokers() {
  319. alert("working...");
  320. }
  321. function load_add() {
  322. }