pzy
2024-09-05 63ba619e1a67b46156c22a45edb1e38d6d1663c3
WebTM/views/¼Æ»®¹ÜÀí/¹¤ÒÕ·Ïß/Gy_MaterialTechParamBillMain.html
@@ -177,6 +177,30 @@
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">模具编码</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" lay-verify="HMouldNumber" name="HMouldNumber" id="HMouldNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HMouldID" id="HMouldID" lay-verify="HMouldID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHMould" id="btnSearchHMould" 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: 75px;">模具名称</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMouldName" lay-verify="HMouldName" id="HMouldName" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">模具型号</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMouldModel" lay-verify="HMouldModel" id="HMouldModel" style="background-color:#efefef4d;" readonly>
                                            </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="HRemark" id="HRemark" lay-verify="HRemark" style=" width: 500px;">
@@ -462,6 +486,12 @@
            });
            //#endregion
            //#region é€‰æ‹©æ¨¡å…·æŒ‰é’®
            form.on('submit(btnSearchHMould)', function () {
                get_checkSearchHMould();
            });
            //#endregion
            // ä¿å­˜æäº¤
            form.on('submit(btnSave)', function (data) {//提交
@@ -529,10 +559,10 @@
                //新增行表格数据
                var NewRow = {
                    "HTechParamID": "",
                    "HTechParamID": 0,
                    "HTechParamNumber": "",
                    "HTechParamName": "",
                    "HTechParamUnitID": "",
                    "HTechParamUnitID": 0,
                    "HTechParamUnitName": "",
                    "HStd": "0",
                    "HMax": "0",
@@ -540,6 +570,10 @@
                    "HDataForm": "设备采集",
                    "HDataUnit": "秒",
                    "HDataTimes": "0",
                    "HTechParamClassID": "0",
                    "HSNO": "0",
                    "HStdNextTimes": "0",
                    "HTechParamIDStd":"0",
                    "HSourceBillNo": "0",
                    "HSourceBillType": "0",
                    "HSourceEntryID": "0",
@@ -631,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);
            }
@@ -847,17 +910,44 @@
            }
            //#endregion
            //#region æ¨¡å…·é€‰æ‹©é¡µé¢
            function get_checkSearchHMould() {
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '工序表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../模治具管理/模治具管理/Gy_MouldFileList.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('请选择数据');
                        }
                        //获取数据
                        $("#HMouldID").val(checkStatus.data[0].hmainid);
                        $("#HMouldNumber").val(checkStatus.data[0].模具编号);
                        $("#HMouldName").val(checkStatus.data[0].模具名称);
                        $("#HMouldModel").val(checkStatus.data[0].模具型号);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            }
            //#endregion
            //#region å­è¡¨ï¼šå¿«æ·é”®(F7)打开弹窗
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    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%'],
@@ -871,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 () {
@@ -930,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 = [];
                                    //}
                                }
                            });
                        }
@@ -1115,6 +1324,10 @@
                                , "HEquipNumber": tableMain[0]["设备代码"]
                                , "HEquipName": tableMain[0]["设备名称"]
                                , "HEquipModel": tableMain[0]["设备型号"]
                                , "HMouldID": tableMain[0]["HMouldID"]
                                , "HMouldNumber": tableMain[0]["模具代码"]
                                , "HMouldName": tableMain[0]["模具名称"]
                                , "HMouldModel": tableMain[0]["模具型号"]
                                , "HDeptID": tableMain[0]["HDeptID"]
                                , "HDeptName": tableMain[0]["部门"]
                                , "HWorkCenterID": tableMain[0]["HWorkCenterID"]
@@ -1174,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);