| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- <%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8" %>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
- <c:set value="<%=request.getContextPath()%>" var="ctx"></c:set>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>流向查询</title>
- <meta name="keywords" content="流向查询">
- <meta name="description" content="流向信息查询页面">
- <link rel="shortcut icon" href="favicon.ico">
- <link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
- <link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
- <link href="${ctx}/css/animate.css" rel="stylesheet">
- <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
- <link href="${ctx}/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
- </head>
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-title">
- <div class="row">
- <div class="col-sm-12">
- <h3>流向查询</h3>
- </div>
- </div>
- </div>
- <div class="ibox-content">
- <form class="form-horizontal m-t" name="flowform" id="flowform">
- <div class="row">
- <div class="col-sm-2"></div>
- <div class="col-sm-8">
- <div class="form-group">
- <label class="col-sm-4 control-label"><span class="text-danger">*</span>数码:</label>
- <div class="col-sm-4">
- <input class="form-control" type="text" name="code" id="code" placeholder="请输入数码" maxlength="100" />
- </div>
- <div class="col-sm-4">
- <button class="btn btn-primary" id="searchBtn" type="button" onclick="search();return false;">查询</button>
- <button class="btn btn-white" id="resetBtn" type="button" onclick="reset();">重置</button>
- </div>
- </div>
- </div>
- <div class="col-sm-2"></div>
- </div>
- </form>
- </div>
-
- <div class="ibox-content" id="resultDiv" style="display:none">
- <div class="row">
- <div class="col-sm-12">
- <div class="alert alert-warning alert-dismissable">
- <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button>
- 输入数码后显示数据
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-sm-12">
- <h4>产品信息</h4>
- <table id="productTable" class="table table-striped table-bordered table-hover dataTables-example">
- <thead>
- <tr>
- <th>产品编号</th>
- <th>产品名称</th>
- <th>品项编码</th>
- <th>产品品项</th>
- <th>产品分类</th>
- </tr>
- </thead>
- <tbody id="productTbody"></tbody>
- </table>
- </div>
- </div>
- <div class="row mt-4">
- <div class="col-sm-12">
- <h4>入库信息</h4>
- <table id="inboundTable" class="table table-striped table-bordered table-hover dataTables-example">
- <thead>
- <tr>
- <th>生产单号</th>
- <th>彩盒码</th>
- <th>箱码</th>
- <th>托码</th>
- <th>入库人</th>
- <th>生产日期</th>
- </tr>
- </thead>
- <tbody id="inboundTbody"></tbody>
- </table>
- </div>
- </div>
- <div class="row mt-4">
- <div class="col-sm-12">
- <h4>出库信息</h4>
- <table id="outboundTable" class="table table-striped table-bordered table-hover dataTables-example">
- <thead>
- <tr>
- <th>出库单号</th>
- <th>发货仓库</th>
- <th>出库人</th>
- <th>经销商名称</th>
- <th>应销地区</th>
- <th>出库时间</th>
- </tr>
- </thead>
- <tbody id="outboundTbody"></tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 全局js -->
- <script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
- <script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
- <!-- 自定义js -->
- <script src="${ctx}/js/content.js?v=1.0.0"></script>
- <!-- jQuery Validation plugin javascript-->
- <script src="${ctx}/js/plugins/validate/jquery.validate.min.js"></script>
- <script src="${ctx}/js/plugins/validate/messages_zh.min.js"></script>
- <script src="${ctx}/js/plugins/layer/layer.min.js"></script>
- <script type="text/javascript">
- var ctx = "${ctx}";
-
- // 模拟数据
- var mockData = {
- product: {
- productCode: "C20220629001",
- productName: "12g深海小鱼",
- itemCode: "C20220629001002",
- itemName: "麻辣",
- category: "-"
- },
- inbound: {
- productionNo: "188237526440185315",
- boxCode: "1cb40g2dfrfur",
- cartoonCode: "000052140000438700068982",
- palletCode: "000053150000437400013714",
- inboundPerson: "zd003",
- productionDate: "2025-01-23 18:30:11"
- },
- outbound: {
- outboundNo: "SPJ20251700257",
- warehouse: "平江仓",
- outboundPerson: "fulesync",
- dealerName: "山东青岛陈春园",
- salesArea: "-",
- outboundTime: "2025-01-29 11:47:58"
- }
- };
-
- $(function(){
- $('#resetBtn').on('click', function() {
- reset();
- });
- // 表单验证
- $("#flowform").validate({
- rules : {
- code:{
- required : true
- }
- },
- messages : {
- code:{
- required : "请输入数码"
- }
- }
- });
- });
-
- function search(){
- if(!$("#flowform").valid()){
- return;
- }
- layer.load();
- var code = $("#code").val().toLowerCase();
- $.ajax({
- url:"${ctx}/jinzaiOrder/getCodeFlowSearch",
- type:"post",
- data:{code:code},
- success:function(res){
- layer.closeAll();
- if(res.code === 0){
- $("#resultDiv").show();
- // 填充产品信息
- fillProductInfo(res.data.product);
- // 填充入库信息
- fillInboundInfo(res.data.inbound);
- // 填充出库信息
- fillOutboundInfo(res.data.outbound);
- } else {
- layer.msg(res.msg, {icon: 5});
- $("#resultDiv").hide();
- }
- },
- error:function(){
- layer.closeAll();
- layer.msg("查询失败,请重试", {icon: 5});
- }
- });
- // if(!$("#flowform").valid()){
- // return;
- // }
- //
- // layer.load();
- // var code = $("#code").val().toLowerCase();
- //
- // // 模拟延迟加载
- // setTimeout(function(){
- // layer.closeAll();
- // $("#resultDiv").show();
- //
- // // 使用模拟数据填充表格
- // fillProductInfo(mockData.product);
- // fillInboundInfo(mockData.inbound);
- // fillOutboundInfo(mockData.outbound);
- // }, 800);
- }
- function reset() {
- // 重置表单数据
- $("#flowform")[0].reset();
- // 重置jQuery Validate验证状态
- $("#flowform").validate().resetForm();
- // 隐藏结果区域
- $("#resultDiv").hide();
- // 可选:清空结果表格内容
- $("#productTbody").empty();
- $("#inboundTbody").empty();
- $("#outboundTbody").empty();
- }
-
- function fillProductInfo(product){
- var tbody = $("#productTbody");
- tbody.empty();
-
- if(product){
- var row = $('<tr/>');
- row.append($('<td/>').text(product.productCode || '-'));
- row.append($('<td/>').text(product.productName || '-'));
- row.append($('<td/>').text(product.itemCode || '-'));
- row.append($('<td/>').text(product.itemName || '-'));
- row.append($('<td/>').text(product.category || '-'));
- tbody.append(row);
- }
- }
-
- function fillInboundInfo(inbound){
- var tbody = $("#inboundTbody");
- tbody.empty();
-
- if(inbound){
- var row = $('<tr/>');
- row.append($('<td/>').text(inbound.productionNo || '-'));
- row.append($('<td/>').text(inbound.boxCode || '-'));
- row.append($('<td/>').text(inbound.cartoonCode || '-'));
- row.append($('<td/>').text(inbound.palletCode || '-'));
- row.append($('<td/>').text(inbound.inboundPerson || '-'));
- row.append($('<td/>').text(inbound.productionDate || '-'));
- tbody.append(row);
- }
- }
-
- function fillOutboundInfo(outbound){
- var tbody = $("#outboundTbody");
- tbody.empty();
-
- if(outbound){
- var row = $('<tr/>');
- row.append($('<td/>').text(outbound.outboundNo || '-'));
- row.append($('<td/>').text(outbound.warehouse || '-'));
- row.append($('<td/>').text(outbound.outboundPerson || '-'));
- row.append($('<td/>').text(outbound.dealerName || '-'));
- row.append($('<td/>').text(outbound.salesArea || '-'));
- row.append($('<td/>').text(outbound.outboundTime || '-'));
- tbody.append(row);
- }
- }
- </script>
- </body>
- </html>
|