orders-add.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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. $('#tt').tabs({
  13. onSelect:function(title){
  14. $('#tt .panel-body').css('width','auto');
  15. }
  16. });
  17. $(".tabs-wrap").css('width','100%');
  18. //画面数值初期化
  19. // 应付金额
  20. $("#amountPayable").val(0);
  21. // 整单优惠
  22. $("#discountMoney").val(0);
  23. // 总金额
  24. $("#totalMoney").val(0);
  25. $('#discountMoney').bind("input",function(){
  26. // 优惠金额
  27. var discountMoney = parseFloat($("#discountMoney").val()) || 0;
  28. var totalmoney = parseFloat($("#totalMoney").val()) || 0;
  29. var money = Math.round((totalmoney - discountMoney)*100)/100;
  30. // 应付金额
  31. $("#amountPayable").val(money);
  32. });
  33. // 格式 月和日
  34. function p(s) {
  35. return s < 10 ? '0' + s: s;
  36. }
  37. var myDate = new Date();
  38. //获取当前年
  39. var year=myDate.getFullYear();
  40. //获取当前月
  41. var month=myDate.getMonth()+1;
  42. //获取当前日
  43. var date=myDate.getDate();
  44. var orderDate=year+'-'+p(month)+"-"+p(date)+" "+p(myDate.getHours())+':'+p(myDate.getMinutes())+":"+p(myDate.getSeconds());
  45. $("#orderDate").val(orderDate);
  46. });
  47. function btn_ok(){
  48. var trList = $("#add_orderDetails_table").children("tr");
  49. if(trList.length == 0){
  50. layer.alert("请至少输入一条货品详细信息");
  51. return;
  52. }
  53. // 判断是否有重复的货品 begin
  54. //var goodsCodeArr = new Array();
  55. // for (var i=0;i<trList.length;i++) {
  56. // goodsCodeArr[i] = $("#add_orderDetails_table").find("tr").eq(i).find(":text").eq(0).val();
  57. // }
  58. // var s = goodsCodeArr.join(",")+",";
  59. // for(var i=0;i<goodsCodeArr.length;i++) {
  60. // if(s.replace(goodsCodeArr[i]+",","").indexOf(goodsCodeArr[i]+",")>-1) {
  61. // layer.alert("输入的货品不可以重复");
  62. // return;
  63. // }
  64. // }
  65. //
  66. $("#btnsub").click();
  67. }
  68. function btn_back(){
  69. window.location.href="pOrdersController.do?list";
  70. }
  71. function callback(data){
  72. if(data.success){
  73. layer.alert(data.msg, function(index){
  74. window.location.href="pOrdersController.do?list";
  75. layer.close(index);
  76. });
  77. }
  78. else{
  79. layer.alert(data.msg);
  80. }
  81. }
  82. </script>
  83. </head>
  84. <body style="overflow-x: hidden;">
  85. <t:formvalid formid="formobj" dialog="false" usePlugin="password" layout="table" tiptype="1" action="pOrdersController.do?doAdd" callback="callback">
  86. <input id="id" name="id" type="hidden" value="${ordersPage.id }">
  87. <input id="createBy" name="createBy" type="hidden" value="${ordersPage.createBy }">
  88. <input id="updateName" name="updateName" type="hidden" value="${ordersPage.updateName }">
  89. <input id="updateBy" name="updateBy" type="hidden" value="${ordersPage.updateBy }">
  90. <input id="updateDate" name="updateDate" type="hidden" value="${ordersPage.updateDate }">
  91. <input id="bpmStatus" name="bpmStatus" type="hidden" value="${ordersPage.bpmStatus }">
  92. <input id="orderStatus" name="orderStatus" type="hidden" value="${ordersPage.orderStatus }">
  93. <input id="orderOnumber" name="orderOnumber" type="hidden" value="${ordersPage.orderOnumber }">
  94. <input id="sourceType" name="sourceType" type="hidden" value="${empty ordersPage.sourceType?"normal": ordersPage.sourceType }"/>
  95. <t:tabs id="tt" iframe="false" tabPosition="top" fit="false" >
  96. <t:tab href="pOrdersController.do?orderDetailsList&id=${ordersPage.id}" icon="icon-search" title="采购货品" id="orderDetails" heigth="1000px"></t:tab>
  97. </t:tabs>
  98. <%--底部begin --%>
  99. <table cellpadding="0" cellspacing="1" class="formtable" style="position:fixed;bottom:0px;">
  100. <tr>
  101. <td align="right" width="100px">
  102. <label class="Validform_label"><span color="red" class="requiredIcon">*</span>领料点:</label>
  103. </td>
  104. <td class="value" nowrap>
  105. <input id="warehouseId" name="warehouseId" type="hidden" value='${ordersPage.warehouseId}'>
  106. <input name="warehouseName" class="inputxt" value='${ordersPage.warehouseName}' style="width: 150px" id="warehouseName" readonly="readonly" datatype="*" nullmsg="请选择领料点"/>
  107. <span class="Validform_checktip"></span>
  108. <label class="Validform_label" style="display: none;">领料点</label>
  109. <t:choose hiddenName="warehouseId" hiddenid="id" url="pOrdersController.do?selectReferWareHouse&classname=cn.com.lzt.warehouse.entity.WarehouseEntity&codefield=warehouseCode&namefield=warehouseName" name="list"
  110. icon="icon-search" title="领料点" textname="warehouseName" isclear="true" isInit="true" ></t:choose>
  111. </td>
  112. <td align="right">
  113. <label class="Validform_label">总金额:</label>
  114. </td>
  115. <td class="value">
  116. <input id="totalMoney" name="totalMoney" value='${ordersPage.totalMoney}' type="text" style="width: 150px" class="inputxt" readonly="readonly"><b> 元</b>
  117. <span class="Validform_checktip"></span>
  118. <label class="Validform_label" style="display: none;">总金额</label>
  119. </td>
  120. <%--<td align="right">
  121. <label class="Validform_label">整单优惠:</label>
  122. </td>
  123. <td class="value">
  124. <input id="discountMoney" name="discountMoney" type="text" style="width: 150px" class="inputxt" maxlength="10" ignore="ignore" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"><b> 元</b>
  125. <span class="Validform_checktip"></span>
  126. <label class="Validform_label" style="display: none;">整单优惠</label>
  127. </td>--%>
  128. <td align="right" colspan="3" width="100px">
  129. </td>
  130. <td align="right" width="100px">
  131. </td>
  132. <td align="right" width="100px">
  133. </td>
  134. <td align="right" width="100px">
  135. </td>
  136. <td align="right" colspan="3" width="100px">
  137. </td>
  138. <td align="right" width="100px">
  139. </td>
  140. <td align="right" width="100px">
  141. </td>
  142. <td align="right" width="100px">
  143. </td>
  144. <td align="right" style="display: none;">
  145. <label class="Validform_label">优惠后金额(可手动编辑):</label>
  146. </td>
  147. <td class="value" colspan="3" style="display: none;">
  148. <input id="amountPayable" name="amountPayable" value='${ordersPage.amountPayable}' type="text" style="width: 150px" class="inputxt"><b>元</b>
  149. <span class="Validform_checktip"></span>
  150. <label class="Validform_label" style="display: none;">优惠后金额</label>
  151. </td>
  152. </tr>
  153. <tr style="display:none;">
  154. <td align="right">
  155. <label class="Validform_label">制单人:</label>
  156. </td>
  157. <td class="value">
  158. <input id="createName" name="createName" type="text" style="width: 150px" class="inputxt" readonly="readonly">
  159. <span class="Validform_checktip"></span>
  160. <label class="Validform_label" style="display: none;">制单人</label>
  161. </td>
  162. <td align="right">
  163. <label class="Validform_label">提交人:</label>
  164. </td>
  165. <td class="value">
  166. <input id="orderAuditor" name="orderAuditor" type="text" style="width: 150px" class="inputxt" readonly="readonly">
  167. <span class="Validform_checktip"></span>
  168. <label class="Validform_label" style="display: none;">提交人</label>
  169. </td>
  170. <td align="right">
  171. <label class="Validform_label">制单日期:</label>
  172. </td>
  173. <td class="value">
  174. <input id="createDate" name="createDate" type="text" style="width: 150px" class="inputxt" readonly="readonly">
  175. <span class="Validform_checktip"></span>
  176. <label class="Validform_label" style="display: none;">制单日期</label>
  177. </td>
  178. <td align="right">
  179. <label class="Validform_label">提交日期:</label>
  180. </td>
  181. <td class="value">
  182. <input id="auditDate" name="auditDate" type="text" style="width: 150px" class="inputxt" readonly="readonly">
  183. <span class="Validform_checktip"></span>
  184. <label class="Validform_label" style="display: none;">提交日期</label>
  185. </td>
  186. </tr>
  187. <tr>
  188. <td height="50px" align="center" colspan="8">
  189. <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
  190. <a style="margin-left:80px" href="#" class="easyui-linkbutton l-btn" iconcls="icon-le-ok" onclick="btn_ok()">提交</a>
  191. <a href="#" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-le-back" onclick="btn_back()">返回</a>
  192. </td>
  193. </tr>
  194. </table>
  195. <%--底部end --%>
  196. </t:formvalid>
  197. <!-- 添加 附表明细 模版 -->
  198. <div id="listdiv" fit="false" style="margin: 0px; padding: 0px; overflow: hidden; width: auto;">
  199. <table style="display:none;width: auto;" id="add_orderDetails_table" >
  200. <tbody id="add_orderDetails_table_template" >
  201. <tr>
  202. <td align="center"><div style="width: 35px;" name="xh"></div></td>
  203. <td align="center"><input style="width:35px;" type="checkbox" name="ck"/></td>
  204. <td align="left" style="display: none;">
  205. <input name="orderDetailsList[#index#].pnumber" maxlength="16"
  206. type="text" class="inputxt" style="width:130px;" readonly="readonly">
  207. <label class="Validform_label" style="display: none;">货品编码</label>
  208. </td>
  209. <td align="left">
  210. <input name="orderDetailsList[#index#].pname" maxlength="32"
  211. type="text" class="inputxt" style="width:130px;">
  212. <label class="Validform_label" style="display: none;">货品名称</label>
  213. </td>
  214. <td align="left">
  215. <input name="orderDetailsList[#index#].specType" maxlength="50" readonly="readonly"
  216. type="text" class="inputxt" style="width:94px;" >
  217. <label class="Validform_label" style="display: none;">规格型号</label>
  218. </td>
  219. <td align="left">
  220. <t:dictSelect field="orderDetailsList[#index#].measureUnit" type="list" extendJson="{class:'form-control',style:'width:80px'}"
  221. typeGroupCode="metering_calcu_unit" defaultVal="" hasLabel="false" title="计量单位" datatype="*"></t:dictSelect>
  222. <label class="Validform_label" style="display: none;">计量单位</label>
  223. </td>
  224. <td align="left">
  225. <input name="orderDetailsList[#index#].quantity" maxlength="10"
  226. type="text" class="inputxt" style="width:80px;" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')">
  227. <label class="Validform_label" style="display: none;">数量</label>
  228. </td>
  229. <td align="left">
  230. <input name="orderDetailsList[#index#].purchasePrice" maxlength="10" readonly="readonly"
  231. type="text" class="inputxt" style="width:100px;" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')">
  232. <label class="Validform_label" style="display: none;">采购单价</label>
  233. </td>
  234. <td align="left">
  235. <input name="orderDetailsList[#index#].money" readonly="readonly"
  236. type="text" class="inputxt" style="width:100px;" >
  237. <label class="Validform_label" style="display: none;">金额</label>
  238. </td>
  239. <td align="left">
  240. <input name="orderDetailsList[#index#].supplierName" maxlength="100"
  241. type="text" class="inputxt" style="width:130px;" value="${poVal.supplierName}">
  242. <label class="Validform_label" style="display: none;">供应商</label>
  243. </td>
  244. <td align="left">
  245. <input name="orderDetailsList[#index#].remark" maxlength="100" style="width:136px;"
  246. type="text" class="inputxt">
  247. <label class="Validform_label" style="display: none;">备注</label>
  248. <input name="orderDetailsList[#index#].goodsId" type="text" style="display:none"/>
  249. </td>
  250. </tr>
  251. </tbody>
  252. </table>
  253. </div>
  254. </body>
  255. <script src = "webpage/cn/com/lzt/purchase/orders.js"></script>