zrg
2024-07-18 0b3484d0c6f69c5050fefea47687fed9936476f2
WebTM/views/É豸¹ÜÀí/Sb_EquipDotCheckPlanBillEdit.html
@@ -122,6 +122,27 @@
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-row" style="margin-top:10px;">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">使用组织</label>
                                                <div class="layui-input-block" style="margin-left: 120px; width: 185px;">
                                                    <input type="hidden" class="layui-input" lay-verify="HCREATEORGID" name="HCREATEORGID" id="HCREATEORGID" value="0">
                                                    <select name="HUSEORGID" id="HUSEORGID" lay-verify="HUSEORGID">
                                                        <!--动态渲染组织-->
                                                    </select>
                                                </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="text" class="layui-input" lay-verify="HDeptName" name="HDeptName" id="HDeptName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                    <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0">
                                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHDept" id="btnHDept" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
@@ -208,11 +229,16 @@
            set_InitFrom();
            //初始化表格
            set_InitGrid();
            //动态加载组织
            Organ();
            $("#HCREATEORGID").val(sessionStorage["OrganizationID"]);
            //判断操作类型
            if (OperationType == 1) {//无源单
                set_AddFNew();
            }
            else if (OperationType == 3) {//编辑
                //禁用组织选项
                //$("#HUSEORGID").attr("disabled", true);
                set_EditFromGrid();
            }
            else {
@@ -225,7 +251,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": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""  };
                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);
@@ -305,7 +331,7 @@
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true
                    ,content: ['../设备管理/设备档案/Gy_EquipFileMainList.html', 'yes']
                    , content: ['../设备管理/设备档案/Gy_EquipFileMainList.html', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {
@@ -366,6 +392,33 @@
                });
            });
            //表头设备点检规程信息
            form.on('submit(btnHDept)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '部门列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../基础资料/公用基础资料/Gy_DepartmentList.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('请选择数据');
                        }
                        $("#HDeptID").val(checkStatus.data[0].HItemID);
                        $("#HDeptName").val(checkStatus.data[0].部门名称);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                });
            });
            //#endregion
@@ -421,7 +474,7 @@
                //点检计划
                columns_plan = [
                    { type: 'checkbox', fixed: 'left', totalRowText: '合计行'}
                    { type: 'checkbox', fixed: 'left', totalRowText: '合计行' }
                    , { templet: '#xuhao', title: '序号', sort: true, event: "qwe" }
                    , { field: 'HPlanDate', title: '计划日期' }
                    , { field: 'HPlanBeginTime', title: '计划开始时间点' }
@@ -436,7 +489,7 @@
                    , page: true
                    , totalRow: true
                    , limit: 500
                    , limits:[50,200,500,1000,3000]
                    , limits: [50, 200, 500, 1000, 3000]
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns_plan]
@@ -449,7 +502,7 @@
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": sessionStorage["HEmpID"], "HManagerCode": sessionStorage["HEmpNumber"], "HManagerName": sessionStorage["HEmpName"], "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""  }];
                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,16 +525,37 @@
                    }
                });
            }
            //获取组织
            function Organ() {
                //获取登录页组织列
                var Organization = '';
                $.ajax({
                    type: "get",
                    url: GetWEBURL() + "/Web/GetOrganizations",
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data;
                            for (var i = 0; i < data.length; i++) {
                                Organization += '<option  style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
                            }
                            $("#HUSEORGID").append(Organization);
                            $("#HUSEORGID").val(sessionStorage["OrganizationID"])
                            form.render('select');
                        }
                        layer.closeAll("loading");
                    }
                })
            }
            //编辑
            function set_EditFromGrid() {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""  }];
                option.data = [{ "HDotCheckItemID": 0, "HDotCheckCode": "", "HDotCheckItem": "", "HDotCheckPart": "", "HClaim": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRemark": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": "" }];
                table.render(option);
                set_EditGrid_Plan(linterid);  //编辑获取表体--点检计划
                option.data = [{ "HPlanDate": "", "HPlanBeginTime": "", "HPlanEndTime": "", "HRelationFlag": "未点检","DiffDate":0 }];
                option.data = [{ "HPlanDate": "", "HPlanBeginTime": "", "HPlanEndTime": "", "HRelationFlag": "未点检", "DiffDate": 0 }];
                table.render(option_plan);
            }
@@ -497,7 +571,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": "", "HDotCheckItemClassID": 0, "HDotCheckItemClassName": "", "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""  }];
                                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)  //表体数据不为空时
@@ -507,7 +581,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].子备注, "HDotCheckItemClassID": DJData[i].HDotCheckItemClassID, "HDotCheckItemClassName": DJData[i].点检项目分类名称, "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""
                                            "HManagerName": DJData[i].负责人, "HRemark": DJData[i].子备注, "HDotCheckItemClassID": DJData[i].HDotCheckItemClassID, "HDotCheckItemClassName": DJData[i].点检项目分类名称, "HDotCheckItemMethodID": 0, "HDotCheckItemMethodName": ""
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
@@ -552,6 +626,10 @@
                                , "HRemark": data.表头备注
                                , "HMouldDotCheckRuleID": data.HMouldDotCheckRuleID
                                , "HMouldDotCheckRuleName": data.设备点检规程
                                , "HCREATEORGID": data.HCREATEORGID
                                , "HUSEORGID": data.HUSEORGID
                                , "HDeptID": data.HDeptID
                                , "HDeptName": data.部门名称
                            });
                        } else {
@@ -570,7 +648,7 @@
                    url: GetWEBURL() + 'Sb_EquipDotCheckPlanBill/Sb_EquipDotCheckPlanBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (result) {
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data;
                            var subarr = [];
@@ -741,7 +819,7 @@
                                        })
                                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                    }
                                    }
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调