flow_search.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  4. <c:set value="<%=request.getContextPath()%>" var="ctx"></c:set>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta charset="utf-8">
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  10. <title>流向查询</title>
  11. <meta name="keywords" content="流向查询">
  12. <meta name="description" content="流向信息查询页面">
  13. <link rel="shortcut icon" href="favicon.ico">
  14. <link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
  15. <link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
  16. <link href="${ctx}/css/animate.css" rel="stylesheet">
  17. <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
  18. <link href="${ctx}/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
  19. </head>
  20. <body class="gray-bg">
  21. <div class="wrapper wrapper-content animated fadeInRight">
  22. <div class="row">
  23. <div class="col-sm-12">
  24. <div class="ibox float-e-margins">
  25. <div class="ibox-title">
  26. <div class="row">
  27. <div class="col-sm-12">
  28. <h3>流向查询</h3>
  29. </div>
  30. </div>
  31. </div>
  32. <div class="ibox-content">
  33. <form class="form-horizontal m-t" name="flowform" id="flowform">
  34. <div class="row">
  35. <div class="col-sm-2"></div>
  36. <div class="col-sm-8">
  37. <div class="form-group">
  38. <label class="col-sm-4 control-label"><span class="text-danger">*</span>数码:</label>
  39. <div class="col-sm-4">
  40. <input class="form-control" type="text" name="code" id="code" placeholder="请输入数码" maxlength="100" />
  41. </div>
  42. <div class="col-sm-4">
  43. <button class="btn btn-primary" id="searchBtn" type="button" onclick="search();return false;">查询</button>
  44. <button class="btn btn-white" id="resetBtn" type="button" onclick="reset();">重置</button>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="col-sm-2"></div>
  49. </div>
  50. </form>
  51. </div>
  52. <div class="ibox-content" id="resultDiv" style="display:none">
  53. <div class="row">
  54. <div class="col-sm-12">
  55. <div class="alert alert-warning alert-dismissable">
  56. <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
  57. 输入数码后显示数据
  58. </div>
  59. </div>
  60. </div>
  61. <div class="row">
  62. <div class="col-sm-12">
  63. <h4>产品信息</h4>
  64. <table id="productTable" class="table table-striped table-bordered table-hover dataTables-example">
  65. <thead>
  66. <tr>
  67. <th>产品编号</th>
  68. <th>产品名称</th>
  69. <th>品项编码</th>
  70. <th>产品品项</th>
  71. <th>产品分类</th>
  72. </tr>
  73. </thead>
  74. <tbody id="productTbody"></tbody>
  75. </table>
  76. </div>
  77. </div>
  78. <div class="row mt-4">
  79. <div class="col-sm-12">
  80. <h4>入库信息</h4>
  81. <table id="inboundTable" class="table table-striped table-bordered table-hover dataTables-example">
  82. <thead>
  83. <tr>
  84. <th>生产单号</th>
  85. <th>彩盒码</th>
  86. <th>箱码</th>
  87. <th>托码</th>
  88. <th>入库人</th>
  89. <th>生产日期</th>
  90. </tr>
  91. </thead>
  92. <tbody id="inboundTbody"></tbody>
  93. </table>
  94. </div>
  95. </div>
  96. <div class="row mt-4">
  97. <div class="col-sm-12">
  98. <h4>出库信息</h4>
  99. <table id="outboundTable" class="table table-striped table-bordered table-hover dataTables-example">
  100. <thead>
  101. <tr>
  102. <th>出库单号</th>
  103. <th>发货仓库</th>
  104. <th>出库人</th>
  105. <th>经销商名称</th>
  106. <th>应销地区</th>
  107. <th>出库时间</th>
  108. </tr>
  109. </thead>
  110. <tbody id="outboundTbody"></tbody>
  111. </table>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </div>
  119. <!-- 全局js -->
  120. <script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
  121. <script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
  122. <!-- 自定义js -->
  123. <script src="${ctx}/js/content.js?v=1.0.0"></script>
  124. <!-- jQuery Validation plugin javascript-->
  125. <script src="${ctx}/js/plugins/validate/jquery.validate.min.js"></script>
  126. <script src="${ctx}/js/plugins/validate/messages_zh.min.js"></script>
  127. <script src="${ctx}/js/plugins/layer/layer.min.js"></script>
  128. <script type="text/javascript">
  129. var ctx = "${ctx}";
  130. // 模拟数据
  131. var mockData = {
  132. product: {
  133. productCode: "C20220629001",
  134. productName: "12g深海小鱼",
  135. itemCode: "C20220629001002",
  136. itemName: "麻辣",
  137. category: "-"
  138. },
  139. inbound: {
  140. productionNo: "188237526440185315",
  141. boxCode: "1cb40g2dfrfur",
  142. cartoonCode: "000052140000438700068982",
  143. palletCode: "000053150000437400013714",
  144. inboundPerson: "zd003",
  145. productionDate: "2025-01-23 18:30:11"
  146. },
  147. outbound: {
  148. outboundNo: "SPJ20251700257",
  149. warehouse: "平江仓",
  150. outboundPerson: "fulesync",
  151. dealerName: "山东青岛陈春园",
  152. salesArea: "-",
  153. outboundTime: "2025-01-29 11:47:58"
  154. }
  155. };
  156. $(function(){
  157. $('#resetBtn').on('click', function() {
  158. reset();
  159. });
  160. // 表单验证
  161. $("#flowform").validate({
  162. rules : {
  163. code:{
  164. required : true
  165. }
  166. },
  167. messages : {
  168. code:{
  169. required : "请输入数码"
  170. }
  171. }
  172. });
  173. });
  174. function search(){
  175. if(!$("#flowform").valid()){
  176. return;
  177. }
  178. layer.load();
  179. var code = $("#code").val().toLowerCase();
  180. $.ajax({
  181. url:"${ctx}/jinzaiOrder/getCodeFlowSearch",
  182. type:"post",
  183. data:{code:code},
  184. success:function(res){
  185. layer.closeAll();
  186. if(res.code === 0){
  187. $("#resultDiv").show();
  188. // 填充产品信息
  189. fillProductInfo(res.data.product);
  190. // 填充入库信息
  191. fillInboundInfo(res.data.inbound);
  192. // 填充出库信息
  193. fillOutboundInfo(res.data.outbound);
  194. } else {
  195. layer.msg(res.msg, {icon: 5});
  196. $("#resultDiv").hide();
  197. }
  198. },
  199. error:function(){
  200. layer.closeAll();
  201. layer.msg("查询失败,请重试", {icon: 5});
  202. }
  203. });
  204. // if(!$("#flowform").valid()){
  205. // return;
  206. // }
  207. //
  208. // layer.load();
  209. // var code = $("#code").val().toLowerCase();
  210. //
  211. // // 模拟延迟加载
  212. // setTimeout(function(){
  213. // layer.closeAll();
  214. // $("#resultDiv").show();
  215. //
  216. // // 使用模拟数据填充表格
  217. // fillProductInfo(mockData.product);
  218. // fillInboundInfo(mockData.inbound);
  219. // fillOutboundInfo(mockData.outbound);
  220. // }, 800);
  221. }
  222. function reset() {
  223. // 重置表单数据
  224. $("#flowform")[0].reset();
  225. // 重置jQuery Validate验证状态
  226. $("#flowform").validate().resetForm();
  227. // 隐藏结果区域
  228. $("#resultDiv").hide();
  229. // 可选:清空结果表格内容
  230. $("#productTbody").empty();
  231. $("#inboundTbody").empty();
  232. $("#outboundTbody").empty();
  233. }
  234. function fillProductInfo(product){
  235. var tbody = $("#productTbody");
  236. tbody.empty();
  237. if(product){
  238. var row = $('<tr/>');
  239. row.append($('<td/>').text(product.productCode || '-'));
  240. row.append($('<td/>').text(product.productName || '-'));
  241. row.append($('<td/>').text(product.itemCode || '-'));
  242. row.append($('<td/>').text(product.itemName || '-'));
  243. row.append($('<td/>').text(product.category || '-'));
  244. tbody.append(row);
  245. }
  246. }
  247. function fillInboundInfo(inbound){
  248. var tbody = $("#inboundTbody");
  249. tbody.empty();
  250. if(inbound){
  251. var row = $('<tr/>');
  252. row.append($('<td/>').text(inbound.productionNo || '-'));
  253. row.append($('<td/>').text(inbound.boxCode || '-'));
  254. row.append($('<td/>').text(inbound.cartoonCode || '-'));
  255. row.append($('<td/>').text(inbound.palletCode || '-'));
  256. row.append($('<td/>').text(inbound.inboundPerson || '-'));
  257. row.append($('<td/>').text(inbound.productionDate || '-'));
  258. tbody.append(row);
  259. }
  260. }
  261. function fillOutboundInfo(outbound){
  262. var tbody = $("#outboundTbody");
  263. tbody.empty();
  264. if(outbound){
  265. var row = $('<tr/>');
  266. row.append($('<td/>').text(outbound.outboundNo || '-'));
  267. row.append($('<td/>').text(outbound.warehouse || '-'));
  268. row.append($('<td/>').text(outbound.outboundPerson || '-'));
  269. row.append($('<td/>').text(outbound.dealerName || '-'));
  270. row.append($('<td/>').text(outbound.salesArea || '-'));
  271. row.append($('<td/>').text(outbound.outboundTime || '-'));
  272. tbody.append(row);
  273. }
  274. }
  275. </script>
  276. </body>
  277. </html>