|
@@ -10,10 +10,8 @@
|
|
|
<title>生产任务上传记录</title>
|
|
<title>生产任务上传记录</title>
|
|
|
<meta name="keywords" content="生产任务,上传记录">
|
|
<meta name="keywords" content="生产任务,上传记录">
|
|
|
<meta name="description" content="生产任务上传记录管理页面">
|
|
<meta name="description" content="生产任务上传记录管理页面">
|
|
|
- <!-- 引入Bootstrap CSS -->
|
|
|
|
|
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
|
- <!-- 引入Font Awesome图标 -->
|
|
|
|
|
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
|
|
|
|
|
+ <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/bootstrap-select.min.css" rel="stylesheet">
|
|
|
<link href="${ctx}/css/plugins/bootstrap-table/bootstrap-table.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/animate.css" rel="stylesheet">
|
|
@@ -25,16 +23,86 @@
|
|
|
margin-right: 5px;
|
|
margin-right: 5px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .row.mb-4 {
|
|
|
|
|
+ margin-bottom: 1.5rem;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.form-group {
|
|
.form-group {
|
|
|
margin-bottom: 1.5rem;
|
|
margin-bottom: 1.5rem;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .toggle-switch {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ display: inline-block;
|
|
|
|
|
+ width: 60px;
|
|
|
|
|
+ height: 34px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .toggle-switch input {
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ width: 0;
|
|
|
|
|
+ height: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .slider {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ background-color: #ccc;
|
|
|
|
|
+ transition: .4s;
|
|
|
|
|
+ border-radius: 34px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .slider:before {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ content: "";
|
|
|
|
|
+ height: 26px;
|
|
|
|
|
+ width: 26px;
|
|
|
|
|
+ left: 4px;
|
|
|
|
|
+ bottom: 4px;
|
|
|
|
|
+ background-color: white;
|
|
|
|
|
+ transition: .4s;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ input:checked + .slider {
|
|
|
|
|
+ background-color: #2196F3;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ input:checked + .slider:before {
|
|
|
|
|
+ transform: translateX(26px);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.form-container {
|
|
.form-container {
|
|
|
padding: 20px;
|
|
padding: 20px;
|
|
|
border-radius: 8px;
|
|
border-radius: 8px;
|
|
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .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>
|
|
</style>
|
|
|
</head>
|
|
</head>
|
|
|
|
|
|
|
@@ -54,41 +122,30 @@
|
|
|
<div class="ibox-content">
|
|
<div class="ibox-content">
|
|
|
<div class="row row-lg mb-4">
|
|
<div class="row row-lg mb-4">
|
|
|
<div class="col-lg-12">
|
|
<div class="col-lg-12">
|
|
|
- <form id="searchForm" class="form-horizontal">
|
|
|
|
|
- <div class="row mb-3">
|
|
|
|
|
- <div class="col-sm-3">
|
|
|
|
|
- <label for="createTime" class="form-label">创建时间</label>
|
|
|
|
|
- <input type="date" class="form-control" id="createTime" name="createTime">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-sm-3">
|
|
|
|
|
- <label for="factoryName" class="form-label">工厂名称</label>
|
|
|
|
|
- <input type="text" class="form-control" id="factoryName" name="factoryName" placeholder="请输入工厂名称">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-sm-3">
|
|
|
|
|
- <label for="productName" class="form-label">产品名称</label>
|
|
|
|
|
- <input type="text" class="form-control" id="productName" name="productName" placeholder="请输入产品名称">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-sm-3">
|
|
|
|
|
- <label for="wmsStatus" class="form-label">WMS状态</label>
|
|
|
|
|
- <select class="form-select" id="wmsStatus" name="wmsStatus">
|
|
|
|
|
- <option value="">全部</option>
|
|
|
|
|
- <option value="1">成功</option>
|
|
|
|
|
- <option value="2">失败</option>
|
|
|
|
|
- <option value="3">重试中</option>
|
|
|
|
|
- </select>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="form-inline-flex">
|
|
|
|
|
+ <input type="date" class="form-control" id="createTime" name="createTime" 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>
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-sm-12 text-right">
|
|
|
|
|
- <button type="button" id="searchBtn" class="btn btn-success ms-2" onclick="search();return false;">
|
|
|
|
|
- <i class="fas fa-search"></i> 查询
|
|
|
|
|
- </button>
|
|
|
|
|
- <button type="button" id="resetBtn" class="btn btn-secondary ms-2" onclick="reset();return false;">
|
|
|
|
|
- <i class="fas fa-sync-alt"></i> 重置
|
|
|
|
|
- </button>
|
|
|
|
|
- </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>
|
|
</div>
|
|
|
- </form>
|
|
|
|
|
|
|
+ <select id="wmsStatus" class="form-control" style="width: 120px; flex-shrink: 0; margin-right: 10px; margin-bottom: 5px;">
|
|
|
|
|
+ <option value="">全部</option>
|
|
|
|
|
+ <option value="1">成功</option>
|
|
|
|
|
+ <option value="2">失败</option>
|
|
|
|
|
+ <option value="3">重试中</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <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>
|
|
</div>
|
|
|
<div class="row row-lg mt-3">
|
|
<div class="row row-lg mt-3">
|
|
@@ -103,9 +160,8 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 全局js -->
|
|
<!-- 全局js -->
|
|
|
-<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
|
|
|
-<!-- 引入Bootstrap JS -->
|
|
|
|
|
-<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
|
|
|
|
|
|
+<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/bootstrap-select.min.js"></script>
|
|
|
<!-- jQuery Validation plugin javascript-->
|
|
<!-- jQuery Validation plugin javascript-->
|
|
|
<script src="${ctx}/js/plugins/validate/jquery.validate.min.js"></script>
|
|
<script src="${ctx}/js/plugins/validate/jquery.validate.min.js"></script>
|
|
@@ -125,23 +181,35 @@
|
|
|
$(document).ready(function () {
|
|
$(document).ready(function () {
|
|
|
table = $('#table').bootstrapTable("destroy");
|
|
table = $('#table').bootstrapTable("destroy");
|
|
|
initTable();
|
|
initTable();
|
|
|
|
|
+ $('.selectpicker').selectpicker({
|
|
|
|
|
+ liveSearch: true,
|
|
|
|
|
+ size: 5,
|
|
|
|
|
+ actionsBox: true,
|
|
|
|
|
+ selectedTextFormat: 'count > 2'
|
|
|
|
|
+ });
|
|
|
|
|
+ initFactorySelect();
|
|
|
|
|
+ initProductSelect();
|
|
|
|
|
+ // 绑定重置按钮点击事件
|
|
|
|
|
+ $('#resetBtn').on('click', function () {
|
|
|
|
|
+ reset();
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
function queryParams(param) {
|
|
function queryParams(param) {
|
|
|
// 获取查询参数
|
|
// 获取查询参数
|
|
|
let createTime = $.trim($("#createTime").val());
|
|
let createTime = $.trim($("#createTime").val());
|
|
|
- let factoryName = $.trim($("#factoryName").val());
|
|
|
|
|
- let productName = $.trim($("#productName").val());
|
|
|
|
|
|
|
+ let factoryId = $.trim($("#factoryId").val());
|
|
|
|
|
+ let productId = $.trim($("#productId").val());
|
|
|
let wmsStatus = $.trim($("#wmsStatus").val());
|
|
let wmsStatus = $.trim($("#wmsStatus").val());
|
|
|
|
|
|
|
|
if (createTime) {
|
|
if (createTime) {
|
|
|
param['createTime'] = createTime;
|
|
param['createTime'] = createTime;
|
|
|
}
|
|
}
|
|
|
- if (factoryName) {
|
|
|
|
|
- param['factoryName'] = factoryName;
|
|
|
|
|
|
|
+ if (factoryId) {
|
|
|
|
|
+ param['factoryId'] = factoryId;
|
|
|
}
|
|
}
|
|
|
- if (productName) {
|
|
|
|
|
- param['productName'] = productName;
|
|
|
|
|
|
|
+ if (productId) {
|
|
|
|
|
+ param['productId'] = productId;
|
|
|
}
|
|
}
|
|
|
if (wmsStatus) {
|
|
if (wmsStatus) {
|
|
|
param['wmsStatus'] = wmsStatus;
|
|
param['wmsStatus'] = wmsStatus;
|
|
@@ -151,14 +219,18 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function search() {
|
|
function search() {
|
|
|
- table = $('#table').bootstrapTable("destroy");
|
|
|
|
|
- initTable();
|
|
|
|
|
|
|
+ table = $('#table').bootstrapTable("refresh");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function reset() {
|
|
function reset() {
|
|
|
- $("#searchForm")[0].reset();
|
|
|
|
|
- table = $('#table').bootstrapTable("destroy");
|
|
|
|
|
- initTable();
|
|
|
|
|
|
|
+ // 重置表单
|
|
|
|
|
+ $("#createTime").val("");
|
|
|
|
|
+ $("#factoryId").selectpicker('val', '');
|
|
|
|
|
+ $("#productId").selectpicker('val', '');
|
|
|
|
|
+ $("#wmsStatus").val("");
|
|
|
|
|
+
|
|
|
|
|
+ // 刷新表格
|
|
|
|
|
+ table = $('#table').bootstrapTable("refresh");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function reupload(id) {
|
|
function reupload(id) {
|
|
@@ -174,31 +246,90 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function initTable() {
|
|
|
|
|
- // 模拟数据
|
|
|
|
|
- var mockData = generateMockData();
|
|
|
|
|
|
|
+ // 加载工厂数据
|
|
|
|
|
+ function initFactorySelect() {
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: '${ctx}/lineProduct/getFactoryList',
|
|
|
|
|
+ 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');
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ // 加载产品数据
|
|
|
|
|
+ function initProductSelect() {
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: '${ctx}/lineProduct/getProductList',
|
|
|
|
|
+ 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.id + '">' + item.product_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({
|
|
table = $('#table').bootstrapTable({
|
|
|
- data: mockData,
|
|
|
|
|
|
|
+ url: '${ctx}/prodBatch/getProdUploadRecord',
|
|
|
method: 'get',
|
|
method: 'get',
|
|
|
sortable: true,
|
|
sortable: true,
|
|
|
- toolbar: '#toolbar', //工具按钮用哪个容器
|
|
|
|
|
- striped: true, //是否显示行间隔色
|
|
|
|
|
- cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
|
|
|
|
|
- pagination: true, //是否显示分页(*)
|
|
|
|
|
- pageNumber: 1, //初始化加载第一页,默认第一页
|
|
|
|
|
- pageSize: 10, //每页的记录行数(*)
|
|
|
|
|
- pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
|
|
|
|
|
- queryParamsType: '', //默认值为 'limit' ,在默认情况下 传给服务端的参数为:offset,limit,sort
|
|
|
|
|
- // 设置为 '' 在这种情况下传给服务器的参数为:pageSize,pageNumber
|
|
|
|
|
- queryParams: queryParams,//前端调用服务时,会默认传递上边提到的参数,如果需要添加自定义参数,可以自定义一个函数返回请求参数
|
|
|
|
|
- sidePagination: "client", //客户端分页
|
|
|
|
|
|
|
+ toolbar: '#toolbar',
|
|
|
|
|
+ striped: true,
|
|
|
|
|
+ cache: false,
|
|
|
|
|
+ pagination: true,
|
|
|
|
|
+ pageNumber: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ pageList: [10, 25, 50, 100],
|
|
|
|
|
+ queryParamsType: '',
|
|
|
|
|
+ queryParams: queryParams,
|
|
|
|
|
+ sidePagination: "server",
|
|
|
strictSearch: false,
|
|
strictSearch: false,
|
|
|
- minimumCountColumns: 2, //最少允许的列数
|
|
|
|
|
- clickToSelect: true, //是否启用点击选中行
|
|
|
|
|
|
|
+ minimumCountColumns: 2,
|
|
|
|
|
+ clickToSelect: true,
|
|
|
searchOnEnterKey: true,
|
|
searchOnEnterKey: true,
|
|
|
idField: "id",
|
|
idField: "id",
|
|
|
- paginationDetailHAlign: 'right', // 将分页详细信息放在右边
|
|
|
|
|
|
|
+ responseHandler: function (res) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ total: res.total,
|
|
|
|
|
+ rows: res.records
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
columns: [{
|
|
columns: [{
|
|
|
field: 'checkbox',
|
|
field: 'checkbox',
|
|
|
title: '<input type="checkbox" id="checkAll">',
|
|
title: '<input type="checkbox" id="checkAll">',
|
|
@@ -214,7 +345,6 @@
|
|
|
title: '序号',
|
|
title: '序号',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
formatter: function (value, row, index) {
|
|
formatter: function (value, row, index) {
|
|
|
- // 使用this关键字访问表格实例
|
|
|
|
|
var pageNumber = this.pageNumber || 1;
|
|
var pageNumber = this.pageNumber || 1;
|
|
|
var pageSize = this.pageSize || 10;
|
|
var pageSize = this.pageSize || 10;
|
|
|
return (pageNumber - 1) * pageSize + index + 1;
|
|
return (pageNumber - 1) * pageSize + index + 1;
|
|
@@ -231,7 +361,12 @@
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
width: "15%"
|
|
width: "15%"
|
|
|
}, {
|
|
}, {
|
|
|
- field: 'batchNumber',
|
|
|
|
|
|
|
+ field: 'productName',
|
|
|
|
|
+ title: '产品名称',
|
|
|
|
|
+ align: 'center',
|
|
|
|
|
+ width: "15%"
|
|
|
|
|
+ }, {
|
|
|
|
|
+ field: 'batchNo',
|
|
|
title: '批次号',
|
|
title: '批次号',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
width: "15%"
|
|
width: "15%"
|
|
@@ -257,23 +392,25 @@
|
|
|
title: 'WMS状态',
|
|
title: 'WMS状态',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
formatter: function (value) {
|
|
formatter: function (value) {
|
|
|
- if (value === 1) {
|
|
|
|
|
- return '<span class="badge bg-success">成功</span>';
|
|
|
|
|
- } else if (value === 2) {
|
|
|
|
|
- return '<span class="badge bg-danger">失败</span>';
|
|
|
|
|
- } else if (value === 3) {
|
|
|
|
|
- return '<span class="badge bg-warning">重试中</span>';
|
|
|
|
|
|
|
+ // 修复:后端返回的是字符串,需要使用字符串比较
|
|
|
|
|
+ if (value === '1') {
|
|
|
|
|
+ return '<span class="label label-success">成功</span>';
|
|
|
|
|
+ } else if (value === '2') {
|
|
|
|
|
+ return '<span class="label label-danger">失败</span>';
|
|
|
|
|
+ } else if (value === '3') {
|
|
|
|
|
+ return '<span class="label label-warning">重试中</span>';
|
|
|
} else {
|
|
} else {
|
|
|
return '-';
|
|
return '-';
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
width: "10%"
|
|
width: "10%"
|
|
|
}, {
|
|
}, {
|
|
|
- field: 'transferredToPlatform',
|
|
|
|
|
|
|
+ field: 'isUpload',
|
|
|
title: '已传到平台',
|
|
title: '已传到平台',
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
formatter: function (value) {
|
|
formatter: function (value) {
|
|
|
- if (value === 1) {
|
|
|
|
|
|
|
+ // 修复:后端返回的是字符串,需要使用字符串比较
|
|
|
|
|
+ if (value === '1') {
|
|
|
return '<span class="label label-success">是</span>';
|
|
return '<span class="label label-success">是</span>';
|
|
|
} else {
|
|
} else {
|
|
|
return '<span class="label label-danger">否</span>';
|
|
return '<span class="label label-danger">否</span>';
|
|
@@ -285,8 +422,8 @@
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
width: "10%",
|
|
width: "10%",
|
|
|
formatter: function (value, row) {
|
|
formatter: function (value, row) {
|
|
|
- // 只有失败和重试中可以重传
|
|
|
|
|
- if (row.wmsStatus === 2 || row.wmsStatus === 3) {
|
|
|
|
|
|
|
+ // 修复:后端返回的是字符串,需要使用字符串比较
|
|
|
|
|
+ if (row.wmsStatus === '2' || row.wmsStatus === '3') {
|
|
|
return '<button class="btn btn-primary btn-sm" onclick="reupload(' + row.id + ')">重传</button>';
|
|
return '<button class="btn btn-primary btn-sm" onclick="reupload(' + row.id + ')">重传</button>';
|
|
|
} else {
|
|
} else {
|
|
|
return '-';
|
|
return '-';
|
|
@@ -309,33 +446,5 @@
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // 生成模拟数据
|
|
|
|
|
- function generateMockData() {
|
|
|
|
|
- var factories = ['金华工厂', '杭州工厂', '上海工厂', '苏州工厂', '广州工厂'];
|
|
|
|
|
- var lines = ['A线', 'B线', 'C线', 'D线', 'E线'];
|
|
|
|
|
- var products = ['食品A', '食品B', '食品C', '食品D', '食品E'];
|
|
|
|
|
- var mockData = [];
|
|
|
|
|
-
|
|
|
|
|
- for (var i = 1; i <= 50; i++) {
|
|
|
|
|
- var wmsStatus = Math.floor(Math.random() * 3) + 1; // 1-3
|
|
|
|
|
- var date = new Date();
|
|
|
|
|
- date.setDate(date.getDate() - Math.floor(Math.random() * 30));
|
|
|
|
|
- var formattedDate = date.toISOString().split('T')[0];
|
|
|
|
|
-
|
|
|
|
|
- mockData.push({
|
|
|
|
|
- id: i,
|
|
|
|
|
- factoryName: factories[Math.floor(Math.random() * factories.length)],
|
|
|
|
|
- lineName: '产线' + lines[Math.floor(Math.random() * lines.length)],
|
|
|
|
|
- batchNumber: 'BAT' + Date.now().toString().slice(-6) + i,
|
|
|
|
|
- transferredToDataCenter: Math.floor(Math.random() * 2), // 0或1
|
|
|
|
|
- createTime: formattedDate,
|
|
|
|
|
- wmsStatus: wmsStatus,
|
|
|
|
|
- transferredToPlatform: Math.floor(Math.random() * 2) // 0或1
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return mockData;
|
|
|
|
|
- }
|
|
|
|
|
</script>
|
|
</script>
|
|
|
</html>
|
|
</html>
|