WebTM/views/¼Æ»®¹ÜÀí/¹¤ÒÕ·Ïß/Gy_MaterialTechParamBillMain.html
@@ -205,7 +205,7 @@
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HRemark" id="HRemark" lay-verify="HRemark" style=" width: 500px;">
                                            </div>
                                        </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
@@ -413,27 +413,27 @@
                $("#HMaker").val(sessionStorage["HUserName"]);
                $("#HMakerDate").val(Format(new Date(), "yyyy-MM-dd"));
            }
            //else if (OperationType == 2) {
            //    RoadBillMain(linterid);
            //    $.ajax({
            //        url: GetWEBURL() + "/Web/GetMAXNum",
            //        type: "GET",
            //        async: false,
            //        data: { "HBillType": '3301' },
            //        success: function (d) {
            //            $("#HInterID").val(d.data[0].HInterID);
            //            $("#HBillNo").val(d.data[0].HBillNo);
            //            $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
            //        }
            //    });
            //}
            else if (OperationType == 2) {
                //初始化表格
                get_InitGrid();
                RoadBillMain(linterid);
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    async: false,
                    data: { "HBillType": '3334' },
                    success: function (d) {
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                    }
                });
            }
            else if (OperationType == 3) {
                //禁用按钮
                var num = 1;
                HfBtn(num);
                debugger;
                //初始化表格
                get_InitGrid();
@@ -559,10 +559,10 @@
                //新增行表格数据
                var NewRow = {
                    "HTechParamID": "",
                    "HTechParamID": 0,
                    "HTechParamNumber": "",
                    "HTechParamName": "",
                    "HTechParamUnitID": "",
                    "HTechParamUnitID": 0,
                    "HTechParamUnitName": "",
                    "HStd": "0",
                    "HMax": "0",
@@ -570,6 +570,10 @@
                    "HDataForm": "设备采集",
                    "HDataUnit": "秒",
                    "HDataTimes": "0",
                    "HTechParamClassID": "0",
                    "HSNO": "0",
                    "HStdNextTimes": "0",
                    "HTechParamIDStd":"0",
                    "HSourceBillNo": "0",
                    "HSourceBillType": "0",
                    "HSourceEntryID": "0",
@@ -661,10 +665,39 @@
                        , { field: 'HDataForm', title: '采集来源', templet: '#HDataForm-select' }
                        , { field: 'HDataUnit', title: '采集时间单位', templet: '#HDataUnit-select' }
                        , { field: 'HDataTimes', title: '采集周期频率', edit: 'text', totalRow: true }
                        , { field: 'HTechParamClassID', title: '工艺参数大类', hide: true }
                        , { field: 'HTechParamClassName', title: '工艺参数大类名称', edit: 'text', event: "HTechParamClassName" }     //f7
                        , { field: 'HSNO', title: '工艺次序', edit: 'text', totalRow: true }
                        , { field: 'HStdNextTimes', title: '理论次序间隔', edit: 'text', totalRow: true }
                        , { field: 'HTechParamIDStd', title: '对应设定值工艺参数', hide: true }
                        , { field: 'HTechParamIDStdName', title: '对应设定值工艺参数值', edit: 'text', event: "HTechParamIDStdName  " }     //f7
                        , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                    ]]
                }
                option.data = [];
                var rowdata = [
                    {
                        "HTechParamID": 0,
                        "HTechParamNumber": "",
                        "HTechParamName": "",
                        "HTechParamUnitID": 0,
                        "HTechParamUnitName": "",
                        "HStd": "0",
                        "HMax": "0",
                        "HMin": "0",
                        "HDataForm": "设备采集",
                        "HDataUnit": "秒",
                        "HDataTimes": "0",
                        "HTechParamClassID": "0",
                        "HSNO": "0",
                        "HStdNextTimes": "0",
                        "HTechParamIDStd": "0",
                        "HSourceBillNo": "0",
                        "HSourceBillType": "0",
                        "HSourceEntryID": "0",
                        "HSourceInterID": "0"
                    }
                ];
                option.data = rowdata;
                table.render(option);
            }
@@ -911,11 +944,10 @@
                    if (event.key == "F7") {
                        //工艺参数
                        if (obj.event == "HTechParamNumber") {
                            //打开器具管理小窗体
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '模具列表',
                                title: '工艺列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
@@ -929,12 +961,52 @@
                                    if (checkStatus.data.length === 0) {
                                        return layer.msg('请选择数据');
                                    }
                                    obj.update({
                                        "HTechParamID": checkStatus.data[0].HItemID,
                                        "HTechParamNumber": checkStatus.data[0].工艺参数代码,
                                        "HTechParamName": checkStatus.data[0].工艺参数名称,
                                    });
                                   // table.cache["mainTable"].splice(0, 1);
                                    table.cache["mainTable"] = table.cache["mainTable"].filter(row => row.HTechParamID !== 0 && row.HTechParamID !== undefined);
                                    for (var rowData of checkStatus.data) {
                                        var NewRow = {
                                            "HTechParamID": rowData.HItemID,
                                            "HTechParamNumber": rowData.工艺参数代码,
                                            "HTechParamName": rowData.工艺参数名称,
                                            "HTechParamUnitID": 0,
                                            "HTechParamUnitName": "",
                                            "HStd": "0",
                                            "HMax": "0",
                                            "HMin": "0",
                                            "HDataForm": "设备采集",
                                            "HDataUnit": "秒",
                                            "HDataTimes": "0",
                                            "HTechParamClassID": "0",
                                            "HSNO": "0",
                                            "HStdNextTimes": "0",
                                            "HTechParamIDStd": "0",
                                            "HSourceBillNo": "0",
                                            "HSourceBillType": "0",
                                            "HSourceEntryID": "0",
                                            "HSourceInterID": "0"
                                        };
                                        table.cache["mainTable"].push(NewRow);
                                    }
                                    option.data = table.cache["mainTable"];
                                    table.render(option);
                                    //for (var i = 0; i < checkStatus.data.length; i++) {
                                    //    option.data.push({
                                    //        "HTechParamID": checkStatus.data[i].HItemID,
                                    //        "HTechParamNumber": checkStatus.data[i].工艺参数代码,
                                    //        "HTechParamName": checkStatus.data[i].工艺参数名称,
                                    //    })
                                    //}
                                    //obj.update({
                                    //    "HTechParamID": checkStatus.data[0].HItemID,
                                    //    "HTechParamNumber": checkStatus.data[0].工艺参数代码,
                                    //    "HTechParamName": checkStatus.data[0].工艺参数名称,
                                    //});
                                    //table.render(option);
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , end: function () {
@@ -988,6 +1060,85 @@
                                        });
                                        OptionData = [];
                                    }
                                }
                            });
                        }
                        //工艺参数大类
                        if (obj.event == "HTechParamClassName") {
                            //打开工艺参数大类小窗体
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '工艺参数大类',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../../views/基础资料/公用基础资料/Gy_TechnologyParameterType.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({
                                        "HTechParamClassID": checkStatus.data[0].HItemID,
                                        "HTechParamClassName": checkStatus.data[0].工艺参数分类名称,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , end: function () {
                                    //if (OptionData.length > 0) {
                                    //    //更新表格缓存的数据
                                    //    obj.update({
                                    //        "HTechParamClassID": OptionData[0].HItemID,
                                    //        "HTechParamClassName": OptionData[0].工艺参数大类名称,
                                    //    });
                                    //    OptionData = [];
                                    //}
                                }
                            });
                        }
                        //对应设定值工艺参数
                        if (obj.event == "HTechParamIDStdName") {
                            //打开对应设定值工艺参数(小窗体
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '对应设定值工艺参数列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['80%', '80%'],
                                maxmin: true,
                                content: ['../../../views/基础资料/公用基础资料/Gy_TechnologyParameter.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({
                                        "HTechParamIDStd": checkStatus.data[0].HItemID,
                                        "HTechParamIDStdName": checkStatus.data[0].对应设定值工艺参数名称,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , end: function () {
                                    //if (OptionData.length > 0) {
                                    //    //更新表格缓存的数据
                                    //    obj.update({
                                    //        "HTechParamIDStd": OptionData[0].HItemID,
                                    //        "HTechParamIDStdName": OptionData[0].对应设定值工艺参数名称,
                                    //    });
                                    //    OptionData = [];
                                    //}
                                }
                            });
                        }
@@ -1162,8 +1313,8 @@
                            var tableSub = result.data[1];
                            //主表
                            form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HInterID": tableMain[0]["HInterID"]
                                , "HBillNo": tableMain[0]["单据号"]
                                "HInterID": OperationType == 2 ? "" : tableMain[0]["HInterID"]
                                , "HBillNo": OperationType == 2 ? "" : tableMain[0]["单据号"]
                                , "HDate": Format(new Date(tableMain[0]["日期"]), "yyyy-MM-dd")
                                , "HMaterID": tableMain[0]["HMaterID"]
                                , "HMaterNumber": tableMain[0]["物料代码"]
@@ -1236,8 +1387,12 @@
                for (var i = 0; i < table.cache["mainTable"].length; i++) {
                    if (table.cache["mainTable"][i] != "") {
                        table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
                        table.cache["mainTable"][i].HTechParamIDStd == null ? 0 : table.cache["mainTable"][i].HTechParamIDStd
                        num.push(table.cache["mainTable"][i])
                    }
                }
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(num);