duhe
2025-03-15 fbe7faa4df8d3ba04067fecf789b7df9e5bf7a04
WebTM/views/É豸¹ÜÀí/Sb_EquipMaintainPlanBillEdit.html
@@ -68,7 +68,7 @@
                                                <div class="layui-input-block" style="margin-left: 120px;width: 185px;">
                                                    <select name="HCycleUnit" lay-filter="aihao" id="HCycleUnit">
                                                        <option value="天">天</option>
                                                        <option value="周">周</option>
                                                        <!--<option value="周">周</option>-->
                                                        <option value="月">月</option>
                                                        <option value="å¹´">å¹´</option>
                                                    </select>
@@ -276,6 +276,12 @@
            //判断操作类型
            if (OperationType == 1) {//无源新增
                set_AddFNew();
            }
            else if (OperationType == 2) {//如果修改则走下面 new                                        //复制
                OperationType = 1;
                set_EditFromGrid(linterid);
                //获取最大单据号
                get_MAXNum();
            }
            else if (OperationType == 3) {//编辑
                set_EditFromGrid(linterid);
@@ -640,6 +646,7 @@
                    , { field: 'HPlanBeginTime', title: '计划开始时间点' }
                    , { field: 'HPlanEndTime', title: '计划结束时间点' }
                    , { field: 'HSafeEndTime', title: '安全结束时间点' }
                    , { field: 'HErrBeginTime', title: '预警开始时间点' }
                    , { field: 'HRelationFlag', title: '关联标记' }
                    , { field: 'DiffDate', title: '相差间隔' }
                ];
@@ -676,6 +683,7 @@
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    async: false,
                    data: { "HBillType": sBillType },
                    success: function (d) {
                        //console.log(d.data);
@@ -713,31 +721,31 @@
            function set_EditFromGrid(linterid) {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                table.render(option);
                //option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                //table.render(option);
                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }];
                table.render(option1);
                //option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": 0, "HUnitNumber": "", "HUnitName": "", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HQty": "0", "HRemark": "" }];
                //table.render(option1);
                set_EditGrid_Plan(linterid);  //编辑获取表体--点检计划
                option.data = [{ "HPlanDate": "", "HPlanBeginTime": "", "HPlanEndTime": "", "HSafeEndTime": "","HRelationFlag": "未点检", "DiffDate": 0 }];
                table.render(option_plan);
                //option.data = [{ "HPlanDate": "", "HPlanBeginTime": "", "HPlanEndTime": "", "HSafeEndTime": "", "HErrBeginTime": "","HRelationFlag": "未点检", "DiffDate": 0 }];
                //table.render(option_plan);
            }
            //编辑获取表头
            function set_EditForm(linterid) {
                $.ajax({
                    url: GetWEBURL() + "Sb_EquipMaintainPlanBill/Sb_EquipMaintainPlanBillListCheckDetai",
                    type: "GET",
                    async: false,
                    data: {
                        "HID": linterid
                    },
                    success: function (result) {
                        //console.log(result.code)
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            console.log(result)
                            var data = result.data.h_v_Sb_EquipMaintainPlanBillList[0];
                            form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HBillNo": data.单据号
                                "HInterID": OperationType == 2 ? "" : linterid
                                , "HBillNo": OperationType == 2 ? "" : data.单据号
                                , "HDate": formatDate(data.日期)
                                , "HInnerBillNo": data.内部单据号
                                , "HEquipID": data.设备ID
@@ -770,11 +778,11 @@
            }
            //编辑获取表体
            function set_EditGrid(linterid) {
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sb_EquipMaintainPlanBill/Sb_EquipMaintainPlanBillListProjectDetaiNew',
                    type: "GET",
                    async: false,
                    data: { "HInterID": linterid },
                    success: function (result) {
                        if (result.count == 1) {
@@ -854,11 +862,11 @@
            // ç¼–辑获取表体--点检计划
            function set_EditGrid_Plan(linterid) {
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sb_EquipMaintainPlanBill/GetPlanList',
                    type: "GET",
                    async: false,
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (result) {
                        if (result.count == 1) {
@@ -868,7 +876,7 @@
                                rowdata.push(
                                    {
                                        "HPlanDate": Pub_Format(data[i].计划日期, "yyyy-MM-dd"), "HPlanBeginTime": Pub_Format(data[i].计划开始时间点, "yyyy-MM-dd hh:mm:ss"), "HPlanEndTime": Pub_Format(data[i].计划结束时间点, "yyyy-MM-dd hh:mm:ss"), "HSafeEndTime": Pub_Format(data[i].安全结束时间点, "yyyy-MM-dd hh:mm:ss")
                                        , "HRelationFlag": data[i].关联标记, "DiffDate": data[i].相差间隔
                                        , "HErrBeginTime": Pub_Format(data[i].预警开始时间点, "yyyy-MM-dd hh:mm:ss"), "HRelationFlag": data[i].关联标记, "DiffDate": data[i].相差间隔
                                    }
                                )
                            }