clothingUserInit.jsp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%@include file="/context/mytags.jsp"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>员工服装领用初始登记</title>
  7. <style>
  8. .ui-button {
  9. display: inline-block;
  10. padding: 2px 2px;
  11. margin-bottom: 0;
  12. font-size: 8px;
  13. font-weight: normal;
  14. line-height: 1.42857143;
  15. text-align: center;
  16. white-space: nowrap;
  17. vertical-align: middle;
  18. -ms-touch-action: manipulation;
  19. touch-action: manipulation;
  20. cursor: pointer;
  21. -webkit-user-select: none;
  22. -moz-user-select: none;
  23. -ms-user-select: none;
  24. user-select: none;
  25. background-image: none;
  26. border: 1px solid transparent;
  27. border-radius: 4px;
  28. }
  29. </style>
  30. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  31. <script type="text/javascript">
  32. $(document).ready(function(){
  33. $('#tt').tabs({
  34. onSelect:function(title){
  35. var height =window.top.document.body.offsetHeight;
  36. height = height -181.3 - 36 - 100 -4;//去掉底部输入框table高度、title高度、弹出框小于后台页面高度、文本格式高度
  37. $('#tt .panel-body').css('width','auto').css('height',height+'px');
  38. }
  39. });
  40. $(".tabs-wrap").css('width','100%');
  41. });
  42. function btn_ok(){
  43. var trList = $("#add_clothingUserDetail_table").children("tr");
  44. if(trList.length == 0){
  45. layer.alert("请至少输入一条货品详细信息");
  46. return;
  47. }
  48. $("#btnsub").click();
  49. }
  50. function btn_back(){
  51. window.closeCurrentDialog();
  52. }
  53. function callback(data){
  54. if(data.success){
  55. layer.alert(data.msg, function(index){
  56. frameElement.api.opener.refresh();
  57. window.closeCurrentDialog();
  58. });
  59. }
  60. else{
  61. layer.alert(data.msg);
  62. }
  63. }
  64. //初始化下标
  65. function resetTrNum(tableId) {
  66. $tbody = $("#"+tableId+"");
  67. $tbody.find('>tr').each(function(i){
  68. $(':input, select,button,a', this).each(function(){
  69. var $this = $(this), name = $this.attr('name'),id=$this.attr('id'),onclick_str=$this.attr('onclick'), val = $this.val();
  70. if(name!=null){
  71. if (name.indexOf("#index#") >= 0){
  72. $this.attr("name",name.replace('#index#',i));
  73. }else{
  74. var s = name.indexOf("[");
  75. var e = name.indexOf("]");
  76. var new_name = name.substring(s+1,e);
  77. $this.attr("name",name.replace(new_name,i));
  78. }
  79. }
  80. //add_clothingUserDetail_table
  81. var warehouseid = $("#warehouseid").val();
  82. var departid = $("#departid").val();
  83. //给明细添加弹出框
  84. name = $this.attr('name');
  85. if(id!=null){
  86. if (id.indexOf("#index#") >= 0){
  87. $this.attr("id",id.replace('#index#',i));
  88. }else{
  89. var s = id.indexOf("[");
  90. var e = id.indexOf("]");
  91. var new_id = id.substring(s+1,e);
  92. $this.attr("id",id.replace(new_id,i));
  93. }
  94. }
  95. if(onclick_str!=null){
  96. if (onclick_str.indexOf("#index#") >= 0){
  97. $this.attr("onclick",onclick_str.replace(/#index#/g,i));
  98. }else{
  99. }
  100. }
  101. });
  102. $(this).find('div[name=\'xh\']').html(i+1);
  103. });
  104. }
  105. function beforeSave(){
  106. $tbody = $("#add_clothingUserDetail_table");
  107. var ret = true;
  108. var lineNo = 0;
  109. $tbody.find('>tr').each(function(i){
  110. var quantity = $("[name='clothingUserDetailList["+i+"].quantity']").val();
  111. if(quantity > 0 && (!$("[name='clothingUserDetailList["+i+"].startdate']").val() || $("[name='clothingUserDetailList["+i+"].startdate']").val() == '')){
  112. ret = false;
  113. lineNo = i+1;
  114. }
  115. });
  116. if(!ret)
  117. tip('第'+lineNo+'行领用日期不能为空,请录入日期再提交');
  118. else
  119. $tbody.find('>tr').each(function(i){
  120. $(':input, select,button,a', this).each(function(){
  121. $("#add_clothingUserDetail_table").find("tr").eq(i).find("select").eq(0).removeAttr("disabled");
  122. });
  123. });
  124. return ret;
  125. }
  126. </script>
  127. </head>
  128. <body style="overflow-x: hidden;">
  129. <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" tiptype="1" action="clothingUserController.do?doInitAdd" beforeSubmit="beforeSave">
  130. <input id="userid" name="userid" type="hidden" value="${userid}"/>
  131. <input id="departid" name="departid" type="hidden" value="${departid}"/>
  132. <input id="postid" name="postid" type="hidden" value="${postid}"/>
  133. <t:tabs id="tt" iframe="false" tabPosition="top" fit="false" >
  134. <t:tab href="clothingUserController.do?initDetail&userid=${userid}&postid=${postid}&departid=${departid}" icon="icon-search" title="服装领用登记明细" id="clothingUserDetail" heigth="1000px">
  135. </t:tab>
  136. </t:tabs>
  137. <table cellpadding="0" cellspacing="1" class="formtable" style="position:fixed;bottom:0px;">
  138. <tr>
  139. <td height="50px" align="center" colspan="8">
  140. <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
  141. <a style="margin-left:80px" href="#" class="easyui-linkbutton l-btn" iconcls="icon-le-ok" onclick="btn_ok()">提交</a>
  142. <a href="#" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-le-back" onclick="btn_back()">返回</a>
  143. </td>
  144. </tr>
  145. </table>
  146. </t:formvalid>
  147. </body>