WebTM/views/É豸¹ÜÀí/Sb_Add_EqpMaintenanceBillList.html
@@ -295,7 +295,7 @@
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;;
                var NewRow = { "HRepairID1": 0, "HRepairCode": "", "HRepairName": "", "HManagerID1": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" };
                var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */};
                switch (obj.event) {
                    //增加一行
                    case 'btn-AddLine': set_AddLine(NewRow);
@@ -503,7 +503,8 @@
                    }
                });
            });
            //#region è¡¨å¤´ä¿¡æ¯é€‰æ‹©å•据弹窗
            //表头信息选择单据弹窗
            form.on('submit(XDHList)', function () {
                //页面层-自定义
                layer.open({
@@ -515,7 +516,8 @@
                    content: ['../设备管理/Sb_EqpConkBookBillList.html', 'yes'],
                    btn: ['确定', '取消']
                    , btn1: function (index, layero) {
                        //按钮【按钮一】的回调
                        //var NewRow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " };
                        ////按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
@@ -524,6 +526,49 @@
                        $("#HMainSourceBillNo").val(checkStatus.data[0].单据号);
                        $("#HMainSourceInterID").val(checkStatus.data[0].hmainid);
                        $("#HMainSourceEntryID").val(checkStatus.data[0].hsubid);
                        ////按选单号加载表体数据
                        //$.ajax({
                        //    url: GetWEBURL() + 'Sb_EqpRepairWorkBill/Sb_EqpRepairWorkBillSubByHMainSourceBillNo',
                        //    type: "GET",
                        //    data: { "HMainSourceBillNo": checkStatus.data[0].单据号 },
                        //    success: function (result) {
                        //        if (result.count == 1) {
                        //            var EndData = result.data;
                        //            var rowdate = layui.table.cache["mainTable"];
                        //            if (rowdate.length == 0)  //表体数据为空时
                        //            {
                        //                buttonArr = [];//清空数组
                        //                for (var i = 0; i < checkStatus.data.length; i++) {
                        //                    var checkrow = { "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "", "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid, "HSourceBillNo": EndData[i].单据号, "HSourceBillType": EndData[i].HBillType };
                        //                    buttonArr.push(checkrow);  //将之前的数据存储
                        //                }
                        //                table.reload("mainTable", {
                        //                    data: buttonArr    //将数据重新载入表格
                        //                })
                        //            }
                        //            else {
                        //                buttonArr = [];//清空数组
                        //                for (var i = 0; i < EndData.length; i++) {
                        //                    var checkrow = {
                        //                        "HRepairID": rowdate[i].HRepairID, "HRepairCode": rowdate[i].HRepairCode, "HRepairName": rowdate[i].HRepairName,
                        //                        "HRepairExplanation": rowdate[i].HRepairExplanation, "HManagerID": rowdate[i].HManagerID, "HManagerCode": rowdate[i].HManagerCode,
                        //                        "HManagerName": rowdate[i].HManagerName, "HMoney": rowdate[i].HMoney, "HRemark": rowdate[i].HRemark,
                        //                        "HSourceInterID": EndData[i].hmainid, "HSourceEntryID": EndData[i].hsubid,
                        //                        "HSourceBillNo": EndData[i].单据号, "HSourceBillType": EndData[i].HBillType
                        //                    };
                        //                    buttonArr.push(checkrow);  //将之前的数据存储
                        //                }
                        //                table.reload("mainTable", {
                        //                    data: buttonArr    //将数据重新载入表格
                        //                })
                        //            }
                        //        } else {
                        //            layer.alert(result.code + result.Message, { icon: 5 });
                        //        }
                        //    }, error: function () {
                        //        layer.alert("接口请求失败!", { icon: 5 });
                        //    }
                        //});
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
@@ -615,14 +660,18 @@
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                    , { field: 'HRepairID1', title: 'HRepairID1', edit: 'text', event: "", hide: true }
                    , { field: 'HRepairID', title: 'HRepairID', edit: 'text', event: "", hide: true }
                    , { field: 'HRepairCode', title: '维修项目代码', edit: 'text', event: "", event: "HRepairCode" }
                    , { field: 'HRepairName', title: '维修项目', edit: 'text', event: "" }
                    , { field: 'HManagerID1', title: 'HManagerID1', edit: 'text', hide: true }
                    , { field: 'HManagerID', title: 'HManagerID', edit: 'text', hide: true }
                    , { field: 'HManagerCode', title: '负责人代码', edit: 'text', event: "HManagerCode" }
                    , { field: 'HManagerName', title: '负责人', edit: 'text' }
                    , { field: 'HRepairExplanation', title: '维修要求', edit: 'text' }
                    , { field: 'HRemark', title: '备注', event: "", edit: 'text' }
                    //, { field: 'HSourceInterID', title: '源单主内码' }
                    //, { field: 'HSourceEntryID', title: '源单子内码' }
                    //, { field: 'HSourceBillNo', title: '源单单号' }
                    //, { field: 'HSourceBillType', title: '源单类型' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150 }
                ];
                option = {
@@ -643,7 +692,7 @@
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [{ "HRepairID1": 0, "HRepairCode": "", "HRepairName": "", "HManagerID1": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" }];
                option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " "*/ }];
                table.render(option);
            }
@@ -671,7 +720,7 @@
            function set_EditFromGrid() {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{ "HRepairID1": 0, "HRepairCode": "", "HRepairName": "", "HManagerID1": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": "" }];
                option.data = [{ "HRepairID": 0, "HRepairCode": "", "HRepairName": "", "HManagerID": 0, "HManagerCode": "", "HManagerName": "", "HRepairExplanation": "", "HRemark": ""/*, "HSourceInterID": 0, "HSourceEntryID": 0, "HSourceBillNo": " ", "HSourceBillType": " " */}];
                table.render(option);
            }
@@ -806,7 +855,7 @@
                                    }
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HRepairID1: checkStatus.data[0].HItemID,
                                        HRepairID: checkStatus.data[0].HItemID,
                                        HRepairCode: checkStatus.data[0].HNumber,
                                        HRepairName: checkStatus.data[0].HName,
                                    });
@@ -847,7 +896,7 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HManagerID1: checkStatus.data[0].HItemID,
                                        HManagerID: checkStatus.data[0].HItemID,
                                        HManagerCode: checkStatus.data[0].HNumber,
                                        HManagerName: checkStatus.data[0].HName
                                    });
@@ -902,6 +951,17 @@
                }
            }
            //判断源单带回数据数组中的值是否相同
            function isAllEqual(array) {
                if (array.length > 0) {
                    return !array.some(function (value, index) {
                        return value !== array[0];
                    });
                } else {
                    return true;
                }
            }
            //数据验证
            function AllowLoadData(sSubStr) {  //sSubStr