Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

targetmanager.js 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  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 TM;
  15. (function (TM) {
  16. let Targets;
  17. (function (Targets) {
  18. let Managers;
  19. (function (Managers) {
  20. class TargetManager extends Unibase.Platform.Core.BaseManager {
  21. getBreakupTenureDates(fromdate, todate, targetdefid, breakuptenureid) {
  22. return __awaiter(this, void 0, void 0, function* () {
  23. const url = 'apis/v4/bizgaze/tm/targets/getbreakupdates/fromdate/' + fromdate + '/todate/' + todate + '/targetdefinitionid/' + targetdefid + '/breakuptenureid/' + breakuptenureid;
  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. exportEmployeeTarget(targetdefinitionid) {
  32. return __awaiter(this, void 0, void 0, function* () {
  33. const url = 'apis/v4/bizgaze/tm/targets/exportemployeetargets/targetdefinitionid/' + targetdefinitionid;
  34. return yield this.dataHelper().getAsync(url).then(function (response) {
  35. if (response.result !== "")
  36. response.result = JSON.parse(response.result);
  37. return response;
  38. });
  39. });
  40. }
  41. exportCustomerTarget(targetdefinitionid) {
  42. return __awaiter(this, void 0, void 0, function* () {
  43. const url = 'apis/v4/bizgaze/tm/targets/exportcustomertargets/targetdefinitionid/' + targetdefinitionid;
  44. return yield this.dataHelper().getAsync(url).then(function (response) {
  45. if (response.result !== "")
  46. response.result = JSON.parse(response.result);
  47. return response;
  48. });
  49. });
  50. }
  51. refreshTenureTypes() {
  52. return __awaiter(this, void 0, void 0, function* () {
  53. const url = 'apis/v4/bizgaze/tm/targetgroups/refreshtenuretypes/np';
  54. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  55. if (response.result !== null)
  56. response.result = JSON.parse(response);
  57. return response;
  58. });
  59. });
  60. }
  61. employeeWiseTarget(authtoken, targetdefinitionid) {
  62. return __awaiter(this, void 0, void 0, function* () {
  63. const url = 'apis/v4/bizgaze/tm/targets/createempwisetarget/authToken/' + authtoken + '/TargetDefinitionId/' + targetdefinitionid;
  64. return yield this.dataHelper().getAsync(url).then(function (response) {
  65. if (response.result !== null)
  66. response.result = JSON.parse(response.result);
  67. return response;
  68. });
  69. });
  70. }
  71. customerWiseTarget(authtoken, targetdefinitionid) {
  72. return __awaiter(this, void 0, void 0, function* () {
  73. const url = 'apis/v4/bizgaze/tm/targets/createcustomerwisetarget/authToken/' + authtoken + '/TargetDefinitionId/' + targetdefinitionid;
  74. return yield this.dataHelper().getAsync(url).then(function (response) {
  75. if (response.result !== null)
  76. response.result = JSON.parse(response.result);
  77. return response;
  78. });
  79. });
  80. }
  81. LoadTargetDetails(TargetDefinitionId, ContactId) {
  82. return __awaiter(this, void 0, void 0, function* () {
  83. const url = 'apis/v4/bizgaze/tm/targets/getemptargetdetails/targetdefinitionid/' + TargetDefinitionId + '/Contactid/' + ContactId;
  84. return yield this.dataHelper().getAsync(url).then(function (response) {
  85. if (response.result !== null)
  86. response.result = JSON.parse(response.result);
  87. return response;
  88. });
  89. });
  90. }
  91. LoadTagWiseTargetDetails(TargetDefinitionId, ContactId) {
  92. return __awaiter(this, void 0, void 0, function* () {
  93. const url = 'apis/v4/bizgaze/tm/targets/gettagwisetargetdetails/targetdefinitionid/' + TargetDefinitionId + '/Contactid/' + ContactId;
  94. return yield this.dataHelper().getAsync(url).then(function (response) {
  95. if (response.result !== null)
  96. response.result = JSON.parse(response.result);
  97. return response;
  98. });
  99. });
  100. }
  101. savecontacttargets(itemlist) {
  102. return __awaiter(this, void 0, void 0, function* () {
  103. const url = 'apis/v4/bizgaze/tm/targets/savecontacttargets/List';
  104. return yield this.dataHelper().postAsync(url, itemlist).then(function (response) {
  105. if (response.result !== null)
  106. response.result = JSON.parse(response.result);
  107. return response;
  108. });
  109. });
  110. }
  111. loadCustomerTargetvsAchive(authtoken, TargetDefinitionId) {
  112. return __awaiter(this, void 0, void 0, function* () {
  113. const url = 'apis/v4/bizgaze/tm/targets/getcustomertargetvsachive/authToken/' + authtoken + '/targetdefinitionid/' + TargetDefinitionId;
  114. return yield this.dataHelper().getAsync(url).then(function (response) {
  115. if (response.result !== null)
  116. response.result = JSON.parse(response.result);
  117. return response;
  118. });
  119. });
  120. }
  121. loadEmployeeTargetvsAchive(authtoken, TargetDefinitionId) {
  122. return __awaiter(this, void 0, void 0, function* () {
  123. const url = 'apis/v4/bizgaze/tm/targets/getemployeetargetvsachive/authToken/' + authtoken + '/targetdefinitionid/' + TargetDefinitionId;
  124. return yield this.dataHelper().getAsync(url).then(function (response) {
  125. if (response.result !== null)
  126. response.result = JSON.parse(response.result);
  127. return response;
  128. });
  129. });
  130. }
  131. GetDBPTargetPlanning(stateid, districtid, segmentid, productlinetagid, distributorid, targetdefinitionid) {
  132. return __awaiter(this, void 0, void 0, function* () {
  133. const url = 'apis/v4/bizgaze/mobil/targets/getdbpplanning/StateId/' + stateid + '/DistrictId/' + districtid + '/SegmentId/' + segmentid + '/ProductLinetagId/' + productlinetagid + '/DistributorId/' + distributorid + '/TargetdefinitionId/' + targetdefinitionid;
  134. return yield this.dataHelper().getAsync(url).then(function (response) {
  135. if (response.result !== null)
  136. response.result = JSON.parse(response.result);
  137. return response;
  138. });
  139. });
  140. }
  141. GetDBPTargetPlannings(obj) {
  142. return __awaiter(this, void 0, void 0, function* () {
  143. const url = 'apis/v4/bizgaze/mobil/targets/getdbpplannings';
  144. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  145. if (response.result !== null)
  146. response.result = JSON.parse(response.result);
  147. return response;
  148. });
  149. });
  150. }
  151. saveTargetPlan(targetList) {
  152. return __awaiter(this, void 0, void 0, function* () {
  153. const url = 'apis/v4/bizgaze/mobil/targets/savedbpplanningsasync/List';
  154. return yield this.dataHelper().postAsync(url, targetList).then(function (response) {
  155. if (response.result !== null)
  156. response.result = JSON.parse(response.result);
  157. return response;
  158. });
  159. });
  160. }
  161. saveApprove(targetdefinitionid) {
  162. return __awaiter(this, void 0, void 0, function* () {
  163. const url = 'apis/v4/bizgaze/mobil/targets/changedbptargetdefinitionstatus/targetdefinitionid/' + targetdefinitionid;
  164. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  165. if (response.result !== null)
  166. response.result = JSON.parse(response.result);
  167. return response;
  168. });
  169. });
  170. }
  171. getTargetDefinitionDetails(TargetDefinitionId) {
  172. return __awaiter(this, void 0, void 0, function* () {
  173. const url = 'apis/v4/bizgaze/tm/targets/gettargetdefinitiondetails/targetdefinitionid/' + TargetDefinitionId;
  174. return yield this.dataHelper().getAsync(url).then(function (response) {
  175. if (response.result !== null)
  176. response.result = JSON.parse(response.result);
  177. return response;
  178. });
  179. });
  180. }
  181. ApplyDBPDistricts() {
  182. return __awaiter(this, void 0, void 0, function* () {
  183. const url = 'apis/v4/bizgaze/mobil/targets/getpreviousperformancestates';
  184. return yield this.dataHelper().getAsync(url).then(function (response) {
  185. if (response.result !== null)
  186. response.result = JSON.parse(response.result);
  187. return response;
  188. });
  189. });
  190. }
  191. getContactWiseTargetDetails(ContactId) {
  192. return __awaiter(this, void 0, void 0, function* () {
  193. const url = 'apis/v4/bizgaze/tm/targets/getcontactwisetargetdetails/Contactid/' + ContactId;
  194. return yield this.dataHelper().getAsync(url).then(function (response) {
  195. if (response.result != "" && response.result !== null)
  196. response.result = JSON.parse(response.result);
  197. return response;
  198. });
  199. });
  200. }
  201. static Instance() {
  202. if (this._instance === undefined)
  203. this._instance = new TargetManager();
  204. return this._instance;
  205. }
  206. }
  207. Managers.TargetManager = TargetManager;
  208. })(Managers = Targets.Managers || (Targets.Managers = {}));
  209. })(Targets = TM.Targets || (TM.Targets = {}));
  210. })(TM = Apps.TM || (Apps.TM = {}));
  211. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  212. })(Bizgaze || (Bizgaze = {}));