yxj
2024-10-10 9f1c2ac41687335fe2faa470cfb63ee3a8ecd821
WebTM/views/ÖÊÁ¿¹ÜÀí/¼ìÑé·½°¸µ¥/QC_Add_CheckProject.html
@@ -8,135 +8,150 @@
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <style type="text/css">
        .layui-form-label {
            width: 85px;
        }
        /* é˜²æ­¢ä¸‹æ‹‰æ¡†çš„下拉列表被隐藏---必须设置--- */
        .layui-table-cell {
            overflow: visible !important;
        }
        /* ä½¿å¾—下拉框与单元格刚好合适 */
        td .layui-form-select {
            margin-top: -10px;
            margin-left: -15px;
            margin-right: -15px;
        }
    </style>
</head>
<body>
    <div id="layout1" class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <form id="form0" class="layui-form"  lay-filter="component-form-group" action="">
                    <form id="form0" class="layui-form" lay-filter="component-form-group" action="">
                        <div class="layui-card-header">
                            <div class="layui-btn-group">
                                <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Cancel">退出</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button>
                            </div>
                        </div>
                        <div class="layui-card-body">
                            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                                <!--<ul class="layui-tab-title">
                                <li class="layui-this">基本信息</li>-->
                                <!--<li>其他信息</li>-->
                                <!--</ul>-->
                                <h1 style="text-align:center;"><b>检验方案单</b></h1>
                                <div class="layui-tab-content">
                                    <div class="layui-tab-item layui-show">
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label">单 æ® å·ï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" readonly="readonly" autocomplete="off">
                                                        <input id="HInterID" name="HInterID" value="0" type="hidden" />
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label">单据日期:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDate" id="HDate" readonly="readonly" autocomplete="off" disabled>
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label">方案名称:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HName" id="HName" autocomplete="off" >
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label">物料:</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" name="HMater" id="HMater" lay-verify="HMater" readonly="readonly" autocomplete="off" class="layui-input">
                                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="HMateria-BT">
                                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                        </button>
                                                        <input id="HMaterID" name="HMaterID" type="hidden" />
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label">物料代码:</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" name="HMaterNumber" id="HMaterNumber" lay-verify="HMaterNumber" readonly="readonly" autocomplete="off" class="layui-input">
                                                    </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">单据号</label>
                                                <div class="layui-input-inline">
                                                    <input class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" readonly="readonly" autocomplete="off">
                                                    <input id="HInterID" name="HInterID" type="hidden" />
                                                </div>
                                            </div>
                                            <!--<button class="layui-btn" data-type="reload">选择</button>-->
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label">工序:</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" name="HProcName" id="HProcName" lay-verify="" autocomplete="off" class="layui-input">
                                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="HProc-BT">
                                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                        </button>
                                                        <input id="HProcID" name="HProcID" type="hidden" />
                                                    </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">日期</label>
                                                <div class="layui-input-inline">
                                                    <input class="layui-input" name="HDate" id="HDate" autocomplete="off" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                                </div>
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label"> ç‰©æ–™å¤§ç±»ï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HMaterTypeID" onkeyup="this.value=this.value.replace(/\D/g,'')" value="0" lay-verify="" id="HMaterTypeID"  autocomplete="off">
                                                    </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">方案名称<label style="color:red"> * </label></label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HName" id="HName" class="layui-input">
                                                </div>
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label"> éƒ¨é—¨ï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" name="HDepName" id="HDepName" lay-verify="" autocomplete="off" class="layui-input">
                                                        <input id="HDeptID" name="HDeptID" type="hidden" />
                                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="HDepart-BT">
                                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                        </button>
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label"> å•位:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HUName" lay-verify="" id="HUName" readonly="readonly" autocomplete="off">
                                                        <input id="HUnitID" name="HUnitID" type="hidden" />
                                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="HUnitID-BT">
                                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                        </button>
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs2">
                                                    <label class="layui-form-label"> å•位代码:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HUnitNumber" lay-verify="" id="HUnitNumber" readonly="readonly" autocomplete="off">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-colorpicker-xs">
                                                    <label class="layui-form-label"> å¤‡æ³¨ï¼š</label>
                                                    <div class="layui-input-block">
                                                        <input class="layui-input" name="HRemark" id="HRemark" autocomplete="off">
                                                    </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">物料</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HMaterName" id="HMaterName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HMaterID" id="HMaterID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HMaterList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">物料代码</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HMaterNumber" id="HMaterNumber" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">工序</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HProcName" id="HProcName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HProcID" id="HProcID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HProcList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">物料大类</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HMaterTypeName" id="HMaterTypeName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HMaterTypeID" id="HMaterTypeID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HMaterTypeList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">部门</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">抽样方案</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HSampleSchemeName" id="HSampleSchemeName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HSampleSchemeID" id="HSampleSchemeID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HSampleSchemeList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">单位</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HUnitName" id="HUnitName" class="layui-input" value="" style="float:left;width:150px;">
                                                    <input type="hidden" name="HUnitID" id="HUnitID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HUnitList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">单位代码</label>
                                                <div class="layui-input-inline">
                                                    <input type="text" name="HUnitNumber" id="HUnitNumber" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">备注</label>
                                                <div class="layui-input-inline">
                                                    <textarea placeholder="请输入维备注" class="layui-textarea" name="HRemark" id="HRemark" style="min-height:0px;"></textarea>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
                                                <label class="layui-form-label">默认方案</label>
                                                <div class="layui-input-inline">
                                                    <input type="checkbox" name="HStandard" id="HStandard" lay-skin="primary" title="" checked="">
                                                </div>
                                            </div>
                                        </div>
@@ -144,19 +159,21 @@
                                </div>
                            </div>
                        </div>
                        <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo">
                            <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>
                            </div>
                        </script>
                        <script type="text/html" id="xuhao">
                            {{d.LAY_TABLE_INDEX+1}}
                        </script>
                    </form>
                </div>
            </div>
@@ -166,2129 +183,915 @@
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <!--行下拉选择(分析方法)-->
    <script type="text/html" id="HAnalysisMethod">
        <select name="HAnalysisMethod" lay-filter="HAnalysisMethod" id="HAnalysisMethod{{d.LAY_TABLE_INDEX+1}}">
            <option value="1">定性分析</option>
            <option value="2">定量分析</option>
            <option value="3">其他分析</option>
        </select>
    </script>
    <!--行下拉选择(缺陷等级)-->
    <script type="text/html" id="HDefectLevel">
        <select name="HDefectLevel" lay-filter="HDefectLevel" id="HDefectLevel{{d.LAY_TABLE_INDEX+1}}">
            <option value="1">致命缺陷</option>
            <option value="2">重缺陷</option>
            <option value="3">轻缺陷</option>
        </select>
    </script>
    <!--行下拉选择(状态)-->
    <script type="text/html" id="HStatus">
        <select name="HStatus" lay-filter="HStatus" id="HStatus{{d.LAY_TABLE_INDEX+1}}">
            <option value="0">不合格</option>
            <option value="1" selected>合格</option>
        </select>
    </script>
    <!--复选框(重点检查)-->
    <script type="text/html" id="HKeyInspect">
        <input type="checkbox" value="{{d.HKeyInspect}}" lay-skin="primary" id="HKeyInspect{{d.LAY_TABLE_INDEX+1}}" lay-filter="HKeyInspect" {{ d.HKeyInspect == 1 ? 'checked' : '' }}>
    </script>
    <!--复选框(破坏性检验)-->
    <script type="text/html" id="HDestructInspect">
        <input type="checkbox" value="{{d.HDestructInspect}}" lay-skin="primary" id="HDestructInspect{{d.LAY_TABLE_INDEX+1}}" lay-filter="HDestructInspect" {{ d.HDestructInspect == 1 ? 'checked' : '' }}>
    </script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script>
        //获取参数
        function getUrlVars() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        //获取页面跳转参数
        var params = get_UrlVars();
        if (typeof (params[params[0]]) == "undefined") {
            var OperationType = 1;//操作类型
        } else {
            var OperationType = params[params[0]];//操作类型
            var linterid = params[params[1]];//源单id
            var HSouceBillType = params[params[2]];//源单类型
        }
        var params = getUrlVars();
        var hID = params[params[0]];//编辑查看
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            //#region å…¬ç”¨å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            var option;
            var sBillType = "3320";
            //#endregion
            //判断是否登录 æœªç™»å½•则跳到登录页
            if (sessionStorage.login != "login") {
                layer.confirm("登录失效,请重新登录!", {
                    icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
                }, function () { window.location.href = "../../user/login.html"; });
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //初始化表格
            set_InitGrid();
            //判断操作类型
            if (OperationType == 1) {//无源单
                set_AddFNew();
            }
            var tableReload = table.reload;
            var option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , height: 500
                //,url: '/demo/table/user/' //数据接口
                , page: true //开启分页
                , cols: [[ //表头
                     {type:'checkbox', fixed: 'left'}
                    ,{ templet: '#xuhao', title: '序号', sort: true, fixed: 'left',event:"qwe" }
                    , { field: 'HPrjNo', title: '次序号', event: "", edit: 'text'}
                    , { field: 'HQCCheckItemID', title: '检验项目ID', edit: 'text'}
                    , { field: 'HNumber', title: '检验项目代码', edit: 'text' }
                    , { field: 'HName', title: '检验项目名称', edit: 'text', event: "" }
                    , { field: 'HQCStd', title: '检验标准',edit: 'text', event: "" }
                    , { field: 'HQCStdMax', title: '最大检验标准' , edit: 'text'}
                    , { field: 'HQCUnit', title: '检验单位', event: "", edit: 'text' }
                    , { field: 'HRemark', title: '备注', edit: 'text'}
                     ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
                ]]
                   , limit: 500 //每页默认显示的数量
            };
            //判断是否新增
            if (hID == null || hID == 0)
            {
                //初始加载表格{ "ID": 0, "HWasterReasonName": " ","HBadReasonID":0,"HEmpName": "  ", "HSQProcName": "   ","HProcID":0, "HZRProcName": "  ", "HMRBChecker": "  ", "HRemark": "  ", "HPSProcName": "  ", "HCloseMan": "   " }
                option.data = [{ "HPrjNo": " ", "HQCCheckItemID": 0, "HNumber": "  ", "HName": "   ", "HQCStd": 0, "HQCStdMax": "  ", "HQCUnit": "  ", "HRemark": "  " }];
                table.render(option);
            else if (OperationType == 3) {//编辑
                set_EditFromGrid();
            }
            else
            {
                $("#HInterID").val(hID);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'MES_QC_CheckProjectDetail_Json',
                    type: "GET",
                    data: { "sqlWhere": "and HInterID="+hID },
                    success: function (result) {
                        console.log('gouba' + result);
                        if (result.count == 1) {
                            option.data = result.data;
                            table.render(option);
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index0);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            else {
                layer.alert("未知操作类型!", { icon: 5 });
            }
            //#endregion
               //头工具栏事件
            var rowid = 0;
            var rows = 0;
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            // å¤´å·¥å…·æ äº‹ä»¶
            table.on('toolbar(mainTable)', function (obj) {
                var rowid = 0;
                var checkStatus = table.checkStatus('mainTable')
                    ,data = checkStatus.data;;
                    , data = checkStatus.data;;
                var AddRow = table.cache['mainTable'];
                var NewRow = { "HPrjNo": " ", "HQCCheckItemID": 0, "HNumber": "  ", "HName": "   ", "HQCStd": 0, "HQCStdMax": "  ", "HQCUnit": "  ", "HRemark": "  "};
                var NewRow = {
                    "HPrjNo": 0, "HQCCheckItemID": 0, "HQCCheckItemNumber": "", "HQCCheckItemName": "", "HQCStd": "", "HQCStdMax": "", "HQCUnit": ""
                    , "HRemark": "", "HQCTool": "", "HAnalysisMethod": 1, "HDefectLevel": 3, "HDestructInspect": 0, "HKeyInspect": 0, "HQualityStdID": 0
                    , "HInspectMethodID": 0, "HInspectInstruMentID": 0, "HInspectBasisID": 0, "HSampleSchemeID": 0, "HStatus": 1, "HCompareSymbol": ""
                    , "HTargetVal": "", "HUpLimit": "", "HDownLimit": "", "HUpOffSet": "", "HDownOffSet": "", "HTargetValKey": "", "HUpLimitKey": ""
                    , "HDownLimitKey": "", "HUpOffSetKey": "", "HDownOffSetKey": "", "HTargetValQ": 0, "HUpLimitQ": 0, "HDownLimitQ": 0, "HUpOffSetQ": 0
                    , "HDownOffSetQ": 0, "HTargetValB": 0, "HUpLimitB": 0, "HDownLimitB": 0, "HUpOffSetB": 0, "HDownOffSetB": 0
                    , "HTargetValTxt": "", "HUpLimitTxt": "", "HDownLimitTxt": "", "HUpOffSetTxt": "", "HDownOffSetTxt": ""
                    , "HQualityStdName": "", "HInspectMethodName": "", "HInspectInstruMentName": "", "HInspectBasisName": "", "HSampleSchemeName": ""
                    , "HControlUpperLimit": 0, "HControlLowerLimit":0
                };
                switch (obj.event) {
                    case 'btn-AddLine':
                        //table.cache["mainTable"].push(AddRow[rows]);
                         table.cache["mainTable"].push(NewRow);
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        rows++;
                        layer.msg('增加一行按钮!')
                    //新增一行
                    case 'btn-AddLine': btnAddLine(NewRow);
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
                        if (data.length <= 0) {
                            layer.alert("请选择需要复制的一行!");
                        }
                        else if (data.length>1) {
                            layer.alert("只能选择复制一行!");
                        }
                        else {
                            var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                            var copyrow =copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                            table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.render(option);//将数据渲染到表格上
                            //layer.alert(copyrow);
                        }
                    //复制一行
                    case 'btn-CopyLine': btnCopyLine(data);
                        break;
                }
            });
            //行内事件
            // è¡Œå†…事件
            table.on('tool(mainTable)', function (obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event==='del') {
                    layer.confirm('真的删除行么', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex ==='0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            obj.del();
                            layer.close(index);
                set_GridDelete(obj);   //行内删除
                set_GridCellCheck(obj); //行内快捷键筛选
            });
            //#region åŸºç¡€èµ„料放大镜按钮
            //表头弹窗物料信息
            form.on('submit(HMaterList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '产品模具列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_Material.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HMaterName").val(checkStatus.data[0].物料名称);
                        $("#HMaterNumber").val(checkStatus.data[0].物料代码);
                        $("#HMaterID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头弹窗工序
            form.on('submit(HProcList)', function () {//选择工序
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '工序列表'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../基础资料/生产基础资料/Gy_Process.html', 'yes']
                    , resize: false
                    , 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('请选择数据');
                        }
                        $("#HProcName").val(checkStatus.data[0].工序名称);
                        $("#HProcID").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                    //, cancel: function (index, layero) {
                    //    GetHProcValue(obj);
                    //}
                })
            });
            //表头物料大类
            form.on('submit(HMaterTypeList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '物料分类列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_MaterType.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        console.log(checkStatus);
                        $("#HMaterTypeName").val(checkStatus.data[0].名称);
                        $("#HMaterTypeID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头部门信息
            form.on('submit(HDeptList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '部门列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HDeptName").val(checkStatus.data[0].部门名称);
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头抽样方案信息
            form.on('submit(HSampleSchemeList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '抽样方案列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../Baseset/基础资料/Gy_SampleSchemeListView.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HSampleSchemeName").val(checkStatus.data[0].抽样方案名称);
                        $("#HSampleSchemeID").val(checkStatus.data[0].hmainid);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //表头单位单位
            form.on('submit(HUnitList)', function () {//选择单位
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '单位列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../基础资料/公用基础资料/Gy_Unit.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HUnitName").val(checkStatus.data[0].计量单位名称);
                        $("#HUnitNumber").val(checkStatus.data[0].计量单位代码);
                        $("#HUnitID").val(checkStatus.data[0].HItemID);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //#endregion
            //保存
            form.on('submit(Saver)', function (data) {//保存
                //debugger;
                Saver(data);
            });
            //退出
            form.on('submit(Exit)', function (data) {//
                if (typeof (params[params[0]]) == "undefined") {
                    Pub_Close(2);
                } else {
                    Pub_Close(1);
                }
                //var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                //parent.layer.close(index); //再执行关闭
            });
            //行选择处理(是否委外)
            form.on('select(HAnalysisMethod)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
                var dataindex = elem.attr("data-index");
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HAnalysisMethod = data.value;//把选中下拉框id值赋值给表格缓存
                    }
                });
            });
            //行选择处理(缺陷等级)
            form.on('select(HDefectLevel)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
                var dataindex = elem.attr("data-index");
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HDefectLevel = data.value;//把选中下拉框id值赋值给表格缓存
                    }
                });
            });
            //行选择处理(状态)
            form.on('select(HStatus)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
                var dataindex = elem.attr("data-index");
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HStatus = data.value;//把选中下拉框id值赋值给表格缓存
                    }
                });
            });
            //是否重点检查
            form.on('checkbox(HKeyInspect)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
                var dataindex = elem.attr("data-index");
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HKeyInspect = data.elem.checked;//把选中下拉框id值赋值给表格缓存
                    }
                });
            });
            //是否破坏性检验
            form.on('checkbox(HDestructInspect)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
                var dataindex = elem.attr("data-index");
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HDestructInspect = data.elem.checked;//把选中下拉框id值赋值给表格缓存
                    }
                });
            });
            //是否默认方案
            form.on('checkbox(HStandard)', function (data) {
                $("#HStandard").val(data.elem.checked);
            });
            //#endregion
            //#region å½“前页面所有方法
            //表格行内事件快捷键筛选
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        if (obj.event === 'HQCCheckItemNumber')  //
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '检验项目列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../基础资料/公用基础资料/Gy_CheckItem.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    if (checkStatus.data.length === 1) {
                                        //同步更新表格和缓存对应的值
                                        obj.update({
                                            HQCCheckItemID: checkStatus.data[0].HItemID,
                                            HQCCheckItemNumber: checkStatus.data[0].代码,
                                            HQCCheckItemName: checkStatus.data[0].名称,
                                        });
                                        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]["HQCCheckItemID"] != "" && tableBak[i]["HQCCheckItemID"] != undefined && tableBak[i]["HQCCheckItemID"] != null) {
                                                buttonArr.push(tableBak[i]);  //如果关键字段不为空,则将之前的数据存储
                                            }
                                        }
                                        //将批量选择的数据写入数组(多选行)
                                        for (var i = 0; i < checkStatus.data.length; i++) {
                                            buttonArr.push({
                                                "HPrjNo": i + 1, "HQCCheckItemID": checkStatus.data[i].HItemID, "HQCCheckItemNumber": checkStatus.data[i].代码, "HQCCheckItemName": checkStatus.data[i].名称, "HQCStd": "", "HQCStdMax": "", "HQCUnit": "", "HRemark": ""
                                                , "HTargetVal": 0, "HUpLimit": 0, "HDownLimit": 0, "HUpOffSet": 0, "HDownOffSet": 0, "HTargetValB": 0, "HUpLimitB": 0, "HDownLimitB": 0, "HUpOffSetB": 0, "HDownOffSetB": 0, "HTargetValQ": 0, "HUpLimitQ": 0, "HDownLimitQ": 0, "HUpOffSetQ": 0
                                                , "HDownOffSetQ": 0
                                            });
                                        }
                                        table.reload("mainTable", {
                                            data: buttonArr    //将数据重新载入表格
                                        })
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    }
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }
                            });
                        }
                        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', '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 () {
                                },
                                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', '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 () {
                                },
                                success: function (layero, index) {
                                }
                            });
                        }
                        if (obj.event === 'HInspectInstruMentName')  //
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '检验仪器列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../基础资料/公用基础资料/Gy_InspectInstruMent.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    obj.update({
                                        HInspectInstruMentID: checkStatus.data[0].HItemID,
                                        HInspectInstruMentName: checkStatus.data[0].检验仪器名称,
                                        HQCTool: checkStatus.data[0].检验仪器名称,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                },
                                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', '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 () {
                                },
                                success: function (layero, index) {
                                }
                            });
                        }
                        if (obj.event === 'HSampleSchemeName')  //
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '抽样方案列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../Baseset/基础资料/Gy_SampleSchemeListView.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
                                    //按钮【按钮一】的回调
                                    var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    obj.update({
                                        HSampleSchemeID: checkStatus.data[0].hmainid,
                                        HSampleSchemeName: checkStatus.data[0].抽样方案名称,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                },
                                success: function (layero, index) {
                                }
                            });
                        }
                        obj.event = "";
                        return false;
                    }
                })
            }
            //初始化表格
            function set_InitGrid() {
                //表头
                columns = [
                    { type: 'checkbox', fixed: 'left', totalRowText: '合计行' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                    , { field: 'HPrjNo', title: '次序号', edit: 'text', hide: true }
                    , { field: 'HQCCheckItemID', title: '检验项目ID', edit: 'text', hide: true }
                    , { field: 'HQCCheckItemNumber', title: '检验项目代码*', edit: 'text', event: 'HQCCheckItemNumber' }
                    , { field: 'HQCCheckItemName', title: '检验项目名称', edit: 'text' }
                    , { field: 'HQCStd', title: '检验标准', edit: 'text' }
                    , { field: 'HQCStdMax', title: '最大检验标准', edit: 'text' }
                    , { field: 'HQCUnit', title: '检验单位', edit: 'text' }
                    , { field: 'HQCTool', title: '检验工具(仪器)', edit: 'text' }
                    , { field: 'HAnalysisMethod', title: '分析方法', templet: '#HAnalysisMethod' }
                    , { field: 'HDefectLevel', title: '缺陷等级', templet: '#HDefectLevel' }
                    , { field: 'HDestructInspect', title: '破坏性检验', templet: '#HDestructInspect', unresize: false }
                    , { field: 'HKeyInspect', title: '重点检查', templet: '#HKeyInspect', unresize: false }
                    , { 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: 'HInspectInstruMentID', title: '检验仪器ID', edit: 'text', hide: true }
                    , { field: 'HInspectInstruMentName', title: '检验仪器', edit: 'text', event: 'HInspectInstruMentName' }
                    , { field: 'HInspectBasisID', title: '检验依据ID', edit: 'text', hide: true }
                    , { field: 'HInspectBasisName', title: '检验依据', edit: 'text', event: 'HInspectBasisName' }
                    , { field: 'HSampleSchemeID', title: '抽样方案ID', edit: 'text', hide: true }
                    , { field: 'HSampleSchemeName', title: '抽样方案', edit: 'text', event: 'HSampleSchemeName' }
                    , { field: 'HStatus', title: '状态', templet: '#HStatus' }
                    , { field: 'HCompareSymbol', title: '比较符', edit: 'text' }
                    , { field: 'HTargetVal', title: '目标值', edit: 'text' }
                    , { field: 'HUpLimit', title: '上限值', edit: 'text' }
                    , { field: 'HDownLimit', title: '下限值', edit: 'text' }
                    , { field: 'HUpOffSet', title: '上偏差', edit: 'text' }
                    , { field: 'HDownOffSet', title: '下偏差', edit: 'text' }
                    , { field: 'HTargetValKey', title: '目标值Key', edit: 'text' }
                    , { field: 'HUpLimitKey', title: '上限值Key', edit: 'text' }
                    , { field: 'HDownLimitKey', title: '下限值Key', edit: 'text' }
                    , { field: 'HUpOffSetKey', title: '上偏差Key', edit: 'text' }
                    , { field: 'HDownOffSetKey', title: '下偏差Key', edit: 'text' }
                    , { field: 'HTargetValQ', title: '目标值数量', edit: 'text' }
                    , { field: 'HUpLimitQ', title: '上限值数量', edit: 'text' }
                    , { field: 'HDownLimitQ', title: '下限值数量', edit: 'text' }
                    , { field: 'HUpOffSetQ', title: '上偏差数量', edit: 'text' }
                    , { field: 'HDownOffSetQ', title: '下偏差数量', edit: 'text' }
                    , { field: 'HTargetValB', title: '目标值基础资料', edit: 'text' }
                    , { field: 'HUpLimitB', title: '上限值基础资料', edit: 'text' }
                    , { field: 'HDownLimitB', title: '下限值基础资料', edit: 'text' }
                    , { field: 'HUpOffSetB', title: '上偏差基础资料', edit: 'text' }
                    , { field: 'HDownOffSetB', title: '下偏差基础资料', edit: 'text' }
                    , { field: 'HTargetValTxt', title: '目标值文本', edit: 'text' }
                    , { field: 'HUpLimitTxt', title: '上限值文本', edit: 'text' }
                    , { field: 'HDownLimitTxt', title: '下限值文本', edit: 'text' }
                    , { field: 'HUpOffSetTxt', title: '上偏差文本', edit: 'text' }
                    , { field: 'HDownOffSetTxt', title: '下偏差文本', edit: 'text' }
                    , { field: 'HControlUpperLimit', title: '控制上限', edit: 'text' }
                    , { field: 'HControlLowerLimit', title: '控制下限', edit: 'text' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ];
                option = {
                    id: 'mainTable'
                    , elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , totalRow: true
                    , page: false
                    , cellMinWidth: 120
                    , height: 500
                    , limit: 100
                    , cols: [columns]
                    , done: function (res, curr, count) {
                    }
                };
            }
            //保存
            function Saver(data) {
                var isEndCheck = document.getElementById("HStandard").checked;
                data.field.HStandard = isEndCheck;//将数组合并成字符串
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"];
                if (!AllowLoadData(sSubStr))//数据验证
                {
                    return false;
                }
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "/QC_Management/SaveQCCheckProjectList", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                    parent.layer.close(index); //再执行关闭 Â  Â  Â  Â  Â Â  Â Â Â  Â 
                                });
                            }
                            else {
                                layer.alert(data.Message, { icon: 5 });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            layer.alert("错误:" + err, { icon: 5 });
                        }
                    });
                }
                if (obj.event === 'ReasonNameEvent') {
                    var _obj = obj;
                    switch (rowIndex) {
                        case "0":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "1":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "2":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "3":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "4":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "5":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "6":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "7":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "8":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "9":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "10":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "11":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "12":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "13":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "14":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "15":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "16":
                            //弹出框选择不良原因
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '不良原因列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        ,HBadReasonID:ReasonID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
                            break;
            }
            //无源单新增
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [{
                    "HPrjNo": 0, "HQCCheckItemID": 0, "HQCCheckItemNumber": "", "HQCCheckItemName": "", "HQCStd": "", "HQCStdMax": "", "HQCUnit": ""
                    , "HRemark": "", "HQCTool": "", "HAnalysisMethod": 1, "HDefectLevel": 3, "HDestructInspect": 0, "HKeyInspect": 0, "HQualityStdID": 0
                    , "HInspectMethodID": 0, "HInspectInstruMentID": 0, "HInspectBasisID": 0, "HSampleSchemeID": 0, "HStatus": 1, "HCompareSymbol": ""
                    , "HTargetVal": "", "HUpLimit": "", "HDownLimit": "", "HUpOffSet": "", "HDownOffSet": "", "HTargetValKey": "", "HUpLimitKey": ""
                    , "HDownLimitKey": "", "HUpOffSetKey": "", "HDownOffSetKey": "", "HTargetValQ": 0, "HUpLimitQ": 0, "HDownLimitQ": 0, "HUpOffSetQ": 0
                    , "HDownOffSetQ": 0, "HTargetValB": 0, "HUpLimitB": 0, "HDownLimitB": 0, "HUpOffSetB": 0, "HDownOffSetB": 0
                    , "HTargetValTxt": "", "HUpLimitTxt": "", "HDownLimitTxt": "", "HUpOffSetTxt": "", "HDownOffSetTxt": ""
                    , "HQualityStdName": "", "HInspectMethodName": "", "HInspectInstruMentName": "", "HInspectBasisName": "", "HSampleSchemeName": ""
                    , "HControlUpperLimit": 0, "HControlLowerLimit": 0
                }];
                table.render(option);
            }
            //编辑
            function set_EditFromGrid() {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{
                    "HPrjNo": 0, "HQCCheckItemID": 0, "HQCCheckItemNumber": "", "HQCCheckItemName": "", "HQCStd": "", "HQCStdMax": "", "HQCUnit": ""
                    , "HRemark": "", "HQCTool": "", "HAnalysisMethod": 1, "HDefectLevel": 3, "HDestructInspect": 0, "HKeyInspect": 0, "HQualityStdID": 0
                    , "HInspectMethodID": 0, "HInspectInstruMentID": 0, "HInspectBasisID": 0, "HSampleSchemeID": 0, "HStatus": 1, "HCompareSymbol": ""
                    , "HTargetVal": "", "HUpLimit": "", "HDownLimit": "", "HUpOffSet": "", "HDownOffSet": "", "HTargetValKey": "", "HUpLimitKey": ""
                    , "HDownLimitKey": "", "HUpOffSetKey": "", "HDownOffSetKey": "", "HTargetValQ": 0, "HUpLimitQ": 0, "HDownLimitQ": 0, "HUpOffSetQ": 0
                    , "HDownOffSetQ": 0, "HTargetValB": 0, "HUpLimitB": 0, "HDownLimitB": 0, "HUpOffSetB": 0, "HDownOffSetB": 0
                    , "HTargetValTxt": "", "HUpLimitTxt": "", "HDownLimitTxt": "", "HUpOffSetTxt": "", "HDownOffSetTxt": ""
                    , "HQualityStdName": "", "HInspectMethodName": "", "HInspectInstruMentName": "", "HInspectBasisName": "", "HSampleSchemeName": ""
                    , "HControlUpperLimit": 0, "HControlLowerLimit": 0
                }];
                table.render(option);
            }
            //获取最大单据号及默认值赋值
            function get_MAXNum() {
                //获取最大单据号 new
                $("#HInterID").val("0");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": sBillType },
                    success: function (d) {
                        $("#HInterID").val(0);
                        $("#HPlanInterID").val(0);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                    }
                }
                else if (obj.event === 'EmpNameEvent') {
                     var _obj = obj;
                    switch (rowIndex) {
                        case "0":
                            //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "1":
                             //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "2":
                              //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "3":
                              //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "4":
                           //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "5":
                             //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "6":
                            //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "7":
                         //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "8":
                              //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "9":
                           //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "10":
                            //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "11":
                          //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "12":
                              //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "13":
                              //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "14":
                             //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "15":
                            //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "16":
                              //弹出框选择责任人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HEmpName: EmpName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
                            break;
                });
            }
                    }
                }
                else if (obj.event === 'SQProcNameEvent') {
                     var _obj = obj;
                    switch (rowIndex) {
                        case "0":
                            //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "1":
                                 //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "2":
                             //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "3":
                                //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "4":
                                //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "5":
                               //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "6":
                                //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "7":
                              //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "8":
                               //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "9":
                              //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "10":
                               //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "11":
                             //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "12":
                                //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "13":
                             //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "14":
                               //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "15":
                               //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "16":
                            //弹出框选择申请工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '申请工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
                            break;
            //编辑获取表头
            function set_EditForm(linterid) {
                    }
                }
                else if (obj.event === 'ZRProcNameEvent') {
                     var _obj = obj;
                    switch (rowIndex) {
                        case "0":
                            //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "1":
                              //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "2":
                        //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "3":
                               //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "4":
                               //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "5":
                            //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "6":
                               //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "7":
                            //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "8":
                            //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "9":
                               //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "10":
                             //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "11":
                             //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "12":
                              //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "13":
                              //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "14":
                               //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "15":
                              //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "16":
                             //弹出框选择责任工序
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '责任工序列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
                            break;
                    }
                }
                else if (obj.event === 'BadQtyEvent') {
                     var _obj = obj;
                    switch (rowIndex) {
                        case "0":
                            break;
                         case "1":
                            break;
                         case "2":
                            break;
                         case "3":
                            break;
                         case "4":
                            break;
                         case "5":
                            break;
                         case "6":
                            break;
                         case "7":
                            break;
                         case "8":
                            break;
                         case "9":
                            break;
                         case "10":
                            break;
                         case "11":
                            break;
                         case "12":
                            break;
                         case "13":
                            break;
                         case "14":
                            break;
                         case "15":
                            break;
                         case "16":
                            //$(obj.tr).find(".layui-table-edit").keyup(function () {
                            //    var $input = $(this), val = $input.val();
                            //    if (!val) val = "1";
                            //    $input.val(val.replace(/[^\d]/g, ''));
                            //});
                            break;
                    }
                }
                else if (obj.event === 'RemarkEvent') {
                     var _obj = obj;
                    switch (rowIndex) {
                        case "0":
                            break;
                         case "1":
                            break;
                         case "2":
                            break;
                         case "3":
                            break;
                         case "4":
                            break;
                         case "5":
                            break;
                         case "6":
                            break;
                         case "7":
                            break;
                         case "8":
                            break;
                         case "9":
                            break;
                         case "10":
                            break;
                         case "11":
                            break;
                         case "12":
                            break;
                         case "13":
                            break;
                         case "14":
                            break;
                         case "15":
                            break;
                         case "16":
                            break;
                    }
                }
                else if (obj.event === 'PSProcNameEvent') {
                     var _obj = obj;
                    switch (rowIndex) {
                        case "0":
                              //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "1":
                                 //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "2":
                                //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "3":
                              //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "4":
                                //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "5":
                                 //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "6":
                                 //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "7":
                                //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "8":
                                  //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "9":
                                 //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "10":
                             //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "11":
                                //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "12":
                               //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "13":
                                //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "14":
                                //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "15":
                                 //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                         case "16":
                               //弹出框选择不良确认人
                            layer.open({
                                type: 2
                                , area: ['80%', '80%']
                                , title: '职员列表'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , resize: false
                                , end: function () {
                                    _obj.update({
                                        HPSProcName: QRName
                                    });
                                }
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
                            break;
                    }
                }
                else if (obj.event === 'CloseManEvent') {
                     var _obj = obj;
                    switch (rowIndex) {
                        case "0":
                            break;
                         case "1":
                            break;
                         case "2":
                            break;
                         case "3":
                            break;
                         case "4":
                            break;
                         case "5":
                            break;
                         case "6":
                            break;
                         case "7":
                            break;
                         case "8":
                            break;
                         case "9":
                            break;
                         case "10":
                            break;
                         case "11":
                            break;
                         case "12":
                            break;
                         case "13":
                            break;
                         case "14":
                            break;
                         case "15":
                            break;
                         case "16":
                            break;
                    }
                }
            });
            function RoadBillMain(hID)//加载表头
            {
                alert(hID);
                //查询检验方案单是否存在
                $.ajax({
                    url: GetWEBURL() + "GetQCCheckProjectDetail",
                    url: GetWEBURL() + "QC_Management/MES_QC_CheckProjectListCheckDetai",
                    type: "GET",
                    data: {
                        "HID": hID
                        "HID": linterid
                    },
                    success: function (result) {
                        console.log(result);
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data.h_v_Gy_Edit_QCCheckProjectList[0];
                            form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                            var data = result.data.h_v_Gy_QCCheckProjectList_Edit[0];
                            //$("input[name='HStandard']").prop("checked", data.默认方案 == 0 ? false : true);//true:选中 false:不选中
                            if (data.默认方案 == 1) {
                                $("input[name='HStandard']").prop("checked", true);
                            }
                            else {
                                $("input[name='HStandard']").prop("checked", false);
                            }
                            layui.form.render();//实时渲染选中和不选中的样式,最好添加这句话
                            form.val("component-form-group", {
                                "HBillNo": data.单据号
                                , "HDate": data.日期
                                , "HInterID": data.hmainid
                                , "HDate": formatDate(data.日期)
                                , "HName": data.方案名称
                                , "HMater": data.物料名称
                                , "HMaterID": data.物料ID
                                , "HMaterName": data.物料名称
                                , "HMaterID": data.HMaterID
                                , "HMaterNumber": data.物料代码
                                , "HProcName": data.工序名称
                                , "HProcID": data.工序ID
                                , "HMaterTypeID": data.物料大类ID
                                , "HDepName": data.部门名称
                                , "HDeptID": data.部门ID
                                , "HUName": data.单位名称
                                , "HUnitID": data.单位ID
                                , "HProcID": data.HProcID
                                , "HMaterTypeName": data.物料大类名称
                                , "HMaterTypeID": data.HMaterTypeID
                                , "HDeptName": data.部门名称
                                , "HDeptID": data.HDeptID
                                , "HUnitName": data.单位名称
                                , "HUnitID": data.HUnitID
                                , "HUnitNumber": data.单位代码
                                , "HRemark": data.表头备注
                                , "HSampleSchemeName": data.抽样方案名称
                                , "HSampleSchemeID": data.HSampleSchemeID
                                , "HStandard": data.默认方案 == 1 ? true : false
                            });
                        } else {
@@ -2300,313 +1103,307 @@
                });
            }
            // ç¼–辑获取表头时时间格式矫正方式
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
            var date = new Date();
            var day = date.getDate();
            var month = date.getMonth() + 1;
            var year = date.getFullYear();
            var shijian = year + "-" + month + "-" + day;
                if (month.length < 2) month = '0' + month;
                if (day.length < 2) day = '0' + day;
            //判断是否新增
            if (hID == null || hID == 0) {
                //获取最大单据号 new
                $("#HInterID").val(0);
                $("#HBillNo").val("");
                return [year, month, day].join('-');
            }
            // ç¼–辑获取表体
            function set_EditGrid(linterid) {
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    url: GetWEBURL() + 'QC_Management/MES_QC_CheckProjectListProjectDetai',
                    type: "GET",
                    data: { "HBillType": '3320' },
                    success: function (d) {
                        //console.log(d.data);
                    /* $("#HInterID").val(d.data[0].HInterID);*/
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(shijian);
                        $("#HInterID").val(0);
                    data: { "HInterID": linterid },
                    success: function (result) {
                        if (result.count == 1) {
                            var rowarr = [];
                            var data = result.data;
                            for (var i = 0; i < result.data.length; i++) {
                                switch (data[i].分析方法) {
                                    case "定性分析":
                                        data[i].分析方法 = "1";
                                        break;
                                    case "定量分析":
                                        data[i].分析方法 = "2";
                                        break;
                                    case "其他分析":
                                        data[i].分析方法 = "3";
                                        break;
                                }
                                switch (data[i].缺陷等级) {
                                    case "致命缺陷":
                                        data[i].缺陷等级 = "1";
                                        break;
                                    case "重缺陷":
                                        data[i].缺陷等级 = "2";
                                        break;
                                    case "轻缺陷":
                                        data[i].缺陷等级 = "3";
                                        break;
                                }
                                switch (data[i].状态) {
                                    case "合格":
                                        data[i].状态 = "1";
                                        break;
                                    case "不合格":
                                        data[i].状态 = "0";
                                        break;
                                }
                                rowarr.push({
                                    "HPrjNo": (i + 1), "HQCCheckItemID": data[i].检验项目ID, "HQCCheckItemNumber": data[i].检验项目代码,
                                    "HQCCheckItemName": data[i].检验项目, "HQCStd": data[i].检验标准, "HQCStdMax": data[i].最大检验标准,
                                    "HQCUnit": data[i].检验单位, "HRemark": data[i].表体备注, "HQCTool": data[i].检验工具,
                                    "HAnalysisMethod": data[i].分析方法, "HDefectLevel": data[i].缺陷等级, "HDestructInspect": data[i].破坏性检验 == 0 ? false : true,
                                    "HKeyInspect": data[i].重点检查 == 0 ? false : true, "HQualityStdID": data[i].HQualityStdID, "HInspectMethodID": data[i].HInspectMethodID,
                                    "HInspectInstruMentID": data[i].HInspectInstruMentID, "HInspectBasisID": data[i].HInspectBasisID,
                                    "HSampleSchemeID": data[i].HSampleSchemeID_sub, "HStatus": data[i].状态, "HCompareSymbol": data[i].比较符,
                                    "HTargetVal": data[i].目标值, "HUpLimit": data[i].上限值, "HDownLimit": data[i].下限值, "HUpOffSet": data[i].上偏差,
                                    "HDownOffSet": data[i].下偏差, "HTargetValKey": data[i].目标值Key, "HUpLimitKey": data[i].上限值Key,
                                    "HDownLimitKey": data[i].下限值Key, "HUpOffSetKey": data[i].上偏差Key, "HDownOffSetKey": data[i].下偏差Key,
                                    "HTargetValQ": data[i].目标值数量, "HUpLimitQ": data[i].上限值数量, "HDownLimitQ": data[i].下限值数量,
                                    "HUpOffSetQ": data[i].上偏差数量, "HDownOffSetQ": data[i].下偏差数量, "HTargetValB": data[i].目标值基础资料,
                                    "HUpLimitB": data[i].上限值基础资料, "HDownLimitB": data[i].下限值基础资料, "HUpOffSetB": data[i].上偏差基础资料,
                                    "HDownOffSetB": data[i].下偏差基础资料, "HTargetValTxt": data[i].目标值文本, "HUpLimitTxt": data[i].上限值文本,
                                    "HDownLimitTxt": data[i].下限值文本, "HUpOffSetTxt": data[i].上偏差文本, "HDownOffSetTxt": data[i].下偏差文本,
                                    "HQualityStdName": data[i].质量标准名称, "HInspectMethodName": data[i].检验方法名称, "HInspectInstruMentName": data[i].检验仪器名称,
                                    "HInspectBasisName": data[i].检验依据名称, "HSampleSchemeName": data[i].子抽样方案名称
                                    , "HControlUpperLimit": data[i].控制上限, "HControlLowerLimit": data[i].控制下限
                                });
                            }
                            option.data = rowarr;
                            table.render(option);
                            for (var i = 1; i <= data.length; i++) {
                                switch (data[(i - 1)].分析方法) {
                                    case "定性分析":
                                        data[(i - 1)].分析方法 = "1";
                                        break;
                                    case "定量分析":
                                        data[(i - 1)].分析方法 = "2";
                                        break;
                                    case "其他分析":
                                        data[(i - 1)].分析方法 = "3";
                                        break;
                                }
                                switch (data[(i - 1)].缺陷等级) {
                                    case "致命缺陷":
                                        data[(i - 1)].缺陷等级 = "1";
                                        break;
                                    case "重缺陷":
                                        data[(i - 1)].缺陷等级 = "2";
                                        break;
                                    case "轻缺陷":
                                        data[(i - 1)].缺陷等级 = "3";
                                        break;
                                }
                                switch (data[(i - 1)].状态) {
                                    case "合格":
                                        data[(i - 1)].状态 = "1";
                                        break;
                                    case "不合格":
                                        data[(i - 1)].状态 = "0";
                                        break;
                                }
                                $('#HAnalysisMethod' + i + '').find("option[value='" + (data[(i - 1)].分析方法) + "']").attr("selected", true);
                                $('#HDefectLevel' + i + '').find("option[value='" + (data[(i - 1)].缺陷等级) + "']").attr("selected", true);
                                $('#HStatus' + i + '').find("option[value='" + (data[(i - 1)].状态) + "']").attr("selected", true);
                                if (data[(i - 1)].破坏性检验) {
                                    $('#HDestructInspect' + (i)).attr("checked", true);
                                }
                                if (data[(i - 1)].重点检查) {
                                    $('#HKeyInspect' + (i)).attr("checked", true);
                                }
                            }
                            form.render("select");
                            form.render("checkbox");
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index0);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(hID);
                $("#HInterID").val(hID);//修改时主表ID
               /* RoadBillSub(linterid);*/
            //增加一行
            function btnAddLine(NewRow) {
                table.cache["mainTable"].push(NewRow);
                option.data = table.cache["mainTable"];
                table.render(option);
                for (var i = 1; i <= option.data.length; i++) {
                    $('#HAnalysisMethod' + i + '').find("option[value='" + option.data[i - 1].HAnalysisMethod + "']").attr("selected", true);
                    $('#HDefectLevel' + i + '').find("option[value='" + option.data[i - 1].HDefectLevel + "']").attr("selected", true);
                    $('#HStatus' + i + '').find("option[value='" + option.data[i - 1].HStatus + "']").attr("selected", true);
                    if (option.data[i - 1].HDestructInspect) {
                        $('#HDestructInspect' + i + '').attr("checked", true);
                    }
                    if (option.data[i - 1].HKeyInspect) {
                        $('#HKeyInspect' + i + '').attr("checked", true);
                    }
                }
                form.render('select');
                form.render('checkbox');
            }
            //选择产品弹窗
            form.on('submit(HMateria-BT)', function () {//产品
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '物料'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_MaterialList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择工序
            form.on('submit(HProc-BT)', function () {//选择工序
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '工序列表'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_ProcList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择部门
            form.on('submit(HDepart-BT)', function () {//选择部门
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '部门列表'
                    , shade: 0.6 //遮罩透明度
                    //, maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , resize: false
                    , cancel: function (index, layero) {
                    }
                })
            });
            //选择单位
            form.on('submit(HUnitID-BT)', function () {//选择单位
                layer.open({
                    type: 2
                    , area: ['666px', '666px']
                    , title: '单位列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_UnitList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            form.on('submit(Exit)', function (data) {//
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            });
            //选择责任人
            form.on('submit(HEmployeeID-BT)', function () {//选择责任人
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '职员列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择责任工序
            form.on('submit(HZRProcID-BT)', function () {//选择责任工序
                layer.open({
                    type: 2
                    , area: ['80%', '80%']
                    , title: '责任工序列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            form.on('submit(Cancel)', function () {
                if (hID == null || hID == 0) {
                    parent.location.href = "../../../views/index.html"
            //复制一行
            function btnCopyLine(data) {
                var copydata = JSON.stringify(data);
                if (data.length <= 0) {
                    layer.msg("请选择需要复制的一行!");
                }
                else if (data.length > 1) {
                    layer.msg("只能选择复制一行!");
                }
                else {
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                }
            })
                    var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                    var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                    table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                    option.data = table.cache["mainTable"];//将数据绑定到data上
                    table.render(option);//将数据渲染到表格上
                    for (var i = 1; i <= option.data.length; i++) {
                        $('#HAnalysisMethod' + i + '').find("option[value='" + option.data[i - 1].HAnalysisMethod + "']").attr("selected", true);
                        $('#HDefectLevel' + i + '').find("option[value='" + option.data[i - 1].HDefectLevel + "']").attr("selected", true);
                        $('#HStatus' + i + '').find("option[value='" + option.data[i - 1].HStatus + "']").attr("selected", true);
            form.on('submit(Saver)', function (data) {//保存
                //debugger;
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr;
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "SaveQCCheckProjectList", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { icon: 1 });
                                $('#add-btn').addClass("layui-btn-disabled").attr("disabled",true);
                            }
                            else {
                                f_alert(data.Message);
                                console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                            console.log("Reason" + sMainStr);
                        if (option.data[i - 1].HDestructInspect) {
                            $('#HDestructInspect' + i + '').attr("checked", true);
                        }
                        if (option.data[i - 1].HKeyInspect) {
                            $('#HKeyInspect' + i + '').attr("checked", true);
                        }
                    }
                    form.render('select');
                    form.render('checkbox');
                }
            }
            //表格行内事件删除
            function set_GridDelete(obj) {
                var data = obj.data;
                if (obj.event === 'del') {
                    layer.confirm('真的删除行么', function (index) {
                        var rowIndex = $(obj.tr).attr("data-index");
                        option.data = table.cache["mainTable"];//将数据绑定到data上
                        obj.del();
                        option.data.splice(rowIndex, 1);//删除缓存的行
                        table.reload('mainTable', option);
                        layer.close(index);
                    });
            });
            function f_alert(sMsg) {
                layer.alert(sMsg, { icon: 5 });
            }
            //监听提交
            form.verify({
                numberOrEmpty: function (value, item) {
                    // if (value != '') {
                    if (!/^\d+$/.test(value)) {
                        return '不能为空或数字或者0';
                    }
                    //}
                }
            });
            }
            // éžç©ºéªŒè¯
            function AllowLoadData(sSubStr) {  //非空验证
                var Result = true;
        });
        //定义全局变量
        var HReasonName, ReasonID, EmpName, SQProcName,
            ProcID,ZRProcName,QRName
            ;
        function GetHReasonValue(obj)  //返回不良原因
        {
             HReasonName = obj[0].HName;
             ReasonID = obj[0].HItemID;
        }
        //返回物料
        function GetHMaterNameValue(obj) {  //返回物料
            $("#HMater").val(obj[0].HName);
            $("#HMaterID").val(obj[0].HItemID);
            $("#HMaterNumber").val(obj[0].HNumber);
        }
        //返回工序
        function GetHProcValue(obj) {  //返回工序
            $("#HProcName").val(obj[0].工序);
            $("#HProcID").val(obj[0].HItemID);
            $("#HProcNumber").val(obj[0].工序代码);
        }
        function GetHDeptNameValue(obj) {  //返回部门
            $("#HDepName").val(obj[0].HName);
            $("#HDeptID").val(obj[0].HItemID);
            $("#HDeptNumber").val(obj[0].HNumber);
        }
         //返回单位
        function GetHUnitNameValue(obj) {
            $("#HUName").val(obj[0].HName);
            $("#HUnitID").val(obj[0].HItemID);
            $("#HUnitNumber").val(obj[0].HNumber);
        }
                var HName = $("#HName").val(); //方案名称
        function GetHKeeperValue(obj) {  //返回责任人
            EmpName = obj[0].HName;
           // $("#HEmpName").val(obj[0].HName);
            //$("#HItemID").val(obj[0].HItemID);
        }
        //function GetHProcValue(obj) {  //返回申请工序
        //    SQProcName = obj[0].工序;
        //    ProcID = obj[0].HItemID;
        //    //$("#HSQProcName").val(obj[0].工序);
        //    //$("#HProcID").val(obj[0].HItemID);
        //}
        function GetHZRValue(obj) {   //返回责任工序
            ZRProcName = obj[0].工序;
            //$("#HZRProcName").val(obj[0].工序);
            //$("#HItemID").val(obj[0].HItemID);
        }
        //HWorker
        function GetHWorkerValue(obj) {  //返回不良确认人
            QRName = obj[0].HName;
            //$("#HQRName").val(obj[0].HName);
            //$("#HItemID").val(obj[0].HItemID);
        }
        function AllowLoadData(sSubStr) {  //非空验证
            //if ($("#HSourceBillNo").val() == '') {
            //    layer.msg("请先扫源单!", { icon: 5 });
            //    return false;
            //}
            if ($("#HDeptName").val() == '') {
                layer.msg("部门没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HSecManager").val() == '') {
                layer.msg("验收人没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HKeeper").val() == '') {
                layer.msg("保管人没有选择", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            //if ($("#HWHNAME").val() == '') {
            //    layer.msg("仓库没有选择!", { icon: 5 });
            //    return false;
            //}
            if ($("#HBillNo").val() == '') {
                layer.msg("错误的单据号", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HInterID").val() == '') {
                layer.msg("错误的内码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (typeof (sSubStr) == "undefined") {
                layer.msg("没有物料明细记录", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (!typeof (sSubStr) == "undefined") {
                //for (var i = 0; i <= sSubStr.length - 1; i++) {  //判断扫码数量不能大于应收数量
                //    if (parseFloat(sSubStr[i].HQtyMust) > 0) {
                //        if (parseFloat(sSubStr[i].HQty) > parseFloat(sSubStr[i].HQtyMust))
                //        {
                //            layer.msg("数量不能大于应收数量", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                //            return false;
                //        }
                //    }
                //}
                for (var i = 0; i <= sSubStr.length - 1; i++) {   //判断扫码数量不能为0
                    if (parseFloat(sSubStr[i].HQty) > 0) {
                        s = 1;
                    }
                }
                if (s == 0) {
                    layer.msg("产品入库记录未扫码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                if (HName == null || HName == undefined || HName == "") {
                    layer.msg("请输入方案名称!", { icon: 5 });
                    return false;
                }
                var ref = /^[0-9]+\.?[0-9]*$/;
                var sSubStr = table.cache['mainTable'];
                for (var i = 0; i < sSubStr.length; i++) {
                    if (!ref.test(sSubStr[i].HTargetValQ)) {
                        layer.msg("第" + (i + 1) + "行 ç›®æ ‡å€¼æ•°é‡ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (!ref.test(sSubStr[i].HUpLimitQ)) {
                        layer.msg("第" + (i + 1) + "行 ä¸Šé™å€¼æ•°é‡ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (!ref.test(sSubStr[i].HDownLimitQ)) {
                        layer.msg("第" + (i + 1) + "行 ä¸‹é™å€¼æ•°é‡ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (!ref.test(sSubStr[i].HUpOffSetQ)) {
                        layer.msg("第" + (i + 1) + "行 ä¸Šåå·®æ•°é‡ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (!ref.test(sSubStr[i].HDownOffSetQ)) {
                        layer.msg("第" + (i + 1) + "行 ä¸‹åå·®æ•°é‡ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (!ref.test(sSubStr[i].HTargetValB)) {
                        layer.msg("第" + (i + 1) + "行 ç›®æ ‡å€¼åŸºç¡€èµ„æ–™ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (!ref.test(sSubStr[i].HUpLimitB)) {
                        layer.msg("第" + (i + 1) + "行 ä¸Šé™å€¼åŸºç¡€èµ„æ–™ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (!ref.test(sSubStr[i].HDownLimitB)) {
                        layer.msg("第" + (i + 1) + "行 ä¸‹é™å€¼åŸºç¡€èµ„æ–™ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (!ref.test(sSubStr[i].HUpOffSetB)) {
                        layer.msg("第" + (i + 1) + "行 ä¸Šåå·®åŸºç¡€èµ„æ–™ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (!ref.test(sSubStr[i].HDownOffSetB)) {
                        layer.msg("第" + (i + 1) + "行 ä¸‹åå·®åŸºç¡€èµ„æ–™ å­—段,请输入正确的数字", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                    if (sSubStr[i].HQCCheckItemID == 0 || sSubStr[i].HQCCheckItemID == null || sSubStr[i].HQCCheckItemID == undefined) {
                        layer.msg("第" + (i + 1) + "行 æ£€éªŒé¡¹ç›®ä¸ºç©ºï¼Œè¯·é€‰æ‹©æ£€éªŒé¡¹ç›®", { icon: 5, btn: ['确认'], time: 3000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                }
                return Result;
            }
            else {
                return true;
            }
            //#endregion
        });
        //返回工序
        function GetProcessValue(obj) {  //返回工序
            $("#HProcName").val(obj[0].工序名称);
            $("#HProcID").val(obj[0].HItemID);
        }
        function GetMaterValue(obj) {  //物料
            $("#HMaterName").val(obj[0].物料名称);
            $("#HMaterNumber").val(obj[0].物料代码);
            $("#HMaterID").val(obj[0].HItemID);
        }
        function GetMaterTypeValue(obj) {  //物料分类
            $("#HMaterTypeName").val(obj[0].名称);
            $("#HMaterTypeID").val(obj[0].HItemID);
        }
        function GetHDeptNameValue(obj) {  //部门
            $("#HDeptName").val(obj[0].部门名称);
            $("#HDeptID").val(obj[0].HItemID);
        }
        function GetUnitValue(obj) {   //计量单位
            $("#HUnitName").val(obj[0].计量单位名称);
            $("#HUnitNumber").val(obj[0].计量单位代码);
            $("#HUnitID").val(obj[0].HItemID);
        }
    </script>
</body>
</html>