<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8" />
|
<title>当前工单(扫码汇报)</title>
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
<script src="../../../layuiadmin/grwebapp.js"></script>
|
<script src="../../../layuiadmin/HideButton.js"></script>
|
<script src="../../../layuiadmin/soulTable.slim.js"></script>
|
<script src="../../../layuiadmin/echarts.min.js"></script>
|
<script src="../../../layuiadmin/PlateBinding.js"></script>
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-col-md12">
|
<div class="layui-card" style="padding: 1px">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div style="width: 65%; height: calc(135vh); float: left; background-color: rgb(255 255 255) ">
|
<div id="top" style="width:100%;height:calc(60vh);">
|
<div id="top-left" style="width: 30%; height: calc(40vh); float: left;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 30px;"><span style="font-weight:bolder">设备</span></label>
|
</div>
|
<div>
|
<img src="../../../layuiadmin/layui/images/device.png" onerror="javascript:this.src='../../../layuiadmin/layui/images/erro.png';this.onerror = null" style="width:40%;height:calc(15vh);float:left" />
|
<div style="float:left;margin-left:5%;">
|
<dl>
|
<dd>
|
<h2><span style="margin-left:10px;" id="HEquipName"></span></h2>
|
<h3><span>设备编号:<span style="margin-left:10px;" id="HEquipCode"></span></span></h3>
|
<h3><span>设备状态:<span style="margin-left:10px;" id="HEquipStatus"></span></span></h3>
|
<h3><span>运行时间:<span style="margin-left:10px;" id="HWorkTime"></span></span></h3>
|
<h3><span>当日点检时间:<span style="margin-left:10px;" id="HDotCheckDate"></span></span></h3>
|
<h3><span>最后保养时间:<span style="margin-left:10px;" id="HMaintainDate"></span></span></h3>
|
</dd>
|
</dl>
|
</div>
|
</div>
|
</div>
|
<div id="center-center" style="width: 15%; height: calc(40vh); float: left; margin-left: 0.2%;">
|
<div id="chart1" style="width: 75%; height: calc(40vh); left: 2%; float: left;"></div>
|
</div>
|
<div id="center-right" style="width: 500px; height: calc(40vh); float: left;margin-top:5%;">
|
<div class="layui-row" style="margin-bottom: 30px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">条形码:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HBarCodeSN" value="" lay-verify="HBarCodeSN" autocomplete="off" placeholder="请键入后回车" id="HBarCodeSN" style="width: 240px;">
|
<input type="hidden" name="HBarCode" id="HBarCode" value="">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">工序:</label>
|
<div class="layui-input-block" style="margin-left: 9px;">
|
<input type="text" class="layui-input" name="HProcName" value="" lay-verify="HProcName" id="HProcName" style="background-color: #efefef4d; width: 43%; display: inline-block;" readonly>
|
<input type="hidden" name="HProcID" id="HProcID" lay-verify="HProcID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProcID" id="btnHProcID" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">流水号:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HProcNo" value="" lay-verify="HProcNo" id="HProcNo" style="width: 150px; background-color: #efefef4d; " readonly>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">合格数量:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HQty" value="0" lay-verify="HQty" id="HQty" style="width: 150px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">生产资源:</label>
|
<div class="layui-input-block" style="margin-left: 9px;">
|
<input type="text" class="layui-input" name="HSourceName" value="" lay-verify="HSourceName" id="HSourceName" style="background-color: #efefef4d; width: 43%; display: inline-block;" readonly>
|
<input type="hidden" name="HSourceID" id="HSourceID" lay-verify="HSourceID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHSourceID" id="btnHSourceID" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">工作中心:</label>
|
<div class="layui-input-block" style="margin-left: 9px;">
|
<input type="text" class="layui-input" name="HCenterName" value="" lay-verify="HCenterName" id="HCenterName" style="background-color: #efefef4d; width: 43%; display: inline-block;" readonly>
|
<input type="hidden" name="HCenterID" id="HCenterID" lay-verify="HCenterID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHCenterID" id="btnHCenterID" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">生产班组:</label>
|
<div class="layui-input-block" style="margin-left: 9px;">
|
<input type="text" class="layui-input" name="HGroupName" value="" lay-verify="HGroupName" id="HGroupName" style="background-color: #efefef4d; width: 43%; display: inline-block;" readonly>
|
<input type="hidden" name="HGroupID" id="HGroupID" lay-verify="HGroupID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHGroupID" id="btnHGroupID" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">操作员:</label>
|
<div class="layui-input-block" style="margin-left: 9px;">
|
<input type="text" class="layui-input" name="HEmpName" value="" lay-verify="HEmpName" id="HEmpName" style="background-color: #efefef4d; width: 43%; display: inline-block;" readonly>
|
<input type="hidden" name="HEmpID" id="HEmpID" lay-verify="HEmpID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmpID" id="btnHEmpID" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">工时</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HWorkTimes" id="HWorkTimes" value="0" style="width: 150px;">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">单据日期:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="date" class="layui-input" name="HDate" lay-verify="HDate" style="width: 150px;" autocomplete="off" id="HDate">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">单据号:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HBillNo" value="" lay-verify="HBillNo" style="width: 150px; background-color: #efefef4d; font-size: 12.5px;" autocomplete="off" id="HBillNo" readonly>
|
<input type="hidden" name="HInterID" id="HInterID">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">生产订单:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HICMOBillNo" value="" lay-verify="HICMOBillNo" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HICMOBillNo" readonly>
|
<input type="hidden" name="HICMOInterID" id="HICMOInterID">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">流转卡:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HProcExchBillNo" value="" lay-verify="HProcExchBillNo" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HProcExchBillNo" readonly>
|
<input type="hidden" class="layui-input" name="lngBillKey" id="lngBillKey">
|
<input type="hidden" class="layui-input" name="lngBillSubKey" id="lngBillSubKey">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">物料代码:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HMaterNumber" value="" lay-verify="HMaterNumber" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HMaterNumber" readonly>
|
<input type="hidden" class="layui-input" name="HMaterID" id="HMaterID">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">物料名称:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HMaterName" value="" lay-verify="HMaterName" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HMaterName" readonly>
|
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">规格型号:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HMaterModel" value="" lay-verify="HMaterModel" style="width: 150px; background-color: #efefef4d; font-size: 13px;" autocomplete="off" id="HMaterModel" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">计量单位:</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HUnitName" value="" lay-verify="HUnitName" style="width: 150px; background-color: #efefef4d;" autocomplete="off" id="HUnitName" readonly>
|
<input type="hidden" name="HUnitID" id="HUnitID">
|
<input type="hidden" name="eventType" id="eventType" value="Add">
|
<input type="hidden" name="HPRDOrgID" id="HPRDOrgID" value="0">
|
<input type="hidden" name="HICMOQty" id="HICMOQty" value="0">
|
<input type="hidden" name="HPlanQty" id="HPlanQty" value="0">
|
<input type="hidden" name="HLastSubProc" id="HLastSubProc" value="true">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">穴号</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HMouldNum" id="HMouldNum" style="width: 150px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">不良数量</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HBadCount" id="HBadCount" value="0" style="width: 150px;">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">遗失数量</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HLossQty" id="HLossQty" value="0" style="width: 150px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">取样数量</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HToCheckQty" id="HToCheckQty" value="0" style="width: 150px;">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">报废数量</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HWasterQty" id="HWasterQty" value="0" style="width: 150px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">返工数量</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HBackWorkQty" id="HBackWorkQty" value="0" style="width: 150px;">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">工废数量</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HWasterQty_Work" id="HWasterQty_Work" value="0" style="width: 150px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">料废数量</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HWasterQty_Mater" id="HWasterQty_Mater" value="0" style="width: 150px;">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">模具编号</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HMouldNo" id="HMouldNo" value="" style="width: 150px;" readonly>
|
<input type="hidden" class="layui-input" name="HMouldID" id="HMouldID" value="0">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">模具名称</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HMouldName" id="HMouldName" value="" style="width: 150px;" readonly>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin-bottom: 15px;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 65px;">模具型号</label>
|
<div class="layui-input-block" style="margin-left: 95px;">
|
<input type="text" class="layui-input" name="HModel" id="HModel" value="" style="width: 150px;" readonly>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div id="center" style="width: 100%; height: calc(55vh); margin-top: 1%;">
|
<div id="center-left" style="width: 30%; height: calc(40vh); float: left;">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 30px;"><span style="font-weight:bolder">人员</span></label>
|
</div>
|
<div style="margin-left:25%;">
|
<dl>
|
<dd>
|
<h2><span>部门:<span style="margin-left:10px;" id="HDepName"></span></span></h2>
|
<h3><span>班组:<span style="margin-left:10px;" id="HGroupName"></span></span></h3>
|
<h3><span>操作员:<span style="margin-left:10px;" id="HEmpName"></span></span></h3>
|
<h3><span>负责人:<span style="margin-left:10px;" id="HManagerName"></span></span></h3>
|
</dd>
|
</dl>
|
</div>
|
</div>
|
<div id="center-right" style="width: 15%; height: calc(40vh); float: left; margin-left: 0.2%; ">
|
<div id="chart2" style="width: 75%; height: calc(40vh); left: 2%; float: left;"></div>
|
</div>
|
</div>
|
<div id="bottom" style="width: 100%; height: calc(10vh);">
|
<div id="bottom-left" style="width: 100%; height: calc(10vh);">
|
<div style="text-align: left; width: 100%; height: calc(10vh); ">
|
<button type="button" lay-submit="" lay-filter="tg" class="layui-btn layui-btn-radius " style="margin-left: 15%;" id="tg">停工挂起</button>
|
<button type="button" lay-submit="" lay-filter="kg" class="layui-btn layui-btn-radius " style="margin-left: 5%; " id="kg">开工</button>
|
<button type="button" lay-submit="" lay-filter="Add" class="layui-btn layui-btn-radius " style="margin-left: 20%;" id="Add">新增</button>
|
<button type="button" lay-submit="" lay-filter="Saver" class="layui-btn layui-btn-radius " style="margin-left: 5%; " id="Saver">保存</button>
|
<button type="button" lay-submit="" lay-filter="Exit" class="layui-btn layui-btn-radius " style="margin-left: 5%; " id="Exit">退出</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div id="center-right-maintable" style="width: 34%; height: calc(135vh); float: left; margin-left: 0.2%; background-color: rgb(255 255 255) ">
|
<div class="layui-tab" lay-filter="tab-POStockInBill">
|
<ul class="layui-tab-title" lay-filter="tab-all">
|
<li lay-id="1" style="padding:1px;" class="layui-this">扫码记录</li>
|
</ul>
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show">
|
<div class="layui-form-item">
|
<table class="" id="mainTable" style="width:110%;" lay-filter="mainTable"></table>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
</div>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill" id="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|
<script>
|
//获取参数
|
var HBillType = ""; //单据类型
|
var HSourceInterID = ""; //源单主内码
|
var HSourceEntryID = ""; //源单子内码
|
var HSourceBillNo = ""; //源单单号
|
var HSourceBillType = ""; //源单类型
|
var HEquipName = ""; //设备名称
|
var HEquipCode = ""; //设备编号
|
var HEmpName = ""; //操作员
|
var HManagerName = ""; //负责人
|
var HGroupName = ""; //班组
|
|
var edit = function (data) {
|
HBillType = data[0].HBillType;
|
HSourceInterID = data[0].HSourceInterID;
|
HSourceEntryID = data[0].HSourceEntryID;
|
HSourceBillNo = data[0].HSourceBillNo;
|
HSourceBillType = data[0].HSourceBillType;
|
HEquipName = data[0].HEquipName;//设备名称
|
HEquipCode = data[0].HEquipCode;//设备编号
|
HICMOBillNo = data[0].HICMOBillNo;//生产订单单号
|
HICMOInterID = data[0].HICMOInterID;//生产订单主内码
|
HICMOEntryID = data[0].HICMOEntryID;//生产订单子内码
|
HSourceID = data[0].HSourceID;//生产资源id
|
HEmpName = data[0].HEmpName;//操作员
|
HManagerName = data[0].HManagerName;//负责人
|
HGroupName = data[0].HGroupName;//班组
|
}
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index', //主入口模块
|
}).use(['index', 'form', 'table', 'element', 'laypage', 'laydate', 'soulTable'], function () {
|
//#region 公共变量
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element
|
, laypage = layui.laypage
|
, laydate = layui.laydate
|
, util = layui.util
|
, soulTable = layui.soulTable
|
var sWhere = "";
|
var options = [];
|
//#endregion
|
|
//#region 进入页面即加载
|
|
var HModName = "Cj_StationOutBill_CurrentWork";
|
//不需要显示的字段 可扩展
|
var titleData = ["HInterID", "HEntryID", "HSourceID", "HMaterID", "HDeptID", "源单子内码", "源单类型", "单据类型"];
|
var HFinishRate = 0; //完成率
|
var HQualifiedRate = 0; //合格率
|
//初始化界面
|
set_ClearBill();
|
|
$("#HEquipName").text(HEquipName);//设备名称
|
$("#HEquipCode").text(HEquipCode);//设备编号
|
$("#HEmpName").text(HEmpName);//操作员
|
$("#HManagerName").text(HManagerName);//负责人
|
$("#HGroupName").text(HGroupName);//班组
|
//#endregion
|
|
//#region 【仪表盘】
|
var chart1 = echarts.init(document.getElementById("chart1"));
|
|
var colorTemplate1 = [[0.2, "rgba(255,0,0,0.8)"], [0.8, "rgba(0,255,255,0.8)"], [1, "rgba(0,255,0,0.8)"]];
|
|
var data1 = [{
|
name: "完成率",
|
value: HFinishRate.toFixed(2),
|
}];
|
|
// 指定图表的配置项和数据
|
var option = {
|
//backgroundColor: "#000",
|
tooltip: { // 本系列特定的 tooltip 设定。
|
show: true,
|
formatter: "{b}:{c}%",
|
backgroundColor: "rgba(50,50,50,0.7)", // 提示框浮层的背景颜色。注意:series.tooltip 仅在 tooltip.trigger 为 'item' 时有效。
|
borderColor: "#333", // 提示框浮层的边框颜色。...
|
borderWidth: 0, // 提示框浮层的边框宽。...
|
padding: 5, // 提示框浮层内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距。...
|
textStyle: { // 提示框浮层的文本样式。...
|
// color ,fontStyle ,fontWeight ,fontFamily ,fontSize ,lineHeight ,.......
|
},
|
},
|
series: [
|
{
|
name: "单仪表盘示例", // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
|
type: "gauge", // 系列类型
|
progress: {
|
show: true
|
},
|
radius: "100%", // 参数:number, string。 仪表盘半径,默认 75% ,可以是相对于容器高宽中较小的一项的一半的百分比,也可以是绝对的数值。
|
center: ["50%", "50%"], // 仪表盘位置(圆心坐标)
|
startAngle: 225, // 仪表盘起始角度,默认 225。圆心 正右手侧为0度,正上方为90度,正左手侧为180度。
|
endAngle: -45, // 仪表盘结束角度,默认 -45
|
clockwise: true, // 仪表盘刻度是否是顺时针增长,默认 true。
|
min: 0, // 最小的数据值,默认 0 。映射到 minAngle。
|
max: 100, // 最大的数据值,默认 100 。映射到 maxAngle。
|
splitNumber: 10, // 仪表盘刻度的分割段数,默认 10。
|
axisLine: { // 仪表盘轴线(轮廓线)相关配置。
|
show: true, // 是否显示仪表盘轴线(轮廓线),默认 true。
|
lineStyle: { // 仪表盘轴线样式。
|
color: colorTemplate1, //仪表盘的轴线可以被分成不同颜色的多段。每段的 结束位置(范围是[0,1]) 和 颜色 可以通过一个数组来表示。默认取值:[[0.2, '#91c7ae'], [0.8, '#63869e'], [1, '#c23531']]
|
opacity: 1, //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
width: 5, //轴线宽度,默认 30。
|
shadowBlur: 20, //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
|
shadowColor: "#fff", //阴影颜色。支持的格式同color。
|
}
|
},
|
splitLine: { // 分隔线样式。
|
show: true, // 是否显示分隔线,默认 true。
|
length: 0, // 分隔线线长。支持相对半径的百分比,默认 30。
|
lineStyle: { // 分隔线样式。
|
color: "#eee", //线的颜色,默认 #eee。
|
opacity: 1, //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
width: 2, //线度,默认 2。
|
type: "solid", //线的类型,默认 solid。 此外还有 dashed,dotted
|
shadowBlur: 10, //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
|
shadowColor: "#fff", //阴影颜色。支持的格式同color。
|
}
|
},
|
axisTick: { // 刻度(线)样式。
|
show: false, // 是否显示刻度(线),默认 true。
|
splitNumber: 5, // 分隔线之间分割的刻度数,默认 5。
|
length: 8, // 刻度线长。支持相对半径的百分比,默认 8。
|
lineStyle: { // 刻度线样式。
|
color: "#eee", //线的颜色,默认 #eee。
|
opacity: 1, //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
width: 1, //线度,默认 1。
|
type: "solid", //线的类型,默认 solid。 此外还有 dashed,dotted
|
shadowBlur: 10, //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
|
shadowColor: "#fff", //阴影颜色。支持的格式同color。
|
},
|
},
|
axisLabel: { // 刻度标签。
|
show: false, // 是否显示标签,默认 true。
|
distance: 5, // 标签与刻度线的距离,默认 5。
|
color: "#1E1E1E", // 文字的颜色,默认 #fff。
|
fontSize: 9, // 文字的字体大小,默认 5。
|
formatter: "{value}", // 刻度标签的内容格式器,支持字符串模板和回调函数两种形式。 示例:// 使用字符串模板,模板变量为刻度默认标签 {value},如:formatter: '{value} kg'; // 使用函数模板,函数参数分别为刻度数值,如formatter: function (value) {return value + 'km/h';}
|
},
|
pointer: { // 仪表盘指针。
|
show: true, // 是否显示指针,默认 true。
|
length: "70%", // 指针长度,可以是绝对数值,也可以是相对于半径的百分比,默认 80%。
|
width: 5, // 指针宽度,默认 8。
|
},
|
itemStyle: { // 仪表盘指针样式。
|
color: "auto", // 指针颜色,默认(auto)取数值所在的区间的颜色
|
opacity: 1, // 图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
borderWidth: 0, // 描边线宽,默认 0。为 0 时无描边。
|
borderType: "solid", // 柱条的描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'。
|
borderColor: "#000", // 图形的描边颜色,默认 "#000"。支持的颜色格式同 color,不支持回调函数。
|
shadowBlur: 10, // (发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
|
shadowColor: "#fff", // 阴影颜色。支持的格式同color。
|
},
|
emphasis: { // 高亮的 仪表盘指针样式
|
itemStyle: {
|
//高亮 和正常 两者具有同样的配置项,只是在不同状态下配置项的值不同。
|
}
|
},
|
title: { // 仪表盘标题。
|
show: true, // 是否显示标题,默认 true。
|
offsetCenter: [0, "120%"],//相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
|
color: "#1E1E1E", // 文字的颜色,默认 #333。
|
fontSize: 20, // 文字的字体大小,默认 15。
|
},
|
detail: { // 仪表盘详情,用于显示数据。
|
show: true, // 是否显示详情,默认 true。
|
offsetCenter: [0, "70%"],// 相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
|
color: "auto", // 文字的颜色,默认 auto。
|
fontSize: 30, // 文字的字体大小,默认 15。
|
formatter: "{value}%", // 格式化函数或者字符串
|
},
|
data: data1
|
}
|
]
|
};
|
// 使用刚指定的配置项和数据显示图表
|
chart1.setOption(option);
|
|
|
var chart2 = echarts.init(document.getElementById("chart2"));
|
|
var data2 = [{
|
name: "合格率",
|
value: HQualifiedRate.toFixed(2),
|
}];
|
|
// 指定图表的配置项和数据
|
var option2 = {
|
//backgroundColor: "#000",
|
tooltip: { // 本系列特定的 tooltip 设定。
|
show: true,
|
formatter: "{b}:{c}%",
|
backgroundColor: "rgba(50,50,50,0.7)", // 提示框浮层的背景颜色。注意:series.tooltip 仅在 tooltip.trigger 为 'item' 时有效。
|
borderColor: "#333", // 提示框浮层的边框颜色。...
|
borderWidth: 0, // 提示框浮层的边框宽。...
|
padding: 5, // 提示框浮层内边距,单位px,默认各方向内边距为5,接受数组分别设定上右下左边距。...
|
textStyle: { // 提示框浮层的文本样式。...
|
// color ,fontStyle ,fontWeight ,fontFamily ,fontSize ,lineHeight ,.......
|
},
|
},
|
series: [
|
{
|
name: "单仪表盘示例", // 系列名称,用于tooltip的显示,legend 的图例筛选,在 setOption 更新数据和配置项时用于指定对应的系列。
|
type: "gauge", // 系列类型
|
radius: "100%", // 参数:number, string。 仪表盘半径,默认 75% ,可以是相对于容器高宽中较小的一项的一半的百分比,也可以是绝对的数值。
|
center: ["50%", "50%"], // 仪表盘位置(圆心坐标)
|
startAngle: 225, // 仪表盘起始角度,默认 225。圆心 正右手侧为0度,正上方为90度,正左手侧为180度。
|
endAngle: -45, // 仪表盘结束角度,默认 -45
|
clockwise: true, // 仪表盘刻度是否是顺时针增长,默认 true。
|
min: 0, // 最小的数据值,默认 0 。映射到 minAngle。
|
max: 100, // 最大的数据值,默认 100 。映射到 maxAngle。
|
splitNumber: 10, // 仪表盘刻度的分割段数,默认 10。
|
axisLine: { // 仪表盘轴线(轮廓线)相关配置。
|
show: true, // 是否显示仪表盘轴线(轮廓线),默认 true。
|
lineStyle: { // 仪表盘轴线样式。
|
color: colorTemplate1, //仪表盘的轴线可以被分成不同颜色的多段。每段的 结束位置(范围是[0,1]) 和 颜色 可以通过一个数组来表示。默认取值:[[0.2, '#91c7ae'], [0.8, '#63869e'], [1, '#c23531']]
|
opacity: 1, //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
width: 5, //轴线宽度,默认 30。
|
shadowBlur: 20, //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
|
shadowColor: "#fff", //阴影颜色。支持的格式同color。
|
}
|
},
|
splitLine: { // 分隔线样式。
|
show: true, // 是否显示分隔线,默认 true。
|
length: 0, // 分隔线线长。支持相对半径的百分比,默认 30。
|
lineStyle: { // 分隔线样式。
|
color: "#eee", //线的颜色,默认 #eee。
|
opacity: 1, //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
width: 2, //线度,默认 2。
|
type: "solid", //线的类型,默认 solid。 此外还有 dashed,dotted
|
shadowBlur: 10, //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
|
shadowColor: "#fff", //阴影颜色。支持的格式同color。
|
}
|
},
|
axisTick: { // 刻度(线)样式。
|
show: false, // 是否显示刻度(线),默认 true。
|
splitNumber: 5, // 分隔线之间分割的刻度数,默认 5。
|
length: 8, // 刻度线长。支持相对半径的百分比,默认 8。
|
lineStyle: { // 刻度线样式。
|
color: "#eee", //线的颜色,默认 #eee。
|
opacity: 1, //图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
width: 1, //线度,默认 1。
|
type: "solid", //线的类型,默认 solid。 此外还有 dashed,dotted
|
shadowBlur: 10, //(发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
|
shadowColor: "#fff", //阴影颜色。支持的格式同color。
|
},
|
},
|
axisLabel: { // 刻度标签。
|
show: false, // 是否显示标签,默认 true。
|
distance: 5, // 标签与刻度线的距离,默认 5。
|
color: "#1E1E1E", // 文字的颜色,默认 #fff。
|
fontSize: 9, // 文字的字体大小,默认 5。
|
formatter: "{value}", // 刻度标签的内容格式器,支持字符串模板和回调函数两种形式。 示例:// 使用字符串模板,模板变量为刻度默认标签 {value},如:formatter: '{value} kg'; // 使用函数模板,函数参数分别为刻度数值,如formatter: function (value) {return value + 'km/h';}
|
},
|
pointer: { // 仪表盘指针。
|
show: true, // 是否显示指针,默认 true。
|
length: "70%", // 指针长度,可以是绝对数值,也可以是相对于半径的百分比,默认 80%。
|
width: 5, // 指针宽度,默认 8。
|
},
|
itemStyle: { // 仪表盘指针样式。
|
color: "auto", // 指针颜色,默认(auto)取数值所在的区间的颜色
|
opacity: 1, // 图形透明度。支持从 0 到 1 的数字,为 0 时不绘制该图形。
|
borderWidth: 0, // 描边线宽,默认 0。为 0 时无描边。
|
borderType: "solid", // 柱条的描边类型,默认为实线,支持 'solid', 'dashed', 'dotted'。
|
borderColor: "#000", // 图形的描边颜色,默认 "#000"。支持的颜色格式同 color,不支持回调函数。
|
shadowBlur: 10, // (发光效果)图形阴影的模糊大小。该属性配合 shadowColor,shadowOffsetX, shadowOffsetY 一起设置图形的阴影效果。
|
shadowColor: "#fff", // 阴影颜色。支持的格式同color。
|
},
|
emphasis: { // 高亮的 仪表盘指针样式
|
itemStyle: {
|
//高亮 和正常 两者具有同样的配置项,只是在不同状态下配置项的值不同。
|
}
|
},
|
title: { // 仪表盘标题。
|
show: true, // 是否显示标题,默认 true。
|
offsetCenter: [0, "120%"],//相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
|
color: "#1E1E1E", // 文字的颜色,默认 #333。
|
fontSize: 20, // 文字的字体大小,默认 15。
|
},
|
detail: { // 仪表盘详情,用于显示数据。
|
show: true, // 是否显示详情,默认 true。
|
offsetCenter: [0, "70%"],// 相对于仪表盘中心的偏移位置,数组第一项是水平方向的偏移,第二项是垂直方向的偏移。可以是绝对的数值,也可以是相对于仪表盘半径的百分比。
|
color: "auto", // 文字的颜色,默认 auto。
|
fontSize: 30, // 文字的字体大小,默认 15。
|
formatter: "{value}%", // 格式化函数或者字符串
|
},
|
data: data2
|
}
|
]
|
};
|
// 使用刚指定的配置项和数据显示图表
|
chart2.setOption(option2);
|
|
//#endregion
|
|
//#region 头工具栏事件
|
|
//条形码回车方法
|
$('#HBarCodeSN').on('keydown', function (event) {
|
var HBarCode = $('#HBarCodeSN').val();
|
if (event.keyCode == 13) {
|
HBarCode = HBarCode.toUpperCase();
|
if (!HBarCode) {
|
layer.msg("条形码不能为空!")
|
return;
|
}
|
txtHBarCode_KeyDown(HBarCode);
|
}
|
});
|
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
switch (obj.event) {
|
//删除
|
case 'set_DeleteBill': set_DeleteBill();
|
break;
|
};
|
});
|
|
|
//生产资源
|
form.on('submit(btnHSourceID)', function () {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: "生产资源列表" //标题
|
, shift: 2//弹出动画
|
, content: ["../../基础资料/生产基础资料/Gy_Source.html", "yes"]
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HSourceID").val(checkStatus.data[0].HItemID);
|
$("#HSourceName").val(checkStatus.data[0].生产资源名称);
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
});
|
|
//工序
|
form.on('submit(btnHProcID)', function () {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: "工序列表" //标题
|
, shift: 2//弹出动画
|
, content: ["../../基础资料/生产基础资料/Gy_Process.html", "yes"]
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HProcID").val(checkStatus.data[0].HItemID);
|
$("#HProcName").val(checkStatus.data[0].工序名称);
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
});
|
|
|
//工作中心
|
form.on('submit(btnHCenterID)', function () {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: "工作中心列表" //标题
|
, shift: 2//弹出动画
|
, content: ["../../基础资料/公用基础资料/Gy_WorkCenter.html", "yes"]
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HCenterID").val(checkStatus.data[0].HItemID);
|
$("#HCenterName").val(checkStatus.data[0].工作中心名称);
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
});
|
|
//生产班组
|
form.on('submit(btnHGroupID)', function () {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: "生产班组列表" //标题
|
, shift: 2//弹出动画
|
, content: ["../../基础资料/工资基础资料/Gy_Group.html?type=HGroup", "yes"]
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HGroupID").val(checkStatus.data[0].HItemID);
|
$("#HGroupName").val(checkStatus.data[0].班组名称);
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
});
|
|
//操作员
|
form.on('submit(btnHEmpID)', function () {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: "操作员列表" //标题
|
, shift: 2//弹出动画
|
, content: ["../../基础资料/公用基础资料/Gy_EmployeeList.html?type=HEmp", "yes"]
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HEmpID").val(checkStatus.data[0].HItemID);
|
$("#HEmpName").val(checkStatus.data[0].职员名称);
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
});
|
|
//保存
|
form.on('submit(Saver)', function (data) {//提交
|
Saver(data);
|
})
|
|
//退出
|
form.on('submit(Exit)', function (data) {//提交
|
Pub_Close(1);
|
})
|
|
|
//新增
|
form.on('submit(Add)', function (data) {
|
layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
|
location.replace('Cj_StationOutBill_CurrentWork.html');
|
});
|
})
|
|
|
//#endregion
|
|
//#region 本页面所有被调用的方法
|
function set_ClearBill() {
|
get_CriticalPartsList();
|
$("#HPRDOrgID").val(sessionStorage["OrganizationID"]);
|
$("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
|
$('#Add').addClass("layui-btn-disabled").attr("disabled", true);//新增按钮禁用
|
//get_Display();
|
get_Display_OutBillList();
|
get_Display_UserList();
|
get_ConfigFileInfo_EquipFile();
|
MaxBillNO();
|
//查询
|
get_FastQuery();
|
}
|
|
//获取最大单据号
|
function MaxBillNO() {
|
$("#HInterID").val("0");
|
$("#HBillNo").val("");
|
//获取最大单据号
|
$.ajax({
|
url: GetWEBURL() + "/Web/GetMAXNum",
|
type: "GET",
|
data: { "HBillType": '3791' },
|
success: function (d) {
|
//console.log(d.data);
|
$("#HInterID").val(d.data[0].HInterID);
|
$("#HBillNo").val(d.data[0].HBillNo);
|
}
|
});
|
}
|
|
//初始化表格
|
function get_CriticalPartsList() {
|
options = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, page: false
|
, totalRow: true
|
//, cellMinWidth: 120
|
, data: []
|
, height: 780
|
, limit: Number.MAX_VALUE
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { type: 'numbers', title: '序号' }
|
, { field: '制单日期', title: '日期', width: 100 }
|
, { field: '物料代码', title: '产品代码', width: 100 }
|
, { field: '物料名称', title: '产品名称', width: 100 }
|
, { field: '条码', title: '条码', width: 100 }
|
, { field: '出站数量', title: '数量', width: 100 }
|
, { field: '生产订单号', title: '订单号', width: 100 }
|
]]
|
}
|
|
table.render(options);
|
|
}
|
|
//删除单据
|
function set_DeleteBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
layer.confirm('确定删除' + data[0].条码 + '吗?', function (index) {
|
var ajaxLoad = layer.load();
|
//逻辑删除方法
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationOutBill_CurrentWork/get_PanelDisplay',
|
type: "GET",
|
data: { "HInterID": data[0].hmainid, "HDeleteMan": sessionStorage["HUserName"], "HBillSubType": "3791" },
|
success: function (result) {
|
if (result.count == 1) {
|
get_Display_OutBillList();
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
layer.close(index);
|
});
|
} else {
|
layer.msg('请选择一行数据编辑!');
|
}
|
}
|
|
//#region 快速过滤
|
function get_FastQuery() {
|
get_Display(sWhere);
|
sWhere = "";//调用接口后清空sWhere缓存
|
}
|
//#endregion
|
|
|
function get_Display(sWhere) {
|
sWhere = " and HInterID='" + HSourceInterID + "' and 源单子内码='" + HSourceEntryID + "'";
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/CheckBill/GetICMOBillStatusList',
|
type: "GET",
|
async: false,
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
$("#HProcName").val(result.data[0]["工序"]);
|
$("#HProcID").val(result.data[0]["HProcID"]);
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
|
}
|
|
//#region 查询
|
function get_PanelDisplay(sWhere) {
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationOutBill_CurrentWork/get_PanelDisplay',
|
type: "GET",
|
async: false,
|
data: { "HSourceID": HSourceID, "HICMOInterID": HICMOInterID, "HICMOEntryID": HICMOEntryID, "HSourceInterID": HSourceInterID, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
var data = result.data.h_p_JIT_GetCurrentTicketInfo[0];
|
$("#HICMOBillNo").text(data.HSourceBillNo);//工单号
|
$("#HICMOBillStatus").text('');//当前状态
|
$("#HMaterNumber").text(data.HMaterNumber);//产品代码
|
$("#HMaterName").text(data.HMaterName);//产品名称
|
$("#HMaterModel").text(data.HModel);//规格型号
|
$("#HPlanQty").text(data.HPlanQty);//计划数量
|
$("#HReportQty").text(data.HRelationQty);//汇报总数
|
$("#HPickMtrlStatus").text('');//领料状态
|
$("#HFCheckNum").text(data.首检次数);//首检次数
|
$("#HPrCheckNum").text(data.过程检次数);//过程检次数
|
$("#HPPCheckNum").text(data.巡检次数);//巡检次数
|
HFinishRate = data.完成率;//完成率
|
HQualifiedRate = data.合格率;//合格率
|
layer.close(ajaxLoad);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
|
}
|
//#endregion
|
|
//查询用户关联信息
|
function get_Display_UserList() {
|
var sWhere = " and 编码='" + sessionStorage["Czybm"] + "'";
|
var ajaxLoad = layer.load();
|
//进入页面显示的缓存列表
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/Cj_CollectionOfSingleProductDefectsUserList',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.count == 1) {
|
|
$("#HDeptID").val(data1.data[0]["HDeptID"]);
|
$("#HDeptName").val(data1.data[0]["车间"]);
|
//$("#HProcName").val(data1.data[0]["工序"]);
|
//$("#HProcID").val(data1.data[0]["HProcID"]);
|
$("#HSourceID").val(data1.data[0]["HSourceID"]);
|
$("#HSourceName").val(data1.data[0]["生产资源"]);
|
$("#HEmpID").val(data1.data[0]["HEmpID"]);
|
$("#HEmpName").val(data1.data[0]["质检员"]);
|
$("#HGroupID").val(data1.data[0]["HGroupID"]);
|
$("#HGroupName").val(data1.data[0]["生产班组"]);
|
$("#HCenterID").val(data1.data[0]["HWorkCenterID"]);
|
$("#HCenterName").val(data1.data[0]["工作中心"]);
|
layer.close(ajaxLoad);
|
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
|
});
|
}
|
|
//#region 根据平板绑定,自动带出基础资料信息
|
function get_ConfigFileInfo_EquipFile() {
|
var objdata = get_ConfigFileInfo();
|
//$("#HProcID").val(objdata.HProcID); //工序ID
|
//$("#HProcName").val(objdata.HProcName); //工序名称
|
//$("#HEquipID").val(objdata.HEquipID); //设备ID
|
$("#HEquipCode").text(objdata.HEquipName); //设备名称
|
//$("#HSourceID").val(objdata.HSourceID); //生产资源ID
|
//$("#HSourceName").val(objdata.HSourceName); //生产资源名称
|
//$("#HGroupID").val(objdata.HGroupID); //班组ID
|
//$("#HGroupName").val(objdata.HGroupName); //班组名称
|
//$("#HCenterID").val(objdata.HWorkCenterID); //工作中心ID
|
//$("#HCenterName").val(objdata.HWorkCenterName); //工作中心名称
|
|
}
|
//#endregion
|
|
//查询当前用户今天的出站单的数据
|
function get_Display_OutBillList() {
|
sWhere = " and 制单人='" + sessionStorage["HUserName"] + "' and CONVERT(varchar(10),制单日期,20)=CONVERT(varchar(10),GETDATE(),20) ";
|
//进入页面显示的缓存列表
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Cj_StationOutBill_CurrentWork/get_Out_Display',
|
type: "GET",
|
async: false,
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "HBillSubType": "3791" },
|
success: function (data1) {
|
if (data1.count == 1) {
|
options.data = data1.data;
|
table.render(options);
|
} else {
|
layer.alert(data1.Message, { icon: 5 });
|
}
|
|
layer.close(wait);
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
layer.close(wait);
|
}
|
|
//条码回车查询
|
function txtHBarCode_KeyDown(HBarCode) {
|
|
var indexs = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_StationOutBill_CurrentWork/SNHBardCodeList",
|
async: false,
|
data: { "HBarCode": HBarCode, "HProcID": $("#HProcID").val(), "HOrgID": sessionStorage["OrganizationID"] },
|
dataType: "json",
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.close(indexs);
|
$("#HProcNo").val(data1.data[0]["工序号"]);
|
$("#HICMOBillNo").val(data1.data[0]["生产订单号"]);
|
$("#HICMOInterID").val(data1.data[0]["hicmointerid"]);
|
$("#HProcExchBillNo").val(data1.data[0]["单据号"]);
|
$("#lngBillKey").val(data1.data[0]["hmainid"]);
|
$("#lngBillSubKey").val(data1.data[0]["hsubid"]);
|
$("#HMaterNumber").val(data1.data[0]["产品代码"]);
|
$("#HMaterName").val(data1.data[0]["产品"]);
|
$("#HMaterModel").val(data1.data[0]["规格型号"]);
|
$("#HMaterID").val(data1.data[0]["HMaterID"]);
|
$("#HUnitName").val(data1.data[0]["单位"]);
|
$("#HUnitID").val(data1.data[0]["HUnitID"]);
|
$("#HQty").val(data1.data[0]["最小包装数量"]);
|
$("#HICMOQty").val(data1.data[0]["生产数量"]);
|
$("#HPlanQty").val(data1.data[0]["流转卡数量"]);
|
$("#HBarCode").val(HBarCode);
|
getHModel(data1.data[0]["hmainid"], data1.data[0]["hsubid"], data1.data[0]["单据号"]);
|
}
|
else {
|
layer.close(indexs);
|
layer.msg(data1.Message);
|
}
|
//光标跳转到SN条码文本框上
|
//$("#HBarCodeSN").focus();
|
$("#HBarCodeSN").val("");
|
},
|
error: function (err) {
|
layer.close(indexs);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//根据条形码的查出的流转卡主子id+流转卡 找出对应的模具
|
function getHModel(HInterID, HEntryID, HBillNo) {
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_StationOutBill_CurrentWork/getHModelList",
|
async: false,
|
data: { "HInterID": HInterID, "HEntryID": HEntryID, "HBillNo": HBillNo},
|
dataType: "json",
|
success: function (data1) {
|
if (data1.count == 1) {
|
$("#HMouldID").val(data1.data[0]["HMouldID"]);
|
$("#HMouldNo").val(data1.data[0]["模具编码"]);
|
$("#HMouldName").val(data1.data[0]["模具名称"]);
|
$("#HModel").val(data1.data[0]["模具型号"]);
|
}
|
else {
|
layer.close(indexs);
|
layer.msg(data1.Message);
|
}
|
},
|
error: function (err) {
|
layer.close(indexs);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//保存
|
function Saver(data) {
|
if ($("#HProcExchBillNo").val() == "") {
|
layer.msg("请扫流转卡!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return;
|
}
|
if ($("#HQty").val() == 0 && $("#HBadCount").val() == 0) {
|
|
layer.msg("不良和合格数量不能同时为0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
return;
|
}
|
|
var oMain = JSON.stringify(data.field) + ";" + sessionStorage["HUserName"] + ";Add";
|
var index = layer.load();
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/Cj_StationOutBill/AddBill",
|
async: false,
|
data: { "oMain": oMain },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) {
|
layer.close(index);
|
SaverSub(oMain);
|
//layer.msg("提交成功");
|
//$('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮禁用
|
//$('#Add').removeClass("layui-btn-disabled").attr("disabled", false);//新增按钮启用
|
}
|
else {
|
layer.close(index);
|
layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
//保存出站单子表
|
function SaverSub(data) {
|
var oMain = data;
|
var index = layer.load();
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/Cj_StationOutBill_CurrentWork/AddBillSub",
|
async: false,
|
data: { "oMain": oMain },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) {
|
layer.close(index);
|
layer.msg("提交成功");
|
$('#Saver').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮禁用
|
$('#Add').removeClass("layui-btn-disabled").attr("disabled", false);//新增按钮启用
|
get_Display_OutBillList();
|
}
|
else {
|
layer.close(index);
|
layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//以上是layui模块
|
});
|
|
|
//生产资源
|
function GetGySource(obj) {
|
$("#HSourceID").val(obj.HItemID);
|
$("#HSourceName").val(obj.生产资源名称);
|
}
|
|
//工作中心
|
function GetWorkCenterValue(obj) {
|
$("#HCenterID").val(obj[0].HItemID);
|
$("#HCenterName").val(obj[0].工作中心名称);
|
}
|
|
//生产班组
|
function GetHGroupValue(obj) {
|
$("#HGroupName").val(obj[0].班组名称);
|
$("#HGroupID").val(obj[0].HItemID);
|
}
|
|
//操作员
|
function GetHEmpValue(obj) {
|
$("#HEmpID").val(obj[0].HItemID);
|
$("#HEmpName").val(obj[0].职员名称);
|
}
|
</script>
|