yangle
2023-11-13 2b3793d712e0685e218d684a8ecafed3bfcf462b
返修台优化
配件更换功能优化
单品过站完善
6个文件已修改
954 ■■■■ 已修改文件
WebTM/views/生产管理/生产任务单/Sc_ICMOBillEdit_NoTable.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/产线组装追溯/Cj_AssemblyTraceability.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站/Cj_CollectionOfSingleProductDefects.html 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站/Cj_ProcessItemBGA.html 188 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站/Cj_ProcessItemBGA_PJGH.html 279 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/单品过站/Cj_ProcessItemStationPlatform.html 384 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillEdit_NoTable.html
@@ -248,7 +248,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">计划开完工期</label>
                                            <label class="layui-form-label" style="width: 85px;">计划完工期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="date" class="layui-input" lay-verify="HPlanEndDate" name="HPlanEndDate" id="HPlanEndDate" style="padding-left: 80px;">
                                            </div>
WebTM/views/³µ¼ä¹ÜÀí/²úÏß×é×°×·ËÝ/Cj_AssemblyTraceability.html
@@ -31,7 +31,7 @@
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 10px;">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">退出</button>
                        <!--<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">退出</button>-->
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾/Cj_CollectionOfSingleProductDefects.html
@@ -138,6 +138,7 @@
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HProcExchBillNo" lay-verify="HProcExchBillNo" id="HProcExchBillNo" value="" style="background-color:#efefef4d;">
                                                <input type="hidden" class="layui-input" name="HProcExchInterID" lay-verify="HProcExchInterID" id="HProcExchInterID" value="0">
                                                <input type="hidden" class="layui-input" name="HProcExchEntryID" lay-verify="HProcExchEntryID" id="HProcExchEntryID" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
@@ -277,84 +278,10 @@
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">时间单位</label>
                                            <div class="layui-input-block" style="margin-left: 120px;width: 184px;">
                                                <select name="HMainTimeUnit" lay-verify="HMainTimeUnit" id="HMainTimeUnit">
                                                    <option value="小时">小时</option>
                                                    <option value="天">天</option>
                                                    <option value="天">天</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">材质</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaterTexture" lay-verify="HMaterTexture" id="HMaterTexture" value="" onmouseover="this.title=this.value">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">图号版本</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" lay-verify="HPicNumVer" name="HPicNumVer" id="HPicNumVer">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">总装图号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HPicNumAssemble" id="HPicNumAssemble" onmouseover="this.title=this.value">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">工艺路线大类</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="hidden" class="layui-input" lay-verify="HRoutingGroupID" name="HRoutingGroupID" id="HRoutingGroupID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="text" class="layui-input" lay-verify="HRoutingGroupIDName" name="HRoutingGroupIDName" id="HRoutingGroupIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnRoutingGroup" id="btnRoutingGroup" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">成品编号</label>
                                            <div class="layui-input-block" style="margin-left: 115px;">
                                                <input type="text" class="layui-input" name="HProductNum" lay-verify="HProductNum" id="HProductNum" value="" onmouseover="this.title=this.value">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">版本</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HVerNum" lay-verify="HVerNum" id="HVerNum" value="" onmouseover="this.title=this.value">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <div class="layui-input-block" style="margin-left: 185px;">
                                                <input type="checkbox" name="checkboxIsProNo" id="checkboxIsProNo" lay-skin="primary" lay-filter="checkboxIsProNo" title="转工序">
                                                <input type="hidden" value="1" name="IsProNo" id="IsProNo" lay-verify="IsProNo">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                    <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>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_up"><i class="layui-icon layui-icon-form"></i>上一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_under"><i class="layui-icon layui-icon-form"></i>下一行</button>
                            <button type="button" class="layui-btn layui-btn-sm" lay-event="btn_Refresh"><i class="layui-icon layui-icon-form"></i>刷新流水号</button>
                        </div>
                    </script>
                </form>
            </div>
        </div>
@@ -394,9 +321,7 @@
        $("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
     
        //判断是否新增
        if (linterid == null || linterid == 0) {
            //$("#HIDDEN").hide();
            OperationType = 1;
        if (OperationType == 1) {
            $.ajax({
                url: GetWEBURL() + "/Web/GetMAXNum",
@@ -411,21 +336,6 @@
            });
            //初始化界面
            set_ClearBill();
        } else if (OperationType == 2) {
            //禁用组织选项
            //$("#HOrgID").attr("disabled", true);
            RoadBillMain(linterid);
            $.ajax({
                url: GetWEBURL() + "/Web/GetMAXNum",
                type: "GET",
                async: false,
                data: { "HBillType": '3717' },
                success: function (d) {
                    $("#HInterID").val(d.data[0].HInterID);
                    $("#HBillNo").val(d.data[0].HBillNo);
                    $("#HBillNo_bak").val(d.data[0].HBillNo);
                }
            });
        }
@@ -469,7 +379,7 @@
        //新增
        form.on('submit(set_AddNew)', function () {
            layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
                location.replace('Cj_CollectionOfSingleProductDefects.html?OperationType=1&linterid=0');
                location.replace('Cj_CollectionOfSingleProductDefects.html?OperationType=1&linterid=' + linterid);
            });
        });
@@ -560,6 +470,7 @@
                        $("#HICMOEntryID").val(data1.data[0]["HICMOEntryID"]);
                        $("#HProcExchBillNo").val(data1.data[0]["工序流转卡"]);
                        $("#HProcExchInterID").val(data1.data[0]["HSourceInterID"]);
                        $("#HProcExchEntryID").val(data1.data[0]["HProcExchEntryID"]);
                        $("#HMaterNumber").val(data1.data[0]["物料编码"]);
                        $("#HMaterID").val(data1.data[0]["HMaterID"]);
                        $("#HMaterName").val(data1.data[0]["物料名称"]);
@@ -699,7 +610,7 @@
            var sMainStr = JSON.stringify(data.field);
            var sMainSub = sMainStr + ';' + HResult + ";" + sessionStorage["HUserName"] ;
            var sMainSub = sMainStr + ';' + HResult + ";" + sessionStorage["HUserName"] +";"+ linterid ;
            var index = layer.load();
            $.ajax({
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾/Cj_ProcessItemBGA.html
@@ -29,9 +29,9 @@
            <div class="layui-card-body" style="padding: 1px;">
                <form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
                    <div style="padding: 2px; ">
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnAdd" id="btnSave">打印</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnAdd" id="btnSave">新增</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnCancel" id="btnEdit">退出</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnPrint" id="btnPrint">打印</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnAdd" id="btnAdd">新增</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnCancel" id="btnCancel">退出</button>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill" style="width: 49.5%; float: left; background-color: white;height:430px;">
                        <ul class="layui-tab-title" lay-filter="tab-all">
@@ -165,7 +165,7 @@
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">条形码</label>
                                                <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                    <input type="text" class="layui-input" lay-verify="HBarCode" name="HBarCode" id="HBarCode">
                                                    <input type="text" class="layui-input" lay-verify="HBarCodeSN" name="HBarCodeSN" id="HBarCodeSN">
                                                </div>
                                            </div>
                                        </div>
@@ -239,7 +239,7 @@
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">产品SN</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" lay-verify="HMaterSN" name="HMaterSN" id="HMaterSN" style="background-color:#efefef4d;" readonly>
                                                    <input type="text" class="layui-input" lay-verify="HBarCode" name="HBarCode" id="HBarCode" style="background-color:#efefef4d;" readonly>
                                                </div>
                                            </div>
                                        </div>
@@ -255,6 +255,8 @@
                                                    <input type="hidden" name="HCreator" id="HCreator" lay-verify="HCreator">
                                                    <input type="hidden" name="HCreateDate" id="HCreateDate" lay-verify="HCreateDate">
                                                    <input type="hidden" name="HProcExchInterID" id="HProcExchInterID" lay-verify="HProcExchInterID" value="0">
                                                    <input type="hidden" name="HProcExchEntryID" id="HProcExchEntryID" lay-verify="HProcExchEntryID" value="0">
                                                    <input type="hidden" name="HSourceInterID" id="HSourceInterID" lay-verify="HSourceInterID" value="0">
                                                    <input type="hidden" name="HSourceEntryID" id="HSourceEntryID" lay-verify="HSourceEntryID" value="0">
                                                    <input type="hidden" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" value="">
@@ -329,7 +331,7 @@
                , laydate = layui.laydate
                , tree = layui.tree
            var titleData = ["HInterID", "HEntryID", "HBadReasonID", "HSourceInterID","HSourceEntryID"];//子表不需要显示的字段 å¯æ‰©å±•
            var hpj =0;
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -340,8 +342,8 @@
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //条形码回车方法
            $('#HBarCode').on('keydown', function (event) {
                var HBarCode = $('#HBarCode').val();
            $('#HBarCodeSN').on('keydown', function (event) {
                var HBarCode = $('#HBarCodeSN').val();
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg("条形码不能为空!")
@@ -362,18 +364,33 @@
                get_checkSearchChangeMater();
            });
            //子表行内事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
            });
            // NG保存
            form.on('submit(NGSave)', function (data) {
                get_Save(data,"NG");
            });
            // OK保存
            form.on('submit(OKSave)', function (data) {
                get_Save(data,"OK");
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
            //初始化界面
            function set_ClearBill() {
                $('#btnAdd').addClass("layui-btn-disabled").attr("disabled", true);
                //初始化单据
                createBillNo();
                var mychart1 = echarts.init(document.getElementById('mychart1'));
                get_Display();
                get_Histogram1(mychart1);//柱状图1
                get_UsreList();
                get_Display();
            }
            // ç”Ÿæˆå•据号
@@ -505,14 +522,9 @@
            //查询列表数据
            function get_Display() {
                var HSourceInterID = $("#HSourceInterID").val();
                var HSourceEntryID = $("#HSourceEntryID").val();
                var HBarCode = $("#HBarCode").val();
                var sWhere = "";
                if (HSourceInterID != 0 && HSourceEntryID != 0) {
                    sWhere = " and HSourceInterID=" + HSourceInterID + " and HSourceEntryID=" + HSourceEntryID;
                } else {
                    sWhere = " and HSourceInterID=0 and HSourceEntryID=0 ";
                }
                sWhere = " and SN码='" + HBarCode + "'";
                var ajaxLoad = layer.load();
                $.ajax({
                    url: GetWEBURL() + "/Cj_SingleStation/ProcessItemRepair",
@@ -548,15 +560,6 @@
                            }
                            col.push({ fixed: 'right', title: '操作', toolbar: '#barDemo' });
                            if (data1.data.length != 0) {
                                $("#HBadReasonID").val(data1.data[0]["HBadReasonID"]);
                                $("#HBadReasonName").val(data1.data[0]["不良原因"]);
                            //$("#HBadTypeID").val();
                            //$("#HBadTypeName").val();
                            //$("#HBadResultID").val();
                            //$("#HBadResultName").val();
                            }
                            var option = {
                                elem: '#mainTable'
                                //, toolbar: '#toolbarDemo'
@@ -599,10 +602,12 @@
                            $("#HDeptID").val(data1.data[0]["HDeptID"]);
                            $("#HDeptName").val(data1.data[0]["车间"]);
                            $("#HProName").val(data1.data[0]["工序"]);
                            $("#HProcess").val(data1.data[0]["HProcID"]);
                            $("#HSourceID").val(data1.data[0]["HSourceID"]);
                            $("#HSourceName").val(data1.data[0]["生产资源"]);
                            $("#HEmpID").val(data1.data[0]["HEmpID"]);
                            $("#HEmpName").val(data1.data[0]["质检员"]);
                            $("#HCreator").val(data1.data[0]["质检员"]);
                            //$("#HGroupID").val(data1.data[0]["HGroupID"]);
                            //$("#HGroupName").val(data1.data[0]["生产班组"]);
                            layer.close(ajaxLoad);
@@ -626,7 +631,7 @@
                var index = layer.load();
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Cj_SingleStation/HBardCodeList",
                    url: GetWEBURL() + "/Cj_SingleStation/HFBardCodeList",
                    async: false,
                    data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
                    dataType: "json",
@@ -638,6 +643,7 @@
                            $("#HICMOEntryID").val(data1.data[0]["HICMOEntryID"]);
                            $("#HProcExchBillNo").val(data1.data[0]["工序流转卡"]);
                            $("#HProcExchInterID").val(data1.data[0]["HSourceInterID"]);
                            $("#HProcExchEntryID").val(data1.data[0]["HProcExchEntryID"]);
                            $("#HUnitID").val(data1.data[0]["HUnitID"]);
                            $("#HUnitName").val(data1.data[0]["单位"]);
                            $("#HOrgName").val(data1.data[0]["组织"]);
@@ -646,21 +652,63 @@
                            $("#HMaterID").val(data1.data[0]["HMaterID"]);
                            $("#HMaterName").val(data1.data[0]["物料名称"]);
                            $("#HMaterModel").val(data1.data[0]["规格型号"]);
                            $("#HMaterSN").val(data1.data[0]["条码"]);
                            $("#HBarCode").val(data1.data[0]["条码"]);
                            $("#HBadReasonID").val(data1.data[0]["HBadReasonID"]);
                            $("#HBadReasonName").val(data1.data[0]["不良原因"]);
                            if (data1.data.length != 0) {
                                //$("#HBadTypeID").val();
                                //$("#HBadTypeName").val();
                                //$("#HBadResultID").val();
                                //$("#HBadResultName").val();
                            }
                            //查询返修记录
                            get_Display();
                        }
                        else {
                            layer.close(index);
                            layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        $("#HBarCode").val("");
                        $("#HBarCodeSN").val("");
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //删除方法
            function set_GridDelete(obj) {
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        var HInterID = obj.data.HInterID;
                        var HEntryID = obj.data.HEntryID;
                        var ajaxLoad = layer.load();
                        $.ajax({
                            url: GetWEBURL() + "/Cj_SingleStation/ProcessItemRepairDel",
                            type: "GET",
                            async: false,
                            data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"],"HBill":"ZB" },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg("删除成功!");
                                    layer.close(ajaxLoad);
                                    //查询返修记录
                                    get_Display();
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                    layer.close(ajaxLoad);
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                                layer.close(ajaxLoad);
                            }
                        })
                    });
                }
            }
            //不良原因选择页面
@@ -692,36 +740,43 @@
                })
            }
            //换配件页面
            function get_checkSearchChangeMater() {
                var HMaterSN = $("#HMaterSN").val();
                if (HMaterSN == "") {
                var HBarCode = $("#HBarCode").val();
                if (HBarCode == "") {
                    return layer.msg("请先扫条码!");
                }
                if (hpj == 0) {
                    return layer.msg("请先保存返修记录!");
                }
                var HInterID = $("#HInterID").val();
                var HBillNo = $("#HBillNo").val();
                //var HEmpName = $("#HEmpName").val();
                //var HProdMac = $("#HProdMac").val();
                //var HSourceInterID = $("#HSourceInterID").val();
                //var HSourceEntryID = $("#HSourceEntryID").val();
                //var HSourceBillNo = $("#HSourceBillNo").val();
                //var HSourceBillType = $("#HSourceBillType").val();
                //var HBarCode = $("#HBarCode").val();
                var HEmpName = $("#HEmpName").val();
                var HProdMac = $("#HProdMac").val();
                var HSourceInterID = $("#HSourceInterID").val();
                var HSourceEntryID = $("#HSourceEntryID").val();
                var HSourceBillNo = $("#HSourceBillNo").val();
                var HSourceBillType = $("#HSourceBillType").val();
                var HProcExchBillNo = $("#HProcExchBillNo").val();
                var HProcess = $("#HProcess").val();
                var dataParams = {
                    'OperationType': 1
                    , 'HMaterSN': HMaterSN
                    , 'HInterID': HInterID
                    , 'HBillNo': HBillNo
                    //, 'HEmpName': HEmpName
                    //, 'HProdMac': HProdMac
                    //, 'HSourceInterID': HSourceInterID
                    //, 'HSourceEntryID': HSourceEntryID
                    //, 'HSourceBillNo': HSourceBillNo
                    //, 'HSourceBillType': HSourceBillType
                    //, 'HBarCode': HBarCode
                    //, 'subMaterList_Temp': $("#subMaterList_Temp").val()
                    , 'HMaterSN': HBarCode
                    , 'HEmpName': HEmpName
                    , 'HProdMac': HProdMac
                    , 'HSourceInterID': HSourceInterID
                    , 'HSourceEntryID': HSourceEntryID
                    , 'HSourceBillNo': HSourceBillNo
                    , 'HSourceBillType': HSourceBillType
                    , 'HBarCode': HBarCode
                    , 'HProcExchBillNo': HProcExchBillNo
                    , 'HProcess': HProcess
                    , 'subMaterList_Temp': $("#subMaterList_Temp").val()
                }
                var datajson = JSON.stringify(dataParams);
                url = encodeURI('../../车间管理/单品过站/Cj_ProcessItemBGA_PJGH.html?OperationType=1&datajson=' + datajson);
@@ -743,6 +798,43 @@
                })
            }
            //保存
            function get_Save(data, HResult) {
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache["mainTable"]);
                var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"] + ";" + HResult;
                var index = layer.load();
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Cj_SingleStation/HFXAddRepairBill",
                    async: false,
                    data: { "sMainSub": sMainSub },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) {
                            $('#NGSave').addClass("layui-btn-disabled").attr("disabled", true);
                            $('#OKSave').addClass("layui-btn-disabled").attr("disabled", true);
                            $('#btnAdd').removeClass("layui-btn-disabled").attr("disabled", false);
                            layer.close(index);
                            layer.msg("提交成功");
                            hpj = 1;
                            get_Display();
                            var mychart1 = echarts.init(document.getElementById('mychart1'));
                            get_Histogram1(mychart1);//柱状图1
                        }
                        else {
                            layer.close(index);
                            layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    },
                    error: function (err) {
                        layer.close(index);
                        layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
            }
            //#endregion
        });
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾/Cj_ProcessItemBGA_PJGH.html
@@ -85,6 +85,26 @@
                                                <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" placeholder="请输入内容" onmouseover="this.title=this.value" style=" width: 500px;">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                <input type="hidden" name="HSourceInterID" id="HSourceInterID" lay-verify="HSourceInterID" value="0">
                                                <input type="hidden" name="HSourceEntryID" id="HSourceEntryID" lay-verify="HSourceEntryID" value="0">
                                                <input type="hidden" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" value="">
                                                <input type="hidden" name="HSourceBillType" id="HSourceBillType" lay-verify="HSourceBillType" value="">
                                                <input type="hidden" name="HRelationQty" id="HRelationQty" lay-verify="HRelationQty" value="0">
                                                <input type="hidden" name="HRelationMoney" id="HRelationMoney" lay-verify="HRelationMoney" value="0">
                                                <input type="hidden" name="HMaterID" id="HMaterID" lay-verify="HMaterID" value="0">
                                                <input type="hidden" name="HMaterNumber" id="HMaterNumber" lay-verify="HMaterNumber" value="">
                                                <input type="hidden" name="HMaterName" id="HMaterName" lay-verify="HMaterName" value="">
                                                <input type="hidden" name="HUnitID" id="HUnitID" lay-verify="HUnitID" value="0">
                                                <input type="hidden" name="HQty" id="HQty" lay-verify="HQty" value="0">
                                                <input type="hidden" name="HSupID" id="HSupID" lay-verify="HSupID" value="0">
                                                <input type="hidden" name="HBatchNo" id="HBatchNo" lay-verify="HBatchNo">
                                                <input type="hidden" name="HProcExchBillNo" id="HProcExchBillNo" lay-verify="HProcExchBillNo">
                                                <input type="hidden" name="HProcess" id="HProcess" lay-verify="HProcess">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
@@ -152,6 +172,7 @@
        //定义全局变量
        var HModName = "Cj_CollectionOfSingleProductDefects";
        var option2 = [];
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -173,6 +194,8 @@
            $("#HInterID").val(datajson.HInterID);
            $("#HBillNo").val(datajson.HBillNo);
            $("#HBillNo_bak").val(datajson.HBillNo);
            $("#HProcExchBillNo").val(datajson.HProcExchBillNo);
            $("#HProcess").val(datajson.HProcess);
            //初始化界面
            set_ClearBill();
        }
@@ -184,20 +207,25 @@
        //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
        //条形码回车方法
        $('#HBarCodeSN').on('keydown', function (event) {
            var HBarCode = $('#HBarCodeSN').val();
        $('#HBarCode').on('keydown', function (event) {
            var HBarCode = $('#HBarCode').val();
            if (event.keyCode == 13) {
                if (!HBarCode) {
                    layer.msg("条形码不能为空!")
                    return;
                }
                txtHBarCode_KeyDown(HBarCode);
                get_Accessory(HBarCode);
            }
        });
        //选择不良原因
        form.on('submit(btnHBadReason)', function () {
            btnHBadReason();
        //配件更换记录子表行内事件
        table.on('tool(mainTable1)', function (obj) {
            set_GridDelete1(obj);   //行内删除
        });
        //物料清单子表行内事件
        table.on('tool(mainTable2)', function (obj) {
            set_GridDelete2(obj);   //行内删除
        });
        //选择质检员
@@ -212,18 +240,6 @@
            });
        });
        //保存提交
        form.on('submit(btnSave_BL)', function (data) {//提交
            if (AllowLoadData(data)) {
                set_AddNew(data, "不良");
            }
        });
        form.on('submit(btnSave_BF)', function (data) {//提交
            if (AllowLoadData(data)) {
                set_AddNew(data, "报废");
            }
        });
        //退出
        form.on('submit(btnEdit)', function (data) {
@@ -241,10 +257,14 @@
        //初始化界面
        function set_ClearBill() {
            //光标跳转到配件文本框上
            $("#HBarCode").focus();
            //查询绑定用户
            get_Display();
            //查询条码绑定的返修记录
            get_RepairRecord();
            //查询物料清单数据
            get_BomList($("#HProcExchBillNo").val());
        }
        //查询
@@ -277,66 +297,53 @@
            });
        }
        //条码回车查询
        function txtHBarCode_KeyDown(HBarCode) {
        //条码回车查询更换配件
        var KNum = 0;
        function get_Accessory(HBarCode) {
            var index = layer.load();
            $.ajax({
                type: "GET",
                url: GetWEBURL() + "/Cj_SingleStation/HBardCodeList",
                async: true,
                url: GetWEBURL() + "/Cj_SingleStation/HBardCodeAccessoryList",
                async: false,
                data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
                dataType: "json",
                success: function (data1) {
                    if (data1.count == 1) {
                        layer.close(index);
                        $("#HICMOBillNo").val(data1.data[0]["生产订单"]);
                        $("#HICMOInterID").val(data1.data[0]["HICMOInterID"]);
                        $("#HProcExchBillNo").val(data1.data[0]["工序流转卡"]);
                        $("#HProcExchInterID").val(data1.data[0]["HSourceInterID"]);
                        $("#HMaterNumber").val(data1.data[0]["物料编码"]);
                        $("#HMaterID").val(data1.data[0]["HMaterID"]);
                        $("#HMaterName").val(data1.data[0]["物料名称"]);
                        $("#HModel").val(data1.data[0]["规格型号"]);
                        $("#HBarCode").val(data1.data[0]["条码"]);
                        for (var i = 0; i < option2.data.length; i++) {
                            if (data1.data[0]["HMaterNumber"] == option2.data[i]["配件代码"] && option2.data[i]["HBatchNo"] == data1.data[0]["HBatchNo"] && option2.data[i]["HBatchNo"] != "") {
                                return layer.msg("当前批次已扫入,请不要重复扫入!");
                            }
                            if (data1.data[0]["HMaterNumber"] == option2.data[i]["配件代码"] && option2.data[i]["HBatchNo"] != data1.data[0]["HBatchNo"] && option2.data[i]["HBatchNo"] != "") {
                                layer.confirm('是否要替换当前批次', function (index) {
                                    layer.close(index);
                                    $('#HProcName').val(HBarCode);
                                    option2.data[i]["HBatchNo"] = data1.data[0]["HBatchNo"];
                                    option2.data[i]["HBarCode"] = HBarCode;
                                    table.render(option2);
                                    //保存配件更改记录
                                    set_AddNew();
                                });
                                break;
                            }
                            KNum += 1;
                        }
                        $('#HBarCode').val("");
                    }
                    else {
                        layer.close(index);
                        layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                    $("#HBarCodeSN").val("");
                },
                error: function (err) {
                    layer.close(index);
                    layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                }
            });
        }
        //不良原因选择页面
        function btnHBadReason() {
            layer.open({
                type: 2//弹窗类型
                , skin: 'layui-layer-rim' //加上边框
                , area: ['90%', '90%']//大小
                , title: '不良原因列表'//标题
                , shift: 2//弹出动画
                , content: ['../../基础资料/生产基础资料/Gy_BadReason.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('请选择数据');
                    }
                    //获取数据
                    $("#HBadReasonID").val(checkStatus.data[0].HItemID);
                    $("#HBadReasonName").val(checkStatus.data[0].不良原因名称);
                    layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                }
            })
        }
        //质检员选择页面
@@ -366,20 +373,21 @@
        //查询条码绑定的返修记录
        function get_RepairRecord() {
            var sWhere = " and HBarCodeSN='" + $("#HMaterSN").val() + "' and HBarCode is not null";
            var index = layer.load();
            $.ajax({
                type: "GET",
                url: GetWEBURL() + "/Cj_SingleStation/Sc_SourceLineRepairBillSub_MaterList",
                async: false,
                data: { "sWhere": " and HSourceBillNo='" + $("#HMaterSN").val() + "'", "user": sessionStorage["HUserName"] },
                data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                dataType: "json",
                success: function (data1) {
                    if (data1.count == 1) {
                        layer.close(index);
                        var option = {
                            elem: '#mainTable'
                            , toolbar: '#toolbarDemo'
                            elem: '#mainTable1'
                            //, toolbar: '#toolbarDemo'
                            , page: false
                            , totalRow: true
                            , data: data1.data
@@ -429,7 +437,140 @@
            });
        }
        //配件记录删除方法
        function set_GridDelete1(obj) {
            if (obj.event === 'del') {
                layer.confirm('真的删除行吗?', function (index) {
                    var HInterID = obj.data.HInterID;
                    var HEntryID = obj.data.HEntryID;
                    var ajaxLoad = layer.load();
                    $.ajax({
                        url: GetWEBURL() + "/Cj_SingleStation/ProcessItemRepairDel",
                        type: "GET",
                        async: false,
                        data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"], "HBill": "PJ"},
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg("删除成功!");
                                layer.close(ajaxLoad);
                                //查询条码绑定的返修记录
                                get_RepairRecord();
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                                layer.close(ajaxLoad);
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    })
                });
            }
        }
        //物料清单删除方法
        function set_GridDelete2(obj) {
            if (obj.event === 'del2') {
                layer.confirm('真的删除行吗?', function (index) {
                    var HInterID = obj.data.BomHInterID;
                    var HEntryID = obj.data.BomHEntryID;
                    var ajaxLoad = layer.load();
                    $.ajax({
                        url: GetWEBURL() + "/Cj_SingleStation/DelBomTempList",
                        type: "GET",
                        async: false,
                        data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"]},
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg("删除成功!");
                                layer.close(ajaxLoad);
                                //查询清单
                                get_BomList($("#HProcExchBillNo").val());
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                                layer.close(ajaxLoad);
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    })
                });
            }
        }
        //流转卡查询关键件清单
        function get_BomList(HBarCode) {
            var index = layer.load();
            $.ajax({
                type: "GET",
                url: GetWEBURL() + "/Cj_SingleStation/HBardCodeBomList",
                async: false,
                data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
                dataType: "json",
                success: function (data1) {
                    if (data1.count == 1) {
                        layer.close(index);
                        $("#HMaterNumber").val(data1.data[0]["HMainMaterNumber"]);
                        $("#HMaterID").val(data1.data[0]["HMainMaterID"]);
                        $("#HMaterName").val(data1.data[0]["HMainMaterName"]);
                        //$("#HProcExchInterID").val(data1.data[0]["HProcExchInterID"]);
                        //$("#HProcExchEntryID").val(data1.data[0]["HProcExchEntryID"]);
                        //$("#HProcExchBillNo").val(data1.data[0]["HProcExchBillNo"]);
                        //$("#HICMOBillNo").val(data1.data[0]["HICMOBillNo"]);
                        //$("#HICMOInterID").val(data1.data[0]["HICMOInterID"]);
                        //$("#HICMOEntryID").val(data1.data[0]["HICMOEntryID"]);
                        //$("#HProcNo").val(data1.data[0]["HProcNo"]);
                        //$("#HPieceQty").val(data1.data[0]["HPieceQty"]);
                        //$("#HICMOQty").val(data1.data[0]["HICMOQty"]);
                        option2 = {
                            elem: '#mainTable2'
                            //, toolbar: '#toolbarDemo'
                            , async: true
                            , page: false
                            //, totalRow: true
                            , cellMinWidth: 120
                            , data: data1.data
                            , height: 185
                            , cols: [[
                                { type: 'numbers', title: '序号' }
                                , { field: '日期', title: '日期' }
                                , { field: '配件代码', title: '配件代码' }
                                , { field: '配件名称', title: '配件名称' }
                                , { field: '配件规格', title: '配件规格' }
                                , { field: '配件数量', title: '配件数量' }
                                , { field: 'HBatchNo', title: '当前批次' }
                                , { field: 'BomHInterID', title: 'BomHInterID', hide: true }
                                , { field: 'BomHEntryID', title: 'BomHEntryID', hide: true }
                                , { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
                                , { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true }
                                , { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true }
                                , { field: 'HProcExchInterID', title: 'HProcExchInterID', hide: true }
                                , { field: 'HProcExchEntryID', title: 'HProcExchEntryID', hide: true }
                                , { field: 'HProcExchBillNo', title: 'HProcExchBillNo', hide: true }
                                , { field: 'HMaterID', title: 'HMaterID', hide: true }
                                , { field: 'HBarCode', title: 'HBarCode', hide: true }
                                , { fixed: 'right', title: '操作', toolbar: '#barDemo2' }
                            ]]
                        }
                        table.render(option2)
                    }
                    else {
                        layer.close(index);
                        layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                    $("#HBarCodeSN").val("");
                },
                error: function (err) {
                    layer.close(index);
                    layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                }
            });
        }
        //获取参数
        function getUrlVars() {
@@ -444,24 +585,28 @@
        }
        //保存HMaker
        function set_AddNew(data, HResult) {
        function set_AddNew() {
            var data1 = { "field": { "HInterID": $("#HInterID").val(), "HBillNo": $("#HBillNo").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HProcExchInterID": $("#HProcExchInterID").val(), "HProcExchEntryID": $("#HProcExchEntryID").val(), "HProcess": $("#HProcess").val() } };
            var sMainStr = JSON.stringify(data.field);
            var sMainSub = sMainStr + ';' + HResult + ";" + sessionStorage["HUserName"];
            var HResult = "配件";
            var sMainStr = JSON.stringify(data1.field);
            var sSubStr = JSON.stringify(table.cache["mainTable2"][KNum]);
            var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"] + ";" + HResult;
            var index = layer.load();
            $.ajax({
                type: "POST",
                url: GetWEBURL() + "/Cj_SingleStation/ProcessBLSave",
                url: GetWEBURL() + "/Cj_SingleStation/HFXAddRepairBill",
                async: false,
                data: { "sMainSub": sMainSub },
                dataType: "json",
                success: function (data) {
                    if (data.count == 1) {
                        $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
                        //$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
                        layer.close(index);
                        layer.msg("提交成功");
                        //查询更换记录
                        get_RepairRecord();
                    }
                    else {
                        layer.close(index);
WebTM/views/³µ¼ä¹ÜÀí/µ¥Æ·¹ýÕ¾/Cj_ProcessItemStationPlatform.html
@@ -30,7 +30,7 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">条形码:</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBarCode" lay-verify="HBarCode" placeholder="请键入后回车" id="HBarCode" style="width: 500px;">
                                                <input type="text" class="layui-input" name="HBarCodeSN" lay-verify="HBarCodeSN" placeholder="请键入后回车" id="HBarCodeSN" style="width: 500px;">
                                            </div>
                                        </div>
                                    </div>
@@ -57,6 +57,7 @@
                                            <label class="layui-form-label" style="width: 85px;">产品编码</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" lay-verify="HMaterNumber" name="HMaterNumber" id="HMaterNumber" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" class="layui-input" lay-verify="HMaterID" name="HMaterID" id="HMaterID">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
@@ -112,6 +113,7 @@
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HProcExchBillNo" lay-verify="HProcExchBillNo" id="HProcExchBillNo" value="" style="background-color:#efefef4d;">
                                                <input type="hidden" class="layui-input" name="HProcExchInterID" lay-verify="HProcExchInterID" id="HProcExchInterID" value="0">
                                                <input type="hidden" class="layui-input" name="HProcExchEntryID" lay-verify="HProcExchEntryID" id="HProcExchEntryID" value="0">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
@@ -119,6 +121,7 @@
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HICMOBillNo" lay-verify="HICMOBillNo" id="HICMOBillNo" value="" style="background-color:#efefef4d;">
                                                <input type="hidden" class="layui-input" name="HICMOInterID" lay-verify="HICMOInterID" id="HICMOInterID" value="0">
                                                <input type="hidden" class="layui-input" name="HICMOEntryID" lay-verify="HICMOEntryID" id="HICMOEntryID" value="0">
                                            </div>
                                        </div>
                                    </div>
@@ -133,7 +136,7 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">产品SN</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBarCode" lay-verify="HBarCode" id="HBarCode" value="" style="background-color:#efefef4d;display: inline-block;" readonly>
                                                <input type="text" class="layui-input" name="HBarCode_P" lay-verify="HBarCode_P" id="HBarCode_P" value="" style="background-color:#efefef4d;display: inline-block;" readonly>
                                            </div>
                                        </div>
                                    </div>
@@ -228,10 +231,15 @@
                        <ul class="layui-tab-title">
                            <li class="layui-this">不良记录</li>
                        </ul>
                        <div class="layui-tab-content">
                        <div class="layui-tab-content" style="background-color: white;">
                            <div class="layui-row" style="margin-bottom: 5px;">
                                <div class="layui-inline">
                                    <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="BadReport" id="BadReport">不良汇报</button>
                                </div>
                            </div>
                            <div class="layui-tab-item layui-show">
                                <!--不良记录-->
                                <table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
                                <table class="layui-hide" id="mainTable3" lay-filter="mainTable3"></table>
                            </div>
                        </div>
                    </div>
@@ -239,7 +247,7 @@
                        <ul class="layui-tab-title">
                            <li class="layui-this">合格记录</li>
                        </ul>
                        <div class="layui-tab-content">
                        <div class="layui-tab-content" style="background-color: white;">
                            <div class="layui-tab-item layui-show">
                                <!--合格记录-->
                                <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
@@ -259,12 +267,20 @@
                        </div>
                    </script>
                    <input type="hidden" id="HProdOrgID" name="HProdOrgID" value="0" />
                    <input type="hidden" name="HPieceQty" id="HPieceQty" value="0">
                    <input type="hidden" name="HICMOQty" id="HICMOQty" value="0">
                </form>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/html" id="barDemo2">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del2">删除</a>
</script>
<script type="text/html" id="barDem03">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del3">删除</a>
</script>
<script>
    layui.config({
@@ -284,7 +300,10 @@
        //定义全局变量
        var HModName = "Cj_CollectionOfSingleProductDefects";
        var HModName = "Cj_ProcessItemStationPlatform";
        var option = [];
        var option2 = [];
        var option3 = [];
        //#endregion
        //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -304,10 +323,16 @@
        //条形码回车方法
        $('#HBarCodeSN').on('keydown', function (event) {
            var HBarCode = $('#HBarCodeSN').val();
            var HBardCodeProcExchBillNo = $('#HBardCodeProcExchBillNo').val();
            if (event.keyCode == 13) {
                if (!HBarCode) {
                    layer.msg("条形码不能为空!")
                if (!HBardCodeProcExchBillNo) {
                    layer.msg("请先扫流转卡!")
                    return;
                } else {
                    if (!HBarCode) {
                        layer.msg("条形码不能为空!")
                        return;
                    }
                }
                txtHBarCode_KeyDown(HBarCode);
            }
@@ -322,9 +347,39 @@
                    return;
                }
                get_BomList(HBarCode);
                if (option.data != 0) {
                    //保存到临时表
                    get_AddBomTempList();
                }
                //查询不良记录
                get_BadRecords(HBarCode);
                //查询合格记录
                get_HGRecords(HBarCode);
            }
        });
        //配件回车方法
        $('#HBardCodeMater').on('keydown', function (event) {
            var HBarCode = $('#HBardCodeMater').val();
            var HBardCodeProcExchBillNo = $('#HBardCodeProcExchBillNo').val();
            if (event.keyCode == 13) {
                if (!HBardCodeProcExchBillNo) {
                    layer.msg("请先扫流转卡!")
                    return;
                } else {
                    if (!HBarCode) {
                        layer.msg("配件不能为空!")
                        return;
                    }
                }
                get_Accessory(HBarCode);
            }
        });
        //不良汇报
        form.on('submit(BadReport)', function () {
            BadReport();
        });
        //选择质检员
        form.on('submit(btnHEmp)', function () {
@@ -374,8 +429,26 @@
        //初始化界面
        function set_ClearBill() {
            //进入页面默认光标在流转卡上
            $("#HBardCodeProcExchBillNo").focus();
            createBillNo();
            get_Display();
            get_CriticalPartsList();//关键件清单
            get_CriticalPartsList();//关键件清单 ä¸è‰¯è®°å½•  åˆæ ¼è®°å½•
        }
        // ç”Ÿæˆå•据号
        function createBillNo() {
            $.ajax({
                url: GetWEBURL() + "/Web/GetMAXNum",
                async: false,
                type: "GET",
                data: { "HBillType": '3791' },
                success: function (d) {
                    $("#HInterID").val(d.data[0].HInterID);
                    $("#HBillNo").val(d.data[0].HBillNo);
                }
            });
        }
        //查询
@@ -417,10 +490,9 @@
            });
        }
        //关键件清单
        function get_CriticalPartsList() {
            var option = {
            option= {
                elem: '#mainTable2'
                //, toolbar: '#toolbarDemo'
                , async: true
@@ -432,41 +504,153 @@
                , cols: [[
                    { type: 'numbers', title: '序号' }
                    , { field: '日期', title: '日期' }
                    , { field: '配件代码', title: '配件代码' }
                    , { field: '配件名称', title: '配件名称' }
                    , { field: '配件规格', title: '配件规格' }
                    , { field: '配件数量', title: '配件数量' }
                    , { field: '当前批次', title: '当前批次' }
                    , { field: 'HBillNo_bak', title: 'HBillNo_bak', hide: true }
                    , { field: 'HBatchNo', title: '当前批次' }
                    , { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
                    , { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true }
                    , { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true }
                    , { field: 'HProcExchInterID', title: 'HProcExchInterID', hide: true }
                    , { field: 'HProcExchEntryID', title: 'HProcExchEntryID', hide: true }
                    , { field: 'HProcExchBillNo', title: 'HProcExchBillNo', hide: true }
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: 'HBarCode', title: 'HBarCode', hide: true }
                ]]
            }
            option2 = {
                elem: '#mainTable3'
                //, toolbar: '#toolbarDemo'
                , async: true
                , page: false
                //, totalRow: true
                , cellMinWidth: 120
                , data: []
                , height: 325
                , cols: [[
                    { type: 'numbers', title: '序号' }
                    , { field: '日期', title: '日期' }
                    , { field: 'HName', title: '产品名称' }
                    , { field: 'HNumber', title: '产品代码' }
                    , { field: 'HBarCode', title: 'SN码' }
                    , { field: '不良原因', title: '不良原因' }
                    , { field: 'HBatchNo', title: '不良类型' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo2' }
                ]]
            }
            option3 = {
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , async: true
                , page: false
                //, totalRow: true
                , cellMinWidth: 120
                , data: []
                , height: 370
                , cols: [[
                    { type: 'numbers', title: '序号' }
                    , { field: 'hmainid', title: 'hmainid', hide: true }
                    , { field: 'hsubid', title: 'hsubid', hide: true }
                    , { field: '日期', title: '日期' }
                    , { field: '产品名称', title: '产品名称' }
                    , { field: '产品条码', title: 'SN码' }
                    , { field: '配件条码', title: '配件SN码' }
                    , { field: '任务单号', title: '订单号' }
                    , { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
                    , { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true }
                    , { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true }
                    , { field: 'HProcExchInterID', title: 'HProcExchInterID', hide: true }
                    , { field: 'HProcExchEntryID', title: 'HProcExchEntryID', hide: true }
                    , { field: 'HProcExchBillNo', title: 'HProcExchBillNo', hide: true }
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: 'HBarCode', title: 'HBarCode', hide: true }
                    , { fixed: 'right', title: '操作', toolbar: '#barDem03' }
                ]]
            }
            table.render(option);
            table.render(option2);
            table.render(option3);
        }
        //查询不良记录
        function get_BadRecords(HBarCode) {
            var ajaxLoad = layer.load();
            //进入页面显示的缓存列表
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/BadRecordsList',
                type: "GET",
                data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        option2.data = data1.data;
                        table.render(option2);
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //查询合格记录
        function get_HGRecords(HBarCode) {
            var ajaxLoad = layer.load();
            //进入页面显示的缓存列表
            $.ajax({
                url: GetWEBURL() + '/Cj_SingleStation/HGRecordsList',
                type: "GET",
                data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
                success: function (data1) {
                    if (data1.count == 1) {
                        option3.data = data1.data;
                        table.render(option3);
                        layer.close(ajaxLoad);
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //条码回车查询
        function txtHBarCode_KeyDown(HBarCode) {
            var index = layer.load();
            $.ajax({
                type: "GET",
                url: GetWEBURL() + "/Cj_SingleStation/HBardCodeList",
                async: true,
                url: GetWEBURL() + "/Cj_SingleStation/HBardCodeAccessoryList",
                async: false,
                data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"]},
                dataType: "json",
                success: function (data1) {
                    if (data1.count == 1) {
                        layer.close(index);
                        $("#HICMOBillNo").val(data1.data[0]["生产订单"]);
                        $("#HICMOInterID").val(data1.data[0]["HICMOInterID"]);
                        $("#HProcExchBillNo").val(data1.data[0]["工序流转卡"]);
                        $("#HProcExchInterID").val(data1.data[0]["HSourceInterID"]);
                        $("#HMaterNumber").val(data1.data[0]["物料编码"]);
                        $("#HMaterID").val(data1.data[0]["HMaterID"]);
                        $("#HMaterName").val(data1.data[0]["物料名称"]);
                        $("#HModel").val(data1.data[0]["规格型号"]);
                        $("#HBarCode").val(data1.data[0]["条码"]);
                        var HProcExchBillNo = $("#HProcExchBillNo").val();
                        //if (data1.data[0]["HSourceBillNo"] != HProcExchBillNo) {
                        //    return layer.msg("扫码错误,请重新扫!");
                        //} else {
                        //    $("#HBarCode_P").val(HBarCode);
                        //    layer.msg("扫码成功!");
                        //}
                        $("#HBarCode_P").val(HBarCode);
                        //保存数据
                        set_AddAssemblyBill();
                    }
                    else {
                        layer.close(index);
@@ -487,28 +671,124 @@
            $.ajax({
                type: "GET",
                url: GetWEBURL() + "/Cj_SingleStation/HBardCodeBomList",
                async: true,
                async: false,
                data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
                dataType: "json",
                success: function (data1) {
                    if (data1.count == 1) {
                        layer.close(index);
                        $("#HICMOBillNo").val(data1.data[0]["生产订单"]);
                        $("#HICMOInterID").val(data1.data[0]["HICMOInterID"]);
                        $("#HProcExchBillNo").val(data1.data[0]["工序流转卡"]);
                        $("#HProcExchInterID").val(data1.data[0]["HSourceInterID"]);
                        $("#HMaterNumber").val(data1.data[0]["物料编码"]);
                        $("#HMaterID").val(data1.data[0]["HMaterID"]);
                        $("#HMaterName").val(data1.data[0]["物料名称"]);
                        $("#HModel").val(data1.data[0]["规格型号"]);
                        $("#HBarCode").val(data1.data[0]["条码"]);
                        $("#HBardCodeProcExchBillNo").attr("readonly", "readonly");//流转卡只读
                        $("#HBardCodeProcExchBillNo").css("background-color", "#efefef4d");//流转卡灰色
                        //光标跳转到配件文本框上
                        $("#HBardCodeMater").focus();
                        $("#HMaterNumber").val(data1.data[0]["HMainMaterNumber"]);
                        $("#HMaterID").val(data1.data[0]["HMainMaterID"]);
                        $("#HMaterName").val(data1.data[0]["HMainMaterName"]);
                        $("#HMaterModel").val(data1.data[0]["HMainModel"]);
                        $("#HProcExchInterID").val(data1.data[0]["HProcExchInterID"]);
                        $("#HProcExchEntryID").val(data1.data[0]["HProcExchEntryID"]);
                        $("#HProcExchBillNo").val(data1.data[0]["HProcExchBillNo"]);
                        $("#HICMOBillNo").val(data1.data[0]["HICMOBillNo"]);
                        $("#HICMOInterID").val(data1.data[0]["HICMOInterID"]);
                        $("#HICMOEntryID").val(data1.data[0]["HICMOEntryID"]);
                        $("#HProcNo").val(data1.data[0]["HProcNo"]);
                        $("#HPieceQty").val(data1.data[0]["HPieceQty"]);
                        $("#HICMOQty").val(data1.data[0]["HICMOQty"]);
                        option.data = data1.data;
                        table.render(option)
                    }
                    else {
                        layer.close(index);
                        layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                    $("#HBarCodeSN").val("");
                },
                error: function (err) {
                    layer.close(index);
                    layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                }
            });
        }
        //配件查询数据
        var KNum = 0;
        function get_Accessory(HBarCode) {
            var index = layer.load();
            $.ajax({
                type: "GET",
                url: GetWEBURL() + "/Cj_SingleStation/HBardCodeAccessoryList",
                async: false,
                data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
                dataType: "json",
                success: function (data1) {
                    if (data1.count == 1) {
                        layer.close(index);
                        for (var i = 0; i < option.data.length; i++) {
                            if (data1.data[0]["HMaterNumber"] == option.data[i]["配件代码"] && option.data[i]["HBatchNo"] == data1.data[0]["HBatchNo"] && option.data[i]["HBatchNo"] != "") {
                                return layer.msg("当前批次已扫入,请不要重复扫入!");
                            }
                            if (data1.data[0]["HMaterNumber"] == option.data[i]["配件代码"] && option.data[i]["HBatchNo"] != data1.data[0]["HBatchNo"] && option.data[i]["HBatchNo"] != "") {
                                layer.confirm('是否要替换当前批次', function (index) {
                                    layer.close(index);
                                    option.data[i]["HBatchNo"] = data1.data[0]["HBatchNo"];
                                    option.data[i]["HBarCode"] = HBarCode;
                                    table.render(option);
                                });
                                break;
                            }
                            if (data1.data[0]["HMaterNumber"] == option.data[i]["配件代码"]) {
                                option.data[i]["HBatchNo"] = data1.data[0]["HBatchNo"];
                                option.data[i]["HBarCode"] = HBarCode;
                                KNum += 1;
                                table.render(option);
                                if (KNum == option.data.length) {
                                    layer.msg("批次已全部匹配!");
                                }
                                break;
                            }
                        }
                        $('#HBardCodeMater').val("");
                    }
                    else {
                        layer.close(index);
                        layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                    $("#HBarCodeSN").val("");
                },
                error: function (err) {
                    layer.close(index);
                    layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                }
            });
        }
        //保存配件到产线组装单临时表
        function get_AddBomTempList() {
            var HInterID = $("#HInterID").val();
            var HBillNo = $("#HBillNo").val();
            var sSubStr = JSON.stringify(table.cache["mainTable2"]);
            var sMainSub = sSubStr + ';' + HInterID + ';' + HBillNo + ";" + sessionStorage["HUserName"] + ";" + "3791" + ";" + sessionStorage["OrganizationID"];
            var index = layer.load();
            $.ajax({
                type: "POST",
                url: GetWEBURL() + "/Cj_SingleStation/AddBomTempList",
                async: false,
                data: { "sMainSub": sMainSub },
                dataType: "json",
                success: function (data) {
                    if (data.count == 1) {
                        layer.close(index);
                    }
                    else {
                        layer.close(index);
                        layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                },
                error: function (err) {
                    layer.close(index);
@@ -541,7 +821,6 @@
                }
            })
        }
         //操作员选择页面
        function btnHEmp2() {
@@ -672,26 +951,49 @@
            })
        }
        //不良汇报
        function BadReport() {
            var HBarCode_P = $("#HBarCode_P").val();
            if (HBarCode_P != "") {
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['100%', '100%']//大小
                    , title: '工序不良汇报'//标题
                    , shift: 2//弹出动画
                    , content: ['../../车间管理/单品过站/Cj_CollectionOfSingleProductDefects.html?OperationType=1&linterid=' + $("#HInterID").val(), 'yes']
                })
            }
            else {
                layer.msg("请先保存一次合格条码!")
            }
        }
    
        //保存HMaker
        function set_AddNew(data, HResult) {
        //保存产线组装主子表 å·¥åºå‡ºç«™å•主子表
        function set_AddAssemblyBill() {
            var data = { "field": { "HInterID": $("#HInterID").val(), "HBillNo": $("#HBillNo").val(), "HProcID": $("#HProcID").val(), "HMaterID": $("#HMaterID").val(), "HGroupID": $("#HGroupID").val(), "HSourceID": $("#HSourceID").val(), "HICMOInterID": $("#HICMOInterID").val(), "HICMOEntryID": $("#HICMOEntryID").val(), "HICMOBillNo": $("#HICMOBillNo").val(), "HBarCode_P": $("#HBarCode_P").val(), "HProdOrgID": sessionStorage["OrganizationID"], "HEmpID2": $("#HEmpID2").val(), "HEmpID": $("#HEmpID").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HProcExchInterID": $("#HProcExchInterID").val(), "HProcExchEntryID": $("#HProcExchEntryID").val(), "HPieceQty": $("#HPieceQty").val(), "HICMOQty": $("#HICMOQty").val(), "HDeptID": $("#HDeptID").val(), "HProcNo": $("#HProcNo").val()} };
            var sMainStr = JSON.stringify(data.field);
            var sMainSub = sMainStr + ';' + HResult + ";" + sessionStorage["HUserName"] ;
            var sSubStr = JSON.stringify(table.cache["mainTable2"]);
            var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"] ;
            var index = layer.load();
            $.ajax({
                type: "POST",
                url: GetWEBURL() + "/Cj_SingleStation/ProcessBLSave",
                url: GetWEBURL() + "/Cj_SingleStation/AddAssemblyBillList",
                async: false,
                data: { "sMainSub": sMainSub },
                dataType: "json",
                success: function (data) {
                    if (data.count == 1) {
                        $('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
                        //$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
                        layer.close(index);
                        layer.msg("提交成功");
                        //保存到临时表
                        get_AddBomTempList();
                        get_BomList($("#HBardCodeProcExchBillNo").val());
                        get_BadRecords($("#HBardCodeProcExchBillNo").val());
                    }
                    else {
                        layer.close(index);