onhandreport-add.jsp 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <%@page import="cn.com.lzt.common.util.StringUtil"%>
  2. <%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  3. <%@include file="/context/mytags.jsp"%>
  4. <!DOCTYPE html>
  5. <html>
  6. <head>
  7. <title>订单表</title>
  8. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  9. <script src="plug-in/layer/layer.js"></script>
  10. <script type="text/javascript">
  11. $(document).ready(function(){
  12. var warehouseid = '${ordersPage.warehouseId}';
  13. if(warehouseid == null || warehouseid==''){
  14. layer.alert('只有领料点管理员可以进行物料上报', {icon: 3, title:'提示'}, function(index){
  15. //do something
  16. window.location.href="onhandReportController.do?listByWarehouse";
  17. layer.close(index);});
  18. }
  19. $('#tt').tabs({
  20. onSelect:function(title){
  21. $('#tt .panel-body').css('width','auto');
  22. }
  23. });
  24. $(".tabs-wrap").css('width','100%');
  25. //画面数值初期化
  26. // 总金额
  27. $("#totalMoney").val(0);
  28. // 格式 月和日
  29. function p(s) {
  30. return s < 10 ? '0' + s: s;
  31. }
  32. var myDate = new Date();
  33. //获取当前年
  34. var year=myDate.getFullYear();
  35. //获取当前月
  36. var month=myDate.getMonth()+1;
  37. //获取当前日
  38. var date=myDate.getDate();
  39. var orderDate=year+'-'+p(month);
  40. $("#orderDate").val(orderDate);
  41. });
  42. function btn_ok(){
  43. var trList = $("#add_orderDetails_table").children("tr");
  44. if(trList.length == 0){
  45. layer.alert("请至少输入一条货品详细信息");
  46. return;
  47. }
  48. // 判断是否有重复的货品 begin
  49. //var goodsCodeArr = new Array();
  50. // for (var i=0;i<trList.length;i++) {
  51. // goodsCodeArr[i] = $("#add_orderDetails_table").find("tr").eq(i).find(":text").eq(0).val();
  52. // }
  53. // var s = goodsCodeArr.join(",")+",";
  54. // for(var i=0;i<goodsCodeArr.length;i++) {
  55. // if(s.replace(goodsCodeArr[i]+",","").indexOf(goodsCodeArr[i]+",")>-1) {
  56. // layer.alert("输入的货品不可以重复");
  57. // return;
  58. // }
  59. // }
  60. $("#btnsub").click();
  61. }
  62. function btn_back(){
  63. window.location.href="onhandReportController.do?listByWarehouse";
  64. }
  65. function callback(data){
  66. if(data.success){
  67. layer.alert(data.msg, function(index){
  68. window.location.href="onhandReportController.do?listByWarehouse";
  69. layer.close(index);
  70. });
  71. }
  72. else{
  73. layer.alert(data.msg);
  74. }
  75. }
  76. </script>
  77. </head>
  78. <body style="overflow-x: hidden;">
  79. <t:formvalid formid="formobj" dialog="false" usePlugin="password" layout="table" tiptype="1" action="onhandReportController.do?doAdd" callback="callback">
  80. <input id="id" name="id" type="hidden" value="${ordersPage.id }">
  81. <input id="createBy" name="createBy" type="hidden" value="${ordersPage.createBy }">
  82. <input id="updateName" name="updateName" type="hidden" value="${ordersPage.updateName }">
  83. <input id="updateBy" name="updateBy" type="hidden" value="${ordersPage.updateBy }">
  84. <input id="updateDate" name="updateDate" type="hidden" value="${ordersPage.updateDate }">
  85. <input id="bpmStatus" name="bpmStatus" type="hidden" value="${ordersPage.bpmStatus }">
  86. <input id="orderStatus" name="orderStatus" type="hidden" value="${ordersPage.orderStatus }">
  87. <input id="orderOnumber" name="orderOnumber" type="hidden" value="${ordersPage.orderOnumber }">
  88. <t:tabs id="tt" iframe="false" tabPosition="top" fit="false" >
  89. <t:tab href="onhandReportController.do?OnhandReportDetailsList&id=${ordersPage.id}&warehouseid=${ordersPage.warehouseId}" icon="icon-search" title="物料上报存货列表" id="orderDetails" heigth="1000px"></t:tab>
  90. </t:tabs>
  91. <%--底部begin --%>
  92. <table cellpadding="0" cellspacing="1" class="formtable" style="position:fixed;bottom:0px;">
  93. <tr>
  94. <td align="right" width="100px">
  95. <label class="Validform_label"><span color="red" class="requiredIcon">*</span>领料点:</label>
  96. </td>
  97. <td class="value" nowrap>
  98. <input id="warehouseId" name="warehouseId" type="hidden" value='${ordersPage.warehouseId}'><%-- '${ordersPage.warehouseId}' --%>
  99. <input name="warehouseName" class="inputxt" value='${ordersPage.warehouseName}' style="width: 150px" id="warehouseName" readonly="readonly" datatype="*" nullmsg="请选择领料点"/><%-- '${ordersPage.warehouseName}' --%>
  100. <span class="Validform_checktip"></span>
  101. <label class="Validform_label" style="display: none;">领料点</label>
  102. <t:choose hiddenName="warehouseId" hiddenid="id" url="onhandReportController.do?selectReferWareHouse&classname=cn.com.lzt.warehouse.entity.WarehouseEntity&codefield=warehouseCode&namefield=warehouseName&scope=part" name="list"
  103. icon="icon-search" title="领料点" textname="warehouseName" isclear="true" isInit="true" ></t:choose>
  104. </td>
  105. <td align="right">
  106. <label class="Validform_label">上报月份:</label>
  107. </td>
  108. <td class="value">
  109. <input id="orderDate" name="orderDate" type="text" style="width: 150px" class="inputxt"
  110. onClick="WdatePicker({dateFmt:'yyyy-MM'})">
  111. <span class="Validform_checktip"></span>
  112. <label class="Validform_label" style="display: none;">上报月份</label>
  113. </td>
  114. <%-- <td align="right">
  115. <label class="Validform_label">总金额:</label>
  116. </td>
  117. <td class="value">
  118. <input id="totalMoney" name="totalMoney" value='${ordersPage.totalMoney}' type="text" style="width: 150px" class="inputxt" readonly="readonly"><b> 元</b>
  119. <span class="Validform_checktip"></span>
  120. <label class="Validform_label" style="display: none;">总金额</label>
  121. </td> --%>
  122. <td align="right">
  123. </td>
  124. <td align="right">
  125. </td>
  126. <td align="right">
  127. </td>
  128. <td align="right">
  129. </td>
  130. </tr>
  131. <tr>
  132. <td align="right">
  133. <label class="Validform_label">制单人:</label>
  134. </td>
  135. <td class="value">
  136. <input id="createName" name="createName" type="text" style="width: 150px" class="inputxt" readonly="readonly">
  137. <span class="Validform_checktip"></span>
  138. <label class="Validform_label" style="display: none;">制单人</label>
  139. </td>
  140. <td align="right">
  141. <label class="Validform_label">制单日期:</label>
  142. </td>
  143. <td class="value">
  144. <input id="createDate" name="createDate" type="text" style="width: 150px" class="inputxt" readonly="readonly">
  145. <span class="Validform_checktip"></span>
  146. <label class="Validform_label" style="display: none;">制单日期</label>
  147. </td>
  148. <td align="right">
  149. </td>
  150. <td align="right">
  151. </td>
  152. <td align="right">
  153. </td>
  154. <td align="right">
  155. </td>
  156. </tr>
  157. <tr>
  158. <td height="50px" align="center" colspan="8">
  159. <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
  160. <a style="margin-left:80px" href="#" class="easyui-linkbutton l-btn" iconcls="icon-le-ok" onclick="btn_ok()">确定</a>
  161. <a href="#" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-le-back" onclick="btn_back()">返回</a>
  162. </td>
  163. </tr>
  164. </table>
  165. <%--底部end --%>
  166. </t:formvalid>
  167. <!-- 添加 附表明细 模版 -->
  168. <div id="listdiv" fit="false" style="margin: 0px; padding: 0px; overflow: hidden; width: auto;">
  169. <table style="display:none;width: auto;" id="add_orderDetails_table" >
  170. <tbody id="add_orderDetails_table_template" >
  171. <tr>
  172. <td align="center"><div style="width: 35px;" name="xh"></div></td>
  173. <td align="center"><input style="width:35px;" type="checkbox" name="ck"/></td>
  174. <td align="left" style="display: none;">
  175. <input name="onhandReportDetailsList[#index#].pnumber" maxlength="32"
  176. type="text" class="inputxt" style="width:130px;" readonly="readonly">
  177. <label class="Validform_label" style="display: none;">货品名称</label>
  178. </td>
  179. <td align="left">
  180. <input name="onhandReportDetailsList[#index#].pname" maxlength="32"
  181. type="text" class="inputxt" style="width:130px;" readonly="readonly">
  182. <label class="Validform_label" style="display: none;">货品名称</label>
  183. </td>
  184. <td align="left">
  185. <input name="onhandReportDetailsList[#index#].specType" maxlength="50" readonly="readonly"
  186. type="text" class="inputxt" style="width:130px;" readonly="readonly">
  187. <label class="Validform_label" style="display: none;">规格型号</label>
  188. </td>
  189. <td align="left">
  190. <t:dictSelect field="onhandReportDetailsList[#index#].measureUnit" type="list" extendJson="{class:'form-control',style:'width:132px'}"
  191. typeGroupCode="metering_calcu_unit" defaultVal="" hasLabel="false" title="计量单位" ></t:dictSelect>
  192. <label class="Validform_label" style="display: none;">计量单位</label>
  193. </td>
  194. <td align="left">
  195. <input name="onhandReportDetailsList[#index#].quantity" maxlength="10"
  196. type="text" class="inputxt" style="width:130px;" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')">
  197. <label class="Validform_label" style="display: none;">数量</label>
  198. </td>
  199. <td align="left">
  200. <input name="onhandReportDetailsList[#index#].purchasePrice" maxlength="10"
  201. type="hidden" class="inputxt" style="width:130px;">
  202. <!-- <label class="Validform_label" style="display: none;">采购单价</label> -->
  203. </td>
  204. <td align="left">
  205. <input name="onhandReportDetailsList[#index#].money" readonly="readonly"
  206. type="hidden" class="inputxt" style="width:130px;" >
  207. <%-- <label class="Validform_label" style="display: none;">金额</label> --%>
  208. </td>
  209. <td align="left">
  210. <input name="onhandReportDetailsList[#index#].remark" maxlength="100" style="width:130px;"
  211. type="text" class="inputxt">
  212. <label class="Validform_label" style="display: none;">备注</label>
  213. <input name="onhandReportDetailsList[#index#].goodsId" type="text" style="display:none"/>
  214. </td>
  215. </tr>
  216. </tbody>
  217. </table>
  218. </div>
  219. </body>
  220. <script src = "webpage/cn/com/lzt/onhandreport/onhandreport.js"></script>