yangle
2023-08-31 8ac8944185fdba9d120d23ebb52cc5c4aa955756
WebTM/views/ÖÊÁ¿¹ÜÀí/¹¤Ðò¼ìÑéµ¥/QC_ProcessCheckBill.html
@@ -770,7 +770,7 @@
                        LoadingInformation2();
                    } else if (HSouceBillType == 3791) {
                        //根据源单id获取源单信息
                        LoadingInformation();
                        LoadingInformation_StationOutBill();
                    } else {
                        layer.alert("源单类型无效!", { icon: 5 });
                    }
@@ -822,12 +822,12 @@
            }
            //根据源单id获取源单信息
            function LoadingInformation() {
            function LoadingInformation_StationOutBill() {
                var wait = layer.load();
                $.ajax({
                    url: GetWEBURL() + '/Cj_StationOutBill/get_Display',
                    url: GetWEBURL() + '/QC_ProcessCheckBill/get_StationOutBill',
                    type: "GET",
                    data: { "sWhere": " and hmainid = " + linterid, "user": sessionStorage["HUserName"] },
                    data: { "HInterID": linterid, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        var data = result.data[0];
                        if (result.count == 1) {
@@ -846,6 +846,10 @@
                            $("#HMainSourceInterID").val(data.hmainid);
                            $("#HProcID").val(data.HProcID);
                            $("#HICMOEntryID").val(HICMOEntryID);
                            $("#HQCSchemeName").val(data.检验方案名称);
                            $("#HQCSchemeID").val(data.检验方案ID);
                            //获取表体检验项目信息
                            get_CheckItem();
                        } else {
                            layer.alert(result.Message, { icon: 5 });
                        }
@@ -906,6 +910,31 @@
            //退出按钮
            form.on('submit(btn-Exit)', function (data) {
                get_Exit();
                sWhere = " and hmainid = " + $("#HInterID").val();
                $.ajax({
                    url: GetWEBURL() + "/QC_ProcessCheckBill/QC_ProcessCheckBillList",
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (result) {
                        if (result.count == 0) {
                            $.ajax({
                                url: GetWEBURL() + "/QC_ProcessCheckBill/Delete_Json",
                                type: "GET",
                                async: false,
                                data: { "HItemID": $("#HInterID").val(), "user": sessionStorage["HUserName"] },
                                success: function (result) {
                                    if (result.count == 1) {
                                        return;
                                    } else {
                                        layer.msg("删除检验值失败!" + result.Message, { icon: 5 });
                                    }
                                }
                            })
                        }
                    }
                })
            });
            //新增按钮
@@ -1545,44 +1574,44 @@
                $.ajax({
                    url: GetWEBURL() + "/Web/GetCheckItemByCheckProjectID",
                    type: "GET",
                    data: { "CheckProjectID": $("#HQCSchemeID").val() },
                    data: { "CheckProjectID": $("#HQCSchemeID").val() == '' ? 0 : $("#HQCSchemeID").val()},
                    success: function (result) {
                        //option.data = result.data;
                        //table.render(option);
                        var rowdata = [];
                        var data = result.data;
                        for (var i = 0; i < result.data.length; i++) {
                            //子表  èµ‹å€¼
                            rowdata.push({
                                "HQCCheckItemID": data[i]["HQCCheckItemID"], "检验项目": data[i]["检验项目"], "HInspectInstruMentID": 0, "检验仪器": "","HQCStd": data[i]["HQCStd"], "HUnit": data[i]["HUnit"], "HQCNote": "", "HAnalysisMethod": data[i]["HAnalysisMethod"], "HResult": data[i]["HResult"],
                                "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": false, "HStatus": 0, "HSampleSchemeID": 0, "HUnitID": 0,
                                "HInspectVal": '', "HTargetVal": '', "HUpLimit": '', "HDownLimit": '', "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": '',
                                "HSampleSchemeName": "", "HSampleQty": "", "HSampleDamageQty": "", "HAcceptQty": "", "HInspectionLevel": "", "HRejectQty": "",
                                "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": ""
                            });
                        }
                        if (result.code == 1) {
                            var rowdata = [];
                            var data = result.data;
                            for (var i = 0; i < result.data.length; i++) {
                                //子表  èµ‹å€¼
                                rowdata.push({
                                    "HQCCheckItemID": data[i]["HQCCheckItemID"], "检验项目": data[i]["检验项目"], "HInspectInstruMentID": 0, "检验仪器": "", "HQCStd": data[i]["HQCStd"], "HUnit": data[i]["HUnit"], "HQCNote": "", "HAnalysisMethod": data[i]["HAnalysisMethod"], "HResult": data[i]["HResult"],
                                    "HMax": "", "HMin": "", "HAvg": "", "HRemark": "", "HKeyInspect": false, "HStatus": 0, "HSampleSchemeID": 0, "HUnitID": 0,
                                    "HInspectVal": '', "HTargetVal": '', "HUpLimit": '', "HDownLimit": '', "HUpOffSet": '', "HDownOffSet": '', "HSampleDamageQty": '',
                                    "HSampleSchemeName": "", "HSampleQty": "", "HSampleDamageQty": "", "HAcceptQty": "", "HInspectionLevel": "", "HRejectQty": "",
                                    "HStrictness": "", "HSampleUnRightQty": "", "HAQL": "", "HSamplingType": ""
                                });
                            }
                        option.data = rowdata;
                        table.render(option);
                            option.data = rowdata;
                            table.render(option);
                        for (var i = 1; i <= result.data.length; i++) {
                            //$('#HAnalysisMethod' + i + '').find("option[value='" + option.data[i - 1].HAnalysisMethod + "']").attr("selected", true);
                            $('#HResult' + i + '').find("option[value='" + option.data[i - 1].HResult + "']").attr("selected", true);
                        }
                        form.render('select');
                            for (var i = 1; i <= result.data.length; i++) {
                                $('#HAnalysisMethod' + i + '').find("option[value='" + option.data[i - 1].HAnalysisMethod + "']").attr("selected", true);
                                $('#HResult' + i + '').find("option[value='" + option.data[i - 1].HResult + "']").attr("selected", true);
                            }
                            form.render('select');
                        option_Check = result.data;
                            option_Check = result.data;
                        $("[name='HEntryID']").attr("value", result.data.length);
                        $("[name='HQCCheckItemID']").attr("value", result.data[result.data.length - 1].HQCCheckItemID);
                        $("[name='HQCCheckItemName']").attr("value", result.data[result.data.length - 1].检验项目);
                        //默认选中最后一行
                        $("tr[data-index = " + (result.data.length - 1) + "] .layui-form-checkbox").dblclick();
                        //$("tr[data-index = " + (result.data.length - 1) + "] .layui-form-checkbox").addClass('layui-form-checked');
                        $("tr[data-index = " + (result.data.length - 1) + "] ").attr({ "style": "background:#ceedfa;color:black" });
                            $("[name='HEntryID']").attr("value", result.data.length);
                            $("[name='HQCCheckItemID']").attr("value", result.data[result.data.length - 1].HQCCheckItemID);
                            $("[name='HQCCheckItemName']").attr("value", result.data[result.data.length - 1].检验项目);
                            //默认选中最后一行
                            $("tr[data-index = " + (result.data.length - 1) + "] .layui-form-checkbox").dblclick();
                            //$("tr[data-index = " + (result.data.length - 1) + "] .layui-form-checkbox").addClass('layui-form-checked');
                            $("tr[data-index = " + (result.data.length - 1) + "] ").attr({ "style": "background:#ceedfa;color:black" });
                        trindex = result.data.length - 1;
                        $("#HEntryID").val() - 1
                            trindex = result.data.length - 1;
                            $("#HEntryID").val() - 1
                        }
                    }
                })
            }
@@ -1845,7 +1874,7 @@
                        , { field: 'HDownLimit', title: '下限值', edit: 'text', hide: true }
                        , { field: 'HUpOffSet', title: '上偏差', edit: 'text', hide: true }
                        , { field: 'HDownOffSet', title: '下偏差', edit: 'text', hide: true }
                        , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                        , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 85  }
                    ]]
                    , done: function (res, curr, count) {
                        option.data = res.data;