812 lines
33 KiB
Plaintext
812 lines
33 KiB
Plaintext
<%@ page language="java" pageEncoding="UTF-8"%>
|
||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
||
|
||
|
||
<!DOCTYPE html>
|
||
<!-- <html lang="zh-CN"> -->
|
||
<!-- BEGIN HEAD -->
|
||
|
||
<head>
|
||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||
<meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1" />
|
||
<title>
|
||
<%= ServerObject.atttable.get("TOPTITLE")%>
|
||
</title>
|
||
<!-- 引用页头及CSS页-->
|
||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||
|
||
<!-- 引入daterangepicker-->
|
||
<link rel="stylesheet"
|
||
href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css" />
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||
charset="utf-8"></script>
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||
charset="utf-8"></script>
|
||
<!--bootstrap-edittable 表格行内编辑 -->
|
||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-editable/css/bootstrap-editable.css"/>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-editable.js" charset="utf-8"></script>
|
||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-editable/js/bootstrap-table-editable.js" charset="utf-8"></script>
|
||
<!-- 引入viewer.js-->
|
||
<link rel="stylesheet"
|
||
href="<%=request.getContextPath()%>/node_modules/viewer-js/viewer.min.css" />
|
||
<script type="text/javascript"
|
||
src="<%=request.getContextPath()%>/node_modules/viewer-js/viewer.min.js"
|
||
charset="utf-8"></script>
|
||
<style type="text/css">
|
||
.modal-full {
|
||
width: 100%;
|
||
margin: 0;
|
||
}
|
||
|
||
.viewer{
|
||
margin: 0;
|
||
padding: 0;
|
||
min-height: 470px;
|
||
}
|
||
.viewer>li{
|
||
overflow: hidden;
|
||
width: calc(100% / 2);
|
||
float: left;
|
||
cursor: pointer;
|
||
padding: 0 1px;
|
||
}
|
||
.viewer>li>img{
|
||
width: 100%;
|
||
}
|
||
</style>
|
||
|
||
<script type="text/javascript">
|
||
|
||
let modelIp = "${modelIp}";
|
||
var beginTimeStore = '';
|
||
var endTimeStore = '';
|
||
|
||
function initDate() {
|
||
//定义locale汉化插件
|
||
beginTimeStore = moment().subtract(30, 'days').format('YYYY-MM-DD') + ' 00:00';
|
||
endTimeStore = moment().subtract(0, 'days').format('YYYY-MM-DD') + ' 23:59';
|
||
var locale = {
|
||
"format": 'YYYY-MM-DD HH:mm',
|
||
"separator": " ~ ",
|
||
"applyLabel": "确定",
|
||
"cancelLabel": "取消",
|
||
"fromLabel": "起始时间",
|
||
"toLabel": "结束时间'",
|
||
"customRangeLabel": "自定义",
|
||
"weekLabel": "W",
|
||
"daysOfWeek": ["日", "一", "二", "三", "四", "五", "六"],
|
||
"monthNames": ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
|
||
"firstDay": 1
|
||
};
|
||
$('#reservationtime').daterangepicker({
|
||
"timePicker": true,
|
||
"timePicker24Hour": true,
|
||
"linkedCalendars": false,
|
||
"autoUpdateInput": false,
|
||
"timePickerIncrement": 10,
|
||
"locale": locale,
|
||
//汉化按钮部分
|
||
ranges: {
|
||
// '今日': [moment(), moment().subtract(-1, 'days')],
|
||
'昨日': [moment().subtract(1, 'days'), moment()],
|
||
'最近7日': [moment().subtract(6, 'days'), moment().subtract(-1, 'days')],
|
||
'本月': [moment().startOf('month'), moment().endOf('month').subtract(-1, 'days')],
|
||
'上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month').subtract(-1, 'days')]
|
||
},
|
||
startDate: beginTimeStore,
|
||
endDate: endTimeStore
|
||
}, function (start, end, label) {
|
||
beginTimeStore = start.format(this.locale.format);
|
||
endTimeStore = end.format(this.locale.format);
|
||
if (!this.startDate) {
|
||
this.element.val('');
|
||
} else {
|
||
this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
|
||
}
|
||
});
|
||
$('#reservationtime').val(beginTimeStore + locale.separator + endTimeStore);
|
||
};
|
||
var dosearch = function() {
|
||
$("#table").bootstrapTable('refresh');
|
||
$("#table_fitting").bootstrapTable('refresh');
|
||
};
|
||
|
||
var companyId = "";
|
||
var goodsNames = [];
|
||
$(function() {
|
||
initDate();
|
||
initFun();
|
||
goodsList();
|
||
});
|
||
|
||
function goodsList(){
|
||
$.ajax({
|
||
type: 'GET',
|
||
url: ext.contextPath + '/sparepart/goods/getList.do',
|
||
dataType: 'json',
|
||
data: {
|
||
rows: 1000, // 每页要显示的数据条数
|
||
page: 1, // 每页显示数据的开始页码
|
||
className: "地磅",
|
||
},
|
||
error: function () {
|
||
initFun_fitting();
|
||
return false;
|
||
},
|
||
success: function (data) {
|
||
var total = data.total;
|
||
if(total>0){
|
||
seriesdata = [];
|
||
var rows = data.rows;
|
||
$.each(rows,function(index,value){
|
||
let goods = {value:value.name,text:value.name}
|
||
goodsNames.push(goods);
|
||
});
|
||
}
|
||
initFun_fitting();
|
||
}
|
||
});
|
||
}
|
||
var initFun = function(){
|
||
|
||
$("#table").bootstrapTable({ // 对应table标签的id
|
||
url: "http://"+modelIp + "/work/weighingData/getList.do", // 获取表格数据的url
|
||
contentType : null,
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||
pageSize: 10, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
startDateStr: beginTimeStore,
|
||
endDateStr: endTimeStore,
|
||
carNumber: $('#search_name').val(),
|
||
errorCode: $('#errorCode').val(),
|
||
}
|
||
},
|
||
sortName: 'gross_weight_time', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
/*checkbox: true, // 显示一个勾选框
|
||
},{*/
|
||
field: 'serialNo', // 返回json数据中的name
|
||
title: '流水号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'grossWeightTime', // 返回json数据中的name
|
||
title: '称重日期', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter:function (value, row, index){
|
||
return value.substring(0,16);
|
||
},
|
||
},{
|
||
field: 'grossWeight', // 返回json数据中的name
|
||
title: '称重', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'IOType', // 返回json数据中的name
|
||
title: '进/出', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
editable: {
|
||
type: 'select',
|
||
title: '进/出',
|
||
source:[{value:1,text:'进'},{value:2,text:'出'},{value:3,text:'未知'}],
|
||
display: function(value) {
|
||
let text = "未知";
|
||
if (value==1) {
|
||
text = "进";
|
||
}
|
||
if (value==2){
|
||
text = "出";
|
||
}
|
||
$(this).text(text);
|
||
}
|
||
},
|
||
},{
|
||
field: 'carNumber', // 返回json数据中的name
|
||
title: '车牌号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
editable: { //编辑列元素
|
||
type: 'text',
|
||
title: '车牌号',
|
||
validate: function (v) {
|
||
if (!v) return '车牌号不能为空';
|
||
}
|
||
}
|
||
},{
|
||
field: 'errorCode', // 返回json数据中的name
|
||
title: '车牌状态', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index){
|
||
if(value){
|
||
return "未识别";
|
||
}else{
|
||
return "已识别";
|
||
}
|
||
}
|
||
}, {
|
||
field: 'isUse', // 返回json数据中的name
|
||
title: '是否拟合', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index) {
|
||
if (value == '1') {
|
||
return "已拟合";
|
||
} else {
|
||
return "未拟合";
|
||
}
|
||
}
|
||
},{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 160, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
var buts= '';
|
||
buts+= '<button class="btn btn-default btn-sm" title="图片" onclick="getimg(\'' + row.serialNo + '\')">图片</button>';
|
||
buts+= '<button class="btn btn-default btn-sm" title="识别" onclick="getCarNumber(\'' + row.serialNo + '\')">识别</button>';
|
||
buts+= '<button class="btn btn-default btn-sm" title="拟合" onclick="fitting(\'' + row.serialNo + '\',\'' + row.IOType + '\')">拟合</button>';
|
||
buts='<div class="btn-group" >'+buts+'</div>';
|
||
return buts;
|
||
}
|
||
}
|
||
],
|
||
//保存列修改后的数据
|
||
onEditableSave: function (field, row, oldValue, $el) {
|
||
$.post("http://"+modelIp + "/work/weighingData/doUpdate.do", {serialNo:row.serialNo,carNumber:row.carNumber,IOType:row.IOType
|
||
}, function(data) {
|
||
if (data.res == 1){
|
||
$("#table").bootstrapTable('refresh');
|
||
}else if(data.res == 0){
|
||
showAlert('d','修改失败','mainAlertdiv');
|
||
}else{
|
||
showAlert('d',data.res,'mainAlertdiv');
|
||
}
|
||
},'json');
|
||
},
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
console.info("加载数据失败");
|
||
}
|
||
});
|
||
}
|
||
var initFun_fitting = function(){
|
||
|
||
$("#table_fitting").bootstrapTable({ // 对应table标签的id
|
||
url: "http://"+modelIp + "/work/weighingSaveData/getList.do", // 获取表格数据的url
|
||
contentType : null,
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||
pageSize: 10, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
startDateStr: beginTimeStore,
|
||
endDateStr: endTimeStore,
|
||
carNumber: $('#search_name').val(),
|
||
goodsName: $('#goodsName').val(),
|
||
}
|
||
},
|
||
sortName: 'i_weight_time', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
checkbox: true, // 显示一个勾选框
|
||
},{
|
||
field: 'goodsName', // 返回json数据中的name
|
||
title: '物品名称', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
editable: {
|
||
type: 'select',
|
||
title: '物品名称',
|
||
source:goodsNames
|
||
}
|
||
},{
|
||
field: 'carNumber', // 返回json数据中的name
|
||
title: '车牌号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'IWeightTime', // 返回json数据中的name
|
||
title: '来料时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter:function (value, row, index){
|
||
return value.substring(0,16);
|
||
},
|
||
},{
|
||
field: 'weight', // 返回json数据中的name
|
||
title: '来料重量', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter:function (value, row, index){
|
||
return Math.abs(value);
|
||
},
|
||
},{
|
||
field: 'OWeightTime', // 返回json数据中的name
|
||
title: '出厂时间', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter:function (value, row, index){
|
||
return value.substring(0,16);
|
||
},
|
||
},{
|
||
field: 'carType', // 返回json数据中的name
|
||
title: '车辆类型', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
editable: { //编辑列元素
|
||
type: 'text',
|
||
title: '车辆类型',
|
||
validate: function (v) {
|
||
if (!v) return '车辆类型不能为空';
|
||
}
|
||
}
|
||
}
|
||
],
|
||
//保存列修改后的数据
|
||
onEditableSave: function (field, row, oldValue, $el) {
|
||
$.post("http://"+modelIp + "/work/weighingSaveData/doUpdate.do", {id:row.id,carType:row.carType,goodsName:row.goodsName
|
||
}, function(data) {
|
||
if (data.res == 1){
|
||
$("#table_fitting").bootstrapTable('refresh');
|
||
}else if(data.res == 0){
|
||
showAlert('d','修改失败','fittingAlertdiv');
|
||
}else{
|
||
showAlert('d',data.res,'fittingAlertdiv');
|
||
}
|
||
},'json');
|
||
},
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table_fitting");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
showAlert('d',"加载数据失败",'fittingAlertdiv');
|
||
console.info("加载数据失败");
|
||
}
|
||
});
|
||
}
|
||
|
||
var viewer = null;
|
||
function getimg(serialNo) {
|
||
$('#img-serialNo').html(serialNo);
|
||
$.ajax({
|
||
type: 'GET',
|
||
url: "http://"+modelIp + "/work/weighingData/doView.do",
|
||
dataType: 'json',
|
||
data: {
|
||
serialNo: serialNo,
|
||
},
|
||
error: function () {
|
||
showAlert('d','获取照片失败','mainAlertdiv');
|
||
},
|
||
success: function (datas) {
|
||
if(datas.length>0){
|
||
var data = datas[0];
|
||
/*$("#img13").attr("src", "data:image/jpeg;base64,"+data.weighingPictures13);
|
||
$("#img14").attr("src", "data:image/jpeg;base64,"+data.weighingPictures14);*/
|
||
let str = '<li><img data-original="data:image/jpeg;base64,'+data.weighingPictures13+'" src="data:image/jpeg;base64,'+data.weighingPictures13+'" alt="图片1"></li>' +
|
||
'<li><img data-original="data:image/jpeg;base64,'+data.weighingPictures14+'" src="data:image/jpeg;base64,'+data.weighingPictures14+'" alt="图片2"></li>';
|
||
$('#viewer').html(str);
|
||
|
||
if (viewer) {
|
||
viewer.destroy();
|
||
}
|
||
viewer = new Viewer(document.getElementById('viewer'), {
|
||
url: 'data-original',
|
||
fullscreen: false,
|
||
});
|
||
/*$('#viewer').viewer({
|
||
url: 'data-original'
|
||
});*/
|
||
}
|
||
|
||
stopBubbleDefaultEvent();
|
||
|
||
openModal('imgModal');
|
||
}
|
||
});
|
||
}
|
||
function getCarNumber(serialNo) {
|
||
$('#img-serialNo').html(serialNo);
|
||
$.ajax({
|
||
type: 'GET',
|
||
url: "http://"+modelIp + "/work/weighingData/run.do",
|
||
dataType: 'json',
|
||
data: {
|
||
serialNo: serialNo,
|
||
},
|
||
error: function () {
|
||
showAlert('d','识别失败','mainAlertdiv');
|
||
},
|
||
success: function (data) {
|
||
if (data.res == 1){
|
||
showAlert('s',data.msg,'mainAlertdiv');
|
||
$("#table").bootstrapTable('refresh');
|
||
}else {
|
||
showAlert('d',data.msg,'mainAlertdiv');
|
||
}
|
||
}
|
||
});
|
||
}
|
||
function fitting(serialNo,IOType) {
|
||
if(IOType==1 || IOType==2){
|
||
$("#table_grossWeight").bootstrapTable('destroy'); //加载前先销毁
|
||
$("#table_grossWeight").bootstrapTable({ // 对应table标签的id
|
||
url: "http://"+modelIp + "/work/weighingData/getList.do", // 获取表格数据的url
|
||
contentType : null,
|
||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||
striped: true, //表格显示条纹,默认为false
|
||
pagination: true, // 在表格底部显示分页组件,默认false
|
||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
||
pageSize: 10, // 页面数据条数
|
||
pageNumber: 1, // 首页页码
|
||
sidePagination: 'server', // 设置为服务器端分页
|
||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||
return {
|
||
rows: params.limit, // 每页要显示的数据条数
|
||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||
sort: params.sort, // 要排序的字段
|
||
order: params.order,
|
||
serialNo: serialNo,
|
||
}
|
||
},
|
||
sortName: 'gross_weight_time', // 要排序的字段
|
||
sortOrder: 'desc', // 排序规则
|
||
columns: [
|
||
{
|
||
checkbox: true, // 显示一个勾选框
|
||
},{
|
||
field: 'serialNo', // 返回json数据中的name
|
||
title: '流水号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'grossWeightTime', // 返回json数据中的name
|
||
title: '称重日期', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter:function (value, row, index){
|
||
return value.substring(0,16);
|
||
},
|
||
},{
|
||
field: 'grossWeight', // 返回json数据中的name
|
||
title: '称重', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle' // 上下居中
|
||
},{
|
||
field: 'IOType', // 返回json数据中的name
|
||
title: '进/出', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index){
|
||
let text = "未知";
|
||
if (value==1) {
|
||
text = "进";
|
||
}
|
||
if (value==2){
|
||
text = "出";
|
||
}
|
||
return text;
|
||
}
|
||
},{
|
||
field: 'carNumber', // 返回json数据中的name
|
||
title: '车牌号', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
},{
|
||
field: 'errorCode', // 返回json数据中的name
|
||
title: '车牌状态', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index){
|
||
if(value){
|
||
return "未识别";
|
||
}else{
|
||
return "已识别";
|
||
}
|
||
}
|
||
},{
|
||
field: 'isUse', // 返回json数据中的name
|
||
title: '是否拟合', // 表格表头显示文字
|
||
align: 'center', // 左右居中
|
||
valign: 'middle', // 上下居中
|
||
formatter: function (value, row, index){
|
||
if(value == '1'){
|
||
return "已拟合";
|
||
}else{
|
||
return "未拟合";
|
||
}
|
||
}
|
||
},{
|
||
title: "操作",
|
||
align: 'center',
|
||
valign: 'middle',
|
||
width: 120, // 定义列的宽度,单位为像素px
|
||
formatter: function (value, row, index) {
|
||
var buts= '';
|
||
buts+= '<button class="btn btn-default btn-sm" title="选择" onclick="doNewSaveData(\'' + serialNo + '\',\'' + row.serialNo + '\')">' +
|
||
'<i class="fa fa-check"></i><span class="hidden-md hidden-lg">选择</span></button>';
|
||
buts='<div class="btn-group" >'+buts+'</div>';
|
||
return buts;
|
||
}
|
||
}
|
||
],
|
||
onLoadSuccess: function(){ //加载成功时执行
|
||
adjustBootstrapTableView("table_grossWeight");
|
||
},
|
||
onLoadError: function(){ //加载失败时执行
|
||
showAlert('d',"加载数据失败",'grossAlertdiv');
|
||
console.info("加载数据失败");
|
||
}
|
||
});
|
||
stopBubbleDefaultEvent();
|
||
openModal('fittingModal');
|
||
}else {
|
||
showAlert('d','未明确进/出,无法拟合。','mainAlertdiv');
|
||
return false;
|
||
}
|
||
}
|
||
function doNewSaveData(serialNo01,serialNo02) {
|
||
$.ajax({
|
||
type: 'GET',
|
||
url: "http://"+modelIp + "/work/weighingData/doNewSaveData.do",
|
||
dataType: 'json',
|
||
data: {
|
||
serialNo01: serialNo01,
|
||
serialNo02: serialNo02,
|
||
},
|
||
error: function () {
|
||
showAlert('d','接口错误','grossAlertdiv');
|
||
},
|
||
success: function (data) {
|
||
if(data.res>0){
|
||
showAlert('s',data.msg,'grossAlertdiv');
|
||
closeModal('subModal');
|
||
dosearch();
|
||
}else{
|
||
showAlert('d',data.msg,'grossAlertdiv');
|
||
}
|
||
}
|
||
});
|
||
}
|
||
var websocket = null;
|
||
//判断当前浏览器是否支持WebSocket
|
||
if ('WebSocket' in window) {
|
||
websocket = new ReconnectingWebSocket("ws://"+modelIp + "/WeighingSocket/");
|
||
} else {
|
||
console.info('当前浏览器 Not support websocket')
|
||
}
|
||
|
||
//连接发生错误的回调方法
|
||
websocket.onerror = function () {
|
||
};
|
||
|
||
//连接成功建立的回调方法
|
||
websocket.onopen = function () {
|
||
console.info('地磅websocker开启');
|
||
}
|
||
|
||
//接收到消息的回调方法
|
||
websocket.onmessage = function (event) {
|
||
let str = '<div class="alert alert-warning alert-dismissible">' +
|
||
'<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>' +
|
||
' <h4><i class="icon fa fa-warning"></i> ' + event.data+'<button class="btn btn-danger btn-sm" title="刷新" onclick="doRenovate()">刷新</button></h4>' +
|
||
'</div>';
|
||
$('#subDiv').html(str);
|
||
}
|
||
|
||
//连接关闭的回调方法
|
||
websocket.onclose = function () {
|
||
console.info('地磅websocker关闭');
|
||
closeWebSocket();
|
||
}
|
||
|
||
//监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。
|
||
window.onbeforeunload = function () {
|
||
closeWebSocket();
|
||
}
|
||
|
||
//关闭WebSocket连接
|
||
function closeWebSocket() {
|
||
websocket.close();
|
||
}
|
||
function doRenovate(){
|
||
location.reload(true);
|
||
}
|
||
function showErrorCode(){
|
||
$('#errorCodeElem').show();
|
||
$('#goodsNameElem').hide();
|
||
|
||
$('#excelElem').hide();
|
||
}
|
||
function hideErrorCode(){
|
||
$('#errorCodeElem').hide();
|
||
$('#goodsNameElem').show();
|
||
$('#excelElem').show();
|
||
}
|
||
function doExcel(){
|
||
var checkedItems = $("#table_fitting").bootstrapTable('getSelections');
|
||
var datas = "";
|
||
$.each(checkedItems, function (index, item) {
|
||
datas += item.id + ",";
|
||
});
|
||
if (datas == "") {
|
||
swal({
|
||
text: "未检测到勾选内容,您确定要全部导出吗?",
|
||
dangerMode: true,
|
||
buttons: {
|
||
cancel: {
|
||
text: "取消",
|
||
value: null,
|
||
visible: true,
|
||
className: "btn btn-default btn-sm",
|
||
closeModal: true,
|
||
},
|
||
confirm: {
|
||
text: "确定",
|
||
value: true,
|
||
visible: true,
|
||
className: "btn btn-danger btn-sm",
|
||
closeModal: true
|
||
}
|
||
}
|
||
}).then(function (willDelete) {
|
||
if (willDelete) {
|
||
window.open("http://"+modelIp + "/work/weighingSaveData/downloadExcel.do?startDateStr="+beginTimeStore+"&endDateStr="+endTimeStore+"&carNumber="+$('#search_name').val()+"&goodsName="+$('#goodsName').val());
|
||
}
|
||
});
|
||
} else {
|
||
window.open("http://"+modelIp + "/work/weighingSaveData/downloadExcel.do?ids="+datas);
|
||
}
|
||
}
|
||
|
||
</script>
|
||
|
||
</head>
|
||
<body class="hold-transition ${cu.themeclass} sidebar-mini">
|
||
<div class="wrapper">
|
||
<div class="content-wrapper">
|
||
<input type="hidden" name="jsp_id" id="jsp_id" value="waterQualityModel">
|
||
<!-- Main content -->
|
||
<section class="content container-fluid">
|
||
<div id="subDiv"></div>
|
||
<div id="subEditDiv"></div>
|
||
<div id="subDetailDiv"></div>
|
||
<div id="PRDetail4SelectsDiv"></div>
|
||
<div id="user4SelectDiv"></div>
|
||
<div id="Goods4SelectsDiv"></div>
|
||
<div id="fileInputDiv"></div>
|
||
<div id="goodsAddDiv"></div>
|
||
<div id="equ4SelectDiv"></div>
|
||
<div id="fault4SelectDiv"></div>
|
||
<div class="nav-tabs-custom">
|
||
<ul class="nav nav-tabs">
|
||
<li class="active"><a href="#tab_1" data-toggle="tab" onclick="showErrorCode()">称重数据</a></li>
|
||
<li><a href="#tab_2" data-toggle="tab" onclick="hideErrorCode()">拟合数据</a></li>
|
||
<li class="pull-right">
|
||
<a href="#" class="text-muted">
|
||
<form id="searchForm">
|
||
<div class="input-group pull-left input-group-sm" style="margin-right: 10px" id="errorCodeElem">
|
||
<label style="padding-top:5px">识别情况:</label>
|
||
<select id="errorCode" class="form-control select2 pull-right" style="width:80px" onchange="dosearch();">
|
||
<option selected value="">全部</option>
|
||
<option value="0">已识别</option>
|
||
<option value="1">未识别</option>
|
||
</select>
|
||
</div>
|
||
<div class="input-group pull-left input-group-sm" style="margin-right: 10px;width: 50px;display: none" id="excelElem">
|
||
<div class="input-group-btn">
|
||
<button class="btn btn-default" onclick="doExcel();">导出</button>
|
||
</div>
|
||
</div>
|
||
<div class="input-group pull-left input-group-sm" style="margin-right: 10px">
|
||
<label style="padding-top:5px">时间范围:</label>
|
||
<input type="text" class="form-control pull-right" id="reservationtime" style="width:240px">
|
||
</div>
|
||
<div class="input-group pull-left input-group-sm" style="width: 250px;display: none" id="goodsNameElem">
|
||
<input type="text" id="goodsName" name="goodsName" class="form-control pull-right" placeholder="物品">
|
||
</div>
|
||
<div class="input-group pull-left input-group-sm" style="width: 250px;">
|
||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="车牌号">
|
||
<div class="input-group-btn">
|
||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
<div class="tab-content">
|
||
<div class="tab-pane active" id="tab_1">
|
||
<div id="mainAlertdiv"></div>
|
||
<table id="table"></table>
|
||
</div>
|
||
<!-- /.tab-pane -->
|
||
<div class="tab-pane" id="tab_2">
|
||
<div id="fittingAlertdiv"></div>
|
||
<table id="table_fitting"></table>
|
||
</div>
|
||
<!-- /.tab-pane -->
|
||
</div>
|
||
<!-- /.tab-content -->
|
||
</div>
|
||
<div class="modal fade" id="imgModal">
|
||
<div class="modal-dialog modal-full">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">查看图片(流水号:<span id="img-serialNo"></span>)</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<!-- 多张图片 -->
|
||
<ul id="viewer" class="viewer">
|
||
</ul>
|
||
<%--<img src="" id="img13" style="width: 100%;">
|
||
<img src="" id="img14" style="width: 100%;">--%>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|
||
<div class="modal fade" id="fittingModal">
|
||
<div class="modal-dialog modal-xlg">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span></button>
|
||
<h4 class="modal-title">选择拟合数据</h4>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div id="grossAlertdiv"></div>
|
||
<table id="table_grossWeight"></table>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||
</div>
|
||
</div>
|
||
<!-- /.modal-content -->
|
||
</div>
|
||
<!-- /.modal-dialog -->
|
||
</div>
|
||
</section>
|
||
</div>
|
||
</div>
|
||
</body>
|
||
</html>
|