Built files from Bizgaze WebServer
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Bizgaze;
  11. (function (Bizgaze) {
  12. let Apps;
  13. (function (Apps) {
  14. let CRM;
  15. (function (CRM) {
  16. let Companies;
  17. (function (Companies) {
  18. let Managers;
  19. (function (Managers) {
  20. class CompanyManager extends Unibase.Platform.Core.BaseManager {
  21. getAssignedCompanies(Ids) {
  22. return __awaiter(this, void 0, void 0, function* () {
  23. const url = 'apis/v4/bizgaze/crm/companies/assignedcompanies/selectedcompanyids/' + Ids;
  24. return yield this.dataHelper().getAsync(url).then(function (response) {
  25. if (response.result !== null)
  26. response.result = JSON.parse(response.result);
  27. return response;
  28. });
  29. });
  30. }
  31. getAssignedBranches(BranchIds, UserId) {
  32. return __awaiter(this, void 0, void 0, function* () {
  33. const url = 'apis/v4/bizgaze/crm/companies/getbranchesbyids/selectedbranchids/' + BranchIds + '/userid/' + UserId;
  34. return yield this.dataHelper().getAsync(url).then(function (response) {
  35. if (response.result !== null)
  36. response.result = JSON.parse(response.result);
  37. return response;
  38. });
  39. });
  40. }
  41. getWarehousesbyCompanyid(CompanyId, BranchId) {
  42. return __awaiter(this, void 0, void 0, function* () {
  43. const url = 'apis/v4/unibase/platform/companies/getwarehousesbycompanyid/companyid/' + CompanyId + '/branchid/' + BranchId;
  44. return yield this.dataHelper().getAsync(url).then(function (response) {
  45. if (response.result !== null)
  46. response.result = JSON.parse(response.result);
  47. return response;
  48. });
  49. });
  50. }
  51. refreshBranchTypes() {
  52. return __awaiter(this, void 0, void 0, function* () {
  53. const url = 'apis/v4/bizgaze/crm/companies/refreshbranchtypes/np';
  54. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  55. return response.message;
  56. });
  57. });
  58. }
  59. getBankBranchDetails(id) {
  60. return __awaiter(this, void 0, void 0, function* () {
  61. const url = 'apis/v4/bizgaze/crm/companies/getbankbranches/bankbranchid/' + id;
  62. return yield this.dataHelper().getAsync(url).then(function (response) {
  63. if (response.result !== null)
  64. response.result = JSON.parse(response.result);
  65. return response;
  66. });
  67. });
  68. }
  69. getUserBranches(id) {
  70. return __awaiter(this, void 0, void 0, function* () {
  71. const url = 'apis/v4/bizgaze/crm/companies/getuserbranches/contactid/' + id;
  72. return yield this.dataHelper().getAsync(url).then(function (response) {
  73. if (response.result !== null)
  74. response.result = JSON.parse(response.result);
  75. return response;
  76. });
  77. });
  78. }
  79. changeBranch(branchid, partitionid) {
  80. return __awaiter(this, void 0, void 0, function* () {
  81. const url = 'apis/v4/bizgaze/crm/companies/changebranch/branchid/' + branchid + '/partitionid/' + partitionid;
  82. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  83. if (response.result !== null)
  84. var identity = JSON.parse(response.result);
  85. identity = Object.keys(identity).reduce((c, k) => (c[k.charAt(0).toLowerCase() + k.slice(1)] = identity[k], c), {});
  86. for (var s = 0; s < identity.settings.length; s++) {
  87. identity.settings[s] = Object.keys(identity.settings[s]).reduce((c, k) => (c[k.charAt(0).toLowerCase() + k.slice(1)] = identity.settings[s][k], c), {});
  88. }
  89. Unibase.Platform.Membership.Infos.Identity.setCurrentUser(identity);
  90. response.result = JSON.parse(response.result);
  91. return response;
  92. });
  93. });
  94. }
  95. getBranch(branchid) {
  96. return __awaiter(this, void 0, void 0, function* () {
  97. const url = 'apis/v4/bizgaze/crm/companies/getbranchbybranchid/branchid/' + branchid;
  98. return yield this.dataHelper().getAsync(url).then(function (response) {
  99. if (response.result !== null)
  100. response.result = JSON.parse(response.result);
  101. return response;
  102. });
  103. });
  104. }
  105. getBranches(CompanyId) {
  106. return __awaiter(this, void 0, void 0, function* () {
  107. const url = 'apis/v4/bizgaze/crm/companies/getallbranchesbycompanyid/companyid/' + CompanyId;
  108. return yield this.dataHelper().getAsync(url).then(function (response) {
  109. if (response.result !== null)
  110. response.result = JSON.parse(response.result);
  111. return response;
  112. });
  113. });
  114. }
  115. static Instance() {
  116. if (this._instance === undefined)
  117. this._instance = new CompanyManager();
  118. return this._instance;
  119. }
  120. }
  121. Managers.CompanyManager = CompanyManager;
  122. })(Managers = Companies.Managers || (Companies.Managers = {}));
  123. })(Companies = CRM.Companies || (CRM.Companies = {}));
  124. })(CRM = Apps.CRM || (Apps.CRM = {}));
  125. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  126. })(Bizgaze || (Bizgaze = {}));