| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- <%@ 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 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/bootstrap-select.min.css" rel="stylesheet">
- <link href="${ctx}/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
- <link href="${ctx}/css/animate.css" rel="stylesheet">
- <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
- <style>
- .row.mb-4 {
- margin-bottom: 1.5rem;
- }
- .form-inline-flex {
- display: flex;
- flex-wrap: wrap;
- align-items: center;
- gap: 5px;
- }
- @media (max-width: 768px) {
- .form-inline-flex {
- flex-direction: column;
- align-items: stretch;
- }
- .form-inline-flex .form-control,
- .form-inline-flex .btn,
- .form-inline-flex .selectpicker {
- width: 100% !important;
- margin-right: 0 !important;
- }
- }
- </style>
- </head>
- <body class="gray-bg">
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox">
- <div class="ibox-title">
- <div class="row">
- <div class="col-sm-10">
- <h3>补打信息记录</h3>
- </div>
- </div>
- </div>
- <div class="ibox-content">
- <div class="row row-lg mb-4">
- <div class="col-lg-12">
- <div class="form-inline-flex">
- <input type="date" class="form-control" id="reprintTime" name="reprintTime" style="width: 180px; flex-shrink: 0; margin-right: 10px; margin-bottom: 5px;">
- <div style="width: 200px; flex-shrink: 0; margin-right: 10px; margin-bottom: 5px;">
- <select id="factoryId" class="form-control selectpicker" data-live-search="true" title="请选择工厂">
- </select>
- </div>
- <div style="width: 200px; flex-shrink: 0; margin-right: 10px; margin-bottom: 5px;">
- <select id="productId" class="form-control selectpicker" data-live-search="true" title="请选择产品">
- </select>
- </div>
- <button type="button" id="searchBtn" class="btn btn-success"
- onclick="search();return false;" style="margin-right: 5px; margin-bottom: 5px;">
- 查询
- </button>
- <button type="button" id="resetBtn" class="btn btn-default"
- onclick="reset();return false;" style="margin-right: 5px; margin-bottom: 5px;">重置
- </button>
- </div>
- </div>
- </div>
- <div class="row row-lg mt-3">
- <div class="col-sm-12">
- <table id="table" data-toggle="table" data-mobile-responsive="true"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
- <script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
- <script src="${ctx}/js/bootstrap-select.min.js"></script>
- <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/bootstrap-table/bootstrap-table.min.js"></script>
- <script src="${ctx}/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
- <script src="${ctx}/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
- <script src="${ctx}/js/common.js"></script>
- <script src="${ctx}/js/plugins/layer/layer.min.js"></script>
- <script src="${ctx}/js/Math.uuid.js"></script>
- <script src="${ctx}/js/content.js?v=1.0.0"></script>
- </body>
- <script>
- var table = null;
- $(document).ready(function () {
- table = $('#table').bootstrapTable("destroy");
- initTable();
- $('.selectpicker').selectpicker({
- liveSearch: true,
- size: 5,
- actionsBox: true,
- selectedTextFormat: 'count > 2'
- });
- initFactorySelect();
- initProductSelect();
- // Bind reset button click event
- $('#resetBtn').on('click', function () {
- reset();
- });
- });
- function queryParams(param) {
- // Get search parameters
- let reprintTime = $.trim($("#reprintTime").val());
- let factoryId = $.trim($("#factoryId").val());
- let productId = $.trim($("#productId").val());
- if (reprintTime) {
- param['reprintTime'] = reprintTime;
- }
- if (factoryId) {
- param['factoryId'] = factoryId;
- }
- if (productId) {
- param['sku'] = productId;
- }
- return param;
- }
- function search() {
- table = $('#table').bootstrapTable("refresh");
- }
- function reset() {
- // Reset form
- $("#reprintTime").val("");
- $("#factoryId").selectpicker('val', '');
- $("#productId").selectpicker('val', '');
- // Refresh table
- table = $('#table').bootstrapTable("refresh");
- }
- // Load factory data (reused from original file)
- function initFactorySelect() {
- $.ajax({
- url: '${ctx}/lineProduct/getFactoryList', // Assuming same endpoint
- type: 'POST',
- dataType: 'json',
- beforeSend: function () {
- $('#factoryId').prop('disabled', true).selectpicker('refresh');
- },
- success: function (res) {
- $('#factoryId').empty();
- if (res.data && res.data.length) {
- res.data.forEach(item => {
- $('#factoryId').append('<option value="' + item.id + '">' + item.factory_name + '</option>');
- });
- }
- $('#factoryId').selectpicker('refresh');
- },
- error: function (xhr) {
- $('#factoryId').empty().append('<option value="">加载失败</option>');
- $('#factoryId').selectpicker('refresh');
- layer.msg('获取工厂数据失败: ' + xhr.statusText);
- },
- complete: function () {
- $('#factoryId').prop('disabled', false).selectpicker('refresh');
- }
- });
- }
- // Load product data (reused from original file)
- function initProductSelect() {
- $.ajax({
- url: '${ctx}/itemNew/getItemAll', // Assuming same endpoint
- type: 'POST',
- dataType: 'json',
- beforeSend: function () {
- $('#productId').prop('disabled', true).selectpicker('refresh');
- },
- success: function (res) {
- $('#productId').empty();
- if (res.data && res.data.length) {
- res.data.forEach(item => {
- $('#productId').append('<option value="' + item.sku + '">' + item.item_name + '</option>');
- });
- }
- $('#productId').selectpicker('refresh');
- },
- error: function (xhr) {
- $('#productId').empty().append('<option value="">加载失败</option>');
- $('#productId').selectpicker('refresh');
- layer.msg('获取产品数据失败: ' + xhr.statusText);
- },
- complete: function () {
- $('#productId').prop('disabled', false).selectpicker('refresh');
- }
- });
- }
- function initTable() {
- table = $('#table').bootstrapTable({
- url: '${ctx}/prodBatch/getReprintRecord', // ** IMPORTANT: Use the new data endpoint **
- method: 'get',
- sortable: true,
- striped: true,
- cache: false,
- pagination: true,
- pageNumber: 1,
- pageSize: 10,
- pageList: [10, 25, 50, 100],
- queryParamsType: '',
- queryParams: queryParams,
- sidePagination: "server",
- strictSearch: false,
- minimumCountColumns: 2,
- clickToSelect: true,
- searchOnEnterKey: true,
- idField: "id", // Assuming there is a unique ID field
- responseHandler: function (res) {
- return {
- total: res.total,
- rows: res.records
- };
- },
- columns: [{
- title: '序号',
- align: 'center',
- formatter: function (value, row, index) {
- var pageNumber = this.pageNumber || 1;
- var pageSize = this.pageSize || 10;
- return (pageNumber - 1) * pageSize + index + 1;
- },
- width: "5%"
- }, {
- field: 'taskOrderNo',
- title: '任务单号',
- align: 'center'
- }, {
- field: 'factoryName',
- title: '工厂名称',
- align: 'center'
- }, {
- field: 'workshopName',
- title: '生产车间',
- align: 'center'
- }, {
- field: 'lineName',
- title: '产线',
- align: 'center'
- }, {
- field: 'productName',
- title: '产品名称',
- align: 'center'
- }, {
- field: 'boxCode',
- title: '箱码',
- align: 'center'
- }, {
- field: 'palletCode',
- title: '托码',
- align: 'center'
- }, {
- field: 'reprintTime',
- title: '补打时间',
- align: 'center'
- }],
- onLoadSuccess: function (data) {
- console.log("数据加载成功", data);
- },
- onLoadError: function () {
- layer.msg('数据加载失败', {icon: 2});
- }
- });
- }
- </script>
- </html>
|