viewStockRemove.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <%@ page language="java" contentType="text/html;charset=GBK"
  2. pageEncoding="GBK"%>
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  5. <html>
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html;charset=GBK">
  8. <title>编辑库存调拨单</title>
  9. <link href="${pageContext.request.contextPath }/main.css" rel="stylesheet" type="text/css" />
  10. <link href="/shares/js/yw/master1/liger/skins/ynet/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  11. <link href="/shares/css/yw/master1/reset.css" rel="stylesheet" type="text/css" />
  12. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  13. <script type="text/javascript" src="/shares/js/constant.js"></script>
  14. <script type="text/javascript" src="/shares/js/common.js"></script>
  15. <script type="text/javascript" src="/shares/js/file.js"></script>
  16. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  17. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerDateEditor.js" type="text/javascript"></script>
  18. <script src="/shares/xheditor/xheditor-1.1.14/xheditor-1.1.14-zh-cn.min.js" type="text/javascript" ></script>
  19. <!-- 选择窗口需要加载的js文件 start-->
  20. <script src="${pageContext.request.contextPath}/liger/lib/json2.js" type="text/javascript"></script>
  21. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerDialog.js" type="text/javascript"></script>
  22. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  23. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerTextBox.js" type="text/javascript"></script>
  24. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerCheckBox.js" type="text/javascript"></script>
  25. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerComboBox.js" type="text/javascript"></script>
  26. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/plugins/ligerSpinner.js" type="text/javascript"></script>
  27. <script type="text/javascript" src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"></script>
  28. <script type="text/javascript" src="/shares/js/yw/erp/stockRemove.js"></script>
  29. <link rel="stylesheet" type="text/css" href="/shares/css/yw/master1/win/jquery.jscrollpane.codrops1.css" />
  30. <script type="text/javascript" src="/shares/js/yw/master1/jquery.mousewheel.js"></script>
  31. <!-- the jScrollPane script -->
  32. <script type="text/javascript" src="/shares/js/yw/master1/jquery.jscrollpane.min.js"></script>
  33. <script type="text/javascript" src="/shares/js/yw/master1/scroll-startstop.events.jquery.js"></script>
  34. <script type="text/javascript" src="/shares/js/yw/master1/scroll.js"></script>
  35. <style type="text/css">
  36. body {
  37. background:#fff;
  38. }
  39. </style>
  40. <script type="text/javascript">
  41. var stockRemoveDetailData = ${requestScope.Rows};
  42. var task = "${requestScope.task}";
  43. var locationobjs;
  44. $(f_initGrid);
  45. $(function (){
  46. loadTypeTree("usertree",{type:"singleuser",tab:"1,2",backId:"stock_remove_user",backName:"stock_remove_user_name"});
  47. $("#stock_remove_date").ligerDateEditor({ showTime: true, labelAlign: 'left', showTime:false, width:150,height:21});
  48. var selectFromDepot = "${requestScope.stockRemove.stock_remove_from_depot}";
  49. if (selectFromDepot != null && selectFromDepot != "") {
  50. $("#stock_remove_from_depot").val(selectFromDepot);
  51. }
  52. var selectFromLocation = "${requestScope.stockRemove.stock_remove_from_location}";
  53. if (selectFromLocation != null && selectFromLocation != "") {
  54. getLocations("stock_remove_from_depot","stock_remove_from_location");
  55. };
  56. var selectToDepot = "${requestScope.stockRemove.stock_remove_to_depot}";
  57. if (selectToDepot != null && selectToDepot != "") {
  58. $("#stock_remove_to_depot").val(selectToDepot);
  59. }
  60. var selectToLocation = "${requestScope.stockRemove.stock_remove_to_location}";
  61. if (selectToLocation != null && selectToLocation != "") {
  62. getLocations("stock_remove_to_depot","stock_remove_to_location");
  63. };
  64. });
  65. function getLocations(depot,location){
  66. $("#"+location).empty();
  67. $('#'+location).append("<option value=''>--请选择--</option> ");
  68. var depot_val=$('#'+depot).val();
  69. $.ajax({
  70. url:"locationAction.do?date="+new Date()+"&task=getLocations",
  71. type:"post",
  72. dataType:"json",
  73. data:"depot_id="+ $("#"+depot).val(),
  74. success:function(data){
  75. locationobjs = data;
  76. if(locationobjs.length == 0){
  77. if(depot=="stock_remove_from_depot")
  78. $("#selectloc1").hide();
  79. else
  80. $("#selectloc2").hide();
  81. }else{
  82. if(depot=="stock_remove_from_depot")
  83. $("#selectloc1").show();
  84. else
  85. $("#selectloc2").show();
  86. for(var i=0;i<locationobjs.length;i++){
  87. $('#'+location).append("<option value='"+locationobjs[i].location_id+"'>"+locationobjs[i].location_name+"</option>");
  88. }
  89. if(depot=="stock_remove_from_depot")
  90. $("#"+location).val("${requestScope.stockRemove.stock_remove_from_location}");
  91. else
  92. $("#"+location).val("${requestScope.stockRemove.stock_remove_to_location}");
  93. };
  94. hasDetails();
  95. }
  96. });
  97. }
  98. function isSelDepot(){
  99. var stock_remove_depot_val=$('#stock_remove_from_depot').val();
  100. if(stock_remove_depot_val == ""){
  101. $.ligerDialog.warn("请先选择转出仓库 !");
  102. }else{
  103. if(locationobjs != null && locationobjs != "" && locationobjs.length > 0){
  104. var stock_remove_location_val = $('#stock_remove_from_location').val();
  105. if(stock_remove_location_val == ""){
  106. $.ligerDialog.warn("请先选择库位 !");
  107. }else{
  108. f_import();
  109. }
  110. }else{
  111. f_import();
  112. }
  113. }
  114. }
  115. function checkForm() {
  116. var rs = $.validate({
  117. name : "stock_remove_num",
  118. model : [ {
  119. type : "require",
  120. msg : "调拨单号不能为空!",
  121. }]
  122. });
  123. var rs = $.validate({
  124. name : "stock_remove_title",
  125. model : [ {
  126. type : "require",
  127. msg : "调拨主题不能为空!",
  128. }]
  129. });
  130. rs = $.validate({
  131. name : "stock_remove_user_name",
  132. model : [ {
  133. type : "require",
  134. msg : "调拨人不能为空!",
  135. }]
  136. }) && rs;
  137. rs = $.validate({
  138. name : "stock_remove_date",
  139. model : [ {
  140. type : "require",
  141. msg : "调拨日期不能为空!"
  142. }]
  143. }) && rs;
  144. rs = $.validate({
  145. name : "stock_remove_from_depot",
  146. model : [ {
  147. type : "require",
  148. msg : "转出仓库不能为空!"
  149. }]
  150. }) && rs;
  151. if(document.getElementById("selectloc1").style.display != "none"){
  152. rs = $.validate({
  153. name : "stock_remove_from_location",
  154. model : [ {
  155. type : "require",
  156. msg : "库位不能为空!"
  157. }]
  158. }) && rs;
  159. }
  160. rs = $.validate({
  161. name : "stock_remove_to_depot",
  162. model : [ {
  163. type : "require",
  164. msg : "转入仓库不能为空!"
  165. }]
  166. }) && rs;
  167. if(document.getElementById("selectloc2").style.display != "none"){
  168. rs = $.validate({
  169. name : "stock_remove_to_location",
  170. model : [ {
  171. type : "require",
  172. msg : "库位不能为空!"
  173. }]
  174. }) && rs;
  175. }
  176. if($("#stock_remove_from_depot").val() != "" && $("#stock_remove_to_depot").val() != ""){
  177. if(($("#stock_remove_from_depot").val() == $("#stock_remove_to_depot").val()) && ($("#stock_remove_from_location").val() == $("#stock_remove_to_location").val())){
  178. $.ligerDialog.warn("转出仓库和转入仓库不能相同 !");
  179. rs = false;
  180. }
  181. }
  182. if (rs) {
  183. return true;
  184. }
  185. return false;
  186. }
  187. function hasDetails(){
  188. getData();
  189. var jsonDataVal = $("#jsonData").val();
  190. if (jsonDataVal.length > 2) {
  191. if($("#stock_remove_from_depot").val()!= null && $("#stock_remove_from_depot").val()!= ""){
  192. $("#stock_remove_from_depot_").val($("#stock_remove_from_depot").val());
  193. $("#stock_remove_from_depot").attr("disabled",true);
  194. }
  195. if($("#stock_remove_from_location").val()!= null && $("#stock_remove_from_location").val()!= ""){
  196. $("#stock_remove_from_location_").val($("#stock_remove_from_location").val());
  197. $("#stock_remove_from_location").attr("disabled",true);
  198. };
  199. }else{
  200. $("#stock_remove_from_depot").attr("disabled",false);
  201. $("#stock_remove_from_location").attr("disabled",false);
  202. };
  203. }
  204. function savestock_remove(){
  205. getData();
  206. var myfrom = document.getElementById("myfrom");
  207. myfrom.action = "stockRemoveAction.do";
  208. $("#task").val("doEdit");
  209. }
  210. function createstock_removetock(){
  211. getData();
  212. var myfrom = document.getElementById("myfrom");
  213. myfrom.action = "stockRemovetockAction.do";
  214. $("#task").val("add");
  215. }
  216. </script>
  217. <style type="text/css">
  218. .file-style{
  219. width: 550px;
  220. }
  221. .file-style input[type='file'] {
  222. width:385px ;
  223. height:24px;
  224. line-height:22px;
  225. vertical-align: bottom;
  226. background-color: #fff;
  227. border: 1px solid #cccccc;
  228. margin-top: 2px;
  229. margin-bottom: 2px;
  230. }
  231. </style>
  232. </head>
  233. <body style="background: none; overflow: hidden;" ontouchmove="event.preventDefault();">
  234. <div class="s_title b10 f6">
  235. <img src="/shares/images/master1/gg_ico.png" width="27" height="26" />查看库存调拨单
  236. <div class="article_title">
  237. <input class="art_back" style="width: 50px;" title="返回" name="" onclick="history.back(-1);" type="button" />
  238. </div>
  239. </div>
  240. <div id="jp-container" class="jp-container liuyan">
  241. <div class="forum-container">
  242. <center>
  243. <table class="l-table-edit">
  244. <tr>
  245. <th colspan="4">基本信息</th>
  246. </tr>
  247. <tr>
  248. <td class="l-table-edit-text" width="15%">调拨单号:</td>
  249. <td class="l-table-edit-td" width="35%">
  250. ${requestScope.stockRemove.stock_remove_num}
  251. </td>
  252. <td class="l-table-edit-text" width="15%">主题:</td>
  253. <td class="l-table-edit-td" width="35%">
  254. ${requestScope.stockRemove.stock_remove_title}
  255. </td>
  256. </tr>
  257. <tr>
  258. <td class="l-table-edit-text" width="15%">调拨日期:</td>
  259. <td class="l-table-edit-td" width="35%">
  260. ${requestScope.stockRemove.stock_remove_date }
  261. </td>
  262. <td class="l-table-edit-text">调拨人:</td>
  263. <td class="l-table-edit-td">
  264. ${requestScope.stockRemove.stock_remove_user_name}
  265. </td>
  266. </tr>
  267. <tr>
  268. <td class="l-table-edit-text">转出仓库:</td>
  269. <td class="l-table-edit-td">
  270. ${requestScope.stockRemove.stock_remove_from_depot_name}
  271. ${requestScope.stockRemove.stock_remove_from_location_name}
  272. </td>
  273. <td class="l-table-edit-text">转入仓库:</td>
  274. <td class="l-table-edit-td">
  275. ${requestScope.stockRemove.stock_remove_to_depot_name}
  276. ${requestScope.stockRemove.stock_remove_to_location_name}
  277. </td>
  278. </tr>
  279. <tr>
  280. <td class="l-table-edit-text" >备注 </td>
  281. <td class="l-table-edit-td" colspan="3">
  282. ${requestScope.stockRemove.stock_remove_remark }
  283. </td>
  284. </tr>
  285. <tr>
  286. <th colspan="4">调拨明细</th>
  287. </tr>
  288. </table>
  289. <input type="hidden" id="jsonData" name="jsonData" value="">
  290. <input type="hidden" id="tabid" name="tabid" value="${param.tabid }">
  291. <input type="hidden" id="task" name="task" value="doEdit">
  292. <input type="hidden" id="stock_remove_id" name="stock_remove_id" value="${requestScope.stockRemove.stock_remove_id}">
  293. <input type="hidden" id="stock_remove_from_depot_" name="stock_remove_from_depot_" value="${requestScope.stockRemove.stock_remove_from_depot}">
  294. <input type="hidden" id="stock_remove_from_location_" name="stock_remove_from_location_" value="${requestScope.stockRemove.stock_remove_from_location}">
  295. </center>
  296. </div>
  297. <div id="maingrid" style="margin: 0; padding: 0"></div>
  298. </div>
  299. <%@ include file="/include/message.jsp"%>
  300. </body>
  301. </html>