addfeedstoragein.jsp 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  2. <html>
  3. <head>
  4. <%@ include file="../common/header.jsp" %>
  5. <script type="text/javascript" src="${contextPath }/js/calendar/WdatePicker.js"></script>
  6. <script type="text/javascript">
  7. $(document).ready(function (){
  8. $("#BusinessDate").bind("click", function() {WdatePicker();});
  9. var type = "${type}";
  10. });
  11. /*function updateFeedStorage(){
  12. //提交之前验证保存记录之前是否有入库记录、有的话可以保存
  13. var type = $("#type").val();
  14. var feedstorageId = $("#feedstorageId").val();
  15. var feedId = $("#feed.Id").val();
  16. var feedName = $("#feed.FNAME").val();
  17. var OperateWeight = $("#OperateWeight").val();
  18. var PCpde = $("#PCpde").val();
  19. var TPrice = $("#TPrice").val();
  20. var BusinessDate = $("#BusinessDate").val();
  21. var Remark = $("#Remark").val();
  22. var XCpde = $("#XCpde").val();
  23. var GCpde = $("#GCpde").val();
  24. var JCpde = $("#JCpde").val();
  25. if(BusinessDate.length == 0){
  26. alert("【入库日期】必填");
  27. $("#BusinessDate").focus();
  28. return false;
  29. }
  30. if(OperateWeight.length == 0){
  31. alert("【操作重量】必填");
  32. $("#OperateWeight").focus();
  33. $("#ConfirmWeight").val("");
  34. return false;
  35. }
  36. }*/
  37. function caculatSprice(){
  38. var TPrice = $("#TPrice").val();
  39. var OperateWeight = $("#OperateWeight").val();
  40. if(TPrice != "" && OperateWeight != ""){
  41. $("#SPrice").val((TPrice / OperateWeight).toFixed(2));
  42. //$("#SPrice").setval()=TPrice/OperateWeight;
  43. }
  44. }
  45. function saveFeedStorageIn(){
  46. var feedId = $("#feedId").val();
  47. var OperateWeight = $("#OperateWeight").val();
  48. var PCpde = $("#PCpde").val();
  49. var TPrice = $("#TPrice").val();
  50. var BusinessDate = $("#BusinessDate").val();
  51. var Remark = $("#Remark").val();
  52. var XCpde = $("#XCpde").val();
  53. var GCpde = $("#GCpde").val();
  54. var JCpde = $("#JCpde").val();
  55. if(BusinessDate.length == 0){
  56. alert("【入库日期】必填");
  57. $("#BusinessDate").focus();
  58. return false;
  59. }
  60. if(OperateWeight.length == 0){
  61. alert("【操作重量】必填");
  62. $("#OperateWeight").focus();
  63. $("#ConfirmWeight").val("");
  64. return false;
  65. }
  66. if(isNaN(TPrice)&&TPrice!=""){
  67. alert("【金额】必须为数字");
  68. return false;
  69. }
  70. if(isNaN(OperateWeight)){
  71. alert("【操作重量】必须为数字");
  72. return false;
  73. }
  74. $.ajax({
  75. async: false,
  76. type: "post",
  77. dataType:"json", //返回类型json
  78. data: "feedId="+feedId+"&OperateWeight="+OperateWeight+"&PCpde="+PCpde+"&TPrice="
  79. +TPrice+"&BusinessDate="+BusinessDate+"&Remark="+Remark+"&XCpde="+XCpde+"&GCpde="+GCpde+"&JCpde="+JCpde,
  80. url: "${contextPath }/admin/feedstorage/updatefeedstorage.html",
  81. error: function(){alert("系统错误");},
  82. success: function(json){
  83. if(json.status == "success"){
  84. $("#TPrice").val("");
  85. $("#OperateWeight").val("");
  86. $("#PCpde").val("");
  87. $("#TPrice").val("");
  88. $("#BusinessDate").val("");
  89. $("#Remark").val("");
  90. $("#XCpde").val("");
  91. $("#GCpde").val("");
  92. $("#JCpde").val("");
  93. $("#SPrice").val("");
  94. }
  95. }
  96. });
  97. }
  98. </script>
  99. </head>
  100. <body style="background-color: #E0E0E0">
  101. <div>
  102. <div class="navfrm">
  103. <span>当前位置:库存量维护</span>
  104. </div>
  105. <input type="hidden" id="feedstorageId" name="feedstorageId" value="${map.FeedStorageId }" ></input>
  106. <input type="hidden" id="type" name="type" value="${type }" ></input>
  107. <table cellspacing="1" cellpadding="1" border="0" style="width: 99%;" class="tabsty">
  108. <tbody>
  109. <tr style="height:30px;" class="greb">
  110. <td style="text-align:right;"><span style="color: red">* </span>入库日期:</td>
  111. <td><input id="BusinessDate" name="BusinessDate" value="${map.BusinessDate }" /></td>
  112. </tr>
  113. <tr style="height:30px;" class="greb">
  114. <td style="text-align:right;"><span style="color: red">* </span>饲料名称:</td>
  115. <td>
  116. <select id="feedId">
  117. <c:forEach items="${feeds }" var="feed">
  118. <option value="${feed.ID }" <c:if test="${feed.ID == map.FeedId}">selected="selected"</c:if>>
  119. <c:out value="${feed.FNAME }" />
  120. </option>
  121. </c:forEach>
  122. </select>
  123. </td>
  124. </tr>
  125. <tr id="czzldiv" style="height:30px;" class="greb">
  126. <td style="text-align:right;"><span style="color: red">* </span>操作重量:</td>
  127. <td><input id="OperateWeight" name="OperateWeight" value="${map.OperateWeight }" onblur="caculatSprice()" /></td>
  128. </tr>
  129. <tr style="height:30px;" class="greb">
  130. <td style="text-align:right;">金额:</td>
  131. <td><input id="TPrice" name="TPrice" value="${map.TPrice }" onblur="caculatSprice()" /></td>
  132. </tr>
  133. <tr style="height:30px;" class="greb">
  134. <td style="text-align:right;">单价:</td>
  135. <td><input id="SPrice" name="SPrice" value="${map.SPrice }" disabled="disabled" /></td>
  136. </tr>
  137. <tr style="height:30px;" class="greb">
  138. <td style="text-align:right;">批号:</td>
  139. <td><input id="PCpde" name="PCpde" value="${map.PCpde }" /></td>
  140. </tr>
  141. <tr style="height:30px;" class="greb">
  142. <td style="text-align:right;">许可证:</td>
  143. <td><input id="XCpde" name="XCpde" value="${map.TPrice }" /></td>
  144. </tr>
  145. <tr style="height:30px;" class="greb">
  146. <td style="text-align:right;">供应商:</td>
  147. <td><input id="GCpde" name="GCpde" value="${map.TPrice }" /></td>
  148. </tr>
  149. <tr style="height:30px;" class="greb">
  150. <td style="text-align:right;">经办人:</td>
  151. <td><input id="JCpde" name="JCpde" value="${map.PCpde }" /></td>
  152. </tr>
  153. <tr style="height:30px;" class="greb">
  154. <td style="text-align:right;">备注:</td>
  155. <td><input id="Remark" name="Remark" value="${map.Remark }" /></td>
  156. </tr>
  157. <tr style="height:30px;" class="greb">
  158. <td></td>
  159. <td>
  160. <input id="smbut" type="button" value="保存并继续" onclick="saveFeedStorageIn();" class="inputbutton" style="height:30px;width:80px;font-size:12px;">&nbsp;&nbsp;&nbsp;
  161. </td>
  162. </tr>
  163. </tbody>
  164. </table>
  165. </div>
  166. </body>
  167. </html>