万材erp项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

809 lines
38 KiB

<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('数据采集')" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="gray-bg">
<div class="container" style="position: relative;">
<br>
<div class="row">
<span>当前单号:</span><span id="formCode"></span>
</div>
<div class="col-xl-8 col-md-8 m-b-30">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="false">SOP</a>
</li>
<li class="nav-item">
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="true">包装</a>
</li>
<li class="nav-item">
<a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">标签打印</a>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade" id="home" role="tabpanel" aria-labelledby="home-tab">
<img style="width: 600px;height:600px" th:src="@{/img/home.png}" alt="">
</div>
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
<div class="col-xl-8 col-md-6">
<p>包装容量: <span id="box_max_num">暂无</span> </p>
<p>开始序号: <span>001</span> 包装等级: <span>1级</span> 箱子序号: <select id="box_list"></select> </p>
<p>
箱子代码: <span id="box_code">暂未生成代码(该代码会在打印标签的时候生成)</span>
</p>
<p>
<button id="btn_set_box" data-toggle="modal" class="btn btn-primary" data-target="#box_modal">箱子最大数量</button>
<button class="btn btn-primary" id="print_boxCode">打印标签</button>
</p>
<div class="modal inmodal" id="box_modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content animated bounceInRight">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
</button>
<i class="fa fa-laptop modal-icon"></i>
<h4 class="modal-title">设置箱号规则</h4>
<!-- <small class="font-bold">这里可以显示副标题。-->
</div>
<div class="modal-body">
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>-->
<form class="form-horizontal m" id="form_set_box">
<div class="form-group">
<!-- <label>Email</label>-->
<!-- <input type="email" placeholder="请输入您的Email" class="form-control">-->
<input name="maxNum" id="input_maxNum" oninput="value=value.replace(/[^\d]/g,'')" placeholder="输入箱子上限数量" type="text" class="form-control" >
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
<button id="btn_sub_box" data-dismiss="modal" type="button" class="btn btn-primary">提交</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-xl-4 col-md-6">
<p>当前装箱数量: <span id="curr_num">暂无</span> / <span id="box_max_num2">总量</span> </p>
</div>
<div class="col-sm-12 select-table table-striped" style="padding-bottom: 100px;">
<table id="bootstrap-table"></table>
</div>
</div>
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
<p>标签重打</p>
<p>扫描标签 <input type="text"></p>
<div class="col-sm-12 select-table table-striped" style="padding-bottom: 100px;">
<table id="bootstrap-table2"></table>
</div>
</div>
</div>
</div>
<div class="col-xl-4 col-md-4 m-b-30">
<p>所属单号: <input type="text" id="input_workform_code">
<button class="btn btn-primary" id="btn_search_workform_code">查询</button>
<button id="btn_add_workform" data-toggle="modal" class="btn btn-primary" data-target="#myModal">添加</button>
<button id="btn_edit_workform" data-toggle="modal" class="btn btn-primary" data-target="#editWorkForm">修改</button>
</p>
<p>箱号查询:
<input type="text" id="input_boxQuery">
</p>
<p>s&nbsp;&nbsp;n查询:
<input type="text" id="input_snQuery">
</p>
<div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content animated bounceInRight">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
</button>
<i class="fa fa-laptop modal-icon"></i>
<h4 class="modal-title">添加新的单号</h4>
<!-- <small class="font-bold">这里可以显示副标题。-->
</div>
<div class="modal-body">
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>-->
<form class="form-horizontal m" id="form_workform_add">
<div class="form-group">
<!-- <label>Email</label>-->
<!-- <input type="email" placeholder="请输入您的Email" class="form-control">-->
<input name="formCode" id="input_workFormCode" placeholder="请输入工单号码" type="text" class="form-control" >
<input name="wlCode" id="input_wlCode" placeholder="请输入产品料号" type="text" class="form-control">
<input name="special" id="input_special" placeholder="请输入产品描述" type="text" class="form-control" >
<input name="formNeedNum" id="input_needNum" placeholder="请输入工单数量" type="text" class="form-control" >
<input name="snPrefix" id="input_snPrefix" placeholder="请输入箱号规则" type="text" class="form-control" >
<input name="other" id="input_other" placeholder="其他" type="text" class="form-control" >
<!-- <input name="batch" id="input_batch" placeholder="请输入生产批次" type="text" class="form-control" >-->
<!-- <input name="vendor" id="input_vendor" placeholder="请输入厂商代码" type="text" class="form-control" >-->
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
<button id="btn_sub_workForm" data-dismiss="modal" type="button" class="btn btn-primary">提交</button>
</div>
</div>
</div>
</div>
<button id="btn_snModal" data-toggle="modal" class="btn btn-primary" data-target="#snModal" style="display:none;"></button>
<div class="modal inmodal" id="editWorkForm" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content animated bounceInRight">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
</button>
<i class="fa fa-laptop modal-icon"></i>
<h4 class="modal-title">修改单号</h4>
<!-- <small class="font-bold">这里可以显示副标题。-->
</div>
<div class="modal-body">
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>-->
<form class="form-horizontal m" id="form_workform_edit">
<div class="form-group">
<!-- <label>Email</label>-->
<!-- <input type="email" placeholder="请输入您的Email" class="form-control">-->
<input name="formCode" id="input_edit_workFormCode" placeholder="请输入工单号码" type="text" class="form-control" >
<input name="wlCode" placeholder="请输入产品料号" type="text" class="form-control">
<input name="special" placeholder="请输入产品描述" type="text" class="form-control" >
<input name="snPrefix" placeholder="请输入箱号规则" type="text" class="form-control" >
<input name="other" placeholder="其他" type="text" class="form-control" >
<!-- <input name="batch" id="input_batch" placeholder="请输入生产批次" type="text" class="form-control" >-->
<!-- <input name="vendor" id="input_vendor" placeholder="请输入厂商代码" type="text" class="form-control" >-->
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
<button id="btn_edit_sub_workForm" data-dismiss="modal" type="button" class="btn btn-primary">提交</button>
</div>
</div>
</div>
</div>
<div class="modal inmodal" id="snModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content animated bounceInRight">
<div class="modal-body">
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>-->
<div class="form-group">
<p>隶属工单号:<span id="sn_formCode"></span></p>
<p>箱子代码:<span id="sn_boxCode"></span></p>
<p>s n号码:<span id="sn_sn"></span> </p>
<div class="row">
<div class="col-md-4">
测试人:<span id="sn_actTest"></span>
</div>
<div class="col-md-4">
状态:<span id="sn_status"></span>
</div>
<div class="col-md-4">
时间:<span id="sn_passTime"></span>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-8">
<p>
所属产品: <span id="model">xxxxxxxx</span>
</p>
</div>
<div class="col-md-4">
<p>
工单总数:<span id="formNeedNum">4522</span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-8">
<p>
工单类型: <span>正常工单</span>
</p>
</div>
<div class="col-md-4">
<p>
优先级别:<span>一级</span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-8">
<p>
PASS数量: <span id="pass_num">4000</span>
</p>
</div>
<div class="col-md-4">
<p>
FAIL数量:<span id="fail_num">0</span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-8">
<p>
工艺流程: <span>外协厂包装流程</span>
</p>
</div>
<div class="col-md-4">
<p>
是否拼板:<span></span>
</p>
</div>
</div>
<!-- <div class="row">-->
<!-- <div class="col-md-8">-->
<!-- <p>-->
<!-- 目检结果: <span>PASS </span>-->
<!-- </p>-->
<!-- </div>-->
<!-- <div class="col-md-4">-->
<!-- <p>-->
<!-- 是否超投:<span> 否</span>-->
<!-- </p>-->
<!-- </div>-->
<!-- </div>-->
<div class="row">
<div class="col-md-8">
<p>
数据收集方式: <span>人工/扫描输入</span>
</p>
</div>
</div>
<div class="row">
<div class="col-md-8">
<p>
过站条码:: <input id="input_sn" type="text">
</p>
</div>
</div>
<div class="row">
<div class="col-md-8">
<button id="btn_delete_workform" data-toggle="modal" class="btn btn-danger" data-target="#deleteWorkForm">删除</button>
</div>
</div>
<div class="modal inmodal" id="deleteWorkForm" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content animated bounceInRight">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
</button>
<i class="fa fa-laptop modal-icon"></i>
<h4 class="modal-title">删除</h4>
<!-- <small class="font-bold">这里可以显示副标题。-->
</div>
<div class="modal-body">
<!-- <p><strong>RuoYi</strong>是一个完全响应式,基于Bootstrap3.3.6最新版本开发的扁平化主题,她采用了主流的左右两栏式布局,使用了Html5+CSS3等现代技术,她提供了诸多的强大的可以重新组合的UI组件,并集成了最新的jQuery版本(v2.1.1),当然,也集成了很多功能强大,用途广泛的jQuery插件,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。</p>-->
<form class="form-horizontal m" id="form_workform_delete">
<div class="form-group">
<!-- <input name="formCode" id="input_edit_workFormCode" placeholder="请输入工单号码" type="text" class="form-control" >-->
<!-- <input name="wlCode" placeholder="请输入产品料号" type="text" class="form-control">-->
<!-- <input name="special" placeholder="请输入产品描述" type="text" class="form-control" >-->
<!-- <input name="snPrefix" placeholder="请输入箱号规则" type="text" class="form-control" >-->
<!-- <input name="other" placeholder="其他" type="text" class="form-control" >-->
<input name="boxCode" placeholder="请输入箱号" type="text" class="form-control">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal" onclick="close()">关闭</button>
<button id="btn_delete_sub_workForm" data-dismiss="modal" type="button" class="btn btn-primary">提交</button>
</div>
</div>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "ck/workform";
function queryParams(params) {
var search = $.table.queryParams(params);
if ($('#box_list option:selected').val()!=null){
search.boxId = $('#box_list option:selected').val();
}
return search;
}
$(function() {
var options = {
url: prefix + "/list",
// createUrl: prefix + "/add",
// updateUrl: prefix + "/edit/{versionNo}/{cpCode}",
// removeUrl: prefix + "/remove",
// exportUrl: prefix + "/export",
modalName: "sn",
showSearch:false,
showPageGo:false,
showRefresh:false,
showColumns:false,
cardView:false,
showToggle:false,
queryParams: queryParams,
columns: [
{
field: 'status',
title: '状态',
// visible: false
formatter: function (value ,row,index) {
return "通过";
}
},
{
field: 'code',
title: '过站SN',
},
{
field: 'space1',
title: '过站时间',
// visible: false
},
{
field: 'space2',
title: '测试人',
// visible: false
},
/* {
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.versionNo + '\',\'' + row.cpCode + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.versionNo + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
} */]
};
$.table.init(options);
});
// var t1 = window.setInterval(calculation, 1000);//定时访问
// function calculation() {
// $('#bootstrap-table').bootstrapTable('refresh');
// $('#bootstrap-table').bootstrapTable('hideLoading');
//
// };
$("#bootstrap-table2").bootstrapTable({
showHeader:true,
// showRefresh: true,
pageSize: 10,
pageNumber: 1,
columns: [{
checkbox: true
},
{
field:"id",
title:"序号",
formatter:function (value, row, index){
return index+1;
}
},
{
field: 'lableName',
title: '标签模板名称',
// visible: false
},
{
field: 'storeProcess',
title: '存储过程',
},
{
title: '标签模板地址',
align: 'center',
formatter: function (value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.versionNo + '\',\'' + row.cpCode + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.versionNo + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}
],
});
function boxChange(){
var box_id = $('#box_list option:selected').val();
$.ajax({
url: "/ck/workform/getBox",
data: {"id":box_id},
type: "GET",
contentType:"application/json;charset=utf-8",/*传递json类型*/
dataType: "json",
success: function(data) {
var boxWorkformHead=data.boxWorkformHead;
$("#box_code").text(data.boxWorkformHead.boxCode);
if (boxWorkformHead.boxCode!=null||boxWorkformHead.currNum==boxWorkformHead.maxNum|| parseInt($("#pass_num").text())>=parseInt($("#formNeedNum").text())){
$("#input_sn").attr("disabled","disabled");
}else {
$("#input_sn").removeAttr("disabled");
}
$("#box_max_num").text(data.boxWorkformHead.maxNum);
$("#box_max_num2").text(data.boxWorkformHead.maxNum);
$("#curr_num").text(data.boxWorkformHead.currNum);
// table.options.updateUrl.add("{boxId}", box_id);
$('#bootstrap-table').bootstrapTable('refresh');
$('#bootstrap-table').bootstrapTable('hideLoading');
}
});
}
//箱子列表发生了改变
$("#box_list").change(function () {
boxChange();
});
//新增单号
$("#btn_sub_workForm").click(function (){
$.ajax({
url: "/ck/workform/add",
data: $('#form_workform_add').serialize(),
type: "POST",
dataType: "json",
success: function(data) {
if (data.value==1){
var workformHead=data.workformHead;
$("#formCode").text(workformHead.formCode);
$("#fail_num").text(workformHead.faildNum);
$("#pass_num").text(workformHead.passNum);
$("#model").text(workformHead.wlCode);
$("#formNeedNum").text(workformHead.formNeedNum);
$("#btn_set_box").show();
$("#box_list").empty();
$("box_max_num").text("");
$("box_code").text("");
$("box_max_num2").text("");
$("curr_num").text("");
$.modal.msgSuccess(data.msg);
}else {
$.modal.msgError(data.msg);
}
document.getElementById("form_workform_add").reset();
}
});
});
$("#btn_edit_workform").click(function () {
if ($("#formCode").text() == "") {
$.modal.msgError("先查询单号");
return;
}
$("#input_edit_workFormCode").val($("#formCode").text());
});
$("#btn_edit_sub_workForm").click(function (){
if ($("#formCode").text() == "") {
$.modal.msgError("先查询单号");
return;
}
$.ajax({
url: "/ck/workform/edit",
data: $('#form_workform_edit').serialize(),
type: "POST",
dataType: "json",
success: function(data) {
if (data.value==1){
$.modal.msgSuccess("修改成功,重新查询后可见");
}else {
$.modal.msgError(data.msg);
}
document.getElementById("form_workform_edit").reset();
}
});
});
$("#btn_set_box").hide();
//设置箱子的回调事件
function insertBoxCallback(data){
$("#box_list").empty();
if (data.boxWorkformHeads.length==0){
$("#btn_set_box").show();
}else {
$("#btn_set_box").hide();
// var option0 = $("<option style='display: none'>").val("").text("");
$("#box_list").append("<option style='display: none'></option>");
for (var i=0;i<data.boxWorkformHeads.length;i++){
var option = $("<option>").val(data.boxWorkformHeads[i].id).text(i+1);
$("#box_list").append(option);
}
}
}
//设置箱子
$("#btn_sub_box").click(function (){
var dataparam=$("#form_set_box").serialize();
dataparam=dataparam+"&"+"workformCode="+$("#formCode").text();
$.operate.save("/ck/workform/setBox", dataparam,insertBoxCallback);
document.getElementById("form_workform_add").reset();
});
//查询单号
$("#btn_search_workform_code").click(function (){
$.ajax({
url: "/ck/workform/queryByCode",
data: JSON.stringify({"formCode":$("#input_workform_code").val()}),
type: "POST",
contentType:"application/json;charset=utf-8",/*传递json类型*/
dataType: "json",
success: function(data) {
$("#formNeedNum").text("");
var workformHead=data.workformHead;
$("#formCode").text(workformHead.formCode);
$("#fail_num").text(workformHead.faildNum);
$("#pass_num").text(workformHead.passNum);
$("#model").text(workformHead.wlCode);
$("#formNeedNum").text(workformHead.formNeedNum);
$("#box_list").empty();
$("#input_workform_code").val("");
if (data.boxWorkformHeads.length==0){
$("#btn_set_box").show();
}else {
$("#btn_set_box").hide();
// var option0 = $("<option style='display: none'>").val("").text("");
$("#box_list").append("<option style='display: none'></option>");
for (var i=0;i<data.boxWorkformHeads.length;i++){
var option = $("<option>").val(data.boxWorkformHeads[i].id).text(i+1);
$("#box_list").append(option);
}
}
}
});
});
function boxCodeSearch(){
$.ajax({
url: "/ck/workform/boxQuery",
data: $("#input_boxQuery").val(),
type: "POST",
contentType:"application/text;charset=utf-8",/*传递json类型*/
dataType: "json",
success: function(data) {
$("input_boxQuery").val("");
$("#formNeedNum").text("");
var workformHead=data.workformHead;
$("#formCode").text(workformHead.formCode);
$("#fail_num").text(workformHead.faildNum);
$("#pass_num").text(workformHead.passNum);
$("#model").text(workformHead.wlCode);
$("#formNeedNum").text(workformHead.formNeedNum);
$("#box_list").empty();
$("#input_workform_code").val("");
if (data.boxWorkformHeads.length==0){
$("#btn_set_box").show();
}else {
$("#btn_set_box").hide();
// var option0 = $("<option style='display: none'>").val("").text("");
$("#box_list").append("<option style='display: none'></option>");
for (var i=0;i<data.boxWorkformHeads.length;i++){
var option = $("<option>").val(data.boxWorkformHeads[i].id).text(i+1);
$("#box_list").append(option);
}
$("#box_list").val(data.boxWorkformHead.id);
boxChange();
}
}
});
}
//sn回车触发的事件
function sub_sn(){
var boxId=$('#box_list option:selected').val();
var sn=$("#input_sn").val().trim();
if(sn==""||$("#formCode").text()==""||boxId==null){
$.modal.msgError("单号或sn或箱号不可为空");
return;
}
$.ajax({
url: "/ck/workform/addSn",
data: JSON.stringify({"code":sn,"boxId":boxId}),
type: "POST",
contentType:"application/json;charset=utf-8",/*传递json类型*/
dataType: "json",
success: function(data) {
$("#input_sn").val("");
if (data.value==0){
// $.modal.msgError("重码或异常")
alert(data.sn+"重码");
return ;
}else if (data.value==1){
var boxWorkformHead=data.boxWorkformHead;
var workformHead=data.workformHead;
$("#curr_num").text(boxWorkformHead.currNum);
$("#pass_num").text(workformHead.passNum);
if (boxWorkformHead.currNum==boxWorkformHead.maxNum){
$("#input_sn").attr("disabled","disabled");
print(boxWorkformHead);
}
if (workformHead.passNum>=workformHead.formNeedNum){
$("#input_sn").attr("disabled","disabled");
}
$('#bootstrap-table').bootstrapTable('refresh');
$('#bootstrap-table').bootstrapTable('hideLoading');
}else {
alert(data.sn+"规则不对");
return ;
}
}
});
}
//请求打印
function print(boxWorkformHead){
$.modal.msg("打印中");
$("#input_sn").attr("disabled","disabled");
$.ajax({
url: "/ck/workform/print",
data: JSON.stringify(boxWorkformHead),
type: "POST",
contentType:"application/json;charset=utf-8",/*传递json类型*/
dataType: "json",
success: function(data) {
if (data.value==1){
// var boxWorkformHead=data.boxWorkformHead;
// $("#input_sn").removeAttr("disabled");
console.log(data);
$("#box_code").text(data.boxWorkformHead.boxCode);
$.modal.msgSuccess("打印成功");
}else {
$.modal.msgError("打印失败");
}
}
});
}
//手动打印
$("#print_boxCode").click(function () {
$.modal.msgError("手动打印中");
var boxWorkformHead={id:$('#box_list option:selected').val()};
print(boxWorkformHead);
})
$("#btn_set_box").click(function (){
document.getElementById("form_set_box").reset();
$.ajax({
url: "/ck/workform/checkWlCode",
data: JSON.stringify({"formCode":$("#formCode").text(),"wlCode":$("#model").text()}),
type: "POST",
contentType:"application/json;charset=utf-8",/*传递json类型*/
dataType: "json",
success: function(data) {
$("#input_maxNum").val(data.boxWorkformHead.maxNum);
}
});
});
//sn输入框绑定回车事件
window.onload = function(e) {
var isCommit=false;
var codeString = "";
var lastTime;
var caseFormat = false;
$("#input_sn").keydown(function(e) {
var nextTime = new Date().getTime();
var code = e.which;
if(code==13){
sub_sn();
}
lastTime = nextTime;
});
$("#input_boxQuery").keydown(function(e) {
var code = e.which;
if(code==13){
boxCodeSearch();
}
});
$("#input_snQuery").keydown(function(e) {
var code = e.which;
if(code==13){
snSearch();
}
});
};
function snSearch(){
$.ajax({
url: "/ck/workform/snQuery",
data: $("#input_snQuery").val(),
type: "POST",
contentType:"application/text;charset=utf-8",/*传递json类型*/
dataType: "json",
success: function(data) {
console.log(data);
if (data.value==1){
var boxWorkformHead=data.boxWorkformHead;
var workformBoxProduct=data.workformBoxProduct;
$("#btn_snModal").click();
$("#sn_formCode").text(boxWorkformHead.workformCode);
$("#sn_boxCode").text(boxWorkformHead.boxCode);
$("#sn_sn").text(workformBoxProduct.code);
$("#sn_actTest").text(workformBoxProduct.space2);
$("#sn_status").text("pass");
$("#sn_passTime").text(workformBoxProduct.space1);
}else {
$.modal.msgError("sn不存在");
}
$("#input_snQuery").val("");
}
});
}
$("#btn_delete_sub_workForm").on("click",function (){
let boxCode = $("input[name='boxCode']").val();
$.ajax({
url:ctx + "ck/workform/remove",
type:"post",
dataType:"json",
data:{"boxCode":boxCode},
success: function (resp) {
if (resp.code===0){
$.modal.msgSuccess("删除成功!");
}else {
$.modal.msgError(resp.msg);
}
},
error: function () {
$.modal.msgError("出错了!");
}
})
close();
})
function close(){
$("input[name='boxCode']").val("");
}
</script>
</body>
</html>