zrg
2024-05-08 98f349c5121be6f7194e11c5f64225233d26000a
WebTM/views/É豸¹ÜÀí/Sb_EquipDotCheckPlanBillEdit.html
@@ -225,7 +225,7 @@
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var NewRow = { "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" };
                var NewRow = { "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""  };
                switch (obj.event) {
                    //增加一行
                    case 'btn-AddLine': set_AddLine(NewRow);
@@ -392,6 +392,10 @@
                    , { field: 'HDotCheckItemID', title: '点检项目ID', edit: 'text', hide: true }
                    , { field: 'HDotCheckCode', title: '点检项目代码', edit: 'text', event: "HDotCheckCode" }
                    , { field: 'HDotCheckItem', title: '点检项目', edit: 'text', event: "" }
                    , { field: 'HDotCheckItemClassID', title: '点检项目分类ID', edit: 'text', hide: true }
                    , { field: 'HDotCheckItemClassName', title: '点检项目分类', edit: 'text', event: 'HDotCheckItemClassName' }
                    , { field: 'HDotCheckItemMethodID', title: '点检方法ID', edit: 'text', hide: true }
                    , { field: 'HDotCheckItemMethodName', title: '点检方法', edit: 'text', event: 'HDotCheckItemMethodName' }
                    , { field: 'HDotCheckPart', title: '点检部位', edit: 'text', event: "" }
                    , { field: 'HClaim', title: '具体要求', edit: 'text' }
                    , { field: 'HManagerID', title: '负责人代码', edit: 'text', hide: true }
@@ -445,7 +449,7 @@
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" }];
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""  }];
                table.render(option);
            }
            //获取最大单据号及默认值赋值
@@ -472,7 +476,7 @@
            function set_EditFromGrid() {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""  }];
                table.render(option);
@@ -493,7 +497,7 @@
                            if (result.count == 1) {
                                var DJData = result.data;//点检
                                var rowdate1 = layui.table.cache["mainTable"];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "" }];
                                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""  }];
                                table.render(option);
                                if (DJData.length != 0)  //表体数据不为空时
@@ -503,7 +507,7 @@
                                        var checkrow = {
                                            "HDotCheckItemID": DJData[i].点检项目ID, "HDotCheckCode": DJData[i].点检项目代码, "HDotCheckItem": DJData[i].点检项目, "HDotCheckPart": DJData[i].点检部位,
                                            "HClaim": DJData[i].具体要求, "HManagerID": DJData[i].负责人ID, "HManagerCode": DJData[i].负责人代码,
                                            "HManagerName": DJData[i].负责人, "HRemark": DJData[i].子备注
                                            "HManagerName": DJData[i].负责人, "HRemark": DJData[i].子备注, "HDotCheckItemClassID": DJData[i].HDotCheckItemClassID, "HDotCheckItemClassName": DJData[i].点检项目分类名称, "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
@@ -566,11 +570,15 @@
                    url: GetWEBURL() + 'Sb_EquipDotCheckPlanBill/Sb_EquipDotCheckPlanBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (result) {
                        console.log(result);
                        //console.log('gouba' + result);
                    success: function (result) {
                        if (result.count == 1) {
                            option.data = result.data;
                            var data = result.data;
                            var subarr = [];
                            for (var i = 0; i < data.length; i++) {
                                subarr.push({ "HDotCheckItemID": data[i].点检项目ID, "HDotCheckCode": data[i].点检项目代码, "HDotCheckItem": data[i].点检项目, "HDotCheckPart": data[i].点检部位, "HClaim": data[i].具体要求, "HManagerID": data[i].负责人ID, "HManagerCode": data[i].负责人代码, "HManagerName": data[i].负责人, "HRemark": data[i].表体备注, "HDotCheckItemClassID": data[i].HDotCheckItemClassID, "HDotCheckItemClassName": data[i].点检项目分类名称, "HDotCheckItemMethodID": data[i].HDotCheckItemMethodID, "HDotCheckItemMethodName": data[i].点检方法名称 });
                            }
                            option.data = subarr;
                            table.render(option);
                        } else {
@@ -708,6 +716,8 @@
                                            HDotCheckItemID: checkStatus.data[0].HItemID,
                                            HDotCheckItem: checkStatus.data[0].点检项目名称,
                                            HDotCheckCode: checkStatus.data[0].点检项目代码,
                                            HDotCheckItemClassID: checkStatus.data[0].HDotCheckItemClassID,
                                            HDotCheckItemClassName: checkStatus.data[0].点检项目分类名称,
                                            //HDotCheckPart: checkStatus.data[0].点检部位
                                        });
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
@@ -723,7 +733,7 @@
                                        }
                                        //将批量选择的数据写入数组(多选行)
                                        for (var i = 0; i < checkStatus.data.length; i++) {
                                            buttonArr.push({ "HDotCheckItemID": checkStatus.data[i].HItemID, "HDotCheckCode": checkStatus.data[i].点检项目代码, "HDotCheckItem": checkStatus.data[i].点检项目名称, "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "" });
                                            buttonArr.push({ "HDotCheckItemID": checkStatus.data[i].HItemID, "HDotCheckCode": checkStatus.data[i].点检项目代码, "HDotCheckItem": checkStatus.data[i].点检项目名称, "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": checkStatus.data[i].HDotCheckItemClassID, "HDotCheckItemClassName": checkStatus.data[i].点检项目分类名称, "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "" });
                                        }
                                        table.reload("mainTable", {
@@ -777,6 +787,74 @@
                                }
                            });
                        }
                        if (obj.event === 'HDotCheckItemClassName')  //点检项目分类
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '点检项目分类列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true
                                , content: ['../基础资料/基础资料/Gy_DotCheckItemClassList.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({
                                        HDotCheckItemClassID: checkStatus.data[0].HItemID,
                                        HDotCheckItemClassName: checkStatus.data[0].点检项目分类名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                }
                            });
                        }
                        if (obj.event === 'HDotCheckItemMethodName')  //点检方法
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '点检方法列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true
                                , content: ['../基础资料/基础资料/Gy_DotCheckItemMethodList.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({
                                        HDotCheckItemMethodID: checkStatus.data[0].HItemID,
                                        HDotCheckItemMethodName: checkStatus.data[0].点检方法名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                }
                            });
                        }
                        obj.event = "";
                        return false;