123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179 |
- <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
- <html>
- <head>
- <%@ include file="../common/header.jsp" %>
- <script type="text/javascript" src="${contextPath }/js/calendar/WdatePicker.js"></script>
- <script type="text/javascript">
- $(document).ready(function (){
- $("#BusinessDate").bind("click", function() {WdatePicker();});
- var type = "${type}";
- });
-
- /*function updateFeedStorage(){
- //提交之前验证保存记录之前是否有入库记录、有的话可以保存
- var type = $("#type").val();
- var feedstorageId = $("#feedstorageId").val();
- var feedId = $("#feed.Id").val();
- var feedName = $("#feed.FNAME").val();
- var OperateWeight = $("#OperateWeight").val();
- var PCpde = $("#PCpde").val();
- var TPrice = $("#TPrice").val();
- var BusinessDate = $("#BusinessDate").val();
- var Remark = $("#Remark").val();
- var XCpde = $("#XCpde").val();
- var GCpde = $("#GCpde").val();
- var JCpde = $("#JCpde").val();
-
- if(BusinessDate.length == 0){
- alert("【入库日期】必填");
- $("#BusinessDate").focus();
- return false;
- }
-
- if(OperateWeight.length == 0){
- alert("【操作重量】必填");
- $("#OperateWeight").focus();
- $("#ConfirmWeight").val("");
- return false;
- }
-
- }*/
-
- function caculatSprice(){
- var TPrice = $("#TPrice").val();
- var OperateWeight = $("#OperateWeight").val();
-
- if(TPrice != "" && OperateWeight != ""){
- $("#SPrice").val((TPrice / OperateWeight).toFixed(2));
- //$("#SPrice").setval()=TPrice/OperateWeight;
- }
- }
-
- function saveFeedStorageIn(){
- var feedId = $("#feedId").val();
- var OperateWeight = $("#OperateWeight").val();
- var PCpde = $("#PCpde").val();
- var TPrice = $("#TPrice").val();
- var BusinessDate = $("#BusinessDate").val();
- var Remark = $("#Remark").val();
- var XCpde = $("#XCpde").val();
- var GCpde = $("#GCpde").val();
- var JCpde = $("#JCpde").val();
- if(BusinessDate.length == 0){
- alert("【入库日期】必填");
- $("#BusinessDate").focus();
- return false;
- }
-
- if(OperateWeight.length == 0){
- alert("【操作重量】必填");
- $("#OperateWeight").focus();
- $("#ConfirmWeight").val("");
- return false;
- }
- if(isNaN(TPrice)&&TPrice!=""){
- alert("【金额】必须为数字");
- return false;
- }
- if(isNaN(OperateWeight)){
- alert("【操作重量】必须为数字");
- return false;
- }
-
- $.ajax({
- async: false,
- type: "post",
- dataType:"json", //返回类型json
- data: "feedId="+feedId+"&OperateWeight="+OperateWeight+"&PCpde="+PCpde+"&TPrice="
- +TPrice+"&BusinessDate="+BusinessDate+"&Remark="+Remark+"&XCpde="+XCpde+"&GCpde="+GCpde+"&JCpde="+JCpde,
- url: "${contextPath }/admin/feedstorage/updatefeedstorage.html",
- error: function(){alert("系统错误");},
- success: function(json){
- if(json.status == "success"){
- $("#TPrice").val("");
- $("#OperateWeight").val("");
- $("#PCpde").val("");
- $("#TPrice").val("");
- $("#BusinessDate").val("");
- $("#Remark").val("");
- $("#XCpde").val("");
- $("#GCpde").val("");
- $("#JCpde").val("");
- $("#SPrice").val("");
- }
- }
- });
- }
- </script>
- </head>
- <body style="background-color: #E0E0E0">
- <div>
- <div class="navfrm">
- <span>当前位置:库存量维护</span>
- </div>
- <input type="hidden" id="feedstorageId" name="feedstorageId" value="${map.FeedStorageId }" ></input>
- <input type="hidden" id="type" name="type" value="${type }" ></input>
- <table cellspacing="1" cellpadding="1" border="0" style="width: 99%;" class="tabsty">
- <tbody>
- <tr style="height:30px;" class="greb">
- <td style="text-align:right;"><span style="color: red">* </span>入库日期:</td>
- <td><input id="BusinessDate" name="BusinessDate" value="${map.BusinessDate }" /></td>
- </tr>
- <tr style="height:30px;" class="greb">
- <td style="text-align:right;"><span style="color: red">* </span>饲料名称:</td>
- <td>
- <select id="feedId">
- <c:forEach items="${feeds }" var="feed">
- <option value="${feed.ID }" <c:if test="${feed.ID == map.FeedId}">selected="selected"</c:if>>
- <c:out value="${feed.FNAME }" />
- </option>
- </c:forEach>
- </select>
- </td>
- </tr>
- <tr id="czzldiv" style="height:30px;" class="greb">
- <td style="text-align:right;"><span style="color: red">* </span>操作重量:</td>
- <td><input id="OperateWeight" name="OperateWeight" value="${map.OperateWeight }" onblur="caculatSprice()" /></td>
- </tr>
- <tr style="height:30px;" class="greb">
- <td style="text-align:right;">金额:</td>
- <td><input id="TPrice" name="TPrice" value="${map.TPrice }" onblur="caculatSprice()" /></td>
- </tr>
- <tr style="height:30px;" class="greb">
- <td style="text-align:right;">单价:</td>
- <td><input id="SPrice" name="SPrice" value="${map.SPrice }" disabled="disabled" /></td>
- </tr>
- <tr style="height:30px;" class="greb">
- <td style="text-align:right;">批号:</td>
- <td><input id="PCpde" name="PCpde" value="${map.PCpde }" /></td>
- </tr>
- <tr style="height:30px;" class="greb">
- <td style="text-align:right;">许可证:</td>
- <td><input id="XCpde" name="XCpde" value="${map.TPrice }" /></td>
- </tr>
- <tr style="height:30px;" class="greb">
- <td style="text-align:right;">供应商:</td>
- <td><input id="GCpde" name="GCpde" value="${map.TPrice }" /></td>
- </tr>
- <tr style="height:30px;" class="greb">
- <td style="text-align:right;">经办人:</td>
- <td><input id="JCpde" name="JCpde" value="${map.PCpde }" /></td>
- </tr>
- <tr style="height:30px;" class="greb">
- <td style="text-align:right;">备注:</td>
- <td><input id="Remark" name="Remark" value="${map.Remark }" /></td>
- </tr>
- <tr style="height:30px;" class="greb">
- <td></td>
- <td>
- <input id="smbut" type="button" value="保存并继续" onclick="saveFeedStorageIn();" class="inputbutton" style="height:30px;width:80px;font-size:12px;">
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </body>
- </html>
|