holidayList.jsp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  4. <script src="webpage/cn/com/lzt/useractiviti/select_user_tools.js"></script>
  5. <div class="easyui-layout" fit="true">
  6. <div region="center" style="padding:0px;border:0px">
  7. <t:datagrid name="holidayList" checkbox="false" fitColumns="false" title="休假申请" actionUrl="holidayController.do?datagrid" idField="id" fit="true" queryMode="group">
  8. <t:dgCol title="主键" field="id" hidden="true" sortable="false" queryMode="single" width="120"></t:dgCol>
  9. <t:dgCol title="创建人登录名称" field="createBy" sortable="false" hidden="true" queryMode="single" width="120"></t:dgCol>
  10. <t:dgCol title="创建日期" field="createDate" sortable="false" formatter="yyyy-MM-dd hh:mm:ss" hidden="true" queryMode="single" width="120"></t:dgCol>
  11. <t:dgCol title="更新人名称" field="updateName" sortable="false" hidden="true" queryMode="single" width="120"></t:dgCol>
  12. <t:dgCol title="更新人登录名称" field="updateBy" sortable="false" hidden="true" queryMode="single" width="120"></t:dgCol>
  13. <t:dgCol title="更新日期" field="updateDate" sortable="false" formatter="yyyy-MM-dd hh:mm:ss" hidden="true" queryMode="single" width="120"></t:dgCol>
  14. <t:dgCol title="所属部门" field="sysOrgCode" sortable="false" hidden="true" queryMode="single" width="120"></t:dgCol>
  15. <t:dgCol title="所属公司" field="sysCompanyCode" sortable="false" hidden="true" queryMode="single" width="120"></t:dgCol>
  16. <t:dgCol title="申请日期" field="applyDate" sortable="false" align="center" query="false" formatter="yyyy-MM-dd" queryMode="group" width="120"></t:dgCol>
  17. <t:dgCol title="员工姓名" field="realname" sortable="false" queryMode="single" query="false" width="120"></t:dgCol>
  18. <t:dgCol title="员工工号" field="username" sortable="false" queryMode="single" query="false" width="120"></t:dgCol>
  19. <t:dgCol title="休假类型" field="holidayType" sortable="false" query="false" align="center" queryMode="single" dictionary="rest_type" width="70"></t:dgCol>
  20. <t:dgCol title="所属单位" field="belongUnitid" sortable="false" query="false" queryMode="single" width="160"></t:dgCol>
  21. <t:dgCol title="休假开始时间" field="holidayStime" sortable="false" formatter="yyyy-MM-dd hh:mm:ss" align="center" query="false" queryMode="single" width="140"></t:dgCol>
  22. <t:dgCol title="休假结束时间" field="holidayEtime" sortable="false" formatter="yyyy-MM-dd hh:mm:ss" align="center" query="false" queryMode="single" width="140"></t:dgCol>
  23. <t:dgCol title="休假总时长" field="holidayDuration" sortable="false" style="text-align:right," queryMode="single" width="90"></t:dgCol>
  24. <t:dgCol title="申请人" field="createName" sortable="false" queryMode="single" width="120"></t:dgCol>
  25. <t:dgCol title="" field="applicantId" sortable="false" hidden="true" queryMode="single" width="120" ></t:dgCol>
  26. <t:dgCol title="申请状态" field="bpmStatus" sortable="false" query="false" align="center" queryMode="single" dictionary="bpm_status" width="120"></t:dgCol>
  27. <t:dgCol title="流程id" field="procInstId" sortable="false" align="center" queryMode="single" hidden="true" width="120"></t:dgCol>
  28. <t:dgCol title="休假原因" field="holidayReason" sortable="false" hidden="true" queryMode="single" width="120"></t:dgCol>
  29. <t:dgCol title="逻辑删除标识" field="deleteFlag" sortable="false" hidden="true" queryMode="single" dictionary="del_flag" width="120"></t:dgCol>
  30. <t:dgCol title="" field="reject" queryMode="single" hidden="true" width="120"></t:dgCol>
  31. <t:dgCol title="" field="iamApplyUser" queryMode="single" hidden="true" width="120"></t:dgCol>
  32. <t:dgCol title="操作" field="opt" sortable="false"></t:dgCol>
  33. <%-- <t:dgDelOpt title="删除" url="holidayController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/> --%>
  34. <%-- <t:dgFunOpt title="开启" funname="enableObj(id,bpmStatus)" urlclass="ace_button" urlfont="fa-cog"></t:dgFunOpt> --%>
  35. <t:dgFunOpt exp="bpmStatus#eq#1" urlclass="ace_button" urlfont="fa-cog" funname="startUserDefinedProcess(id,bpmStatus,applicantId)" title="提交流程" />
  36. <t:dgFunOpt exp="bpmStatus#ne#1" urlclass="ace_button" urlfont="fa-cog" funname="startus(id,procInstId)" title="查看流程" />
  37. <t:dgFunOpt exp="bpmStatus#eq#2" urlclass="ace_button" urlfont="fa-cog" funname="startusr(id,procInstId,bpmStatus,reject,iamApplyUser,applicantId)" title="撤回流程" />
  38. <t:dgToolBar title="录入" icon="icon-add" operationCode="add" url="holidayController.do?goAdd" funname="add"></t:dgToolBar>
  39. <t:dgToolBar title="修改" icon="icon-edit" operationCode="edit" url="holidayController.do?goUpdate" funname="update"></t:dgToolBar>
  40. <t:dgToolBar title="删除" icon="icon-remove" operationCode="remove" url="holidayController.do?logicDel" funname="deleteObj"></t:dgToolBar>
  41. <t:dgToolBar title="查看" icon="icon-view" url="holidayController.do?goview" funname="goview"></t:dgToolBar>
  42. <%--<t:dgToolBar title="附件管理" icon="icon-detail" funname="fileList" width="100%" height="100%"></t:dgToolBar>--%>
  43. <%-- <t:dgToolBar title="撤销" icon="icon-edit" operationCode="edit" url="holidayController.do?disable" funname="disableObj"></t:dgToolBar> --%>
  44. <%-- <t:dgToolBar title="导出" icon="icon-put" operationCode="put" funname="ExportXls"></t:dgToolBar> --%>
  45. </t:datagrid>
  46. </div>
  47. <script>
  48. $(function() {
  49. var datagrid = $("#holidayListtb");
  50. datagrid.prepend($("#pinjie1 div[name='pinjie2']").html());
  51. $("#pinjie1").html('');
  52. datagrid.children(".datagrid-toolbar").children("span:first").after($("#pinjiechaxun1 div[name='pinjiechaxun2']").html());
  53. $("#pinjiechaxun1").html('');
  54. });
  55. </script>
  56. <div id="pinjie1">
  57. <div name="pinjie2" style="padding:3px; height: auto" class="datagrid-toolbar">
  58. <table style="height:85px;padding:0px" cellpadding="0" cellspacing="1" >
  59. <tbody>
  60. <tr>
  61. <td align="right" style="width: 74px;">
  62. <label class="Validform_label">
  63. 员工姓名:
  64. </label>
  65. </td>
  66. <td class="value">
  67. <input id="realname" name="realname" type="text" style="width: 157px; " class="inputxt" placeholder="请输入员工姓名">
  68. </td>
  69. <td align="right" style="width: 74px;">
  70. <label class="Validform_label">
  71. 申请状态:
  72. </label>
  73. </td>
  74. <td class="value">
  75. <t:dictSelect field="bpmStatus" type="select" typeGroupCode="bpm_status" hasLabel="false" title="申请状态" ></t:dictSelect>
  76. </td>
  77. <td align="right" style="width: 74px;">
  78. <label class="Validform_label">
  79. 所属单位:
  80. </label>
  81. </td>
  82. <td class="value" colspan="3">
  83. <input readonly="true" type="text" id="departname" name="departname" style="width: 157px" placeholder="请选择所属单位" onclick="openDepartmentSelect()">
  84. <input id="orgIds" name="orgIds" type="hidden" value="">
  85. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-select" id="departSearch" onclick="openDepartmentSelect()">选择</a>
  86. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-clean" id="departRedo" onclick="callbackClean()">清空</a>
  87. </td>
  88. </tr>
  89. <tr>
  90. <td align="right">
  91. <label class="Validform_label">
  92. 申请日期:
  93. </label>
  94. </td>
  95. <td class="value" colspan="3">
  96. <input id="applyDate_begin" name="applyDate_begin" type="text" style="width: 150px" class="Wdate"
  97. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'applyDate_end\')}'})" readonly="readonly" placeholder="yyyy-MM-dd"/>~
  98. <input id="applyDate_end" name="applyDate_end" type="text" style="width: 150px" class="Wdate"
  99. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'applyDate_begin\')}'})" readonly="readonly" placeholder="yyyy-MM-dd"/>
  100. </td>
  101. <td align="right">
  102. <label class="Validform_label">
  103. 休假期间:
  104. </label>
  105. </td>
  106. <td class="value">
  107. <input id="holidayStime" name="holidayStime" type="text" style="width: 150px" class="Wdate"
  108. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'holidayEtime\')}'})" readonly="readonly" placeholder="yyyy-MM-dd"/>~
  109. <input id="holidayEtime" name="holidayEtime" type="text" style="width: 150px" class="Wdate"
  110. onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'holidayStime\')}'})" readonly="readonly" placeholder="yyyy-MM-dd"/>
  111. </td>
  112. <td align="right" style="width: 74px;">
  113. <label class="Validform_label">
  114. 休假类型:
  115. </label>
  116. </td>
  117. <td class="value">
  118. <t:dictSelect field="holidayType" type="select" typeGroupCode="rest_type" hasLabel="false" title="休假类型" ></t:dictSelect>
  119. </td>
  120. </tr>
  121. </tbody>
  122. </table>
  123. </div>
  124. </div>
  125. <div id="pinjiechaxun1">
  126. <div name="pinjiechaxun2" style="padding:3px; height: auto" class="datagrid-toolbar">
  127. <div style="float: right;">
  128. <span>
  129. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="personnelBaseArchivesManageSearch" onclick="holidayListsearch()">查询</a>
  130. </span>
  131. <span>
  132. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-reload " id="personnelBaseArchivesManageRedo" onclick="searchReset('holidayList')">重置</a>
  133. </span>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <input id = "user" value="${user.id}" />
  139. <script src = "webpage/cn/com/lzt/holiday/holidayList.js"></script>
  140. <script type="text/javascript">
  141. //启动流程
  142. function startUserDefinedProcess(id,bpmStatus,applicantId,tableName,formUrl){
  143. /* if(bpmStatus != 1){
  144. layer.alert('<t:mutiLang langKey="只有状态为<待提交>时才可进行<提交流程>操作"/>');
  145. return;
  146. } */
  147. if(bpmStatus == 2){
  148. layer.alert('<t:mutiLang langKey="申请处理中不可再次提交流程"/>');
  149. return;
  150. }else if(bpmStatus == 3){
  151. layer.alert('<t:mutiLang langKey="申请已完成不可再次提交流程"/>');
  152. return;
  153. }
  154. /* if(applicantId != $("#user").val()){
  155. layer.alert('您无权限操作该数据!');
  156. return;
  157. } */
  158. //业务表名
  159. var tableName = 't_bus_holiday';
  160. //流程对应表单 URL
  161. var formUrl = 'holidayController.do?goView';
  162. confirm('activitiController.do?startUserDefinedProcess&id='+id+'&tableName='+tableName+'&formUrl='+formUrl,'确定提交流程吗?','holidayList');
  163. }
  164. function startusr(id,usid,bpmStatus,reject,iamApplyUser,applicantId){
  165. if(reject == '2'/* && iamApplyUser == '2' */){
  166. retractProcess1(id,"t_bus_holiday",usid,"holidayList");
  167. return;
  168. }
  169. /* if(applicantId != $("#user").val()){
  170. layer.alert('您无权限操作该数据!');
  171. return;
  172. }
  173. */
  174. /* if(bpmStatus != 2){
  175. layer.alert('<t:mutiLang langKey="只有状态为<处理中>时才可进行<流程撤回>操作"/>');
  176. return;
  177. } */
  178. //业务表名
  179. retractProcess(id,"t_bus_holiday",usid,"holidayList");
  180. }
  181. function startus(id,usid){
  182. processtracking(id,usid);
  183. }
  184. function enableObj(id,bpmStatus) {
  185. if(bpmStatus != 1){
  186. layer.alert('<t:mutiLang langKey="只有状态为<待提交>时才可进行<开启>操作"/>');
  187. return;
  188. }
  189. var url = "holidayController.do?enable";
  190. url += '&id='+id;
  191. $.dialog.confirm('<t:mutiLang langKey="确定要启用此休假申请吗?"/>', function(){
  192. lockuploadify(url);
  193. }, function(){
  194. });
  195. }
  196. function disableObj(title,url, id) {
  197. var rowsData = $('#'+id).datagrid('getSelections');
  198. if (!rowsData || rowsData.length==0) {
  199. layer.alert('请选中一条数据');
  200. return;
  201. }
  202. if(rowsData[0].bpmStatus != 2){
  203. layer.alert('<t:mutiLang langKey="只有状态为<处理中>时才可进行<撤销>操作"/>');
  204. return;
  205. }
  206. url += '&id='+rowsData[0].id;
  207. $.dialog.confirm('<t:mutiLang langKey="确定要撤销此休假申请吗?"/>', function(){
  208. lockuploadify(url);
  209. }, function(){
  210. });
  211. }
  212. function deleteObj(title,url, id){
  213. var rowsData = $('#'+id).datagrid('getSelections');
  214. if (!rowsData || rowsData.length==0) {
  215. layer.alert('请选中一条数据');
  216. return;
  217. }
  218. /* if(rowsData[0].bpmStatus != 1){
  219. layer.alert('<t:mutiLang langKey="只有状态为<待提交>时才可进行<删除>操作"/>');
  220. return;
  221. } */
  222. if(rowsData[0].bpmStatus == 2){
  223. layer.alert('<t:mutiLang langKey="申请处理中不可删除"/>');
  224. return;
  225. }else if(rowsData[0].bpmStatus == 3){
  226. layer.alert('<t:mutiLang langKey="申请已完成不可删除"/>');
  227. return;
  228. }
  229. /* if(rowsData[0].applicantId != $("#user").val()){
  230. layer.alert('您无权限操作该数据!');
  231. return;
  232. } */
  233. url += '&id='+rowsData[0].id;
  234. $.dialog.confirm('<t:mutiLang langKey="确定要删除此休假申请吗?"/>', function(){
  235. lockuploadify(url);
  236. }, function(){
  237. });
  238. }
  239. function lockuploadify(url) {
  240. $.ajax({
  241. async : false,
  242. cache : false,
  243. type : 'POST',
  244. url : url,// 请求的action路径
  245. error : function() {// 请求失败处理函数
  246. },
  247. success : function(data) {
  248. var d = data; // ------ $.parseJSON(data);
  249. if (d.success) {
  250. var msg = d.msg;
  251. layer.alert(msg);
  252. reloadTable();
  253. }
  254. }
  255. });
  256. }
  257. //导入
  258. function ImportXls() {
  259. openuploadwin('Excel导入', 'holidayController.do?upload', "holidayList");
  260. }
  261. //导出
  262. function ExportXls() {
  263. JeecgExcelExport("holidayController.do?exportXls","holidayList");
  264. }
  265. //模板下载
  266. function ExportXlsByT() {
  267. JeecgExcelExport("holidayController.do?exportXlsByT","holidayList");
  268. }
  269. //新增
  270. function add(title,url,id){
  271. window.location.href=url
  272. }
  273. //修改
  274. function update(title,url, id){
  275. var rowsData = $('#'+id).datagrid('getSelections');
  276. if (!rowsData || rowsData.length==0) {
  277. layer.alert('请选中一条数据');
  278. return;
  279. }
  280. /* if(rowsData[0].bpmStatus != 1){
  281. layer.alert('<t:mutiLang langKey="只有状态为<待提交>时才可进行<修改>操作"/>');
  282. return;
  283. } */
  284. if(rowsData[0].bpmStatus == 2){
  285. layer.alert('<t:mutiLang langKey="申请处理中不可编辑"/>');
  286. return;
  287. }else if(rowsData[0].bpmStatus == 3){
  288. layer.alert('<t:mutiLang langKey="申请已完成不可编辑"/>');
  289. return;
  290. }
  291. /* if(rowsData[0].applicantId != $("#user").val()){
  292. layer.alert('您无权限操作该数据!');
  293. return;
  294. } */
  295. updateNotCreateWin("修改",url, "holidayList",false);
  296. }
  297. //查看
  298. function view(title,url, id){
  299. viewNotCreateWin("查看",url, "holidayList",false)
  300. }
  301. //新增
  302. function goview(title,url,id){
  303. var rowsData = $('#'+id).datagrid('getSelections');
  304. if (!rowsData || rowsData.length==0) {
  305. layer.alert('请选中一条数据');
  306. return;
  307. }
  308. window.location.href=url+'&id='+rowsData[0].id+'&typeid='+rowsData[0].transferType;
  309. }
  310. function openDepartmentSelect() {
  311. $.dialog.setting.zIndex = getzIndex();
  312. var orgIds = $("#orgIds").val();
  313. //按照登录用户的组织查询所有子组织
  314. /*$.dialog({content: 'url:departController.do?departSelectByIds&belongUnitid='+orgIds, zIndex: 2100, title: '所属部门列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
  315. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelect, focus: true},
  316. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  317. ]}).zindex();*/
  318. selectUserDep('所属部门列表',function(rows){
  319. one = rows[0];
  320. var depId = one.id;
  321. var depName = one.departName;
  322. $('#departname').val(depName);
  323. $('#departname').blur();
  324. $('#orgIds').val(depId);
  325. });
  326. // 查询所有组织结构
  327. /*$.dialog({content: 'url:departController.do?departSelect&orgIds='+orgIds, zIndex: getzIndex(), title: '所属部门列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
  328. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelect, focus: true},
  329. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  330. ]}).zindex();*/
  331. }
  332. function callbackDepartmentSelect() {
  333. /** 按照登录用户的组织查询所有子组织
  334. var iframe = this.iframe.contentWindow;
  335. var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelectByIds");
  336. var nodes = treeObj.getCheckedNodes(true);
  337. if(nodes.length>0){
  338. var ids='',names='';
  339. for(i=0;i<nodes.length;i++){
  340. var node = nodes[i];
  341. ids += node.id+',';
  342. names += node.name+',';
  343. }
  344. ids = ids.substring(0,ids.length - 1);
  345. names = names.substring(0,names.length - 1);
  346. $('#departname').val(names);
  347. $('#departname').blur();
  348. $('#orgIds').val(ids);
  349. }
  350. */
  351. // 查询所有组织结构
  352. var iframe = this.iframe.contentWindow;
  353. var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
  354. var nodes = treeObj.getCheckedNodes(true);
  355. if(nodes.length>0){
  356. var ids='',names='';
  357. for(i=0;i<nodes.length;i++){
  358. var node = nodes[i];
  359. ids += node.id+',';
  360. names += node.name+',';
  361. }
  362. $('#departname').val(names);
  363. $('#departname').blur();
  364. $('#orgIds').val(ids);
  365. }
  366. }
  367. function callbackClean(){
  368. $('#departname').val('');
  369. $('#orgIds').val('');
  370. }
  371. function fileList(){
  372. var rowsData = $('#holidayList').datagrid('getSelections');
  373. if (!rowsData || rowsData.length==0) {
  374. tip('请先选择一条记录');
  375. return;
  376. }
  377. var id = rowsData[0].id;
  378. $.dialog({
  379. content: 'url:publicpageController.do?tSysFileList&busiId='+id+'&busiTable=t_bus_holiday&bizType=t_bus_holiday&extensions=jpg,png', zIndex: getzIndex(), title: '附件列表', lock: true, width: '800px', height: '600px', opacity: 0.4, button: [
  380. {name: '<t:mutiLang langKey="common.close"/>', callback: function (){}}
  381. ]}).zindex();
  382. }
  383. </script>