Copy of projarrangeDetailList.jsp 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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. <div class="easyui-layout" fit="true">
  5. <input id="tempTime" name="tempTime" type="hidden" value=""/>
  6. <input id="strDate" name="strDate" type="hidden" value=""/>
  7. <div region="center" style="padding:0px;border:0px;overflow: auto;">
  8. <t:datagrid name="projarrangeDetailList" checkbox="false" fitColumns="false" title="项目排班详细表" actionUrl="projarrangeDetailController.do?datagrid" idField="id" fit="true" queryMode="group">
  9. <t:dgCol title="主键" field="id" hidden="true" queryMode="single" width="120"></t:dgCol>
  10. <t:dgCol title="项目排班总揽表ID" field="projarrangeGeneralid" hidden="true" formatter="yyyy-MM-dd" query="false" queryMode="single" dictionary="t_bus_projarrange_general,id,arrange_duty_month" width="120"></t:dgCol>
  11. <t:dgCol title="岗位" field="postid" query="false" queryMode="single" dictionary="t_bus_post,id,post_name, and delete_flag = '0' and status = '0'" width="120"></t:dgCol>
  12. <t:dgCol title="员工姓名" field="userid" queryMode="single" dictionary="t_s_base_user,id,realname" width="120"></t:dgCol>
  13. <t:dgCol title="上班天数(小时)" field="workingDays" queryMode="single" width="120"></t:dgCol>
  14. <t:dgCol title="超时加班(小时)" field="timeoutOvertimeHours" queryMode="single" width="120"></t:dgCol>
  15. <t:dgCol title="国定加班(小时)" field="countryOvertimeHours" queryMode="single" width="120"></t:dgCol>
  16. <t:dgCol title="值班天数(小时)" field="ondutyDays" queryMode="single" width="120"></t:dgCol>
  17. <t:dgCol title="备注" field="remark" queryMode="single" width="120"></t:dgCol>
  18. <t:dgCol title="创建人名称" field="createName" hidden="true" queryMode="single" width="120"></t:dgCol>
  19. <t:dgCol title="创建人登录名称" field="createBy" hidden="true" queryMode="single" width="120"></t:dgCol>
  20. <t:dgCol title="创建日期" field="createDate" formatter="yyyy-MM-dd hh:mm:ss" hidden="true" queryMode="single" width="120"></t:dgCol>
  21. <t:dgCol title="更新人名称" field="updateName" hidden="true" queryMode="single" width="120"></t:dgCol>
  22. <t:dgCol title="更新人登录名称" field="updateBy" hidden="true" queryMode="single" width="120"></t:dgCol>
  23. <t:dgCol title="更新日期" field="updateDate" formatter="yyyy-MM-dd hh:mm:ss" hidden="true" queryMode="single" width="120"></t:dgCol>
  24. <t:dgCol title="所属部门" field="sysOrgCode" hidden="true" queryMode="single" width="120"></t:dgCol>
  25. <t:dgCol title="所属公司" field="sysCompanyCode" hidden="true" queryMode="single" width="120"></t:dgCol>
  26. <%-- <t:dgCol title="操作" field="opt"></t:dgCol> --%>
  27. <%-- <t:dgDelOpt title="删除" url="projarrangeDetailController.do?doDel&id={id}" urlclass="ace_button" urlfont="fa-trash-o"/>
  28. <t:dgToolBar title="录入" icon="icon-add" operationCode="add" url="projarrangeDetailController.do?goAdd" funname="add"></t:dgToolBar>
  29. <t:dgToolBar title="修改" icon="icon-edit" operationCode="edit" url="projarrangeDetailController.do?goUpdate" funname="update"></t:dgToolBar>
  30. <t:dgToolBar title="批量删除" icon="icon-remove" operationCode="remove" url="projarrangeDetailController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
  31. <t:dgToolBar title="查看" icon="icon-search" url="projarrangeDetailController.do?goUpdate" funname="detail"></t:dgToolBar>
  32. <t:dgToolBar title="导入" icon="icon-putout" operationCode="put" funname="ImportXls"></t:dgToolBar>
  33. <t:dgToolBar title="导出" icon="icon-put" operationCode="put" funname="ExportXls"></t:dgToolBar>
  34. <t:dgToolBar title="模板下载" icon="icon-putout" operationCode="putout" funname="ExportXlsByT"></t:dgToolBar> --%>
  35. </t:datagrid>
  36. </div>
  37. <script>
  38. $(function() {
  39. var datagrid = $("#projarrangeDetailListtb");
  40. datagrid.prepend($("#arrangeDutyMonth1 div[name='arrangeDutyMonth2']").html());
  41. $("#arrangeDutyMonth1").html('');
  42. });
  43. </script>
  44. <div id="arrangeDutyMonth1" style="display: none;">
  45. <div name="arrangeDutyMonth2">
  46. <div name="arrangeDutyMonth">
  47. <table>
  48. <tr>
  49. <td>
  50. <label class="Validform_label">
  51. &nbsp;&nbsp;&nbsp;&nbsp;<span color="red" class="requiredIcon">*</span>排班月度:
  52. </label>
  53. <input id="arrangeDutyMonth" name="arrangeDutyMonth" type="text" style="width: 150px" placeholder="请选择排班月度" class="Wdate" datatype="*" onclick="WdatePicker({onpicked:arrangeDutyMonthChange(),dateFmt:'yyyy-MM'})" readonly="readonly" value=""/>
  54. </td>
  55. <td>
  56. <label class="Validform_label">
  57. &nbsp;&nbsp;&nbsp;&nbsp;<span color="red" class="requiredIcon">*</span>项目名称:
  58. </label>
  59. <input readonly="true" type="text" id="departname" name="departname" style="width: 150px" placeholder="请选择项目名称" onclick="openDepartmentSelect()">
  60. <input id="pid" name=pid type="hidden" value="">
  61. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-search" id="departSearch" onclick="openDepartmentSelect()">选择</a>
  62. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-redo" id="departRedo" onclick="callbackClean()">清空</a>
  63. </td>
  64. <td style="width: 500px;text-align: right;">
  65. <a href="#" class="easyui-linkbutton" plain="true" icon="icon-add" operationCode="add" id="" onclick="">自动排班</a>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td></td><td></td>
  70. <td style="width: 500px;text-align: right;">
  71. <a href="#" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-search" plain="true" onclick="">刷新</a>
  72. <a href="#" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-save" plain="true" onclick="btn_ok()">保存</a>
  73. <a href="#" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-putout" plain="true" onclick="">上报</a>
  74. </td>
  75. </tr>
  76. </table>
  77. </div>
  78. </div>
  79. </div>
  80. <script src = "webpage/cn/com/lzt/projarrangedetail/projarrangeDetailList.js"></script>
  81. <script type="text/javascript">
  82. //导入
  83. function ImportXls() {
  84. openuploadwin('Excel导入', 'projarrangeDetailController.do?upload', "projarrangeDetailList");
  85. }
  86. //导出
  87. function ExportXls() {
  88. JeecgExcelExport("projarrangeDetailController.do?exportXls","projarrangeDetailList");
  89. }
  90. //模板下载
  91. function ExportXlsByT() {
  92. JeecgExcelExport("projarrangeDetailController.do?exportXlsByT","projarrangeDetailList");
  93. }
  94. //新增
  95. function add(title,url,id){
  96. window.location.href=url
  97. }
  98. //修改
  99. function update(title,url, id){
  100. updateNotCreateWin("修改",url, "projarrangeDetailList",false);
  101. }
  102. //查看
  103. function view(title,url, id){
  104. viewNotCreateWin("查看",url, "projarrangeDetailList",false)
  105. }
  106. $(function(){
  107. var arrangeDutyMonth=getYearMonth();
  108. $("#arrangeDutyMonth").val(arrangeDutyMonth);
  109. $("#tempTime").val(arrangeDutyMonth);
  110. getData(arrangeDutyMonth);
  111. })
  112. //异步获取表单数据
  113. function getData(arrangeDutyMonth){
  114. var pid="";
  115. pid=$("#pid").val();
  116. var arr = arrangeDutyMonth.split("-");
  117. //获取当前年
  118. var year=arr[0];
  119. //获取当前月
  120. var month=arr[1];
  121. var htmlCode="";
  122. $.ajax({
  123. url : "projarrangeDetailController.do?getCalendar",
  124. type : 'post',
  125. data : {
  126. year : year,
  127. month : month
  128. },
  129. cache : false,
  130. success : function(data) {
  131. var d = data; // ------ $.parseJSON(data);
  132. //console.log(d.attributes[0]);
  133. var strDate="";
  134. for(var i=d.attributes[0].length-1;i>=0;i--){
  135. if(htmlCode.length!=0){
  136. htmlCode+="<td width='120' field='"+d.attributes[0][i].year+"-"+d.attributes[0][i].month+"-"+d.attributes[0][i].day+"' >"+
  137. "<div class='datagrid-cell' style='width: 104px;'><span>"+
  138. d.attributes[0][i].month+"月"+d.attributes[0][i].day+"日"+
  139. "</span><span class='datagrid-sort-icon'>&nbsp;</span></div></td>";
  140. }else{
  141. htmlCode="<td width='120' field='"+d.attributes[0][i].year+"-"+d.attributes[0][i].month+"-"+d.attributes[0][i].day+"' >"+
  142. "<div class='datagrid-cell' style='width: 104px;'><span>"+
  143. d.attributes[0][i].month+"月"+d.attributes[0][i].day+"日"+
  144. "</span><span class='datagrid-sort-icon'>&nbsp;</span></div></td>";
  145. }
  146. if(strDate.length!=0){
  147. strDate+=","+d.attributes[0][i].year+"-"+d.attributes[0][i].month+"-"+d.attributes[0][i].day;
  148. }else{
  149. strDate=d.attributes[0][i].year+"-"+d.attributes[0][i].month+"-"+d.attributes[0][i].day;
  150. }
  151. }
  152. /* for(var i=d.attributes[0].length-1;i>=0;i--){
  153. if(htmlCode.length!=0){
  154. htmlCode+="<td field='a"+i+"a' >"+
  155. "<div class='datagrid-cell' style='width: 104px;'><span>"+
  156. d.attributes[0][i].month+"月"+d.attributes[0][i].day+"日"+
  157. "</span><span class='datagrid-sort-icon'>&nbsp;</span></div></td>";
  158. }else{
  159. htmlCode="<td field='a"+i+"a' >"+
  160. "<div class='datagrid-cell' style='width: 104px;'><span>"+
  161. d.attributes[0][i].month+"月"+d.attributes[0][i].day+"日"+
  162. "</span><span class='datagrid-sort-icon'>&nbsp;</span></div></td>";
  163. }
  164. if(strDate.length!=0){
  165. strDate+=","+"a"+i+"a";
  166. }else{
  167. strDate=+"a"+i+"a";
  168. }
  169. } */
  170. var myTable=$(".datagrid-view2").children("div").children("div").children("table").children("tbody").children("tr:first");
  171. myTable.children("td:first").next().next().next().after(htmlCode);
  172. $("#strDate").val(strDate);
  173. //var myTable1=$(".datagrid-view2").parent("div").next("div").children("table").children("tbody").children("tr:first").children("td");;
  174. //console.log(myTable1.length);
  175. /* var strDate=$("#strDate").val();
  176. var strDateArr=strDate.split(",");
  177. var htmlCode1="<tr>";
  178. for(var i=0;i<strDateArr.length;i++){
  179. htmlCode1 += "<td>"+ i+1+"</td>";
  180. }
  181. htmlCode1+="</tr>";
  182. // console.log(htmlCode1);
  183. $(".datagrid-view2").children("div").next("div").children("table").children("tbody").append(htmlCode);; */
  184. $('#projarrangeDetailList').datagrid('insertRow',{
  185. //index: rowIndex, // 索引从0开始
  186. row: {
  187. postid: "1",
  188. userid: "1",
  189. timeoutOvertimeHours: "1",
  190. workingDays: "1"
  191. }
  192. });
  193. }
  194. });
  195. }
  196. function getYearMonth(){
  197. var myDate = new Date();
  198. //获取当前年
  199. var year=myDate.getFullYear();
  200. //获取当前月
  201. var month=myDate.getMonth()+1;
  202. //获取当前日
  203. //var date=myDate.getDate();
  204. return year+"-"+month;
  205. }
  206. //选择排班月度
  207. function arrangeDutyMonthChange(){
  208. //debugger;
  209. var arrangeDutyMonth="",tempTime="",strDate="";
  210. arrangeDutyMonth=$("#arrangeDutyMonth").val();
  211. tempTime=$("#tempTime").val();
  212. strDate=$("#strDate").val();
  213. var strDateArr=strDate.split(",");
  214. var xxx="";
  215. if(tempTime!=arrangeDutyMonth){
  216. $("#tempTime").val(arrangeDutyMonth);
  217. var myTable=$(".datagrid-view2").children("div").children("div").children("table").children("tbody").children("tr:first");
  218. for(var i=0;i<strDateArr.length;i++){
  219. //myTable.find('"td#' + strDateArr[i]+'"').remove();
  220. //$('"#' + strDateArr[i]+'"').remove();
  221. myTable.children("td[field='"+strDateArr[i]+"']").remove();
  222. if(xxx.length!=0){
  223. xxx+=","+strDateArr[i]+":'"+i+"'";
  224. }else{
  225. xxx=strDateArr[i]+":'"+i+"'";
  226. }
  227. }
  228. // console.log(xxx);
  229. getData(arrangeDutyMonth);
  230. }
  231. }
  232. //部门选择==========
  233. function openDepartmentSelect() {
  234. //$.dialog.setting.zIndex = getzIndex();
  235. var orgIds = $("#pid").val();
  236. $.dialog({content: 'url:departController.do?departSelect&orgIds='+orgIds, zIndex: getzIndex(), title: '所属部门列表', lock: true, width: '400px', height: '350px', opacity: 0.4, button: [
  237. {name: '<t:mutiLang langKey="common.confirm"/>', callback: callbackDepartmentSelect, focus: true},
  238. {name: '<t:mutiLang langKey="common.cancel"/>', callback: function (){}}
  239. ]}).zindex();
  240. }
  241. function callbackDepartmentSelect() {
  242. var iframe = this.iframe.contentWindow;
  243. var treeObj = iframe.$.fn.zTree.getZTreeObj("departSelect");
  244. var nodes = treeObj.getCheckedNodes(true);
  245. if(nodes.length>0){
  246. var ids='',names='';
  247. for(i=0;i<nodes.length;i++){
  248. var node = nodes[i];
  249. ids += node.id+',';
  250. names += node.name+',';
  251. }
  252. $('#departname').val(names);
  253. $('#departname').blur();
  254. $('#pid').val(ids);
  255. }
  256. }
  257. function callbackClean(){
  258. $('#departname').val('');
  259. $('#pid').val('');
  260. }
  261. //部门选择==========
  262. </script>