Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     [LL_WEBREPORT_EXCLUDEHTML /]<!DOCTYPE HTML>
  2.  
  3. <html>
  4. <head>
  5.     <title>Форма редактирования</title>
  6.     <SCRIPT type="text/javascript" SRC="[LL_REPTAG_SUPPORTDIR /]core/jquery.min.js"></SCRIPT>
  7.     <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]core/jquery-ui.min.js"></script>
  8.     <link rel="stylesheet" type="text/css" href="[LL_REPTAG_SUPPORTDIR /]style/jquery-ui.min.css">
  9.     <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jqwidgets/jqxcore.js"></script>
  10.     <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jqwidgets/jqx-all.js"></script>
  11.    
  12.     <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/zjs_plautcore.js"></script>
  13.     <script type="text/javascript" src="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jquery.validate.min.js"></script>
  14.    
  15.     <link rel="stylesheet" type="text/css" href="[LL_REPTAG_SUPPORTDIR /]zmplautcore/css/zcss_plautcore.css">
  16.     <link rel="stylesheet" type="text/css" href="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jqwidgets/styles/jqx.base.css">
  17.     <link rel="stylesheet" type="text/css" href="[LL_REPTAG_SUPPORTDIR /]zmplautcore/js/jqwidgets/styles/jqx.bootstrap.css">
  18.  
  19. </head>
  20. <body>
  21.  
  22.     <script type="text/javascript" language="javascript">
  23.    
  24.         function leadZero(s){
  25.             if (s.length < 2){
  26.                 s = '0'+s;
  27.             }
  28.             return s;
  29.         }
  30.         function setSelection(dropdownList, needToSelect) {
  31.             var sel = document.getElementById(dropdownList);
  32.             var val = needToSelect;
  33.             for(var i = 0, j = sel.options.length; i < j; ++i) {
  34.                 if(sel.options[i].innerHTML === val) {
  35.                    sel.selectedIndex = i;
  36.                    break;
  37.                 }
  38.             }
  39.            
  40.         }
  41.         $(document).ready(function(){
  42.            
  43.             //var now = new Date();
  44.             //var dd = leadZero(String(now.getDate()));
  45.             //var mm = leadZero(String(now.getMonth() + 1));
  46.             //var yyyy = now.getFullYear();
  47.             //var card_status = "Новый";
  48.             //var card_type = "Мероприятие. Ручное создание";
  49.    
  50.             var dd = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_actionCardCreationDate /]:4 /]";
  51.             var mm = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_actionCardCreationDate /]:3 /]";
  52.             var yyyy = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_actionCardCreationDate /]:2 /]";
  53.             var card_status = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:6 /]";
  54.             var card_type = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:3 /]";
  55.             var card_fio = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:8 /]";
  56.             var card_name = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:4 /]";
  57.             var card_branch = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:2 /]";
  58.             var card_be = "[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:7 /]";
  59.            
  60.             //console.log(card_branch);
  61.             //console.log(card_name);
  62.            
  63.             document.getElementById("card_year").value = yyyy;
  64.             document.getElementById("card_month").value = mm;
  65.             document.getElementById("card_day").value = dd;
  66.             document.getElementById("card_type").value = card_type;
  67.             document.getElementById("card_status").value = card_status;
  68.             document.getElementById("card_type").value = card_type;
  69.             document.getElementById("card_fio").value = card_fio;
  70.             document.getElementById("card_name").value = card_name;
  71.            
  72.             document.getElementById("card_name").innerHTML = card_name;
  73.             //document.getElementById("card_branch").value = card_branch;
  74.             //document.getElementById("card_be").value = card_be;
  75.             setSelection("card_name", card_name);
  76.              document.getElementById("card_name").selectedIndex = "3";
  77.             loadEvents();
  78.         })
  79.    
  80.        
  81.    
  82.          function sendForm() {
  83.             if(!validateForm()){
  84.                 alert("Заполните все поля, отмеченные звездочкой.");
  85.                 return;
  86.             }
  87.             var yyyy = document.getElementById("card_year").value;
  88.             var mm = document.getElementById("card_month").value;
  89.             var dd = document.getElementById("card_day").value;
  90.             var card_branch = document.getElementById("card_branch").value;
  91.             var card_status = document.getElementById("card_status").value;
  92.             var card_type = document.getElementById("card_type").value;
  93.             var card_name = document.getElementById("card_name").value;
  94.             var card_be = document.getElementById("card_be").value;
  95.             var card_fio = document.getElementById("card_fio").value;
  96.             var card_sap = document.getElementById("card_sap").value;
  97.    
  98.             plt_openLoader();
  99.            
  100.              $.ajax({url: '[LL_REPTAG_URLPREFIX /]',
  101.    
  102.                     data: {
  103.                         "func":"ll",
  104.                         "objId":"[LL_REPTAG_'ZWR_edit_BWS' NODEINFO:ID /]",
  105.                         "objAction":"RunReport",
  106.                         "year": yyyy,
  107.                         "month": mm,
  108.                         "day": dd,
  109.                         "branch": card_branch,
  110.                         "name": card_name,
  111.                         "type": card_type,
  112.                         "status": card_status,
  113.                         "be": card_be,
  114.                         "fio": card_fio,
  115.                         "sap": card_sap,
  116.                         "dataid": "[LL_REPTAG_&dataid /]",
  117.                         "parentWKSPTypeID": "[LL_REPTAG_&workspaceTypeID /]",
  118.                         "OTCSTicket": "[LL_REPTAG_HTTPCOOKIE assoc:LLCOOKIE /]"
  119.                     },
  120.                     method: 'POST',
  121.                     dataType: 'text',
  122.                     success: function(data) {
  123.                         if(data.indexOf("noerror:") > -1) {
  124.                             var id = data.trim().replace("noerror:", "");
  125.                             var url = '[LL_REPTAG_URLPREFIX /]/app/nodes/' + id;
  126.                             window.opener.location.href = url;
  127.                             //window.opener.location.reload(true);
  128.                             //window.open(url, "_blank");
  129.                             window.close();
  130.                             plt_closeLoader();
  131.                         } else {
  132.                             alert(data);
  133.                             plt_closeLoader();
  134.                         }
  135.                        
  136.                     },
  137.                     error: function(data) {
  138.                         alert(data);
  139.                         plt_closeLoader();
  140.                     }
  141.        
  142.             });
  143.            
  144.      
  145.         }
  146.        
  147.         function validateForm(){
  148.             var card_branch = document.getElementById("card_branch").value;
  149.             var card_status = document.getElementById("card_status").value;
  150.             var card_type = document.getElementById("card_type").value;
  151.             var card_name = document.getElementById("card_name").value;
  152.             var card_be = document.getElementById("card_be").value;
  153.             var card_fio = document.getElementById("card_fio").value;
  154.             var card_sap = document.getElementById("card_sap").value;
  155.            
  156.             console.log(card_branch);
  157.             console.log(card_status);
  158.             console.log(card_type);
  159.             console.log(card_name);
  160.             console.log(card_be);
  161.             console.log(card_fio);
  162.            
  163.             if(checkIsEmployment()){
  164.                 if(card_fio != "" && card_be!="" && card_name!="" && card_type!="" && card_status!="" && card_branch!="" ){
  165.                     return true;
  166.                 } else {
  167.                     return false;
  168.                 }
  169.                
  170.             }
  171.             else {
  172.                 if(card_be!="" && card_name!="" && card_type!="" && card_status!="" && card_branch!="" ){
  173.                     return true;
  174.                 } else {
  175.                     return false;
  176.                 }
  177.             }
  178.            
  179.         }
  180.         function checkIsEmployment() {
  181.             var card_name = document.getElementById("card_name").value;
  182.             var index = $("#card_name")[0].selectedIndex;
  183.             //document.getElementById("card_fio").style.backgroundColor = formConfig[index].ini.backFIO;
  184.             //document.getElementById("label_fio").innerHTML = formConfig[index].ini.strFIO;
  185.             if(typeof formConfig[index].ini.requiredFIO !== 'undefined'){
  186.                $('#card_name').addClass("required");
  187.                 $('#card_name').addClass("disabled");
  188.                 document.getElementById("card_name").style.backgroundColor = formConfig[index].ini.backFIO;
  189.                 return true;
  190.             }
  191.             else {
  192.                 $('#card_name').removeClass("required");
  193.                 $('#card_name').removeClass("disabled");
  194.                 document.getElementById("card_name").style.backgroundColor = "#ffffff";
  195.                 return false;
  196.             }
  197.  
  198.         }
  199.         function isEmpty(obj) {
  200.             for(var key in obj) {
  201.                 if(obj.hasOwnProperty(key))
  202.                     return false;
  203.             }
  204.             return true;
  205.         }
  206.        
  207.         var formConfig;
  208.         function loadEvents()
  209.         {          
  210.             plt_openLoader();
  211.            
  212.                 $.ajax({
  213.                     url: '[LL_REPTAG_URLPREFIX /]',
  214.                         method: 'POST',
  215.                         dataType: 'json',
  216.                         data: {
  217.                             "func":"ll",
  218.                             "objId":"[LL_REPTAG_'ZWR_getEventsNoGroups' NODEINFO:ID /]",
  219.                             "objAction":"RunReport"
  220.                         },
  221.                         success: function(response) {
  222.                             formConfig = response.events;
  223.                             //console.log(response.events);
  224.                             for(i=0; i<formConfig.length-1; i++){
  225.                                 //console.log(response[i]);
  226.                                 console.log(formConfig[i].eventType);
  227.                                 $('#card_name').append('<option value = "'+ formConfig[i].eventType + '">' + formConfig[i].eventType + '</option>');
  228.                             }
  229.                          
  230.                             plt_closeLoader();
  231.            
  232.                             },
  233.                         error: function(x, e) {
  234.                             plt_closeLoader();
  235.                         }
  236.                
  237.                 });
  238.            
  239.            
  240.            
  241.         }
  242.        
  243.         function clearAll() {
  244.               $(".filter").each(function() {
  245.               if ($(this).attr("type") != "checkbox") {
  246.                 $(this).val("");
  247.               } else {
  248.                 $(this).prop("checked", false);
  249.               }
  250.         })
  251.        
  252.        
  253.         }
  254.         function closeWindow()
  255.             {
  256.                 self.close();
  257.             }
  258.     </script>
  259.    
  260.     <style>
  261.       table {
  262.         border: 1px solid #222222;
  263.         padding: 20px;
  264.           border-radius: 10px;
  265.           -webkit-border-radius: 10px;
  266.           -moz-border-radius: 10px;
  267.           -khtml-border-radius: 10px;
  268.           display: block;
  269.        }
  270.        td {
  271.         padding: 10px;
  272.         border: 1px solid #eeeeee;
  273.        }
  274.        .btnback {
  275.             background-image: url("[LL_REPTAG_SUPPORTDIR /]addons/icon.png");
  276.             width:24px;
  277.             height:22px;
  278.             background-repeat: no-repeat;
  279.             background-position: 3px 1px;
  280.             vertical-align: middle;
  281.             background-color: transparent;
  282.             border: none;
  283.        }
  284.        .inputsize {
  285.            height: 22px !important;
  286.            width: 297px !important;
  287.        }
  288.     </style>
  289.    
  290.    
  291.     <div  style="font-size: 13px; font-family: Verdana;">
  292.     <div style="margin: auto; display: table">
  293.     <FORM  id="createForm">
  294.             <table class=" table-block" >
  295.               <tbody>
  296.                 <tr>
  297.                    <th style="text-align: center;" colspan="2">Редактирование карточки [LL_REPTAG_&dataid /]</th>
  298.                 </tr>
  299.                
  300.                 <tr>
  301.                 <td>
  302.                     <label class="col-sm-4 control-label">БЕ (код) <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
  303.                   </td>
  304.                   <td align="left">
  305.                    
  306.                             [LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /]
  307.                                 <select name="card_be" id="card_be"  style="background-color: #eeeeee;  -webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack">
  308.        
  309.                                     <option value="[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:7 /]">[LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:7 /]</option>
  310.                                 </select>
  311.                             [LL_WEBREPORT_ELSE /]
  312.                                 <select name="card_be" id="card_be"  style="-webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack" readonly>
  313.    
  314.                                     <option value="1010">1010</option>
  315.                                     <option value="2020">2020</option>
  316.                                     <option value="3030">3030</option>
  317.                                     <option value="4040">4040</option>
  318.                                     <option value="5050">5050</option>
  319.                                 </select>
  320.                             [LL_WEBREPORT_ENDIF /]
  321.  
  322.                    
  323.  
  324.                   </td>
  325.                 </tr>
  326.                 <tr>
  327.                   <td>
  328.                     <label class="col-sm-4 control-label">Структурное подразделение (код) <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
  329.                   </td>
  330.                   <td align="left">
  331.                    
  332.  
  333.                            
  334.                             [LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /]
  335.                                 <select name="card_branch" id="card_branch"  style="background-color: #eeeeee; -webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack">
  336.                                     <option>
  337.                                         [LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:2 /]
  338.                                     </option>
  339.                                 </select>
  340.                             [LL_WEBREPORT_ELSE /]
  341.                                 <select name="card_branch" id="card_branch"  style="-webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack" readonly>
  342.                                     <option>
  343.                                             <option value="6600">6600</option>
  344.                                             <option value="7700">7700</option>
  345.                                             <option value="8800">8800</option>
  346.                                             <option value="9900">9900</option>
  347.                                             <option value="0000">0000</option>
  348.                                     </option>
  349.                                 </select>
  350.                             [LL_WEBREPORT_ENDIF /]
  351.                        
  352.                   </td>
  353.                 </tr>
  354.                 <td>
  355.                     <label class="col-sm-4 control-label">Тип карточки <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
  356.                   </td>
  357.                   <td align="left">
  358.                     <input type="text" name="card_type" id="card_type" value="Мероприятие" style="height: 22px; width: 297px; background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled  jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light;" readonly >
  359.                   </td>
  360.                 </tr>
  361.                 <tr>
  362.                 <td>
  363.                     <label class="col-sm-4 control-label">ФИО сотрудника <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
  364.                   </td>
  365.                   <td align="left">
  366.                             [LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /]
  367.                                 <input type="text" name="card_fio" id="card_fio"
  368.                                     value="[LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /][LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:8 /][LL_WEBREPORT_ENDIF /]"
  369.                                     style="height: 22px; width: 297px; background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled  jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light;" readonly >
  370.                             [LL_WEBREPORT_ELSE /]
  371.                                 <input type="text" name="card_fio" id="card_fio"
  372.                                     value="[LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /][LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:8 /][LL_WEBREPORT_ENDIF /]"
  373.                                     style="height: 22px; width: 297px;" class="required inputsize filter jqx-input-disabled  jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light;" >
  374.                            
  375.                             [LL_WEBREPORT_ENDIF /]
  376.                    
  377.                   </td>
  378.                 </tr>
  379.                 <tr>
  380.                 <tr>
  381.                   <td>
  382.                     <label class="col-sm-4 control-label">Описание <span style="color: #BA0000; font-family: Verdana; font-size: 16px; font-weight: bold;"> *</label>
  383.                   </td>
  384.                   <td align="left">
  385.                     <select name="card_name" id="card_name" style="-webkit-appearance: menulist-button;" class="required inputsize filter jqx-combobox-state-normal jqx-combobox-state-normal-shinyblack jqx-combobox jqx-combobox-shinyblack jqx-rc-all jqx-rc-all-shinyblack jqx-widget jqx-widget-shinyblack jqx-widget-content jqx-widget-content-shinyblack">
  386.                     </select>
  387.                   </td>
  388.                 </tr>
  389.                
  390.                
  391.                  <tr class="hidden">
  392.                    
  393.    
  394.                     <input type="text" name="card_status" id="card_status" value="[LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /][LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:6 /][LL_WEBREPORT_ENDIF /]" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled  jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
  395.    
  396.                    <input type="text" name="card_year" id="card_year" value="" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled  jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
  397.    
  398.                     <input type="text" name="card_month" id="card_month" value="" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled  jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
  399.    
  400.                    <input type="text" name="card_day" id="card_day" value="" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled  jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
  401.    
  402.                     <input type="text" name="card_sap" id="card_sap" value="[LL_WEBREPORT_IF "[LL_REPTAG_&dataid /]" != "" /][LL_REPTAG_&dataid CATACTION:GETVALUE:[LL_REPTAG_$HCM_general /]:5 /][LL_WEBREPORT_ENDIF /]" style="background-color: #eeeeee;" class="required inputsize filter jqx-input-disabled  jqx-input-group-addon jqx-input-group-addon-light jqx-rc-l jqx-rc-l-light jqx-widget-content jqx-widget-content-light jqx-input-widget jqx-input-widget-light jqx-input jqx-input-light jqx-widget jqx-widget-light jqx-rc-all jqx-rc-all-light";" readonly hidden>
  403.                </tr>
  404.                
  405.                
  406.                <tr>
  407.                  <td class='text-center' colspan="2">
  408.                    <div class="btn-group" style="text-align: center;">
  409.                      <button type="button" class="jqx-rc-all jqx-rc-all-bootstrap jqx-button jqx-button-bootstrap jqx-widget jqx-widget-bootstrap jqx-fill-state-normal jqx-fill-state-normal-bootstrap" onclick="sendForm()">Сохранить</button>
  410.                      <button type="button" class="jqx-rc-all jqx-rc-all-bootstrap jqx-button jqx-button-bootstrap jqx-widget jqx-widget-bootstrap jqx-fill-state-normal jqx-fill-state-normal-bootstrap" onclick="closeWindow()">Отмена</button>
  411.                    </div>
  412.                  </td>
  413.                </tr>
  414.                
  415.              </tbody>
  416.            </table>
  417.            <p><input hidden type="text" name="date" id="date" value="">
  418.    
  419.    </FORM>
  420.    
  421.    
  422.    
  423.    </div>
  424.    </div>
  425. </body>
  426. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement