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

allocateduser.component.js 5.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. var Bizgaze;
  2. (function (Bizgaze) {
  3. let Apps;
  4. (function (Apps) {
  5. let Support;
  6. (function (Support) {
  7. let Components;
  8. (function (Components) {
  9. class AllocatedTo extends Unibase.Platform.Core.BaseComponent {
  10. jsFiles() {
  11. return ['libs/parsley/parsley.min.js', 'apps/support/managers/supportmanager.js', 'apps/support/managers/supportmanager.js', 'tenants/themes/compact/components/details/details.js'];
  12. }
  13. cssFiles() {
  14. return [];
  15. }
  16. html() {
  17. let html = '<form id="frm_BizgazeSupport_AllocatedTo" method="post" data-validate="parsley" class="w-f bg-white"><div class="bg-white b-b modal-header pa-10"><strong id="">Allocated To</strong></div><div style="height: 627px; overflow: hidden auto;" class="simple-scroll-bar modal-body bg-cyan-light-5"><div id = "bizgaze_ValidationSummary" class="clear" > </div><div class="card"><div class="card-body"><div class="floating-label-form-group-with-value" id="div_AllocatedTo"><label for="lbl_AllocatedId">Allocated To <span class="text-danger"> *</span></label ><select style="width:100%" id = "txt_AllocatedName" class="form-control value-control floating-label-control required" data-isdynamic="false" /><input type="hidden" id = "hf_AllocatedId"/><label for= "Validation" id = "lblValidation_AllocatedTo"></label><input type="hidden" id="hfFormPropertyId"/></div></div></div></div><div class="b-t bg-white modal-footer pa-10"><a href="javascript:;" id="btn_CloseAllocate" class="btn btn-light btn-sm mr-auto">Close</a><a href= "javascript:;" id = "btn_SaveAllocate" class="btn_SaveAllocate btn btn-primary btn-sm">Save</a></div></form>';
  18. return html;
  19. }
  20. load(id, containerid, callback) {
  21. var instance = this;
  22. instance.loadUsers();
  23. }
  24. loadUsers() {
  25. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  26. let ticketgroupid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_ticketgroupid").Value;
  27. var url = _appsettings.server_url() + '/apis/v4/bizgaze/support/tickets/getroleticketgroups/ticketgroupid/' + ticketgroupid;
  28. AutoCompleteHelper.getHelper().Create("#txt_AllocatedName", "#hf_AllocatedId", url, function (result) {
  29. });
  30. $("#btn_CloseAllocate").click(function () {
  31. Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp();
  32. });
  33. $("#btn_SaveAllocate").click(function () {
  34. if ($("#txt_AllocatedName").val() != null) {
  35. Bizgaze.Apps.Support.Components.AllocatedTo.Instance().save();
  36. }
  37. else {
  38. $("#div_AllocatedTo").addClass("form-group-required");
  39. MessageHelper.Instance().showError("Please Select Contact", 'bizgaze_ValidationSummary');
  40. }
  41. });
  42. let allocatedid = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_allocatedto").Value;
  43. let allocatedtoname = Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_allocatedtoname").Value;
  44. var selectedAllocatetoname = new Option(allocatedtoname, allocatedid, true);
  45. if (selectedAllocatetoname.value != "0") {
  46. $("#txt_AllocatedName").append(selectedAllocatetoname);
  47. $("#hf_AllocatedId").val(allocatedid);
  48. }
  49. }
  50. save() {
  51. var InstalledAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  52. Bizgaze.Apps.Support.Managers.SupportManager.Instance().UpdateAllocate(Number(Unibase.Themes.Providers.Detail_Settings.Instance().InputParameters.find(x => x.Key == "hf_" + InstalledAppId + "_ticketid").Value), $("#hf_AllocatedId").val()).then(function () {
  53. Unibase.Platform.Helpers.NavigationHelper.Instance().closePopUp();
  54. var detailobj = Unibase.Themes.Compact.Components.Details.Instance();
  55. detailobj._recordId = Unibase.Themes.Providers.DetailHelper.recordId;
  56. detailobj._installedAppId = Unibase.Themes.Providers.DetailHelper.installedAppId;
  57. detailobj._containerId = $("._bizgaze_detail_container:visible").attr("id");
  58. var idetailObj = detailobj;
  59. detailobj.loadPortlets(idetailObj);
  60. MessageHelper.Instance().showSuccess("User Allocated Successfully", '');
  61. });
  62. }
  63. static Instance() {
  64. if (this.instance === undefined) {
  65. this.instance = new Bizgaze.Apps.Support.Components.AllocatedTo();
  66. }
  67. return this.instance;
  68. }
  69. }
  70. Components.AllocatedTo = AllocatedTo;
  71. })(Components = Support.Components || (Support.Components = {}));
  72. })(Support = Apps.Support || (Apps.Support = {}));
  73. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  74. })(Bizgaze || (Bizgaze = {}));