orders-update.jsp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  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. <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  8. <script src="plug-in/layer/layer.js"></script>
  9. <script type="text/javascript">
  10. $(document).ready(function(){
  11. $('#tt').tabs({
  12. onSelect:function(title){
  13. $('#tt .panel-body').css('width','auto');
  14. }
  15. });
  16. $(".tabs-wrap").css('width','100%');
  17. // 区分浏览器 IE浏览器时
  18. if (window.ActiveXObject || "ActiveXObject" in window){
  19. $('#discountMoney').bind("input",function(){
  20. // 优惠金额
  21. var discountMoney = parseFloat($("#discountMoney").val()) || 0;
  22. var totalmoney = parseFloat($("#totalMoney").val()) || 0;
  23. var money = Math.round((totalmoney - discountMoney)*100)/100;
  24. // 应付金额
  25. $("#amountPayable").val(money);
  26. });
  27. // 非IE浏览器时
  28. }else{
  29. $('#discountMoney').bind("input",function(){
  30. // 优惠金额
  31. var discountMoney = parseFloat($("#discountMoney").val()) || 0;
  32. var totalmoney = parseFloat($("#totalMoney").val()) || 0;
  33. var money = Math.round((totalmoney - discountMoney)*100)/100;
  34. // 应付金额
  35. $("#amountPayable").val(money);
  36. });
  37. }
  38. // 查看的时候隐藏返回和提交按钮
  39. if($("#viewFlag").val() != null && $("#viewFlag").val() == '1'){
  40. $("#buttomTable").find('tr:eq(2)').remove();
  41. }
  42. // 金额转换方法 科学计数法 转为 数字
  43. var discountMoney = $("#discountMoney").val();
  44. if(discountMoney != null && discountMoney != ''){
  45. $("#discountMoney").val(new Number(discountMoney));
  46. }
  47. var prepaidMoney = $("#prepaidMoney").val();
  48. if(prepaidMoney != null && prepaidMoney != ''){
  49. $("#prepaidMoney").val(new Number(prepaidMoney));
  50. }
  51. var totalMoney = $("#totalMoney").val();
  52. if(totalMoney != null && totalMoney != ''){
  53. $("#totalMoney").val(new Number(totalMoney));
  54. }
  55. var amountPayable = $("#amountPayable").val();
  56. if(amountPayable != null && amountPayable != ''){
  57. $("#amountPayable").val(new Number(amountPayable));
  58. }
  59. });
  60. function btn_ok(){
  61. var trList = $("#add_orderProducts_table").children("tr");
  62. if(trList.length == 0){
  63. layer.alert("请至少输入一条货品详细信息");
  64. return;
  65. }
  66. var msg = checkUnknownRow(trList);
  67. if(msg.length > 0){
  68. layer.alert(msg);
  69. return;
  70. }
  71. $("#btnsub").click();
  72. }
  73. function btn_back(){
  74. window.location.href="ordersController.do?listByWarehouse&orderType=${ordersPage.orderType }";
  75. }
  76. function callback(data){
  77. if(data.success){
  78. layer.alert(data.msg, function(index){
  79. window.location.href="ordersController.do?listByWarehouse&orderType=${ordersPage.orderType }";
  80. layer.close(index);
  81. });
  82. }
  83. else{
  84. layer.alert(data.msg);
  85. }
  86. }
  87. </script>
  88. </head>
  89. <body style="overflow-x: hidden;">
  90. <t:formvalid formid="formobj" dialog="false" usePlugin="password" layout="table" tiptype="1" action="ordersController.do?doUpdate" callback="callback">
  91. <input id="id" name="id" type="hidden" value="${ordersPage.id }">
  92. <input id="createBy" name="createBy" type="hidden" value="${ordersPage.createBy }">
  93. <input id="updateName" name="updateName" type="hidden" value="${ordersPage.updateName }">
  94. <input id="updateBy" name="updateBy" type="hidden" value="${ordersPage.updateBy }">
  95. <input id="updateDate" name="updateDate" type="hidden" value="${ordersPage.updateDate }">
  96. <input id="bpmStatus" name="bpmStatus" type="hidden" value="${ordersPage.bpmStatus }">
  97. <input id="orderStatus" name="orderStatus" type="hidden" value="${ordersPage.orderStatus }">
  98. <input id="orderType" name="orderType" type="hidden" value="${ordersPage.orderType }">
  99. <%-- 增加一个div,用于调节页面大小,否则默认太小 --%>
  100. <t:tabs id="tt" iframe="false" tabPosition="top" fit="false">
  101. <t:tab href="ordersController.do?orderProductsList&id=${ordersPage.id}" icon="icon-search" title="采购货品" id="orderProducts"></t:tab>
  102. </t:tabs>
  103. <%--底部begin --%>
  104. <table cellpadding="0" cellspacing="1" class="formtable" id="buttomTable" style="position:fixed;bottom:0px;">
  105. <tr>
  106. <td align="right" width="100px">
  107. <label class="Validform_label"><span color="red" class="requiredIcon">*</span>领料点:</label>
  108. </td>
  109. <%--
  110. <td class="value" nowrap>
  111. <input id="warehouseId" name="warehouseId" type="hidden" value='${ordersPage.warehouseId}'>
  112. <input name="warehouseName" class="inputxt" value='${ordersPage.warehouseName}' style="width: 150px" id="warehouseName" readonly="readonly" datatype="*" nullmsg="请选择领料点"/>
  113. <span class="Validform_checktip"></span>
  114. <c:if test="${not empty viewFlag}">
  115. <label class="Validform_label" style="display: none;">领料点</label>
  116. </c:if>
  117. <c:if test="${empty viewFlag}">
  118. <label class="Validform_label" style="display: none;">领料点</label>
  119. <t:choose hiddenName="warehouseId" hiddenid="id" url="ordersController.do?selectReferWareHouse&classname=cn.com.lzt.warehouse.entity.WarehouseEntity&codefield=warehouseCode&namefield=warehouseName" name="list"
  120. icon="icon-search" title="领料点" textname="warehouseName" isclear="true" isInit="true" ></t:choose>
  121. </c:if>
  122. </td>--%>
  123. <td class="value">
  124. <c:if test="${empty viewFlag }">
  125. <t:dictSelect field="warehouseId" id="warehouseId" type="list"
  126. dictTable="t_b_warehouse" dictField="id"
  127. dictCondition="where responsible_person = '${userid}'"
  128. dictText="warehouse_name" datatype="*"
  129. defaultVal="${ordersPage.warehouseId}"
  130. hasLabel="false" title="项目领料点"></t:dictSelect>
  131. <span class="Validform_checktip"></span>
  132. <label class="Validform_label" style="display: none;">项目领料点</label>
  133. </c:if>
  134. <c:if test="${not empty viewFlag }">
  135. <t:dictSelect field="warehouseId" id="warehouseId" type="list"
  136. dictTable="t_b_warehouse" dictField="id"
  137. dictText="warehouse_name" datatype="*"
  138. defaultVal="${ordersPage.warehouseId}"
  139. readonly="readonly"
  140. hasLabel="false" title="项目领料点"></t:dictSelect>
  141. <span class="Validform_checktip"></span>
  142. <label class="Validform_label" style="display: none;">项目领料点</label>
  143. </c:if>
  144. </td>
  145. <td align="right">
  146. <label class="Validform_label">申购月份:</label>
  147. </td>
  148. <td>
  149. <c:if test="${not empty viewFlag }">
  150. <t:dictSelect field="orderMonths" id="orderMonths" type="list"
  151. dictTable="t_b_ordermonths" dictField="id"
  152. dictText="ordermonths_name" datatype="*" readonly="readonly"
  153. defaultVal="${ordersPage.orderMonths}"
  154. hasLabel="false" title="申购月份"></t:dictSelect>
  155. <span class="Validform_checktip"></span>
  156. <label class="Validform_label" style="display: none;">申购月份</label>
  157. </c:if>
  158. <c:if test="${empty viewFlag }">
  159. <t:dictSelect field="orderMonths" id="orderMonths" type="list"
  160. dictTable="t_b_ordermonths" dictField="id"
  161. dictCondition="where ref_date between '${ref_date_begin}' and '${ref_date_end}'"
  162. dictText="ordermonths_name" datatype="*"
  163. defaultVal="${ordersPage.orderMonths}"
  164. hasLabel="false" title="申购月份"></t:dictSelect>
  165. <span class="Validform_checktip"></span>
  166. <label class="Validform_label" style="display: none;">申购月份</label>
  167. </c:if>
  168. </td>
  169. <td align="right">
  170. <label class="Validform_label">总金额(元):</label>
  171. </td>
  172. <td class="value">
  173. <input id="totalMoney" name="totalMoney" type="text" style="width: 150px" class="inputxt" value='${ordersPage.totalMoney}' readonly="readonly">
  174. <span class="Validform_checktip"></span>
  175. <label class="Validform_label" style="display: none;">总金额</label>
  176. </td>
  177. <td align="right">
  178. </td>
  179. <td align="right">
  180. </td><td align="right">
  181. </td>
  182. <%--<td align="right">
  183. <label class="Validform_label">整单优惠:</label>
  184. </td>
  185. <td class="value">
  186. <input id="discountMoney" name="discountMoney" type="text" style="width: 150px" maxlength="10" ignore="ignore" class="inputxt" value='${ordersPage.discountMoney}' ignore="ignore" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"><b> 元</b>
  187. <span class="Validform_checktip"></span>
  188. <label class="Validform_label" style="display: none;">整单优惠</label>
  189. </td> --%>
  190. </tr>
  191. <c:if test="${not empty viewFlag}">
  192. <tr >
  193. <td align="right">
  194. <label class="Validform_label">保洁类金额:</label>
  195. </td>
  196. <td class="value">
  197. <input id="baojieSum" name="baojieSum" type="text" style="width: 150px" class="inputxt" value='${ordersPage.baojieSum}' readonly="readonly"><b> 元</b>
  198. <span class="Validform_checktip"></span>
  199. <label class="Validform_label" style="display: none;">保洁类金额</label>
  200. </td>
  201. <td align="right">
  202. <label class="Validform_label">工程类金额:</label>
  203. </td>
  204. <td class="value">
  205. <input id="gongchengSum" name="gongchengSum" type="text" style="width: 150px" class="inputxt" value='${ordersPage.gongchengSum}' readonly="readonly"><b> 元</b>
  206. <span class="Validform_checktip"></span>
  207. <label class="Validform_label" style="display: none;">工程类金额</label>
  208. </td>
  209. <td align="right">
  210. <label class="Validform_label">办公类金额:</label>
  211. </td>
  212. <td class="value">
  213. <input id="bangongSum" name="bangongSum" type="text" style="width: 150px" class="inputxt" value='${ordersPage.bangongSum}' readonly="readonly"><b> 元</b>
  214. <span class="Validform_checktip"></span>
  215. <label class="Validform_label" style="display: none;">办公类金额</label>
  216. </td>
  217. <td align="right">
  218. <label class="Validform_label"></label>
  219. </td>
  220. <td align="right">
  221. <label class="Validform_label"></label>
  222. </td>
  223. <td align="right">
  224. <label class="Validform_label"></label>
  225. </td>
  226. <td align="right">
  227. <label class="Validform_label"></label>
  228. </td>
  229. </tr>
  230. </c:if>
  231. </tr>
  232. <tr>
  233. <td align="right">
  234. <label class="Validform_label">
  235. <font color="#FF0000"></font>
  236. 备注说明:
  237. </label>
  238. </td>
  239. <td class="value" colspan="3" >
  240. <textarea style="width:680px;height: 20px;"class="inputxt" rows="3" id="description" maxlength="200" name="description" placeholder="">${ordersPage.description}</textarea>
  241. <label class="Validform_label" style="display: none;">备注说明</label>
  242. </td>
  243. </tr>
  244. <c:if test="${empty viewFlag }">
  245. <tr>
  246. <td height="50px" align="center" colspan="8">
  247. <div style="display:none"><input type="submit" id ="btnsub" value=""/></div>
  248. <a href="#" class="easyui-linkbutton l-btn" iconcls="icon-le-ok" onclick="btn_ok()">提交</a>
  249. <a style="margin-left:20px" href="#" class="easyui-linkbutton l-btn" plain="true" iconcls="icon-le-back" onclick="btn_back()">返回</a>
  250. </td>
  251. </tr>
  252. </c:if>
  253. </table>
  254. <%--底部end --%>
  255. </t:formvalid>
  256. <!-- 添加 附表明细 模版 -->
  257. <div style="width: auto;height: 200px;">
  258. <table style="display:none" id="add_orderProducts_table">
  259. <tbody id="add_orderProducts_table_template">
  260. <tr>
  261. <td align="center">
  262. <div style="width: 35px;" name="xh"></div>
  263. <input name="orderProductsList[#index#].supplierId" type="hidden" />
  264. <input name="orderProductsList[#index#].supplierName" type="hidden" />
  265. </td>
  266. <td align="center"><input style="width:35px;" type="checkbox" name="ck"/></td>
  267. <td align="left" style="display: none;">
  268. <input name="orderProductsList[#index#].pnumber" maxlength="16"
  269. type="text" class="inputxt" style="width:130px;"
  270. >
  271. <label class="Validform_label" style="display: none;">货品编码</label>
  272. </td>
  273. <td align="left">
  274. <input name="orderProductsList[#index#].pname" maxlength="32"
  275. type="text" class="inputxt" style="width:130px;"
  276. >
  277. <label class="Validform_label" style="display: none;">货品名称</label>
  278. </td>
  279. <td align="left">
  280. <input name="orderProductsList[#index#].specType" maxlength="50"
  281. type="text" class="inputxt" style="width:130px;"
  282. >
  283. <label class="Validform_label" style="display: none;">规格型号</label>
  284. </td>
  285. <td align="left">
  286. <t:dictSelect field="orderProductsList[#index#].measureUnit" type="list" extendJson="{class:'form-control',style:'width:132px'}"
  287. typeGroupCode="metering_calcu_unit" defaultVal="" hasLabel="false" title="计量单位" datatype="*"></t:dictSelect>
  288. <label class="Validform_label" style="display: none;">计量单位</label>
  289. </td>
  290. <td align="left">
  291. <input name="orderProductsList[#index#].quantity" maxlength="10" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  292. type="text" class="inputxt" style="width:130px;"
  293. datatype="*">
  294. <label class="Validform_label" style="display: none;">数量</label>
  295. </td>
  296. <td align="left">
  297. <input name="orderProductsList[#index#].purchasePrice" maxlength="10" datatype="/^[0-9]+([.]{1}[0-9]+){0,1}$/" onKeyUp="this.value=this.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
  298. type="text" class="inputxt" style="width:130px;" readonly="readonly"
  299. datatype="*">
  300. <label class="Validform_label" style="display: none;">采购单价</label>
  301. </td>
  302. <td align="left">
  303. <input name="orderProductsList[#index#].money" readonly="readonly"
  304. type="text" class="inputxt" style="width:130px;"
  305. >
  306. <label class="Validform_label" style="display: none;">金额</label>
  307. </td>
  308. <td align="left">
  309. <input name="orderProductsList[#index#].remark" maxlength="100"
  310. type="text" class="inputxt" style="width:390px;"
  311. >
  312. <label class="Validform_label" style="display: none;">备注</label>
  313. <input name="orderProductsList[#index#].goodsId" type="text" style="display:none"/>
  314. </td>
  315. </tr>
  316. </tbody>
  317. </table>
  318. </div>
  319. </body>
  320. <script src = "webpage/cn/com/lzt/orders/orders.js"></script>