Built files from Bizgaze WebServer
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

createlead.js 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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 Contacts;
  17. (function (Contacts) {
  18. let Components;
  19. (function (Components) {
  20. class CreateLead extends Unibase.Platform.Core.BaseComponent {
  21. constructor() {
  22. super();
  23. }
  24. cssFiles() {
  25. return [];
  26. }
  27. jsFiles() {
  28. return [''];
  29. }
  30. html(id, containerid) {
  31. return "";
  32. }
  33. init(containerid) {
  34. var instance = this;
  35. }
  36. load(id, containerid, callback) {
  37. }
  38. createcustomer() {
  39. let detailContainer = $("._bizgaze_detail_container:visible");
  40. var isconverttocustomer = (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.filter(function (o) {
  41. return o.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_isconvertedtocustomer";
  42. })[0].Value);
  43. if (Boolean(isconverttocustomer) == true) {
  44. $(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Confirm').addClass('hidden');
  45. }
  46. else {
  47. $(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Confirm').removeClass('hidden');
  48. }
  49. var instance = this;
  50. $(detailContainer).find('.DetailSetting_' + Unibase.Themes.Providers.DetailHelper.installedAppId + '_Confirm').click(function () {
  51. var RefStatusid = (Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.filter(function (o) {
  52. return o.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_refstatusid";
  53. })[0].Value);
  54. if (RefStatusid == 1 || RefStatusid == 2 || RefStatusid == 9) {
  55. MessageHelper.Instance().showError('Cannot Move Non-Prospect Stage Leads To Confirm Stage', 'div_message');
  56. }
  57. else {
  58. Unibase.Platform.Forms.Managers.FormManager.Instance().getFormbyUniqueId("Bizgaze_Platform_Crm_CreateCustomer").then(function (res) {
  59. var formid = res.result.FormId;
  60. var loadobj = {
  61. CallBack: function () {
  62. $(".div_SubFormdetails").find(".btn-success").click();
  63. var tagpropertyid = $(".hdn_tagcontrol").parents(".divCustomProperties").data("uniqueid");
  64. var tagJson = "";
  65. instance.fileCacheHelper.loadJsFile('apps/crm/contacts/managers/contactmanager.js', function () {
  66. $(".div_SubFormdetails").find(".btn-success").click();
  67. var leadid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.filter(function (o) { return o.Key === "hf_" + Unibase.Themes.Providers.DetailHelper.installedAppId + "_recordid"; })[0].Value;
  68. Bizgaze.Apps.Crm.Contacts.Managers.ContactManager.Instance().getleadbyleadid(Number(leadid)).then(function (leadres) {
  69. Bizgaze.Apps.Crm.Contacts.Managers.ContactManager.Instance().getleadtagsbyleadid(Number(leadid), formid).then(function (res) {
  70. return __awaiter(this, void 0, void 0, function* () {
  71. if (leadres.result.LeadType == 2) {
  72. var drdbid = $("#rdb_organizationtypeid_2");
  73. $("#hdnRdb_organizationtypeid").val(2);
  74. drdbid.attr("checked", true).trigger('change');
  75. }
  76. $(".hdn_refid").val(Number(leadid));
  77. $(".txt_organizationid").val(leadres.result.OrganizationName);
  78. if (leadres.result.OrganizationName != "")
  79. $(".div_organizationid").addClass("floating-label-form-group-with-value");
  80. $(".txt_defaultemailid").val(leadres.result.OrganizationEmail);
  81. if (leadres.result.OrganizationEmail != "")
  82. $(".div_defaultemailid").addClass("floating-label-form-group-with-value");
  83. $(".txt_defaultnumberid").val(leadres.result.PhoneNumber);
  84. if (leadres.result.PhoneNumber != "")
  85. $(".div_defaultnumberid").addClass("floating-label-form-group-with-value");
  86. $(".txt_contactname").val(leadres.result.ContactPersonName);
  87. if (leadres.result.ContactPersonName != "")
  88. $(".div_contactname ").addClass("floating-label-form-group-with-value");
  89. $("#txtPhn_phonenumber").val(leadres.result.ContactNumbers);
  90. if (leadres.result.ContactNumbers != "")
  91. $(".div_phonenumber ").addClass("floating-label-form-group-with-value");
  92. $(".txt_emailaddress").val(leadres.result.Email);
  93. if (leadres.result.Email != "")
  94. $(".div_emailaddress").addClass("floating-label-form-group-with-value");
  95. $(".txtAutoComplete_branchid").append($("<option></option>")
  96. .attr("value", leadres.result.BranchId)
  97. .text(leadres.result.AliasName));
  98. $(".txtAutoComplete_designationid")
  99. .append($("<option></option>")
  100. .attr("value", leadres.result.DesignationId)
  101. .text(leadres.result.DesignationName));
  102. if ((leadres.result.AddressName1 != "" && leadres.result.AddressName1 != undefined) || (leadres.result.CityId1 != 0 && leadres.result.CityId1 != undefined)) {
  103. yield $.when().then(function (x) {
  104. $(".subform_container_1").find(".txt_addressname").val(leadres.result.AddressName1);
  105. if (leadres.result.AddressName1 != "")
  106. $(".subform_container_1").find(".div_addressname").addClass("floating-label-form-group-with-value");
  107. $(".subform_container_1").find(".txt_addressline1").val(leadres.result.AddressLine11);
  108. if (leadres.result.AddressLine11 != "")
  109. $(".subform_container_1").find(".div_addressline1").addClass("floating-label-form-group-with-value");
  110. $(".subform_container_1").find(".txt_addressline2").val(leadres.result.AddressLine12);
  111. if (leadres.result.AddressLine12 != "")
  112. $(".subform_container_1").find(".div_addressline2").addClass("floating-label-form-group-with-value");
  113. $(".subform_container_1").find(".txtAutoComplete_cityid").append($("<option></option>").attr("value", leadres.result.CityId1)
  114. .text(leadres.result.Address_CityName1)).trigger("change");
  115. $(".subform_container_1").find(".txt_zipcode").val(leadres.result.PinCode1);
  116. if (leadres.result.PinCode1 != "")
  117. $(".subform_container_1").find(".div_zipcode").addClass("floating-label-form-group-with-value");
  118. $(".subform_container_1").find(".txt_landmark").val(leadres.result.LandMark1);
  119. if (leadres.result.LandMark1 != "")
  120. $(".subform_container_1").find(".div_landmark").addClass("floating-label-form-group-with-value");
  121. });
  122. }
  123. else {
  124. $(".subform_1").find(".btn-icon-circle").click();
  125. }
  126. if ((leadres.result.AddressName2 != "" && leadres.result.AddressName2 != undefined) || (leadres.result.CityId2 != 0 && leadres.result.CityId2 != undefined)) {
  127. $(".subform_container_2").find(".txt_addressname").val(leadres.result.AddressName2);
  128. if (leadres.result.AddressName2 != "")
  129. $(".subform_container_2").find(".div_addressname").addClass("floating-label-form-group-with-value");
  130. $(".subform_container_2").find(".txt_addressline1").val(leadres.result.AddressLine21);
  131. if (leadres.result.AddressLine21 != "")
  132. $(".subform_container_2").find(".div_addressline1").addClass("floating-label-form-group-with-value");
  133. $(".subform_container_2").find(".txt_addressline2").val(leadres.result.AddressLine22);
  134. if (leadres.result.AddressLine22 != "")
  135. $(".subform_container_2").find(".div_addressline2").addClass("floating-label-form-group-with-value");
  136. $(".subform_container_2").find(".txtAutoComplete_cityid").append($("<option></option>").attr("value", leadres.result.CityId2)
  137. .text(leadres.result.Address_CityName2)).trigger("change");
  138. $(".subform_container_2").find(".txt_zipcode").val(leadres.result.PinCode2);
  139. if (leadres.result.PinCode2 != "")
  140. $(".subform_container_2").find(".div_zipcode ").addClass("floating-label-form-group-with-value");
  141. $(".subform_container_2").find(".txt_landmark").val(leadres.result.LandMark2);
  142. if (leadres.result.LandMark2 != "")
  143. $(".subform_container_2").find(".div_landmark").addClass("floating-label-form-group-with-value");
  144. }
  145. else {
  146. $(".subform_2").find(".btn-icon-circle").click();
  147. }
  148. Unibase.Forms.Controls.Tag.Instance().bindEditFormDetails(tagpropertyid, res.result, "");
  149. });
  150. });
  151. });
  152. });
  153. },
  154. Parameters: null,
  155. };
  156. var formviewerObj = {
  157. FormId: formid,
  158. AppConfigurationId: 0,
  159. Pk_Value: 0,
  160. PortletWidgetId: 0,
  161. OnSuccess: null,
  162. OnFail: null,
  163. OnLoad: loadobj,
  164. };
  165. Unibase.Platform.Forms.Components.FormViewer.Instance().init(formviewerObj);
  166. });
  167. }
  168. });
  169. }
  170. static Instance() {
  171. if (this._instance === undefined)
  172. this._instance = new CreateLead();
  173. return this._instance;
  174. }
  175. }
  176. Components.CreateLead = CreateLead;
  177. })(Components = Contacts.Components || (Contacts.Components = {}));
  178. })(Contacts = Crm.Contacts || (Crm.Contacts = {}));
  179. })(Crm = Apps.Crm || (Apps.Crm = {}));
  180. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  181. })(Bizgaze || (Bizgaze = {}));