userWagestrategyList.jsp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <link rel="stylesheet" type="text/css" href="css/commoncss.css"/>
  4. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  5. <div class="easyui-layout" fit="true">
  6. <div region="center" style="padding:0px;border:0px">
  7. <t:datagrid name="userWagestrategyList" checkbox="false" autoLoadData="true" pagination="true" pageSize="50" fitColumns="false" sortName="username" sortOrder="desc" title="员工工资策略设定" actionUrl="userWagestrategyController.do?datagrid&orgIds=${orgIds }&departname=${departname}&realname=${realname}" idField="id" fit="true" queryMode="group">
  8. <t:dgCol title="主键" field="id" align="center" hidden="true" queryMode="single" width="120"></t:dgCol>
  9. <t:dgCol title="员工ID" field="userid" align="center" hidden="true" query="false" queryMode="single" width="120"></t:dgCol>
  10. <t:dgCol title="员工工号" field="userNum" frozenColumn="true" sortable="false" query="false" queryMode="single" width="120"></t:dgCol>
  11. <t:dgCol title="员工姓名" field="realname" frozenColumn="true" sortable="false" query="false" queryMode="single" width="120"></t:dgCol>
  12. <t:dgCol title="员工id" field="userids" sortable="false" align="center" hidden="true" queryMode="single" width="120"></t:dgCol>
  13. <t:dgCol title="是否配置策略" field="isset" frozenColumn="true" sortable="false" query="false" queryMode="single" width="120"></t:dgCol>
  14. <t:dgCol title="所属单位" field="departname" frozenColumn="true" sortable="false" queryMode="single" width="220"></t:dgCol>
  15. <t:dgCol title="所属单位id" field="departid" sortable="false" hidden="true" query="false" queryMode="single" width="120"></t:dgCol>
  16. <t:dgCol title="职务ID" field="dutid" hidden="true" align="center" queryMode="single" width="120"></t:dgCol>
  17. <t:dgCol title="职务" field="dutiesname" sortable="false" queryMode="single" width="180"></t:dgCol>
  18. <t:dgCol title="加班费策略" field="overtimepayStrategyid" sortable="false" queryMode="single" extendParams="editor:'combobox'" dictionary="t_bus_overtimepay_strategy,id,strategy_name, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
  19. <t:dgCol title="值班费策略" field="dutyStrategyid" sortable="false" queryMode="single" extendParams="editor:'combobox'" dictionary="t_bus_dutyfee_strategy,id,strategy_name, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
  20. <t:dgCol title="证书补贴" field="certificateSubsidyid" sortable="false" hidden="true" queryMode="single" width="120"></t:dgCol>
  21. <t:dgCol title="证书补贴" field="certificateName" sortable="false" queryMode="single" width="120"></t:dgCol>
  22. <t:dgCol title="交通补贴" field="trafficSubsidyid" sortable="false" queryMode="single" extendParams="editor:'combobox'" dictionary="t_bus_traffic_subsidy,id,subsidy_name, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
  23. <t:dgCol title="高温补贴" field="megathermalSubsidyid" sortable="false" queryMode="single" extendParams="editor:'combobox'" dictionary="t_bus_megathermal_subsidy,id,subsidy_name, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
  24. <t:dgCol title="餐补策略" field="strategyType" sortable="false" queryMode="single" extendParams="editor:'combobox'" dictionary="strategy_type" width="120"></t:dgCol>
  25. <%-- <t:dgCol title="按次餐费补贴" field="nofixedmealsSubsidyid" sortable="false" queryMode="single" extendParams="editor:'combobox'" dictionary="t_bus_meals_subsidy,id,subsidy_name, and delete_flag = '0' and status = '0' and subsidy_type = 'anciguding' and (project is null or project = '${orgIds}')" width="120"></t:dgCol> --%>
  26. <%-- <t:dgCol title="固定餐费补贴" field="fixedmealsSubsidyid" sortable="false" queryMode="single" extendParams="editor:'combobox'" dictionary="t_bus_meals_subsidy,id,subsidy_name, and delete_flag = '0' and status = '0' and subsidy_type = 'anyueguding' and (project is null or project = '${orgIds}')" width="120"></t:dgCol> --%>
  27. <t:dgCol title="按次餐费补贴" field="nofixedmealsSubsidyid" sortable="false" queryMode="single" extendParams="editor:'combobox'" dictionary="t_bus_meals_subsidy,id,subsidy_name, and delete_flag = '0' and status = '0' and subsidy_type = 'anciguding'" width="120"></t:dgCol>
  28. <t:dgCol title="固定餐费补贴" field="fixedmealsSubsidyid" sortable="false" queryMode="single" extendParams="editor:'combobox'" dictionary="t_bus_meals_subsidy,id,subsidy_name, and delete_flag = '0' and status = '0' and subsidy_type = 'anyueguding'" width="120"></t:dgCol>
  29. <t:dgCol title="缴金补贴" style="text-align:right," field="jiaojinSubsidyid" align="center" sortable="false" queryMode="single" extendParams="editor:{type:'numberbox',options:{ min:0,max:99999.99,precision:2}}" width="120"></t:dgCol>
  30. <t:dgCol title="项目绩效" style="text-align:right," field="projectPerformance" align="center" sortable="false" queryMode="single" extendParams="editor:{type:'numberbox',options:{ min:0,max:99999.99,precision:2}}" width="120"></t:dgCol>
  31. <t:dgCol title="其他补贴" field="otherSubsidyid" sortable="false" align="center" queryMode="single" extendParams="editor:'combobox'" dictionary="t_bus_other_subsidy,id,subsidy_name, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
  32. <t:dgCol title="社保策略" field="socialSecurityStrategyid" sortable="false" extendParams="editor:'combobox'" queryMode="single" dictionary="t_bus_social_security_strategy,id,social_security_unit, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
  33. <t:dgCol title="公积金策略" field="providentFundStrategyid" sortable="false" extendParams="editor:'combobox'" queryMode="single" dictionary="t_bus_provident_fund_strategy,id,provident_fund_name, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
  34. <t:dgCol title="其他补贴-追加调整" style="text-align:right," field="appendPay" align="center" sortable="false" queryMode="single" extendParams="editor:{type:'numberbox',options:{ min:0,max:99999.99,precision:2}}" width="120"></t:dgCol>
  35. <t:dgCol title="代扣款" style="text-align:right," field="daikouFee" align="center" sortable="false" queryMode="single" extendParams="editor:{type:'numberbox',options:{ min:0,max:99999.99,precision:2}}" width="120"></t:dgCol>
  36. <t:dgCol title="扣除调整" style="text-align:right," field="deductPay" align="center" sortable="false" queryMode="single" extendParams="editor:{type:'numberbox',options:{ min:0,max:99999.99,precision:2}}" width="120"></t:dgCol>
  37. <t:dgCol title="独生子女费" style="text-align:right," field="onlychildPay" align="center" sortable="false" queryMode="single" extendParams="editor:{type:'numberbox',options:{ min:0,max:99999.99,precision:2}}" width="120"></t:dgCol>
  38. <t:dgCol title="状态" field="status" hidden="true" sortable="false" queryMode="single" width="120"></t:dgCol>
  39. <t:dgCol title="逻辑删除标识" field="deleteFlag" align="center" sortable="false" hidden="true" queryMode="single" dictionary="del_flag" width="120"></t:dgCol>
  40. <%-- <t:dgCol title="操作" field="opt"></t:dgCol> --%>
  41. <%-- <t:dgDelOpt title="删除" url="userWagestrategyController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/> --%>
  42. <t:dgToolBar operationCode="edit" title="修改" icon="icon-edit" operationCode="edit" funname="editRow"></t:dgToolBar>
  43. <t:dgToolBar operationCode="save" title="保存" icon="icon-save" url="userWagestrategyController.do?saveRows" funname="saveData"></t:dgToolBar>
  44. <t:dgToolBar operationCode="undo" title="取消编辑" icon="icon-cancel1" funname="reject"></t:dgToolBar>
  45. <t:dgToolBar title="导出" icon="icon-put" operationCode="put" funname="ExportXls"></t:dgToolBar>
  46. </t:datagrid>
  47. </div>
  48. <script>
  49. $(function() {
  50. var datagrid = $("#userWagestrategyListtb");
  51. datagrid.prepend($("#pinjie1 div[name='pinjie2']").html());
  52. $("#pinjie1").html('');
  53. datagrid.children(".datagrid-toolbar").children("span:first").after($("#pinjiechaxun1 div[name='pinjiechaxun2']").html());
  54. $("#pinjiechaxun1").html('');
  55. });
  56. // $('#userWagestrategyList').datagrid({
  57. // rowStyler:function(index,row){
  58. // if (row.isset == "未配置"){
  59. // return 'background-color:#CDCDC1';
  60. // }
  61. // }
  62. // });
  63. </script>
  64. <div id="pinjie1">
  65. <div name="pinjie2" style="padding:3px; height: auto" class="datagrid-toolbar">
  66. <div name="searchColums" style="margin:23px 0 18px 0;">
  67. <input type="hidden" id="orgCode" name="orgCode" value="${orgCode}">
  68. <table style="padding:0px" cellpadding="0" cellspacing="1" >
  69. <tbody>
  70. <tr>
  71. <td align="right" style="width: 74px;">
  72. <label class="Validform_label">
  73. 项目名称:
  74. </label>
  75. </td>
  76. <td class="value" colspan="3">
  77. <input readonly="true" type="text" id="departname" name="departname" style="width: 157px" datatype="*" value='${departname}' placeholder="请选择项目名称" onclick="openDepartmentSelect()">
  78. <input id="orgIds" name="orgIds" type="hidden" value='${orgIds}'>
  79. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch" onclick="openDepartmentSelect()">选择</a>
  80. <!-- <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo" onclick="callbackClean()">清空</a> -->
  81. </td>
  82. <td align="right" style="width: 74px;">
  83. <label class="Validform_label">
  84. 员工姓名:
  85. </label>
  86. </td>
  87. <td class="value">
  88. <input id="realname" name="realname" value='${realname}' type="text" style="width: 157px; " class="inputxt" placeholder="请输入员工姓名">
  89. </td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. </div>
  94. </div>
  95. </div>
  96. <div id="pinjiechaxun1">
  97. <div name="pinjiechaxun2" style="padding:3px; height: auto" class="datagrid-toolbar">
  98. <span style="float:right;margin-bottom:4px;">
  99. <span>
  100. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="personnelBaseArchivesManageSearch" onclick="userWagestrategyListsearch1()">查询</a>
  101. </span>
  102. <span>
  103. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-reload " id="personnelBaseArchivesManageRedo" onclick="searchReset('userWagestrategyList')">重置</a>
  104. </span>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. <script src = "webpage/cn/com/lzt/userwagestrategy/userWagestrategyList.js"></script>
  110. <style>
  111. .validatebox-text::-ms-clear {
  112. display: none;
  113. width : 0;
  114. height: 0;
  115. }
  116. </style>
  117. <script type="text/javascript">
  118. function userWagestrategyListsearch1(){
  119. var orgIds = $("#orgIds").val();
  120. // if(orgIds == null || orgIds.length == 0){
  121. // layer.alert("请选择项目");
  122. // return;
  123. // }
  124. window.location.href="userWagestrategyController.do?list&orgIds=" + orgIds+"&departname="+$("#departname").val()+"&realname="+$("#realname").val();
  125. }
  126. //保存数据
  127. function saveData(title,addurl,gname){
  128. if(!endEdit(gname))
  129. return false;
  130. var rows=$('#'+gname).datagrid("getChanges","inserted");
  131. var uprows=$('#'+gname).datagrid("getChanges","updated");
  132. rows=rows.concat(uprows);
  133. if(rows.length<=0){
  134. layer.alert("没有需要保存的数据!");
  135. //tip("没有需要保存的数据!");
  136. return false;
  137. }
  138. var result={};
  139. var mycars = new Array();
  140. for(var i=0;i<rows.length;i++){
  141. mycars[i] = new Array();
  142. for(var d in rows[i]){
  143. mycars[i][d] = rows[i][d];
  144. result["userWagestrategyDaoList["+i+"]."+d]=rows[i][d];
  145. }
  146. }
  147. var temp = false;
  148. for(var j=0;j<mycars.length;j++){
  149. var username = mycars[j].username;
  150. var strategyType = mycars[j].strategyType;
  151. /* var nofixedmealsSubsidyid = mycars[j].nofixedmealsSubsidyid; */
  152. var fixedmealsSubsidyid = mycars[j].fixedmealsSubsidyid;
  153. if(strategyType == '0'){//
  154. if(fixedmealsSubsidyid == ''){
  155. layer.alert("<固定餐补补贴>不能为空!");
  156. //tip("员工编号为【"+username+"】的<固定餐补补贴>不能为空!");
  157. temp = true;
  158. }
  159. }else{
  160. /* if(nofixedmealsSubsidyid != '' || fixedmealsSubsidyid != ''){
  161. tip("员工编号为【"+username+"】的<固定餐补补贴>或<按次餐费补贴>没有为空!");
  162. temp = true;
  163. } */
  164. if(fixedmealsSubsidyid != '' && fixedmealsSubsidyid != '00000000614b4dbc016163e293c60022'){
  165. layer.alert("请设置<固定餐补补贴>为<无>!");
  166. //tip("员工编号为【"+username+"】的<固定餐补补贴>没有为空!");
  167. temp = true;
  168. }
  169. }
  170. if(temp){
  171. break;
  172. }
  173. }
  174. if(temp){
  175. setTimeout(function () {
  176. location.reload();
  177. }, 1500);
  178. return;
  179. }
  180. $.ajax({
  181. url:"<%=basePath%>/"+addurl,
  182. type:"post",
  183. data:result,
  184. dataType:"json",
  185. success:function(data){
  186. tip(data.msg);
  187. reloadTable();
  188. }
  189. })
  190. }
  191. //结束编辑
  192. function endEdit(gname){
  193. var editIndex = $('#'+gname).datagrid('getRows').length-1;
  194. for(var i=0;i<=editIndex;i++){
  195. if($('#'+gname).datagrid('validateRow', i)){
  196. $('#'+gname).datagrid('endEdit', i);
  197. }
  198. else{
  199. layer.alert("请选择餐补策略");
  200. return false;
  201. }
  202. }
  203. return true;
  204. }
  205. //编辑行
  206. function editRow(title,addurl,gname){
  207. var rows=$('#'+gname).datagrid("getChecked");
  208. if(rows.length==0){
  209. layer.alert("请选择条目");
  210. //tip("请选择条目");
  211. return false;
  212. }
  213. for(var i=0;i<rows.length;i++){
  214. var index= $('#'+gname).datagrid('getRowIndex', rows[i]);
  215. $('#'+gname).datagrid('beginEdit', index);
  216. }
  217. }
  218. //update-begin--Author:张忠亮 Date:20150709 for:修正 取消编辑后再次点击录入不进入编辑状态
  219. //取消编辑
  220. function reject(title,addurl,gname){
  221. $('#'+gname).datagrid('clearChecked');
  222. $('#'+gname).datagrid('rejectChanges');
  223. }
  224. // //导出
  225. // function ExportXls() {
  226. // JeecgExcelExport("userWagestrategyController.do?exportXls","userWagestrategyList");
  227. // }
  228. //导出
  229. function ExportXls() {
  230. excelExport("userWagestrategyController.do?exportXls","userWagestrategyList",40000);
  231. }
  232. function excelExport(url,datagridId,time){
  233. var queryParams = $('#'+datagridId).datagrid('options').queryParams;
  234. $('#'+datagridId+'tb').find('*').each(function() {
  235. queryParams[$(this).attr('name')] = $(this).val();
  236. });
  237. var params = '&';
  238. $.each(queryParams, function(key, val){
  239. params+='&'+key+'='+val;
  240. });
  241. var fields = '&field=';
  242. $.each($('#'+ datagridId).datagrid('options').columns[0], function(i, val){
  243. if(val.field != 'opt'){
  244. fields+=val.field+',';
  245. }
  246. });
  247. //update-begin--Author:dangzhenghui Date:20170429 for:TASK #1869 【demo】jeecg excel导出 可以导出 指定行的数据
  248. var id='&id=';
  249. //update-by yulong.zhao 17-10-15 注释该代码具体业务不需要导出指定行
  250. /*$.each($('#'+ datagridId).datagrid('getSelections'), function(i, val){
  251. id+=val.id+",";
  252. });*/
  253. // alert(fields+params+id);
  254. layer.msg('数据导出中,请稍候···', {
  255. time : time,
  256. shade: 0.1});
  257. window.location.href = url+ encodeURI(fields+params+id);
  258. }
  259. //选择项目名称,列表================
  260. function openDepartmentSelect() {
  261. //$.dialog.setting.zIndex = getzIndex();
  262. var orgIds = $("#orgIds").val();
  263. var orgCode = $("#orgCode").val();
  264. if("A_HR" == orgCode) {
  265. $.dialog({
  266. content: 'url:userWageController.do?projectDepartTableAll&ids='+orgIds, zIndex: getzIndex(), title: '项目名称列表', lock: true, width: '600px', height: '350px', opacity: 0.4, button: [
  267. {name: '<t:mutiLang langKey="common.confirm"/>', callback: function (){
  268. var iframe = this.iframe.contentWindow;
  269. if(iframe.getReason().length>0){
  270. var strData=eval(iframe.getReason());
  271. for(var key in strData[0]){
  272. if(key=="strPId"){
  273. $("#orgIds").val(strData[0][key]);
  274. }else if(key=="strDepartName"){
  275. $("#departname").val(strData[0][key]);
  276. }
  277. }
  278. }
  279. }, focus: true},
  280. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  281. ]}).zindex();
  282. } else {
  283. $.dialog({
  284. content: 'url:dialogDealController.do?projectDepartTablePart&ids='+orgIds, zIndex: getzIndex(), title: '项目名称列表', lock: true, width: '600px', height: '350px', opacity: 0.4, button: [
  285. {name: '<t:mutiLang langKey="common.confirm"/>', callback: function (){
  286. var iframe = this.iframe.contentWindow;
  287. if(iframe.getReason().length>0){
  288. var strData=eval(iframe.getReason());
  289. for(var key in strData[0]){
  290. if(key=="strPId"){
  291. $("#orgIds").val(strData[0][key]);
  292. }else if(key=="strDepartName"){
  293. $("#departname").val(strData[0][key]);
  294. }
  295. }
  296. }
  297. }, focus: true},
  298. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  299. ]}).zindex();
  300. }
  301. }
  302. function callbackClean(){
  303. $('#departname').val('');
  304. $('#orgIds').val('');
  305. }
  306. </script>