WebTM/views/ÖÊÁ¿¹ÜÀí/Ê×¼þ¼ìÑéµ¥/QC_Add_Edit_FirstPieceCheckBill.html
@@ -47,19 +47,19 @@
        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 10px;">
                        <!--<button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                            <i class="layui-icon layui-icon-print layuiadmin-button-btn"><span class="btn-title">预览</span></i>
                        </button>-->
                        <!--<button class="layui-btn layuiadmin-btn-order main-btn" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                            <i class="layui-icon layui-icon-edit layuiadmin-button-btn"><span class="btn-title">修改</span></i>
                        </button>-->
                        <button type="button" class="layui-btn layui-btn-normal" style="margin-left: 0px" lay-submit="" lay-filter="btn-AddNew" id="btn-AddNew">新增</button>
                        <button type="button" class="layui-btn layui-btn-normal" style="margin-left: 0px" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
                        <button type="button" class="layui-btn layui-btn-normal" style="margin-left: 0px" lay-submit="" lay-filter="btn-Exit" id="btn-Exit">退出</button>
                    <div style="position: relative; display: flex; align-items: center; padding: 10px;">
                        <!-- æŒ‰é’®ç»„ -->
                        <div style="z-index: 1;">
                            <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="btn-AddNew" id="btn-AddNew">新增</button>
                            <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
                            <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">审核</button>
                            <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="btn-Exit" id="btn-Exit">退出</button>
                            <button type="button" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="btn-SIP" id="btn-SIP">SIP查看</button>
                        </div>
                        <!-- æ ‡é¢˜ï¼Œä½¿ç”¨ç»å¯¹å®šä½ä½¿å…¶åœ¨çˆ¶å®¹å™¨å†…居中 -->
                        <h1 style="position: absolute; left: 50%; transform: translateX(-50%); z-index: 0; text-align: center; width: fit-content; margin: 0; padding: 0 10px;"><b>首件检验单</b></h1>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <h1 style="text-align: center; padding: 10px 0;"><b>首件检验单</b></h1>
                    <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>
                            <li lay-id="2" style="padding:1px;">制单信息</li>
@@ -92,30 +92,6 @@
                                                <input type="hidden" name="HSourceID" id="HSourceID" value="0">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">任务单号</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchICMOBill" id="btnSearchICMOBill" 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: 85px;">任务单数量</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HICMOQty" id="HICMOQty" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="display: none">
                                            <label class="layui-form-label" style="width: 85px;">任务单内码</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HICMOInterID" id="HICMOInterID" value="0" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HICMOEntryID" id="HICMOEntryID" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">生产班次</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
@@ -128,73 +104,117 @@
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline" id="hidediv1">
                                            <label class="layui-form-label" style="width: 85px;">流转卡数量</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HProcExchQty" id="HProcExchQty" style="background-color:#efefef4d;" readonly value="1">
                                            </div>
                                        </div>
                                        <div class="layui-inline" id="hidediv2">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">流转卡号</label>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">任务单号</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HProcExchBillNo" id="HProcExchBillNo" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchProcExch" id="btnSearchProcExch" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <input type="text" class="layui-input" name="HICMOBillNo" id="HICMOBillNo" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HICMOInterID" id="HICMOInterID" value="0" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HICMOEntryID" id="HICMOEntryID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchICMOBill" id="btnSearchICMOBill" 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-inline">
                                            <label class="layui-form-label" style="width: 85px;">批号</label>
                                            <label class="layui-form-label" style="width: 85px;">任务单数量</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBatchNo" id="HBatchNo" style="">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline" style="display: none">
                                            <label class="layui-form-label" style="width: 85px;">流转卡ID</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HProcExchInterID" id="HProcExchInterID" value="0" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="display: none">
                                            <label class="layui-form-label" style="width: 85px;">流转卡子ID</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HProcExchEntryID" id="HProcExchEntryID" value="0" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HICMOQty" id="HICMOQty" style="background-color:#efefef4d;" readonly value="0">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">产品名称</label>
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">产品代码</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HMaterName" id="HMaterName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="text" class="layui-input" name="HMaterID" id="HMaterID" value="0" style="background-color:#efefef4d;width: 60%;display: none;" readonly>
                                                <input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HMaterID" id="HMaterID" value="0" style="background-color:#efefef4d;width: 60%;display: none;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchMater" id="btnSearchMater" 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: 85px;">产品名称</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterName" id="HMaterName" style="background-color:#efefef4d;display: inline-block;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline" id="hidediv2">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">流转卡号</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HProcExchBillNo" id="HProcExchBillNo" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HProcExchInterID" id="HProcExchInterID" value="0" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" class="layui-input" name="HProcExchEntryID" id="HProcExchEntryID" value="0" style="background-color:#efefef4d;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchProcExch" id="btnSearchProcExch" 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" id="hidediv1">
                                            <label class="layui-form-label" style="width: 85px;">流转卡数量</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HProcExchQty" id="HProcExchQty" style="background-color:#efefef4d;" readonly value="0">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">工序</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HProcName" id="HProcName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HProcID" id="HProcID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProc" id="btnHProc" 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: 85px;">取样单</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HTakeSampleCheckBillNo" id="HTakeSampleCheckBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HTakeSampleCheckBillID" id="HTakeSampleCheckBillID" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">检验员</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HFirstCheckEmpName" id="HFirstCheckEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HFirstCheckEmp" id="HFirstCheckEmp" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHFirstCheckEmp" id="btnSearchHFirstCheckEmp" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                                <input type="hidden" name="HFirstCheckEmp" id="HFirstCheckEmp" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">检验方案</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HQCSchemeName" id="HQCSchemeName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HQCSchemeID" id="HQCSchemeID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchQCScheme" id="btnSearchQCScheme" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                                <input type="hidden" name="HQCSchemeID" id="HQCSchemeID" value="0">
                                            </div>
                                        </div>
                                    </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">批号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBatchNo" id="HBatchNo" style="">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">判断结论</label>
                                            <div class="layui-input-block">
                                                <input type="radio" name="HLastResult" value="true" title="合格" checked>
                                                <input type="radio" name="HLastResult" value="false" title="不合格">
                                            </div>
                                        </div>
                                        <div class="layui-inline" style="width: 45%;">
                                            <label class="layui-form-label" style="width: 85px;">SN码记录</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HRemarkSN" id="HRemarkSN" placeholder="请输入内容" onmouseover="this.title=this.value">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline" style="width: 45%;">
@@ -207,32 +227,6 @@
                                            <label class="layui-form-label" style="width: 85px;">异常临时<br />处理方案</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HErrTreatment" id="HErrTreatment" placeholder="请输入内容" onmouseover="this.title=this.value" style="margin-top:10px;">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">判断结论</label>
                                            <div class="layui-input-block">
                                                <input type="radio" name="HLastResult"  value="true" title="合格" >
                                                <input type="radio" name="HLastResult"  value="false" title="不合格" checked>
                                            </div>
                                        </div>
                                        <div class="layui-inline" id="hidediv1" style="margin-left:20px;">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">工序</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HProcName" id="HProcName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHProc" id="btnHProc" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                                <input type="hidden" name="HProcID" id="HProcID" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">取样单</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HTakeSampleCheckBillNo" id="HTakeSampleCheckBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HTakeSampleCheckBillID" id="HTakeSampleCheckBillID" value="0">
                                            </div>
                                        </div>
                                    </div>
@@ -314,11 +308,11 @@
                        </div>
                    </div>
                    <!--<table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>-->
                    <div class="layui-tab layui-tab-card">
                    <div class="layui-tab layui-tab-card" lay-filter="bottomTable">
                        <ul class="layui-tab-title">
                            <li class="layui-this">检验项目</li>
                            <li>抽样检验</li>
                            <li>检测值</li>
                            <li lay-id="1" class="layui-this">检验项目</li>
                            <li lay-id="2">抽样检验</li>
                            <li lay-id="3">检测值</li>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
@@ -377,13 +371,13 @@
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">样本量</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HSampleQty" id="HSampleQty"  value="0"  style="background-color:#efefef4d;" readonly>
                                            <input type="text" class="layui-input" name="HSampleQty" id="HSampleQty" value="0" style="background-color:#efefef4d;" readonly>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label" style="width: 85px;">样本破坏数</label>
                                        <div class="layui-input-block" style="margin-left: 120px;">
                                            <input type="text" class="layui-input" name="HSampleDamageQty" id="HSampleDamageQty"  value="0" style="">
                                            <input type="text" class="layui-input" name="HSampleDamageQty" id="HSampleDamageQty" value="0" style="">
                                        </div>
                                    </div>
                                </div>
@@ -485,7 +479,7 @@
                                                </button>
                                                <input type="hidden" name="HQCCheckItemID" id="HQCCheckItemID" value="0">
                                            </div>
                                        </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:5px;">
                                        <div class="layui-inline">
@@ -644,6 +638,7 @@
                        <div class="layui-btn-container">
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                        </div>
                    </script>
                    <!--隐藏字段-->
@@ -694,6 +689,7 @@
        //1.检验项目表体数据值存储,借用点击行事件,当切换行时把上次所在行的数据存到option.data上;
        //这个思路会有个问题,最后一次点击的那行数据将不会在去触发点击行事件存储值,目前想到的是在执行保存方法时在把最后点击的那一行数据存入option.data上
        var OptionData = [];
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
@@ -708,9 +704,11 @@
                , laydate = layui.laydate
                , element = layui.element;
            //公用变量
            debugger;
            //debugger;
            var rowdata = [];
            var option = [];
            var HDeptID = "";//部门id èŽ·å–ç­æ¬¡
            var HCenterID = "";//工作中心id èŽ·å–ç­æ¬¡
            var rowdata_Value = [];
            var option_Value = [];
@@ -725,6 +723,10 @@
            var UnRightQty_isFied = 0; //用于判断是否合格//检验值表格不合格数量汇总
            var editIndex = 0;//编辑下标
            var SampleNum = [];//样本数量
            var HModName = "QC_Add_Edit_FirstPieceCheckBill";
            var isOpenBox = "0";//是否打开弹框到安灯页面
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "7505";
@@ -749,6 +751,10 @@
            //var linterid = 11880;
            //var HSouceBillType = 3722;
            //var HICMOEntryID = 100027;
            //初始化表格
            set_InitGrid();
            //#region åˆ¤æ–­æ˜¯å¦æ–°å¢ž
            if (OperationType == 1) {
                $("#HInterID").val("");
@@ -756,6 +762,8 @@
                $("#HFirstCheckEmp").val(sessionStorage["HCheckEmpID"]); //根据登录用户带出检验员ID
                $("#HFirstCheckEmpName").val(sessionStorage["HCheckEmpName"]); //根据登录用户带出检验员
                HDeptID = sessionStorage["HDeptID"]; //根据登录用户带出部门ID
                HCenterID = sessionStorage["HWorkCenterID"]; //根据登录用户带出工作中心ID
                //$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);//有源单时保存按钮禁用
                //获取最大单据号
@@ -771,6 +779,8 @@
                        $("#HMaker").val(sessionStorage["HUserName"]);
                    }
                });
                //获取班次
                get_HWorkShift();
            }
            else if (OperationType == 2) {
                $("#HInterID").val("");
@@ -783,6 +793,8 @@
                $("#HFirstCheckEmp").val(sessionStorage["HEmpID"]);
                $("#HFirstCheckEmpName").val(sessionStorage["HEmpName"]);
                HDeptID = sessionStorage["HDeptID"]; //根据登录用户带出部门ID
                HCenterID = sessionStorage["HWorkCenterID"]; //根据登录用户带出工作中心ID
                //获取最大单据号
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
@@ -800,30 +812,65 @@
                if (HSouceBillType == 3722 || HSouceBillType == 4610) {
                    //根据源单id获取源单信息
                    LoadingInformation2();
                    //客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案
                    if ((sessionStorage["OrganizationID"] == "7667152" && sessionStorage["Organization"] == "CMR Technology Mexico S.A. de C.V.") ||
                        (sessionStorage["OrganizationID"] == "100199" && sessionStorage["Organization"] == "杭州斯莫尔磁性材料有限公司"))
                    {
                        //自动带出检验方案
                        GetCheckItemID();
                    }
                }
                //工序进站接收单列表首检
                else if (HSouceBillType == 3790) {
                    //根据源单id获取源单信息
                    LoadingInformation_StationInBill();
                    //客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案
                    if ((sessionStorage["OrganizationID"] == "7667152" && sessionStorage["Organization"] == "CMR Technology Mexico S.A. de C.V.") ||
                        (sessionStorage["OrganizationID"] == "100199" && sessionStorage["Organization"] == "杭州斯莫尔磁性材料有限公司")) {
                        //自动带出检验方案
                        GetCheckItemID();
                    }
                }
                //工序委外接收单列表首检
                else if (HSouceBillType == 3793) {
                    //根据源单id获取源单信息
                    LoadingInformation3();
                    //客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案
                    if ((sessionStorage["OrganizationID"] == "7667152" && sessionStorage["Organization"] == "CMR Technology Mexico S.A. de C.V.") ||
                        (sessionStorage["OrganizationID"] == "100199" && sessionStorage["Organization"] == "杭州斯莫尔磁性材料有限公司")) {
                        //自动带出检验方案
                        GetCheckItemID();
                    }
                }
                //生产订单列表首检
                else if (HSouceBillType == 3710) {
                    //根据源单id获取源单信息
                    LoadingInformation_ICMO();
                    //客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案
                    if ((sessionStorage["OrganizationID"] == "7667152" && sessionStorage["Organization"] == "CMR Technology Mexico S.A. de C.V.") ||
                        (sessionStorage["OrganizationID"] == "100199" && sessionStorage["Organization"] == "杭州斯莫尔磁性材料有限公司")) {
                        //自动带出检验方案
                        GetCheckItemID();
                    }
                }
                //工序流转卡列表首检
                else if (HSouceBillType == 3772) {
                    //根据源单id获取源单信息
                    LoadingInformation_ProcExchange();
                    //客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案
                    if ((sessionStorage["OrganizationID"] == "7667152" && sessionStorage["Organization"] == "CMR Technology Mexico S.A. de C.V.") ||
                        (sessionStorage["OrganizationID"] == "100199" && sessionStorage["Organization"] == "杭州斯莫尔磁性材料有限公司")) {
                        //自动带出检验方案
                        GetCheckItemID();
                    }
                }
                else {
                    layer.alert("源单类型无效!", { icon: 5 });
                }
                //获取班次
                get_HWorkShift();
            }
            else if (OperationType == 3) {
                RoadBillMain(linterid);
@@ -833,8 +880,7 @@
            $("[name='btnSearchCheckItemID']").addClass("layui-btn-disabled").attr("disabled", true);//禁用检验项目放大镜
            //初始化表格
            set_InitGrid();
            //#region æ ¹æ®æºå•获取信息
            //根据源单id获取源单信息(进站接收单)
            function LoadingInformation_StationInBill() {
@@ -842,6 +888,7 @@
                $.ajax({
                    url: GetWEBURL() + '/QC_FirstPieceCheckBill/get_StationInBill',
                    type: "GET",
                    async: false,
                    data: { "HInterID": linterid, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        var data = result.data[0];
@@ -885,6 +932,7 @@
                $.ajax({
                    url: GetWEBURL() + '/CheckBill/get_ProcessExchangeBill',
                    type: "GET",
                    async: false,
                    data: { "HInterID": linterid, "HEntryID": HEntryID, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        var data = result.data[0];
@@ -906,8 +954,11 @@
                            $("#HICMOEntryID").val(data.HICMOEntryID == null ? 0 : data.HICMOEntryID);//
                            $("#HQCSchemeName").val(data.检验方案名称);
                            $("#HQCSchemeID").val(data.检验方案ID);
                            $("#HProcID").val(data.HProcID);//
                            $("#HProcName").val(data.当前工序);//
                            $("#HBatchNo").val(data.批号);
                            HDeptID = data.HWorkShopID == null ? sessionStorage["HDeptID"] : data.HWorkShopID;//工作中心id
                            HCenterID = data.HCenterID == null ? sessionStorage["HWorkCenterID"] : data.HCenterID;//工作中心id
                            //获取表体检验项目信息
                            get_CheckItem();
                        } else {
@@ -928,9 +979,10 @@
                var wait = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/LEMS/MES_IF_ICMOBillList_Json',
                    url: GetWEBURL() + '/QC_FirstPieceCheckBill/get_ICMOBill',
                    type: "GET",
                    data: { "sWhere": "and hmainid = " + linterid, "user": sessionStorage["HUserName"] },
                    async: false,
                    data: { "HICMOInterID": linterid, "HICMOEntryID": HICMOEntryID, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        var data = result.data[0];
                        if (result.count == 1) {
@@ -944,11 +996,16 @@
                            $("#HSourceName").val(data.生产资源);
                            $("#HSourceID").val(data.HSourceID);
                            $("#HMaterID").val(data.HMaterID);
                            $("#HMaterNumber").val(data.产品代码);
                            $("#HMaterName").val(data.产品名称);
                            $("#HMainSourceBillNo").val(data.单据号);
                            $("#HMainSourceBillType").val(data.单据类型);
                            $("#HMainSourceInterID").val(data.hmainid);
                            $("#HICMOEntryID").val(data.HEntryID);
                            $("#HQCSchemeName").val(data.检验方案名称);
                            $("#HQCSchemeID").val(data.检验方案ID);
                            //获取表体检验项目信息
                            get_CheckItem();
                        } else {
                            layer.alert(result.Message, { icon: 5 });
                        }
@@ -966,6 +1023,7 @@
                $.ajax({
                    url: GetWEBURL() + "/QC_FirstPieceCheckBill/get_ICMOBillStatus_Tmp",
                    type: "GET",
                    async: false,
                    data: { "HInterID": linterid, "HEntryID": HICMOEntryID, "HBillType": HSouceBillType },
                    success: function (result) {
                        var data = result.data[0];
@@ -1006,6 +1064,7 @@
                $.ajax({
                    url: GetWEBURL() + '/Cj_StationEntrustOutBill/list',
                    type: "GET",
                    async: false,
                    data: { "sWhere": "and HInterID = " + linterid },
                    success: function (result) {
                        var data = result.data[0];
@@ -1043,11 +1102,12 @@
                    , data = checkStatus.data;
                //新增行表格数据
                var NewRow = {
                    "HQCCheckItemID": "", "检验项目": "", "HInspectInstruMentID": "0", "检验仪器": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HAnalysisMethod": "", "HResult": "",
                    "HQCCheckItemID": "", "检验项目代码": "","检验项目": "", "HInspectInstruMentID": "0", "检验仪器代码": "", "检验仪器": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HAnalysisMethod": "", "HResult": "",
                    "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": false, "HStatus": 0, "HSampleSchemeID": 0, "HUnitID": 0,
                    "HInspectVal": '', "HTargetVal": '', "HUpLimit": '', "HDownLimit": '', "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": '0',
                    "HSampleSchemeName": "", "HSampleQty": "0", "HSampleDamageQty": "0", "HAcceptQty": "0", "HInspectionLevel": "", "HRejectQty": "",
                    "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": ""
                    "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": "", "HCompareSymbol": '=', "HQualityStdID": 0, "HQualityStdName": "",
                    "HInspectMethodID": 0, "HInspectMethodName": "", "HInspectBasisID": 0, "HInspectBasisName": ""
                };
                switch (obj.event) {
@@ -1082,14 +1142,16 @@
                            form.render('select');
                        }
                        break;
                    //列设置
                    case 'set_HideColumn':
                        get_HideColumn();
                        break;
                }
            });
            //#endregion
            //退出按钮
            form.on('submit(btn-Exit)', function (data) {
                get_Exit();
            form.on('submit(btn-Exit)', function (data) {
                sWhere = " and hmainid = " + $("#HInterID").val();
                $.ajax({
                    url: GetWEBURL() + "/QC_FirstPieceCheckBill/QC_FirstPieceCheckBillList",
@@ -1114,6 +1176,7 @@
                        }
                    }
                })
                get_Exit();
            });
            //新增按钮
@@ -1222,6 +1285,27 @@
                    });
                }
                var data = obj.data;
                if (obj.event == '检验仪器代码') {
                    var HNumber = data.检验仪器代码;
                    var linterid = data.HInspectInstruMentID;
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '查看检验仪器'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../../基础资料/公用基础资料/Add_Edit_Gy_InspectInstruMent.html?OperationType=3&linterid=' + linterid + ''
                        , resize: false,
                        end: function () {
                        }
                        , cancel: function () {
                        }
                    })
                }
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    var rowIndex = Number($(obj.tr).attr("data-index")) + Number(1);
                    if (event.key == "F7") {
@@ -1235,7 +1319,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../基础资料/公用基础资料/Gy_CheckItem.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_CheckItem.html?openType=2', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -1245,23 +1329,74 @@
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    var HResult = checkStatus.data[0].默认结论 == "合格" ? 1 : 2
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        æ£€éªŒé¡¹ç›®: checkStatus.data[0].名称
                                        , HQCCheckItemID: checkStatus.data[0].HItemID
                                        , HResult: HResult
                                    });
                                    $('#HResult' + rowIndex + '').find("option[value='" + HResult + "']").attr("selected", true);
                                    form.render('select');
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    if (checkStatus.data.length === 1) {
                                        var HResult = checkStatus.data[0].默认结论 == "合格" ? 1 : 2
                                        //同步更新表格和缓存对应的值
                                        obj.update({
                                            æ£€éªŒé¡¹ç›®: checkStatus.data[0].名称
                                            , æ£€éªŒé¡¹ç›®ä»£ç : checkStatus.data[0].代码
                                            , HQCCheckItemID: checkStatus.data[0].HItemID
                                            , HResult: HResult
                                        });
                                        $('#HResult' + rowIndex + '').find("option[value='" + HResult + "']").attr("selected", true);
                                        form.render('select');
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    } else {
                                        //(多选行)
                                        //将原有表体数据写入数组
                                        var tableBak = table.cache["mainTable"]; //获取之前编辑过的表格数据
                                        buttonArr = [];//清空数组
                                        for (var i = 0; i < tableBak.length; i++) {
                                            if (tableBak[i]["HQCCheckItemID"] != 0 && tableBak[i]["检验项目"] != "" && tableBak[i]["HResult"] != undefined && tableBak[i]["HResult"] != null) {
                                                buttonArr.push(tableBak[i]);  //如果关键字段不为空,则将之前的数据存储
                                            }
                                        }
                                        //将批量选择的数据写入数组(多选行)
                                        for (var i = 0; i < checkStatus.data.length; i++) {
                                            buttonArr.push({
                                                "检验项目": checkStatus.data[i].名称, "检验项目代码": checkStatus.data[i].代码, "HQCCheckItemID": checkStatus.data[i].HItemID, "HResult": 1,
                                                "HInspectInstruMentID": "0", "检验仪器代码": "", "检验仪器": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HAnalysisMethod": "",
                                                "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": false, "HStatus": 0, "HSampleSchemeID": 0, "HUnitID": 0,
                                                "HInspectVal": '', "HTargetVal": '', "HUpLimit": '', "HDownLimit": '', "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": '0',
                                                "HSampleSchemeName": "", "HSampleQty": "0", "HSampleDamageQty": "0", "HAcceptQty": "0", "HInspectionLevel": "", "HRejectQty": "",
                                                "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": ""});
                                        }
                                        table.reload("mainTable", {
                                            data: buttonArr    //将数据重新载入表格
                                        })
                                        for (var i = 1; i <= option.data.length; i++) {
                                            $('#HResult' + i + '').find("option[value='" + option.data[i - 1].HResult + "']").attr("selected", true);
                                            $('#HAnalysisMethod' + i + '').find("option[value='" + option.data[i - 1].HAnalysisMethod + "']").attr("selected", true);
                                            //完成标记
                                            if (option.data[i - 1].HKeyInspect) {
                                                $('#HKeyInspect' + i + '').attr("checked", true);
                                            }
                                        }
                                        form.render('select');
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    }
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                    if (OptionData.length > 0) {
                                        //更新表格缓存的数据
                                        obj.update({
                                            æ£€éªŒé¡¹ç›®: OptionData[0].名称,
                                            æ£€éªŒé¡¹ç›®ä»£ç : OptionData[0].代码,
                                            HQCCheckItemID: OptionData[0].HItemID,
                                            HResult: 1
                                        });
                                        $('#HResult' + rowIndex + '').find("option[value='" + 1 + "']").attr("selected", true);
                                        form.render('select');
                                        OptionData = [];
                                    }
                                }
                            });
                        }
@@ -1275,7 +1410,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../基础资料/公用基础资料/Gy_InspectInstruMent.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_InspectInstruMent.html?openType=2', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -1288,7 +1423,8 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        æ£€éªŒä»ªå™¨: checkStatus.data[0].检验仪器名称
                                        æ£€éªŒä»ªå™¨ä»£ç : checkStatus.data[0].检验仪器代码
                                        , æ£€éªŒä»ªå™¨: checkStatus.data[0].检验仪器名称
                                        , HInspectInstruMentID: checkStatus.data[0].HItemID
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
@@ -1298,6 +1434,155 @@
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                    if (OptionData.length > 0) {
                                        //更新表格缓存的数据
                                        obj.update({
                                            æ£€éªŒä»ªå™¨ä»£ç : OptionData[0].检验仪器代码,
                                            æ£€éªŒä»ªå™¨: OptionData[0].检验仪器名称,
                                            HInspectInstruMentID: OptionData[0].HItemID
                                        });
                                        OptionData = [];
                                    }
                                }
                            });
                        }
                        if (obj.event === 'HQualityStdName')  //
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '质量标准列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../基础资料/公用基础资料/Gy_QualityStd.html?openType=2', '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('请选择数据');
                                    }
                                    obj.update({
                                        HQualityStdID: checkStatus.data[0].HItemID,
                                        HQualityStdName: checkStatus.data[0].质量标准名称,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                    if (OptionData[0].禁用标记 != '是' || OptionData[0].审核人 != "") {
                                        //更新表格缓存的数据
                                        obj.update({
                                            "HQualityStdID": OptionData[0].HItemID
                                            , "HQualityStdName": OptionData[0].质量标准名称
                                        })
                                    } else {
                                        layer.msg("该质量标准已禁用未审核,请重新选择!");
                                    }
                                },
                                success: function (layero, index) {
                                }
                            });
                        }
                        if (obj.event === 'HInspectMethodName')  //
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '检验方法列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../基础资料/公用基础资料/Gy_InspectMethod.html?openType=2', '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('请选择数据');
                                    }
                                    obj.update({
                                        HInspectMethodID: checkStatus.data[0].HItemID,
                                        HInspectMethodName: checkStatus.data[0].检验方法名称,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                    if (OptionData[0].禁用标记 != '是' || OptionData[0].审核人 != "") {
                                        //更新表格缓存的数据
                                        obj.update({
                                            "HInspectMethodID": OptionData[0].HItemID
                                            , "HInspectMethodName": OptionData[0].检验方法名称
                                        })
                                    } else {
                                        layer.msg("该检验方法已禁用未审核,请重新选择!");
                                    }
                                },
                                success: function (layero, index) {
                                }
                            });
                        }
                        if (obj.event === 'HInspectBasisName')  //
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '检验依据列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../基础资料/公用基础资料/Gy_InspectBasis.html?openType=2', '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('请选择数据');
                                    }
                                    obj.update({
                                        HInspectBasisID: checkStatus.data[0].HItemID,
                                        HInspectBasisName: checkStatus.data[0].检验依据名称,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                    if (OptionData[0].禁用标记 != '是' || OptionData[0].审核人 != "") {
                                        //更新表格缓存的数据
                                        obj.update({
                                            "HInspectBasisID": OptionData[0].HItemID
                                            , "HInspectBasisName": OptionData[0].检验依据名称
                                        })
                                    } else {
                                        layer.msg("该检验仪器已禁用未审核,请重新选择!");
                                    }
                                },
                                success: function (layero, index) {
                                }
                            });
@@ -1325,7 +1610,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../基础资料/公用基础资料/Gy_InspectValue.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_InspectValue.html?openType=2', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -1338,7 +1623,8 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HInSpectValueB: checkStatus.data[0].检测值名称
                                        HInSpectValueB: checkStatus.data[0].HItemID,
                                        HInSpectValueB_Text: checkStatus.data[0].检测值名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    var DXValue = checkStatus.data[0].检测值名称; //定性检测值
@@ -1417,6 +1703,12 @@
                set_SaveBill(data);
            });
            //#region å®¡æ ¸æŒ‰é’®
            form.on('submit(set_CheckBill)', function (data) {
                set_CheckBill(0);
            });
            //#endregion
            //保存
            function set_SaveBill(data) {
                //赋值最后一个选中行的数据给option.data
@@ -1428,13 +1720,19 @@
                    layer.msg("任务单数量不能为空且不能小于等于0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HProcExchQty").val() == "" || $("#HProcExchQty").val() <= 0) {
                    layer.msg("流转卡数量不能为空且不能小于等于0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                if ($("#HInspectValB").val() == "") {
                    $("#HInspectValB").val(0)
                }
                //if ($("#HProcExchQty").val() == "" || $("#HProcExchQty").val() <= 0) {
                //    layer.msg("流转卡数量不能为空且不能小于等于0!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                if ($("#HFirstCheckEmp").val() == 0) {
                    layer.msg("检验员未选择!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if (data.field.HLastResult == "false") {
                    isOpenBox = "1";
                }
                var sSubTable = table.cache['mainTable'];
                for (var i = 0; i < sSubTable.length; i++) {
@@ -1478,18 +1776,40 @@
                    data: { "sMainSub": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) {
                            //layer.confirm(data.Message, {
                            //    icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                            //    btn2: function () {
                            //        //parent.layui.admin.events.closeThisTabs();关闭页签
                            //        //window.close();//关闭页面,浏览器有效,PDA无效
                            //        parent.location.href = "../../../views/index.html"
                            //    }//关闭
                            //}, function () { window.location.reload(); });//新增
                        if (data.count == 1) {
                            layer.close(index);
                            layer.msg("提交成功");
                            $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);//保存按钮
                            $('#set_CheckBill').removeClass("layui-btn-disabled").removeAttr("disabled").addClass("layui-btn-normal");
                            if (isOpenBox=="1") {
                                layer.open({
                                    type: 2,
                                    skin: 'layui-layer-rim',
                                    title: '异常反馈单',
                                    closeBtn: 1,
                                    shift: 2,
                                    area: ['100%', '100%'],
                                    maxmin: true,
                                    content: '../../生产管理/异常反馈单/Sc_Add_MESExecptFeedBackBillList.html?OperationType=4&linterid=&HSouceBillType=',
                                    end: function () {
                                    },
                                    success: function (dom, index) {
                                        var data = [];
                                        data.push({
                                            "HICMOBillNo": $("#HICMOBillNo").val(),//工单号
                                            "HSourceName": $("#HSourceName").val(), //设备
                                            "HType": "测量原因",     //异常类型
                                            "HSourceBillNo": $("#HMainSourceBillNo").val()     //流转卡号
                                        });
                                        // é€šè¿‡ç´¢å¼•获取到当前 iframe å¼¹å‡ºå±‚
                                        var iframe = window['layui-layer-iframe' + index];
                                        // è°ƒç”¨ iframe å¼¹å‡ºå±‚内的方法
                                        iframe.edit(data);
                                    },
                                });
                            }
                        }
                        else {
                            layer.close(index);
@@ -1528,6 +1848,7 @@
                                , "HICMOEntryID": data.HICMOEntryID
                                , "HMaterID": data.HMaterID
                                , "HMaterName": data.物料名称
                                , "HMaterNumber": data.物料代码
                                , "HProcID": data.HProcID
                                , "HProcName": data.HProcName
                                , "HProcExchQty": data.HProcExchQty
@@ -1584,6 +1905,7 @@
                                , "HLastResult": data.判定结论 == "合格" ? "true" : "false"
                                , "HTakeSampleCheckBillID": data.HTakeSampleCheckBillID
                                , "HTakeSampleCheckBillNo": data.HTakeSampleCheckBillNo
                                , "HRemarkSN": data.HRemarkSN
                            });
                            data = result.data;
                            //data = result.data.h_v_QC_Edit_FirstPieceCheckBillList;
@@ -1592,14 +1914,14 @@
                            for (var i = 0; i < data.length; i++) {
                                rowdata.push(
                                    {
                                        "HQCCheckItemID": data[i].HQCCheckItemID, "检验项目代码": data[i].检验项目代码, "检验项目": data[i].检验项目名称, "HInspectInstruMentID": data[i].HInspectInstruMentID, "检验仪器": data[i].检验仪器名称, "HQCStd": data[i].检验标准,
                                        "HQCCheckItemID": data[i].HQCCheckItemID, "检验项目代码": data[i].检验项目代码, "检验项目": data[i].检验项目名称, "HInspectInstruMentID": data[i].HInspectInstruMentID, "检验仪器代码": data[i].检验仪器代码, "检验仪器": data[i].检验仪器名称, "HQCStd": data[i].检验标准,
                                        "HUnit": data[i].单位名称, "HQCNote": data[i].检验记录, "HResult": data[i].结论 == "合格" ? 1 : 2,
                                        "HMax": data[i].最大值, "HMin": data[i].最小值, "HAvg": data[i].平均值, "HRemark": data[i].表体备注,
                                        "HAnalysisMethod": data[i].分析方法 == "定性分析" ? 1 : (data[i].分析方法 == "定量分析" ? 2 : 3), "HKeyInspect": data[i].重点检查 == "否" ? false : true,
                                        "HSampleSchemeID": data[i].HSampleSchemeID, "HUnitID": data[i].HUnitID,
                                        "HInspectVal": data[i].检测值, "HTargetVal": data[i].目标值, "HUpLimit": data[i].上限值, "HDownLimit": data[i].下限值, "HUpOffSet": data[i].上偏差, "HDownOffSet": data[i].下偏差, "HSampleDamageQty": data[i].样本破坏数,
                                        "HSampleSchemeName": data[i].抽样方案名称, "HSampleQty": data[i].样本量, "HSampleDamageQty": data[i].样本破坏数, "HAcceptQty": data[i].允许数, "HInspectionLevel": 0, "HRejectQty": data[i].拒绝数,
                                        "HStrictness": 0, "HSampleUnRightQty": data[i].样本不合格数, "HAQL": data[i].AQL, "HSamplingType": 0, "HSamplingType": data[i].抽样类型, "HStrictness": data[i].严格度
                                        "HSampleSchemeName": data[i].抽样方案名称, "HSampleQty": data[i].样本量, "HSampleDamageQty": data[i].样本破坏数, "HAcceptQty": data[i].允许数, "HInspectionLevel": 0, "HRejectQty": data[i].拒绝数,
                                        "HStrictness": 0, "HSampleUnRightQty": data[i].样本不合格数, "HAQL": data[i].AQL, "HSamplingType": data[i].抽样类型, "HStrictness": data[i].严格度, "HCompareSymbol": data[i].比较符, "HQualityStdID": data[i].HQualityStdID, "HQualityStdName": data[i].质量标准, "HInspectMethodID": data[i].HInspectMethodID, "HInspectMethodName": data[i].检验方法, "HInspectBasisID": data[i].HInspectBasisID, "HInspectBasisName": data[i].检验依据,"HCompareSymbol":data[i].比较符
                                    }
                                )
@@ -1653,6 +1975,7 @@
            //表头信息检验方案弹窗
            form.on('submit(btnSearchQCScheme)', function () {
                var HName = $("#HMaterName").val();
                var HProcName = $("#HProcName").val();
                //页面层-自定义
                layer.open({
                    type: 2,
@@ -1662,7 +1985,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../质量管理/检验方案单/QC_CheckProjectList.html?OperationType=1&HName=' + HName+'', 'yes'],
                    content: ['../../质量管理/检验方案单/QC_CheckProjectList.html?OperationType=1&HName=' + HName + '&HProcName=' + HProcName + '', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -1675,7 +1998,7 @@
                        $("#HQCSchemeID").val(checkStatus.data[0].hmainid);
                        $("#HQCSchemeName").val(checkStatus.data[0].检验方案名称);
                        get_CheckItem();
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
@@ -1690,7 +2013,34 @@
                });
            });
            //#region【表体放大镜】
            //SIP查看按钮
            form.on('submit(btn-SIP)', function () {
                var HProcID = $("#HProcID").val();
                var HMaterID = $("#HMaterID").val();
                if (HProcID == 0 && HMaterID == 0) {
                    layer.alert("物料名称与工序不能为空", { icon: 5 });
                }
                else {
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '查看作业指导书'
                        , closeBtn: 1
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../../生产管理/作业指导书/Gy_SOPBill_Video.html?OperationType=5&HMaterID=' + HMaterID + '&HSourceNo=&HSourceEntryID=&HProcID=' + HProcID +'&HType=SIP'
                        , resize: false,
                        end: function () {
                        }
                        , cancel: function () {
                        }
                    })
                }
            });
            //#region ã€è¡¨ä½“放大镜】
            //表体信息检验项目弹窗
            form.on('submit(btnSearchCheckItemID)', function () {
                //页面层-自定义
@@ -1740,7 +2090,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../../views/基础资料/公用基础资料/Gy_Unit.html', 'yes'],
                    content: ['../../../views/基础资料/公用基础资料/Gy_Unit.html?openType=HUnitList', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -1778,7 +2128,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_InspectValue.html', 'yes'],
                    content: ['../../基础资料/公用基础资料/Gy_InspectValue.html?type=HInspect1', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -1825,7 +2175,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_InspectValue.html', 'yes'],
                    content: ['../../基础资料/公用基础资料/Gy_InspectValue.html?type=HInspect', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -1916,7 +2266,7 @@
                        rowdata_Value = [];
                        for (let i = 1; i <= checkStatus.data[0].样本量; i++) {
                            rowdata_Value.push({
                                "HSEQ": i, "HInSpectResult": "", "HInSpectValueB": "", "HInSpectValueT": "", "HInSpectValue": "", "rowNum": $("#HEntryID").val()
                                "HSEQ": i, "HInSpectResult": "", "HInSpectValueB": "0", "HInSpectValueB_Text": "", "HInSpectValueT": "", "HInSpectValue": "", "rowNum": $("#HEntryID").val()
                            });
                        }
                        option_Value.data = rowdata_Value;
@@ -1938,12 +2288,14 @@
            });
            //#endregion
            //#region【选检验方案获取表体检验项目信息】
            window.get_CheckItem = function () {
                var HBatchQty = $("#HProcExchQty").val();
            //#region ã€é€‰æ£€éªŒæ–¹æ¡ˆèŽ·å–è¡¨ä½“æ£€éªŒé¡¹ç›®ä¿¡æ¯ã€‘
            function get_CheckItem() {
                var HBatchQty = $("#HProcExchQty").val() == 0 ? $("#HICMOQty").val() : $("#HProcExchQty").val();
                $.ajax({
                    url: GetWEBURL() + "/Web/GetCheckItemByCheckProjectID",
                    type: "GET",
                    async: false,
                    data: { "CheckProjectID": $("#HQCSchemeID").val() == '' ? 0 : $("#HQCSchemeID").val(), "HBatchQty": HBatchQty },
                    success: function (result) {
                        if (result.code == 1) {
@@ -1954,20 +2306,138 @@
                                //子表  èµ‹å€¼
                                rowdata.push(
                                    {
                                        "HQCCheckItemID": data[i]["HQCCheckItemID"], "检验项目代码": data[i].检验项目代码, "检验项目": data[i]["检验项目"], "HInspectInstruMentID": data[i]["HInspectInstruMentID"], "检验仪器": data[i]["检验仪器"], "HQCStd": data[i]["HQCStd"], "HUnit": data[i]["单位名称"], "HQCNote": "", "HAnalysisMethod": data[i]["分析方法"], "HResult": data[i]["默认结论"],
                                        "HQCCheckItemID": data[i]["HQCCheckItemID"], "检验项目代码": data[i].检验项目代码, "检验项目": data[i]["检验项目"], "HInspectInstruMentID": data[i]["HInspectInstruMentID"], "检验仪器代码": data[i]["检验仪器代码"], "检验仪器": data[i]["检验仪器"], "HQCStd": data[i]["HQCStd"], "HUnit": data[i]["单位名称"], "HQCNote": "", "HAnalysisMethod": data[i]["分析方法"], "HResult": data[i]["默认结论"],
                                        "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": data[i]["重点检查"] == 1 ? true : false, "HStatus": 0, "HSampleSchemeID": data[i]["HSampleSchemeID"], "HUnitID": data[i]["HUnitID"],
                                        "HInspectVal": '', "HTargetVal": '', "HUpLimit":  + data[i].上限值 , "HDownLimit": + data[i].下限值, "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": "0",
                                        "HInspectVal": '', "HTargetVal": data[i].目标值, "HUpLimit": data[i].上限值, "HDownLimit": data[i].下限值, "HCompareSymbol": data[i].比较符, "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": "0",
                                        "HSampleSchemeName": data[i].抽样方案名称, "HSampleQty": data[i].样本量, "HAcceptQty": data[i].允许数, "HInspectionLevel": data[i].检验水平, "HRejectQty": data[i].拒绝数,
                                        "HStrictness": data[i].严格度, "HSampleUnRightQty": "", "HAQL": data[i].AQL, "HSamplingType": data[i].抽样类型
                                        "HStrictness": data[i].严格度, "HSampleUnRightQty": "", "HAQL": data[i].AQL, "HSamplingType": data[i].抽样类型, "HQualityStdID": data[i].HQualityStdID, "HQualityStdName": data[i].质量标准, "HInspectMethodID": data[i].HInspectMethodID, "HInspectMethodName": data[i].检验方法, "HInspectBasisID": data[i].HInspectBasisID, "HInspectBasisName": data[i].检验依据
                                    }
                                );
                                SampleNum.push(5);
                                //SampleNum.push(5);
                                SampleNum.push(data[0].样本量);
                            }
                            //检验项目
                            for (let j = 1; j <= 5; j++) {
                                rowdata_Value.push({
                                    "HSEQ": j, "HInSpectResult": "", "HInSpectValueB": "", "HInSpectValueT": "", "HInSpectValue": "", "rowNum": $("#HEntryID").val()
                                    "HSEQ": j, "HInSpectResult": "", "HInSpectValueB": "0", "HInSpectValueB_Text": "", "HInSpectValueT": "", "HInSpectValue": "", "rowNum": $("#HEntryID").val()
                                });
                            }
                            //检验项目
                            option.data = rowdata;
                            table.render(option);
                            //检验值
                            option_Value.data = rowdata_Value;
                            //console.log(JSON.stringify(option_Value.data));
                            table.render(option_Value);
                            //================================================
                            for (var i = 1; i <= result.data.length; i++) {
                                $('#HAnalysisMethod' + i + '').find("option[value='" + option.data[i - 1].HAnalysisMethod + "']").attr("selected", true);
                                $('#HResult' + i + '').find("option[value='" + option.data[i - 1].HResult + "']").attr("selected", true);
                            }
                            form.render('select');
                            option_Check = result.data;
                            $("[name='HEntryID']").attr("value", result.data.length);
                            $("[name='HQCCheckItemID']").attr("value", result.data[result.data.length - 1].HQCCheckItemID);
                            $("[name='HQCCheckItemName']").attr("value", result.data[result.data.length - 1].检验项目);
                            //默认选中最后一行
                            $("tr[data-index = " + (result.data.length - 1) + "] .layui-form-checkbox").dblclick();
                            //$("tr[data-index = " + (result.data.length - 1) + "] .layui-form-checkbox").addClass('layui-form-checked');
                            $("tr[data-index = " + (result.data.length - 1) + "] ").attr({ "style": "background:#ceedfa;color:black" });
                            trindex = result.data.length - 1;
                            $("#HEntryID").val() - 1
                            //携带出抽样方案
                            ReturnSampleScheme(data);
                        }
                    }
                })
            }
            //根据质检方案自动带出抽样方案信息
            function ReturnSampleScheme(data) {
                $("#HSampleSchemeID").val(data[data.length - 1].hmainid);
                $("#HSampleSchemeName").val(data[data.length - 1].抽样方案名称);
                $("#HSamplingType").val(data[data.length - 1].抽样类型);
                $("#HInspectionLevel").val(data[data.length - 1].检验水平);
                $("#HStrictness").val(data[data.length - 1].严格度);
                $("#HAQL").val(data[data.length - 1].AQL);
                $("#HSampleQty").val(data[data.length - 1].样本量);
                $("#HSampleQty2").val(data[data.length - 1].样本量);
                $("#HAcceptQty").val(data[data.length - 1].允许数);
                $("#HRejectQty").val(data[data.length - 1].拒绝数);
                //显示最后一行的检测值页签中的目标值、上限值、下限值
                $("#HTargetVal").val(data[data.length - 1].目标值);
                $("#HUpLimit").val(data[data.length - 1].上限值);
                $("#HDownLimit").val(data[data.length - 1].下限值);
                //比较符
                $("#HComparator").val(data[data.length - 1].比较符);
                if ($("#HEntryID").val() - 1 >= 0) {
                    option.data[$("#HEntryID").val() - 1].HSampleSchemeID = data[data.length - 1].HSampleSchemeID;
                    option.data[$("#HEntryID").val() - 1].HSampleSchemeName = data[data.length - 1].抽样方案名称;
                    option.data[$("#HEntryID").val() - 1].HSamplingType = data[data.length - 1].抽样类型;
                    option.data[$("#HEntryID").val() - 1].HInspectionLevel = data[data.length - 1].检验水平;
                    option.data[$("#HEntryID").val() - 1].HStrictness = data[data.length - 1].严格度;
                    option.data[$("#HEntryID").val() - 1].HAQL = data[data.length - 1].AQL;
                    option.data[$("#HEntryID").val() - 1].HSampleQty = data[data.length - 1].样本量;
                    option.data[$("#HEntryID").val() - 1].HSampleQty2 = data[data.length - 1].样本量;
                    option.data[$("#HEntryID").val() - 1].HAcceptQty = data[data.length - 1].允许数;
                    option.data[$("#HEntryID").val() - 1].HRejectQty = data[data.length - 1].拒绝数;
                    option.data[$("#HEntryID").val() - 1].HUpLimit = data[data.length - 1].上限值;
                    option.data[$("#HEntryID").val() - 1].HDownLimit = data[data.length - 1].下限值;
                    option.data[$("#HEntryID").val() - 1].HCompareSymbol = data[data.length - 1].比较符;
                }
                rowdata_Value = [];
                for (let i = 1; i <= data[data.length - 1].样本量; i++) {
                    rowdata_Value.push({
                        "HSEQ": i, "HInSpectResult": "", "HInSpectValueB": "0", "HInSpectValueB_Text": "", "HInSpectValueT": "", "HInSpectValue": "", "rowNum": $("#HEntryID").val()
                    });
                }
                option_Value.data = rowdata_Value;
                table.render(option_Value);
                IsHide(table.cache["mainTable"][$("#HEntryID").val() - 1].HAnalysisMethod); //隐藏检测值字段
            }
            //用于双击检验方案使用
            window.get_CheckItem1 = function () {
                var HBatchQty = $("#HProcExchQty").val();
                $.ajax({
                    url: GetWEBURL() + "/Web/GetCheckItemByCheckProjectID",
                    type: "GET",
                    async: false,
                    data: { "CheckProjectID": $("#HQCSchemeID").val() == '' ? 0 : $("#HQCSchemeID").val(), "HBatchQty": HBatchQty },
                    success: function (result) {
                        if (result.code == 1) {
                            var rowdata = [];
                            var data = result.data;
                            rowdata_Value = [];
                            for (var i = 0; i < result.data.length; i++) {
                                //子表  èµ‹å€¼
                                rowdata.push(
                                    {
                                        "HQCCheckItemID": data[i]["HQCCheckItemID"], "检验项目代码": data[i].检验项目代码, "检验项目": data[i]["检验项目"], "HInspectInstruMentID": data[i]["HInspectInstruMentID"], "检验仪器代码": data[i]["检验仪器代码"], "检验仪器": data[i]["检验仪器"], "HQCStd": data[i]["HQCStd"], "HUnit": data[i]["单位名称"], "HQCNote": "", "HAnalysisMethod": data[i]["分析方法"], "HResult": data[i]["默认结论"],
                                        "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": data[i]["重点检查"] == 1 ? true : false, "HStatus": 0, "HSampleSchemeID": data[i]["HSampleSchemeID"], "HUnitID": data[i]["HUnitID"],
                                        "HInspectVal": '', "HTargetVal": '', "HUpLimit": + data[i].上限值, "HDownLimit": + data[i].下限值, "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": "0",
                                        "HSampleSchemeName": data[i].抽样方案名称, "HSampleQty": data[i].样本量, "HAcceptQty": data[i].允许数, "HInspectionLevel": data[i].检验水平, "HRejectQty": data[i].拒绝数,
                                        "HStrictness": data[i].严格度, "HSampleUnRightQty": "", "HAQL": data[i].AQL, "HSamplingType": data[i].抽样类型
                                    }
                                );
                                //SampleNum.push(5);
                                SampleNum.push(data[0].样本量);
                            }
                            //检验项目
                            for (let j = 1; j <= 5; j++) {
                                rowdata_Value.push({
                                    "HSEQ": j, "HInSpectResult": "", "HInSpectValueB": "0", "HInSpectValueB_Text": "", "HInSpectValueT": "", "HInSpectValue": "", "rowNum": $("#HEntryID").val()
                                });
                            }
                            //检验项目
@@ -2000,9 +2470,10 @@
                    }
                })
            }
            //#endregion
            //#region【表头放大镜】
            //#region ã€è¡¨å¤´æ”¾å¤§é•œã€‘
            //表头信息工序流转卡弹窗
            form.on('submit(btnSearchProcExch)', function () {
                //页面层-自定义
@@ -2014,7 +2485,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../../views/Baseset/基础资料/Sc_ProcessExchangeBillListView.html', 'yes'],
                    content: ['../../车间管理/工序流转卡/Sc_ProcessExchangeBillList.html?openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -2053,7 +2524,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../生产管理/生产任务单/Sc_ICMOBillList.html', 'yes'],
                    content: ['../../生产管理/生产任务单/Sc_ICMOBillList.html?openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -2066,7 +2537,10 @@
                        $("#HICMOInterID").val(checkStatus.data[0].hmainid);
                        $("#HICMOEntryID").val(checkStatus.data[0].HEntryID);
                        $("#HICMOBillNo").val(checkStatus.data[0].单据号);
                        $("#HICMOQty").val(checkStatus.data[0].计划生产数量);
                        $("#HMaterNumber").val(checkStatus.data[0].产品代码);
                        $("#HMaterName").val(checkStatus.data[0].产品名称);
                        $("#HMaterID").val(checkStatus.data[0].HMaterID);
                        $("#HICMOQty").val(checkStatus.data[0].生产任务单数量);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
@@ -2131,7 +2605,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../基础资料/生产基础资料/Gy_Source.html', 'yes'],
                    content: ['../../基础资料/生产基础资料/Gy_Source.html?Htype=&openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -2146,6 +2620,7 @@
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        get_ICMOBillStatusList();
                        get_QC_TakeSampleCheckBillList();
                        GetCheckItemID();
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
@@ -2171,7 +2646,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../基础资料/生产基础资料/Gy_Process.html', 'yes'],
                    content: ['../../基础资料/生产基础资料/Gy_Process.html?openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -2186,6 +2661,7 @@
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        get_ICMOBillStatusList();
                        get_QC_TakeSampleCheckBillList();
                        GetCheckItemID();
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
@@ -2200,7 +2676,6 @@
                });
            });
            //表头信息生产班次弹窗
            form.on('submit(btnHShifts)', function () {
                //页面层-自定义
@@ -2212,7 +2687,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../基础资料/生产基础资料/Gy_ShiftsList.html', 'yes'],
                    content: ['../../基础资料/生产基础资料/Gy_WorkShiftList.html?type=HWorkShifts', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -2223,7 +2698,7 @@
                            return layer.msg('请选择数据');
                        }
                        $("#HShiftsName").val(checkStatus.data[0].班次名称);
                        $("#HShiftsID").val(checkStatus.data[0].HItemID);
                        $("#HShiftsID").val(checkStatus.data[0].HInterID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
@@ -2250,7 +2725,7 @@
                    shift: 2,
                    area: ['90%', '90%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_Material.html', 'yes'],
                    content: ['../../基础资料/公用基础资料/Gy_Material.html?openType=2', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -2264,6 +2739,7 @@
                        $("#HMaterNumber").val(checkStatus.data[0].物料代码);
                        $("#HMaterName").val(checkStatus.data[0].物料名称);
                        $("#HMaterID").val(checkStatus.data[0].HItemID);
                        GetCheckItemID();
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
@@ -2289,15 +2765,16 @@
            //初始化表格
            function set_InitGrid() {
                $('#set_CheckBill').addClass("layui-btn-disabled").attr("disabled", true);//初始化禁用审核按钮
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HMakeDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始表格数据
                rowdata = [{
                    "HQCCheckItemID": "", "检验项目": "", "HInspectInstruMentID": "0", "检验仪器": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HAnalysisMethod": "", "HResult": "",
                    "HQCCheckItemID": "0", "检验项目代码": "", "检验项目": "", "HInspectInstruMentID": "0", "检验仪器代码": "", "检验仪器": "", "HQCStd": "", "HUnit": "", "HQCNote": "", "HAnalysisMethod": "", "HResult": "",
                    "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": false, "HStatus": 0, "HSampleSchemeID": 0, "HUnitID": 0,
                    "HInspectVal": '', "HTargetVal": '', "HUpLimit": '', "HDownLimit": '', "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": '0',
                    "HSampleSchemeName": "", "HSampleQty": "0", "HSampleDamageQty": "0", "HAcceptQty": "0", "HInspectionLevel": "", "HRejectQty": "",
                    "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": ""
                    "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": "", "HCompareSymbol": '=', "HQualityStdID": 0, "HQualityStdName": "", "HInspectMethodID": 0, "HInspectMethodName": "", "HInspectBasisID": 0, "HInspectBasisName": ""
                }];
                option = {
                    elem: '#mainTable'
@@ -2310,19 +2787,32 @@
                        { type: 'checkbox', totalRowText: '合计行' }
                        , { type: 'numbers', title: '序号', totalRow: true }
                        , { field: 'HQCCheckItemID', title: 'HQCCheckItemID', hide: true }
                        , { field: '检验项目代码', title: '检验项目代码'}
                        , { field: '检验项目代码', title: '检验项目代码' }
                        , { field: '检验项目', title: '检验项目', edit: 'text', event: 'HQCCheckItemID' }
                        , { field: 'HInspectInstruMentID', title: 'HInspectInstruMentID', hide: true }
                        , {
                            field: '检验仪器代码', title: '检验仪器代码', totalRow: true, templet: function (d) {
                                return '<span style="color: blue;" lay-event="检验仪器代码">' + d.检验仪器代码 + '</span>';
                            }, style: 'cursor: pointer;'
                        }
                        , { field: '检验仪器', title: '检验仪器', edit: 'text', event: 'HInspectInstruMentID' }
                        , { field: 'HResult', title: '结论', templet: '#HResult', event: 'HResult' }
                        , { field: 'HAnalysisMethod', title: '分析方法', templet: '#HAnalysisMethod', event: 'HAnalysisMethod' }
                        , { field: 'HQualityStdID', title: '质量标准ID', edit: 'text', hide: true }
                        , { field: 'HQualityStdName', title: '质量标准', edit: 'text', event: 'HQualityStdName' }
                        , { field: 'HInspectMethodID', title: '检验方法ID', edit: 'text', hide: true }
                        , { field: 'HInspectMethodName', title: '检验方法', edit: 'text', event: 'HInspectMethodName' }
                        , { field: 'HInspectBasisID', title: '检验依据ID', edit: 'text', hide: true }
                        , { field: 'HInspectBasisName', title: '检验依据', edit: 'text', event: 'HInspectBasisName' }
                        , { field: 'HKeyInspect', title: '重点检查', templet: '#HKeyInspect', unresize: false }
                        , { field: 'HQCStd', title: '检验标准', edit: 'text' }
                        , { field: 'HUnit', title: '单位', edit: 'text' }
                        , { field: 'HInspectVal', title: '检验值', edit: 'text'}
                        , { field: 'HInspectVal', title: '检验值', edit: 'text' }
                        , { field: 'HQCNote', title: '检验记录', edit: 'text' }
                        , { field: 'HTargetVal', title: '目标值' }
                        , { field: 'HUpLimit', title: '上限值' }
                        , { field: 'HDownLimit', title: '下限值' }
                        , { field: 'HCompareSymbol', title: '比较符'}
                        , { field: 'HMax', title: '最大值', edit: 'text', totalRow: true }
                        , { field: 'HMin', title: '最小值', edit: 'text', totalRow: true }
                        , { field: 'HAvg', title: '平均值', edit: 'text', totalRow: true }
@@ -2338,7 +2828,6 @@
                        , { field: 'HSampleUnRightQty', title: '样本不合格数', edit: 'text', hide: true }
                        , { field: 'HAQL', title: 'AQL', edit: 'text', hide: true }
                        , { field: 'HStatus', title: '状态', edit: 'text', hide: true }
                        , { field: 'xxx', title: '比较符', edit: 'text', hide: true }
                        , { field: 'HUnitID', title: '单位ID', edit: 'text', hide: true }
                        , { field: 'HUnit', title: '单位', edit: 'text', hide: true }
                        , { field: 'HTargetVal', title: '目标值', edit: 'text', hide: true }
@@ -2372,20 +2861,21 @@
                //初始表格数据
                rowdata_Value = [{
                    "HSEQ": "0", "HInSpectResult": "", "HInSpectValueB": "", "HInSpectValueT": "", "HInSpectValue": ""
                    "HSEQ": "0", "HInSpectResult": "", "HInSpectValueB": "0", "HInSpectValueB_Text": "", "HInSpectValueT": "", "HInSpectValue": ""
                }];
                option_Value = {
                    elem: '#ValueTable'
                    //, toolbar: '#toolbarDemo_Value'
                    , limit: 500 //每页默认显示的数量
                    , height: 'full-50'
                    , height: 'full-370'
                    , cellMinWidth: 150
                    , totalRow: true
                    , cols: [[ //表头
                        { type: 'checkbox', totalRowText: '合计行' }
                        , { field: 'HSEQ', title: '序号' }
                        , { field: 'HInSpectResult', title: '检验结果', templet: '#HInSpectResult' }
                        , { field: 'HInSpectValueB', title: '检测值(定性)', edit: 'text', event: 'HInSpectValueB_Open' }
                        , { field: 'HInSpectValueB', title: '检测值ID(定性)', edit: 'text', hide: true }
                        , { field: 'HInSpectValueB_Text', title: '检测值(定性)', edit: 'text', event: 'HInSpectValueB_Open' }
                        , { field: 'HInSpectValue', title: '检测值(定量)', edit: 'text', totalRow: true }
                        , { field: 'HInSpectValueT', title: '检测值(其他)', edit: 'text' }
                        //, { fixed: 'right', title: '操作', toolbar: '#barDemo' }
@@ -2412,7 +2902,11 @@
                //加载空表格
                option_Value.data = rowdata_Value;
                table.render(option_Value);
                //表体列设置查询
                DisPlay_HideColumn();
            }
            //行选择处理(结论)
            form.on('select(HResult)', function (data) {
@@ -2567,6 +3061,7 @@
                var HEntryID = $("#HEntryID").val() - 1;//数组下标
                var HAnalysisMethod = table.cache["mainTable"][HEntryID].HAnalysisMethod; //分析方法
                option.data[HEntryID].HCompareSymbol = selectValue;
                //判定如果是定量分析
                if (HAnalysisMethod == 2) {
                    if (selectValue.toString() != '=' && selectValue.toString() != 'between') {
@@ -2610,7 +3105,7 @@
                });
            });
            //#region【双击检验项目行事件】
            //#region ã€åŒå‡»æ£€éªŒé¡¹ç›®è¡Œäº‹ä»¶ã€‘
            table.on('rowDouble(mainTable)', function (obj) {
                $("#HInspectResultToSee").css("background-color", "");//去除检验结果输入框背景颜色
                $("#HInspectResultToSee2").css("background-color", "");//去除检验结果输入框背景颜色
@@ -2623,9 +3118,17 @@
                editIndex = Number(nowindex) + Number(1);
                LastIndex = nowindex;
                $("[name='HEntryID']").attr("value", Number(nowindex) + Number(1));
                //$("[name='HQCCheckItemID']").attr("value", option_Check[nowindex].HQCCheckItemID);
                //$("[name='HQCCheckItemName']").attr("value", option_Check[nowindex].检验项目);
                if (option_Check.length > 0) {
                    $("[name='HEntryID']").attr("value", Number(nowindex) + Number(1));
                    $("[name='HQCCheckItemID']").attr("value", option_Check[nowindex].HQCCheckItemID);
                    $("[name='HQCCheckItemName']").attr("value", option_Check[nowindex].检验项目);
                    //显示当前双击行的检测值页签中的目标值、上限值、下限值
                    $("#HTargetVal").val(option_Check[nowindex].目标值);
                    $("#HUpLimit").val(option_Check[nowindex].上限值);
                    $("#HDownLimit").val(option_Check[nowindex].下限值);
                    $("#HComparator").val(option_Check[nowindex].比较符)
                }
                //选中行改变颜色
                check_row(obj);
@@ -2650,7 +3153,7 @@
                    var row_value = [];
                    for (let i = 0; i < SampleNum[nowindex]; i++) {
                        row_value.push({
                            "HSEQ": "0", "HInSpectResult": "", "HInSpectValueB": "", "HInSpectValueT": "", "HInSpectValue": ""
                            "HSEQ": (i + 1), "HInSpectResult": "", "HInSpectValueB": "0", "HInSpectValueB_Text": "", "HInSpectValueT": "", "HInSpectValue": ""
                        });
                    }
                    //刷新检验值表格
@@ -2668,11 +3171,13 @@
                    isFristClick = false;
                }
                //自动跳转到检测值页签
                element.tabChange('bottomTable', '3');  //跳转页签
            });
            //#endregion
            //#region【文本框监听,光标移开时触发】
            //#region ã€æ–‡æœ¬æ¡†ç›‘听,光标移开时触发】
            //[ åˆ¤å®šæ£€éªŒæ˜¯å¦åˆæ ¼ ]监听文本框编辑--检验值
            $("#HInspectVal").blur(function () {
@@ -2797,7 +3302,7 @@
            //#endregion
            //#region【判断是否合格方法】
            //#region ã€åˆ¤æ–­æ˜¯å¦åˆæ ¼æ–¹æ³•】
            function Qualified(HComparator, HEntryID, HAnalysisMethod) {
                var HInspectVal = $("#HInspectVal").val(); //检验值
                var HTargetVal = $("#HTargetVal").val(); //目标值
@@ -2808,7 +3313,7 @@
                var HStatus = $("#HStatus").val() //状态
                var HAcceptQty = $("#HAcceptQty").val();//允许数
                //#region【定性分析方法】
                //#region ã€å®šæ€§åˆ†æžæ–¹æ³•】
                if (HAnalysisMethod == 1) {
                    //状态为合格
                    if (HStatus == 1) {
@@ -2843,7 +3348,7 @@
                    }
                }
                //#endregion
                //#region【定量分析方法】
                //#region ã€å®šé‡åˆ†æžæ–¹æ³•】
                else if (HAnalysisMethod == 2) {
                    //状态为合格
                    if (HStatus == 1) {
@@ -3002,7 +3507,7 @@
                    }
                }
                //#endregion
                //#region【其他分析方法】
                //#region ã€å…¶ä»–分析方法】
                else if (HAnalysisMethod == 3) {
                    //状态为合格
                    if (HStatus == 1) {
@@ -3038,6 +3543,7 @@
                }
                //#endregion
                form.render('select');
                //获取表体结论数据赋值给检验结果
                var HEntryID = $('#HEntryID').val();
@@ -3057,7 +3563,7 @@
            };
            //#endregion
            //#region【赋值与回显】
            //#region ã€èµ‹å€¼ä¸Žå›žæ˜¾ã€‘
            function Assignment(nowindex, dataindex) {
                if (SummaryIndex.indexOf(nowindex) == -1 && option.data[0].HSampleSchemeID == 0) {
                    var dataobj = {
@@ -3065,7 +3571,7 @@
                        HStatus: $("#HStatus").val(), //状态
                        HSampleSchemeID: $("#HSampleSchemeID").val(), //抽样方案ID
                        HSampleSchemeName: $("#HSampleSchemeName").val(), //抽样方案
                        //xxx: $("#xxx").val(),
                       //HCompareSymbol: $("#HCompareSymbol").val(),
                        HUnitID: $("#HUnitID").val(), //单位ID
                        HUnit: $("#HUnit").val(), //单位
                        HInspectVal: $("#HInspectVal").val(), //检验值
@@ -3143,7 +3649,7 @@
                    $("#HSampleSchemeID").val(0);
                    $("#HSampleSchemeName").val("");
                    //xxx: $("#xxx").val();
                   //HCompareSymbol: $("#HCompareSymbol").val();
                    $("#HUnitID").val(0);
                    $("#HUnit").val("");
                    $("#HInspectVal").val("");
@@ -3191,7 +3697,7 @@
                            HStatus: $("#HStatus").val(), //状态
                            HSampleSchemeID: option.data[nowindex].HSampleSchemeID, //抽样方案ID
                            HSampleSchemeName: option.data[nowindex].HSampleSchemeName, //抽样方案
                            //xxx: $("#xxx").val(),
                           //HCompareSymbol: $("#HCompareSymbol").val(),
                            HUnitID: option.data[nowindex].HUnitID, //单位ID
                            HUnit: option.data[nowindex].HUnit,//单位
                            HInspectVal: option.data[nowindex].HInspectVal, //检验值
@@ -3231,7 +3737,7 @@
                        //    HStatus: $("#HStatus").val(), //状态
                        //    HSampleSchemeID: $("#HSampleSchemeID").val(), //抽样方案ID
                        //    HSampleSchemeName: $("#HSampleSchemeName").val(), //抽样方案
                        //    //xxx: $("#xxx").val(),
                        //    //HCompareSymbol: $("#HCompareSymbol").val(),
                        //    HUnitID: $("#HUnitID").val(), //单位ID
                        //    HUnit: $("#HUnit").val(), //单位
                        //    HInspectVal: $("#HInspectVal").val(), //检验值
@@ -3271,7 +3777,7 @@
                            HStatus: $("#HStatus").val(), //状态
                            HSampleSchemeID: option.data[nowindex].HSampleSchemeID, //抽样方案ID
                            HSampleSchemeName: option.data[nowindex].HSampleSchemeName, //抽样方案
                            //xxx: $("#xxx").val(),
                            //HCompareSymbol: $("#HCompareSymbol").val(),
                            HUnitID: option.data[nowindex].HUnitID, //单位ID
                            HUnit: option.data[nowindex].HUnit,//单位
                            HInspectVal: option.data[nowindex].HInspectVal, //检验值
@@ -3293,17 +3799,17 @@
                            HSampleQty: option.data[nowindex].HSampleQty, //样本量
                            HInspectResultToSee: '', //检验结果
                            HInspectResultToSee2: '', //检验结果2
                            HSampleUnRightQty: option.data[nowindex].HSampleUnRightQty,//样本不合格数
                            HUnitID: option.data[nowindex].HUnitID, //单位ID
                            //HSampleUnRightQty: option.data[nowindex].HSampleUnRightQty,//样本不合格数
                            //HUnitID: option.data[nowindex].HUnitID, //单位ID
                            HUnitName: option.data[nowindex].HUnit, //单位
                            HInspectValB: option.data[nowindex].HInspectValB,//检验值ID
                            HInspectVal: option.data[nowindex].HInspectVal, //检验值
                            //HInspectVal: option.data[nowindex].HInspectVal, //检验值
                            HTargetValB: option.data[nowindex].HTargetValB, //目标值ID
                            HTargetVal: option.data[nowindex].HTargetVal,//目标值
                            HUpLimit: option.data[nowindex].HUpLimit, //上限值
                            HDownLimit: option.data[nowindex].HDownLimit, //下限值
                            HUpOffSet: option.data[nowindex].HUpOffSet, //上偏差
                            HDownOffSet: option.data[nowindex].HDownOffSet, //下偏差
                            //HTargetVal: option.data[nowindex].HTargetVal,//目标值
                            //HUpLimit: option.data[nowindex].HUpLimit, //上限值
                            //HDownLimit: option.data[nowindex].HDownLimit, //下限值
                            //HUpOffSet: option.data[nowindex].HUpOffSet, //上偏差
                            //HDownOffSet: option.data[nowindex].HDownOffSet, //下偏差
                        };
                    }
                    //if (option.data[0].HSampleSchemeID == 0) {
@@ -3349,13 +3855,14 @@
                    //回显
                    $("#HSampleSchemeID").val(maindata[nowindex].HSampleSchemeID);
                    $("#HSampleSchemeName").val(maindata[nowindex].HSampleSchemeName);
                    //xxx: $("#xxx").val();
                    //HCompareSymbol: $("#HCompareSymbol").val();
                    $("#HUnitID").val(maindata[nowindex].HUnitID);
                    $("#HUnit").val(maindata[nowindex].HUnit);
                    $("#HInspectVal").val(maindata[nowindex].HInspectVal);
                    $("#HTargetVal").val(maindata[nowindex].HTargetVal);
                    $("#HUpLimit").val(maindata[nowindex].HUpLimit);
                    $("#HDownLimit").val(maindata[nowindex].HDownLimit);
                    $("#HTargetVal").val(maindata[nowindex].HTargetVal == "" ? (option_Check.length > 0 ? option_Check[nowindex].目标值 : "") : maindata[nowindex].HTargetVal );
                    $("#HUpLimit").val(maindata[nowindex].HUpLimit == "" ? (option_Check.length > 0 ? option_Check[nowindex].上限值 : "") : maindata[nowindex].HUpLimit );
                    $("#HDownLimit").val(maindata[nowindex].HDownLimit == "" ? (option_Check.length > 0 ? option_Check[nowindex].下限值 : "") : maindata[nowindex].HDownLimit);
                    $("#HComparator").val(maindata[nowindex].HCompareSymbol == "" ? (option_Check.length > 0 ? option_Check[nowindex].比较符 : "=") : maindata[nowindex].HCompareSymbol);
                    $("#HUpOffSet").val(maindata[nowindex].HUpOffSet);
                    $("#HDownOffSet").val(maindata[nowindex].HDownOffSet);
                    $("#HSampleDamageQty").val(maindata[nowindex].HSampleDamageQty);
@@ -3378,7 +3885,7 @@
                    $("#HInspectValB").val(maindata[nowindex].HInspectValB);
                    $("#HInspectVal").val(maindata[nowindex].HInspectVal);
                    $("#HTargetValB").val(maindata[nowindex].HTargetValB);
                    $("#HTargetVal").val(maindata[nowindex].HTargetVal);
                    //$("#HTargetVal").val(maindata[nowindex].HTargetVal);
                    $("#HUpLimit").val(maindata[nowindex].HUpLimit);
                    $("#HDownLimit").val(maindata[nowindex].HDownLimit);
                    $("#HUpOffSet").val(maindata[nowindex].HUpOffSet);
@@ -3430,13 +3937,41 @@
                            }
                            IsHide(table.cache["mainTable"][HEntryID - 1].HAnalysisMethod); //隐藏检测值字段
                            form.render('select');
                            //循环检验值表格数据,获取不合格数量
                            var HValueTable = table.cache["ValueTable"];
                            var UnRightQty = 0;//检验值表格不合格数量汇总
                            for (let i = 0; i < HValueTable.length; i++) {
                                if (HValueTable[i].HInSpectResult == 2) {
                                    UnRightQty++;
                                }
                            }
                            var HAcceptQty = $("#HAcceptQty").val();//允许数
                            //var HEntryID = OperationType == 3 ? editIndex : $("#HEntryID").val() - 1;
                            if (UnRightQty > HAcceptQty) {
                                $("#HResult" + (Number(HEntryID) )).val(2); //不合格
                                $("#HInspectResultToSee").val('不合格');
                                $("#HInspectResultToSee2").val('不合格');
                                $("#HInspectResultToSee").css("background-color", "#F0D6E3");//改变检验结果输入框背景颜色
                                $("#HInspectResultToSee2").css("background-color", "#F0D6E3");//改变检验结果输入框背景颜色
                            } else {
                                $("#HResult" + (Number(HEntryID) )).val(1); //合格
                                $("#HInspectResultToSee").val('合格');
                                $("#HInspectResultToSee2").val('合格');
                                $("#HInspectResultToSee").css("background-color", "#CEE3F2");//改变检验结果输入框背景颜色
                                $("#HInspectResultToSee2").css("background-color", "#CEE3F2");//改变检验结果输入框背景颜色
                            }
                            form.render('select');
                        } else {
                            option_Value.data = [{
                                "HSEQ": "0", "HInSpectResult": "", "HInSpectValueB": "", "HInSpectValueT": "", "HInSpectValue": ""
                            }];
                            table.render(option_Value);
                            //layer.msg(result.code + result.Message, { icon: 5 });
                            IsHide(table.cache["mainTable"][HEntryID - 1].HAnalysisMethod); //隐藏检测值字段
                            form.render('select');
                        }
                    }
                })
@@ -3740,7 +4275,7 @@
                    url: GetWEBURL() + "/CheckBill/GetICMOBillStatusList",
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere,"user": sessionStorage["HUserName"] },
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            $("#HProcID").val(result.data[0]["HProcID"]);
@@ -3779,7 +4314,7 @@
                                $("#HTakeSampleCheckBillID").val(result.data[0]["hmainid"]);
                                $("#HTakeSampleCheckBillNo").val(result.data[0]["单据号"]);
                            }
                        }
                        }
                    },
                    error: function (err) {
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
@@ -3788,12 +4323,12 @@
            }
            //#region【隐藏检测值字段】
            //#region ã€éšè—æ£€æµ‹å€¼å­—段】
            function IsHide(HAnalysisMethod_Value) {
                if (HAnalysisMethod_Value == 1) { //如果选中【定性分析】,则隐藏定量、其他分析
                    option_Value.cols[0][3].hide = false; //定性
                    option_Value.cols[0][4].hide = true;  //定量
                    option_Value.cols[0][5].hide = true;  //其他
                    option_Value.cols[0][4].hide = false; //定性
                    option_Value.cols[0][5].hide = true;  //定量
                    option_Value.cols[0][6].hide = true;  //其他
                    $("#HComparator").attr("disabled", true); //比较符改为不可编辑
                    $("#HUpLimit").css("background-color", "#E8E8E8").attr("readOnly", true);//改变上限值输入框背景颜色
@@ -3805,9 +4340,9 @@
                    $('#btnSearchTargetValB').removeClass("layui-btn-disabled").attr("disabled", false);//目标值按钮启用
                } else if (HAnalysisMethod_Value == 2) { //如果选中【定量分析】,则隐藏定性、其他分析
                    option_Value.cols[0][4].hide = false;  //定量
                    option_Value.cols[0][3].hide = true;  //定性
                    option_Value.cols[0][5].hide = true;  //其他
                    option_Value.cols[0][5].hide = false;  //定量
                    option_Value.cols[0][4].hide = true;  //定性
                    option_Value.cols[0][6].hide = true;  //其他
                    $("#HUpLimit").attr("readOnly", false).css("background-color", ""); //上限值改为可编辑
                    $("#HDownLimit").attr("readOnly", false).css("background-color", ""); //下限值改为可编辑
@@ -3821,9 +4356,9 @@
                } else if (HAnalysisMethod_Value == 3) { //如果选中【其他分析】,则隐藏定量、定性分析
                    option_Value.cols[0][5].hide = false;  //其他
                    option_Value.cols[0][3].hide = true;  //定性
                    option_Value.cols[0][4].hide = true;  //定量
                    option_Value.cols[0][6].hide = false;  //其他
                    option_Value.cols[0][4].hide = true;  //定性
                    option_Value.cols[0][5].hide = true;  //定量
                    $('#btnSearchInspectValB').addClass("layui-btn-disabled").attr("disabled", true);//检验值按钮
                    $('#btnSearchTargetValB').addClass("layui-btn-disabled").attr("disabled", true);//目标值按钮
@@ -3848,7 +4383,7 @@
            }
            //#endregion
            //#region【改变选中行颜色】
            //#region ã€æ”¹å˜é€‰ä¸­è¡Œé¢œè‰²ã€‘
            function check_row(obj) {
                if (trindex != "") {
                    $("tr[data-index = " + (trindex) + "] ").attr({ "style": "background:" });//取消当前tr颜色
@@ -3905,7 +4440,7 @@
                var oldText = $(this).prev().text();
                var value = obj.value //得到修改后的值
                    , data = obj.data //得到所在行所有键值
                    , field = obj.field; //得到字段
                    , field = obj.field; //得到字段
                var HInspectVal = $("#HInspectVal").val(); //检验值
                var HTargetVal = $("#HTargetVal").val(); //目标值
                var HComparator = $("#HComparator").val(); //比较符
@@ -3973,19 +4508,243 @@
            }
            //#endregion
            //自动带出检验方案
            function GetCheckItemID() {
                var HName = $("#HMaterName").val();
                var HProName = $("#HProcName").val();
                var HSourceID = $("#HSourceID").val();
                if (HName != '' && HName != undefined && HProName != '' && HProName != undefined) {
                    $.ajax({
                        url: GetWEBURL() + "/Web/GetCheckItemID",
                        type: "GET",
                        async: false,
                        data: { "HName": HName, "HProName": HProName,"HSourceID": HSourceID },
                        success: function (result) {
                            if (result.code == 1) {
                                $("#HQCSchemeID").val(result.data[0].hmainid);
                                $("#HQCSchemeName").val(result.data[0].检验方案名称);
                                //带出检验项目、抽样方案
                                get_CheckItem();
                            } else {
                                layer.msg(result.code + result.Message, { icon: 5 });
                            }
                        }
                    })
                }
            }
            window.GetCheckItemID = function () {
                var HName = $("#HMaterName").val();
                var HProName = $("#HProcName").val();
                var HSourceID = $("#HSourceID").val();
                if (HName != '' && HName != undefined && HProName != '' && HProName != undefined) {
                    $.ajax({
                        url: GetWEBURL() + "/Web/GetCheckItemID",
                        type: "GET",
                        async: false,
                        data: { "HName": HName, "HProName": HProName, "HSourceID": HSourceID },
                        success: function (result) {
                            if (result.code == 1) {
                                $("#HQCSchemeID").val(result.data[0].hmainid);
                                $("#HQCSchemeName").val(result.data[0].检验方案名称);
                                get_CheckItem();
                            } else {
                                layer.msg(result.code + result.Message, { icon: 5 });
                            }
                        }
                    })
                }
            }
            //获取班次
            function get_HWorkShift() {
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Gy_ShiftsController/Get_HWorkShift", //方法所在页面和方法名
                    data: {
                        "HDeptID": HDeptID,
                        "HCenterID": HCenterID
                    },
                    success: function (data) {
                        if (data.count == 1)// è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        {
                            var LoadData = data.data;
                            $("#HShiftsID").val(LoadData[0].HInterID); //当前工序ID
                            $("#HShiftsName").val(LoadData[0].班次); //当前工序
                        }
                    },
                    error: function (err) {
                        layer.alert(err, { icon: 5 });
                    }
                });
            }
            //#region å®¡æ ¸æ•°æ®
            function set_CheckBill() {
                var InterID = $("#HInterID").val();
                //逻辑审核方法
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/QC_ValueTable/QC_FirstPieceCheckValue", //方法所在页面和方法名
                    data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 1) {
                            layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                // å¾—到frame索引
                                var index = layer.getFrameIndex(window.name);
                                //关闭当前frame
                                layer.close(index);
                            });
                            $('#set_CheckBill').addClass("layui-btn-disabled").attr("disabled", true);// ç¦ç”¨å®¡æ ¸æŒ‰é’®
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion
            //#region å­è¡¨1:隐藏列设置
            function get_HideColumn() {
                var colName = "";
                var contentUrl = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colName += option.cols[0][i]["title"] + ",";
                }
                var urlStr = window.document.location.pathname;//获取文件路径
                var urlLen = urlStr.split('/');
                for (var i = 0; i < urlLen.length - 4; i++) {
                    contentUrl += "../";
                }
                colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿›è¡Œç¼–码
                contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "隐藏列设置"  //标题
                    , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: [contentUrl, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                })
            }
            //#endregion
            //#region å­è¡¨1:显示列数据
            function DisPlay_HideColumn() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    async: false,
                    type: "GET",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    async: false,
                    success: function (data1) {
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["HQCCheckItemID","HInspectInstruMentID"];
                            dataCol = data1.data[0].HGridString.split(',');
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                if (dataCol.length <= i) {
                                    break;
                                }
                                var dataCols = dataCol[i].split('|');
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                //设置列宽
                                if (dataCols[3] > 0) {
                                    option.cols[0][i + 1]["width"] = dataCols[3];
                                }
                                //设置内容字体大小
                                if (data1.data[0].HFontSize != 0) {
                                    option.cols[0][i + 1]["style"] += "font-size:" + data1.data[0].HFontSize + "px;";
                                } else {
                                    option.cols[0][i + 1]["style"] += "font-size:100%";
                                }
                                //显示列
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
                                }
                                //字体所在位置(å·¦ å±…中 å³)
                                switch (dataCols[2]) {
                                    case "L":
                                        option.cols[0][i + 1]["align"] = "left";
                                        break;
                                    case "M":
                                        option.cols[0][i + 1]["align"] = "center";
                                        break;
                                    case "R":
                                        option.cols[0][i + 1]["align"] = "right";
                                        break;
                                }
                                //设置表格title属性显示别名
                                if (dataCols[4] != null && dataCols[4] != "") {
                                    option.cols[0][i + 1]["title"] = dataCols[4];
                                }
                            }
                            //取消冻结列
                            for (var i = 1; i < option.cols[0].length - 1; i++) {
                                if (option.cols[0][i]["fixed"] != null) {
                                    option.cols[0][i]["fixed"] = null;
                                }
                                else {
                                    break;
                                }
                            }
                            //冻结列
                            if (data1.data[0].HFixCols != 0) {
                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
                                        data1.data[0].HFixCols += 1;
                                    }
                                    option.cols[0][i + 1]["fixed"] = "left";
                                }
                            }
                            table.render(option);
                        } else {
                            table.render(option);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
            //#endregion
            //以上为layui模块
        });
        function GetGySource(obj) {  //生产资源
            $("#HSourceName").val(obj.生产资源名称);
            $("#HSourceID").val(obj.HItemID);
            $("#HSourceName").val(obj[0].生产资源名称);
            $("#HSourceID").val(obj[0].HItemID);
        }
        function GetICMOBillValue(obj) {  //生产订单
            $("#HICMOInterID").val(obj[0].hmainid);
            $("#HICMOEntryID").val(obj[0].HEntryID);
            $("#HICMOBillNo").val(obj[0].单据号);
            $("#HICMOQty").val(obj[0].计划生产数量);
            $("#HICMOQty").val(obj[0].生产任务单数量);
            $("#HMaterNumber").val(obj[0].产品代码);
            $("#HMaterName").val(obj[0].产品名称);
            $("#HMaterID").val(obj[0].HMaterID);
        }
        function GetProcExValue(obj) {  //流转卡
@@ -3994,10 +4753,11 @@
            $("#HProcExchBillNo").val(obj[0].单据号);
        }
        function GetMaterValue(obj) {  //物料
        function GetGyMaterial(obj) {  //物料
            $("#HMaterNumber").val(obj[0].物料代码);
            $("#HMaterName").val(obj[0].物料名称);
            $("#HMaterID").val(obj[0].HItemID);
            GetCheckItemID();
        }
        function GetHEmpValue(obj) {  //质检员
@@ -4008,9 +4768,56 @@
        function GetCheckProjectValue(obj) {  //质检方案
            $("#HQCSchemeID").val(obj[0].hmainid);
            $("#HQCSchemeName").val(obj[0].检验方案名称);
            get_CheckItem();
            get_CheckItem1();
        }
        //班次
        function GetHWorkShiftsValue(obj) {
            $("#HShiftsName").val(obj[0].班次名称);
            $("#HShiftsID").val(obj[0].HInterID);
        }
        //工序
        function GetProcessValue (obj) {
            $("#HProcName").val(obj[0].工序名称);
            $("#HProcID").val(obj[0].HItemID);
        }
        //计量单位
        function GetHUnitListValue(obj) {
            $("#HUnitID").val(obj.HItemID);
            $("#HUnit").val(obj.计量单位名称);
        }
        //检验值
        function GetHInspect1Value(obj) {
            $("#HInspectValB").val(obj[0].HItemID);
            $("#HInspectVal").val(obj[0].检测值名称);
        }
        //检验值
        function GetHInspectValue(obj) {
            $("#HTargetValB").val(obj.HItemID);
            $("#HTargetVal").val(obj.检测值名称);
            $("#HUpLimit").val(obj.HItemID);
            $("#HDownLimit").val(obj.检测值名称);
        }
        //检验项目
        function GetCheckItemValue   (obj) {
            OptionData = obj;
        }
        //检验仪器
        function GetInspectInstruMentValue(obj) {
            OptionData = obj;
        }
        //质量标准
        function GetQualityStdValue(obj) {
            OptionData = obj;
        }
        //检验方法
        function GetInspectMethodValue(obj) {
            OptionData = obj;
        }
        //检验依据
        function GetInspectBasisValue(obj) {
            OptionData = obj;
        }
    </script>
</body>
</html>