yusijie
2022-12-19 44ecd9f1c2b09c79533798ca6bccd53e263dc479
Merge branch 'master' of http://101.37.171.70:10101/r/MESWMS-LayUI
10个文件已修改
1188 ■■■■■ 已修改文件
WebTM/views/基础资料/基础资料/InventoryAnalysis.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具管理/Gy_MouldFile.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具管理/Gy_MouldFileList.html 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具管理/Sc_Add_MouldMaintainPlanBillList.html 939 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具管理/Sc_MouldMaintainPlanBillList.html 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/模治具管理/模治具管理/Sc_MouldMaintainRuleBillList.html 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/要料计划/JIT_NeedMaterPlanBillEdit.html 54 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/计划管理/工艺路线/Gy_RoutingBill.html 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/设备管理/Sb_EquipMaintainPlanBillEdit.html 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/车间管理/工序出站汇报单/Cj_StationOutBill.html 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/InventoryAnalysis.html
@@ -532,7 +532,7 @@
                //初始化表格(退库)
                set_InitGrid7();
                //初始查正常页签
                zc_Display();
                //zc_Display();
            }
            //初始化表格(正常)
@@ -750,7 +750,7 @@
            }
            //盘盈查询
            function py_Display() {
                var sWhere = "isnull(HBookPot,'''')='''' and isnull(HRealPot,'''')!=''''";
                var sWhere = "py";
                var HItemID = $("#HItemID").val();//单据类型
               
                //进入页面显示的缓存列表
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Gy_MouldFile.html
@@ -136,7 +136,7 @@
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">对应ERP物料</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber" style="width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" class="layui-input" name="HMaterID" id="HMaterID" style="background-color:#efefef4d;width: 60%;display: inline-block;">
                                                <input type="hidden" class="layui-input" name="HMaterID" id="HMaterID" style="background-color:#efefef4d;width: 60%;display: inline-block;" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHMaterList" id="btnHMaterList" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Gy_MouldFileList.html
@@ -139,6 +139,10 @@
                get_FastQuery();
            });
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //#endregion
@@ -264,6 +268,14 @@
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //重置过滤条件
            function set_ClearQuery() {
                $("#HNumber").val("")
                $("#HName").val("");
                sWhere = "";
                get_Display(sWhere);
            }
            //新增
            function set_AddNew() {
                //页面层-自定义
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_Add_MouldMaintainPlanBillList.html
@@ -55,6 +55,16 @@
                                                    <input type="text" name="HInnerBillNo" id="HInnerBillNo" class="layui-input">
                                                </div>
                                            </div>
                                            <div class="layui-inline">
                                                <label class="layui-form-label">器具保养规程<label style="color:red"></label></label>
                                                <div class="layui-input-inline">
                                                    <input type="hidden" name="HEquipDotCheckRuleInterID" id="HEquipDotCheckRuleInterID" class="layui-input" value="0" style="float:left;width:150px;">
                                                    <input type="text" name="HEquipDotCheckRuleInterNo" id="HEquipDotCheckRuleInterNo" class="layui-input" value="" style="float:left;width:150px;background-color:#efefef4d;" readonly>
                                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="HEquipDotCheckRuleInterList" style="width:40px;">
                                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-inline">
@@ -105,16 +115,36 @@
                            </div>
                        </div>
                        <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                        <div class="layui-tab layui-tab-card" lay-filter="TabTest">
                            <ul class="layui-tab-title">
                                <li class="layui-this">保养项信息</li>
                                <li>配件信息</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
                                </div>
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                            </div>
                        </script>
                        <script type="text/html" id="toolbarDemo1">
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine1"><i class="layui-icon layui-icon-form"></i>增加一行</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine1"><i class="layui-icon layui-icon-form"></i>复制一行</button>
                            </div>
                        </script>
                        <script type="text/html" id="xuhao">
                            {{d.LAY_TABLE_INDEX+1}}
                        </script>
                        <script type="text/html" id="xuhao1">
                            {{d.LAY_TABLE_INDEX+1}}
                        </script>
                    </form>
@@ -125,6 +155,10 @@
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script type="text/html" id="barDemo1">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del1">删除</a>
    </script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
@@ -158,7 +192,8 @@
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            var option;
            var option = [];//保养
            var option1 = [];//配件
            var sBillType = "3818";
            //var TabRow = { "HMaterID": 0, "HUnitID": "0 ", "HQty": "0   ", "HQtyMust": "0", "HRemark": "  " };
            //#endregion
@@ -170,6 +205,7 @@
            //初始化表格
            set_InitGrid();
            set_InitGrid1();
            //判断操作类型
            if (OperationType == 1) {//无源单
@@ -197,7 +233,7 @@
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;;
                var AddRow = table.cache['mainTable'];
                var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "","HUnitName":"", "HQty": "0   ", "HQtyMust": "0", "HRemark": " " };
                var NewRow = { "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " };
                switch (obj.event) {
                    //新增一行
                    case 'btn-AddLine': btnAddLine(NewRow);
@@ -208,14 +244,582 @@
                }
            });
            // è¡Œå†…事件
            // å¤´å·¥å…·æ äº‹ä»¶
            table.on('toolbar(mainTable1)', function (obj) {
                var rowid = 0;
                var checkStatus = table.checkStatus('mainTable1')
                    , data = checkStatus.data;;
                var AddRow = table.cache['mainTable1'];
                var NewRow = { "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark": " " };
                switch (obj.event) {
                    //新增一行
                    case 'btn-AddLine1': btnAddLine1(NewRow);
                        break;
                    //复制一行
                    case 'btn-CopyLine1': btnCopyLine1(data);
                        break;
                }
            });
            //行内事件
            table.on('tool(mainTable)', function (obj) {
                set_GridDelete(obj);   //行内删除
                set_GridCellCheck(obj); //行内快捷键筛选
            });
            // è¡Œå†…事件
            table.on('tool(mainTable1)', function (obj) {
                set_GridDelete1(obj);   //行内删除
                set_GridCellCheck1(obj); //行内快捷键筛选
            });
            //表头信息器具保养规程
            form.on('submit(HEquipDotCheckRuleInterList)', function () {
                //页面层-自定义
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '器具保养规程列表',
                    closeBtn: 1,
                    shift: 2,
                    area: ['80%', '80%'],
                    maxmin: true,
                    content: ['../../模治具管理/模治具管理/Sc_MouldMaintainRuleBillList.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('请选择数据');
                        }
                        $("#HEquipDotCheckRuleInterNo").val(checkStatus.data[0].单据号);
                        $("#HEquipDotCheckRuleInterID").val(checkStatus.data[0].hmainid);
                        get_DocCheckItem2(checkStatus.data[0].hmainid);
                        layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) {
                        //按钮【按钮二】的回调
                        //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                    },
                    end: function () {
                    },
                    success: function (layero, index) {
                    }
                });
            });
            //新增
            form.on('submit(set_AddNew)', function (data) {
                $("#component-form-group")[0].reset();
                layui.form.render();
                set_AddFNew();
            });
            //保存
            form.on('submit(Saver)', function (data) {//保存
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sSubStr1 = JSON.stringify(table.cache['mainTable1']);
                var sMainSub = sMainStr + ';' + sSubStr1 + ";" + sessionStorage["HUserName"] + ";" + sSubStr;
                if (AllowLoadData(sSubStr1)) {
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "/Sc_MouldMaintainPlanBill/SaveGetMouldMaintainPlanBillList", //方法所在页面和方法名
                            async: true,
                            data: { "msg": sMainSub },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                    layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                        parent.layer.close(index); //再执行关闭
                                    });
                                }
                                else {
                                    layer.alert(data.Message, { icon: 5 });
                                    //console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                                }
                                layer.closeAll("loading");
                            },
                            error: function (err) {
                                layer.alert("错误:" + err, { icon: 5 });
                                //console.log("Reason" + sMainStr);
                            }
                        });
                }
            });
            //预览
            form.on("submit(view)", function (data) {
                window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainPlanBill&OpenTmp=器具保养计划条码");
            });
            //打印Printing
            form.on("submit(print)", function (data) {
                window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainPlanBill&OpenTmp=器具保养计划条码");
            });
            //退出
            form.on('submit(Exit)', function (data) {//
                if (linterid == undefined) {
                    //关闭页签
                    Pub_Close(2);
                }
                else {
                    //关闭页签
                    Pub_Close(1);
                }
            });
            //#endregion
            //初始化表单插件
            function set_InitFrom() {
                //常规用法
                laydate.render({
                    elem: '#HDate'
                });
                laydate.render({
                    elem: '#HBeginDate'
                });
                laydate.render({
                    elem: '#HEndDate'
                });
            }
            //初始化保养项列表
            function set_InitGrid() {
                //表头
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                    , { field: 'HMaintainItemID', title: '保养项目ID', edit: 'text', hide: true }
                    , { field: 'HMaintainItemNumber', title: '保养项目代码', edit: 'text', event: 'HMaintainItemNumber' }
                    , { field: 'HMaintainItem', title: '保养项目' }
                    , { field: 'HMaintainPart', title: '保养部位', edit: 'text' }
                    , { field: 'HClaim', title: '具体要求', edit: 'text' }
                    , { field: 'HManagerID', title: '负责人ID', edit: 'text', hide: true }
                    , { field: 'HManagerNumber', title: '负责人代码', edit: 'text', event: 'HManagerNumber' }
                    , { field: 'HManagerName', title: '负责人' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ];
                option = {
                    id: 'mainTable'
                    , elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: false
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns]
                    , done: function (res, curr, count) {
                    }
                };
            }
            //初始化表格
            function set_InitGrid1() {
                //表头
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao1', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                    , { field: 'HMaterID', title: '配件ID', edit: 'text', hide: true }
                    , { field: 'HMaterNumber', title: '配件代码', edit: 'text', event: "HMaterNumber", }
                    , { field: 'HUnitID', title: '单位ID', edit: 'text', event: "", hide: true }
                    , { field: 'HUnitNumber', title: '单位代码', edit: 'text', event: "HUnitNumber" }
                    , { field: 'HQty', title: '实际用量', edit: 'text' }
                    , { field: 'HQtyMust', title: '单位用量', edit: 'text' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 150 }
                ];
                option1 = {
                    id: 'mainTable1'
                    , elem: '#mainTable1'
                    , toolbar: '#toolbarDemo1'
                    , page: false
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns]
                    , done: function (res, curr, count) {
                    }
                };
            }
            //无源单新增
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark": "" }];
                table.render(option);
                table.render(option1);
            }
            //编辑
            function set_EditFromGrid() {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                table.render(option);
                option.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark": "" }];
                table.render(option);
            }
            //获取最大单据号及默认值赋值
            function get_MAXNum() {
                //获取最大单据号 new
                $("#HInterID").val("0");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3819' },
                    success: function (d) {
                        $("#HInterID").val(0);
                        $("#HPlanInterID").val(0);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                        $("#HBeginDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                        $("#HEndDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                    }
                });
            }
            //编辑获取表头
            function set_EditForm(linterid) {
                //查询检验方案单是否存在
                $.ajax({
                    url: GetWEBURL() + "Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListCheckDetai",
                    type: "GET",
                    data: {
                        "HID": linterid
                    },
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data.h_v_Sc_MouldMaintainPlanBillList[0];
                            form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HBillNo": data.单据号
                                , "HDate": data.日期
                                , "HInnerBillNo": data.内部单据号
                                , "HCycleUnit": data.周期单位
                                , "HCheckCycle": data.保养周期
                                , "HBeginDate": data.计划开始日期
                                , "HEndDate": data.计划结束日期
                                , "HExplanation": data.摘要
                                , "HRemark": data.备注
                                , "HEquipDotCheckRuleInterID": data.HEquipDotCheckRuleInterID
                                , "HEquipDotCheckRuleInterNo": data.器具保养规程
                            });
                        } else {
                            layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }, error: function () {
                        layer.alert("发生错误!", { icon: 5 });
                    }
                });
            }
            // ç¼–辑获取表头时时间格式矫正方式
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
                if (month.length < 2) month = '0' + month;
                if (day.length < 2) day = '0' + day;
                return [year, month, day].join('-');
            }
            // ç¼–辑获取表体
            function set_EditGrid(linterid) {
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (result) {
                        //console.log('gouba' + result);
                        if (result.count == 1) {
                            option.data = result.list[0];
                            table.render(option);
                            option1.data = result.list[1];
                            table.render(option1);
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index0);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //增加一行
            function btnAddLine(NewRow) {
                var tableBak = table.cache["mainTable"]; //获取之前编辑过的表格数据
                buttonArr = [];//清空数组
                for (var i = 0; i < tableBak.length; i++) {
                    buttonArr.push(tableBak[i]);  //将之前的数据存储
                }
                buttonArr.push(NewRow);  //在尾部加一行
                table.reload("mainTable", {
                    data: buttonArr    //将数据重新载入表格
                })
            }
            //增加一行
            function btnAddLine1(NewRow) {
                var tableBak = table.cache["mainTable1"]; //获取之前编辑过的表格数据
                buttonArr = [];//清空数组
                for (var i = 0; i < tableBak.length; i++) {
                    buttonArr.push(tableBak[i]);  //将之前的数据存储
                }
                buttonArr.push(NewRow);  //在尾部加一行
                table.reload("mainTable1", {
                    data: buttonArr    //将数据重新载入表格
                })
            }
            //复制一行
            function btnCopyLine(data) {
                var copydata = JSON.stringify(data);
                if (data.length <= 0) {
                    layer.msg("请选择需要复制的一行!");
                }
                else if (data.length > 1) {
                    layer.msg("只能选择复制一行!");
                }
                else {
                    var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                    var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                    table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                    option.data = table.cache["mainTable"];//将数据绑定到data上
                    table.render(option);//将数据渲染到表格上
                }
            }
            //复制一行
            function btnCopyLine1(data) {
                var copydata = JSON.stringify(data);
                if (data.length <= 0) {
                    layer.msg("请选择需要复制的一行!");
                }
                else if (data.length > 1) {
                    layer.msg("只能选择复制一行!");
                }
                else {
                    var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                    var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                    table.cache["mainTable1"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                    option1.data = table.cache["mainTable1"];//将数据绑定到data上
                    table.render(option1);//将数据渲染到表格上
                }
            }
            // è¡¨æ ¼è¡Œå†…事件删除
            function set_GridDelete(obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                    layer.confirm('真的删除行么', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            //obj.del();
                            //layer.close(index);
                            var oldData = table.cache["mainTable"];
                            oldData.splice(obj.tr.data('index'), 1);
                            table.reload('mainTable', { data: oldData });
                            layer.close(index);
                        }
                    });
                }
            }
            //表格行内事件删除
            function set_GridDelete1(obj) {
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del1') {
                    layer.confirm('真的删除行么', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            var oldData = table.cache["mainTable1"];
                            oldData.splice(obj.tr.data('index'), 1);
                            table.reload('mainTable1', { data: oldData });
                            layer.close(index);
                        }
                    });
                }
            };
            //表格行内事件快捷键筛选
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        if (obj.event === 'HMaintainItemNumber')  //保养项目信息
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '保养项目列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../PublicPage/Gy_Maintain.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({
                                        HMaintainItemID: checkStatus.data[0].HItemID,
                                        HMaintainItemNumber: checkStatus.data[0].HNumber,
                                        HMaintainItem: checkStatus.data[0].HName,
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }
                            });
                        }
                        if (obj.event === 'HManagerNumber')  //责任人信息
                        {
                            //页面层-自定义
                            layer.open({
                                type: 2,
                                skin: 'layui-layer-rim', //加上边框
                                title: '责任人列表',
                                closeBtn: 1,
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../PublicPage/UserInformation.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({
                                        HManagerID: checkStatus.data[0].HItemID,
                                        HManagerNumber: checkStatus.data[0].HNumber,
                                        HManagerName: checkStatus.data[0].HName
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
                                , btn2: function (index, layero) {
                                    //按钮【按钮二】的回调
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                }
                            });
                        }
                        obj.event = "";
                        return false;
                    }
                })
            }
            // ä¿å…»ä¿¡æ¯ é…ä»¶ä¿¡æ¯
            function get_DocCheckItem2(data) {
                $.ajax({
                    url: GetWEBURL() + "/Sc_MouldMaintainRuleBill/Sc_MouldMaintainRuleBillListProjectDetaiNew",
                    type: "GET",
                    async: false,
                    data: { "HInterID": data },
                    success: function (result) {
                        if (result != null) {
                            if (result.count == 1) {
                                var BYData = result.list[0];//保养
                                var PJData = result.list[1];//配件
                                var rowdate1 = layui.table.cache["mainTable"];
                                var rowdate2 = layui.table.cache["mainTable1"];
                                option.data = [{ "HMaintainItemID": 0, "HMaintainItemNumber": " ", "HMaintainItem": " ", "HMaintainPart": " ", "HClaim": " ", "HManagerID": "0 ", "HManagerNumber": " ", "HManagerName": " ", "HRemark": " " }];
                                option1.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark": "" }];
                                table.render(option);
                                table.render(option1);
                                if (BYData.length != 0)  //表体数据不为空时
                                {
                                    buttonArr = [];//清空数组
                                    for (var i = 0; i < BYData.length; i++) {
                                        var checkrow = {
                                            "HMaintainItemID": BYData[i].保养项目ID, "HMaintainItemNumber": BYData[i].保养项目代码, "HMaintainItem": BYData[i].保养项目,
                                            "HMaintainPart": BYData[i].保养部位, "HClaim": BYData[i].具体要求, "HManagerID": BYData[i].负责人ID, "HManagerNumber": BYData[i].负责人代码,
                                            "HManagerName": BYData[i].负责人名称, "HRemark": BYData[i].子备注2
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                }
                                if (PJData.length != 0)  //表体数据不为空时
                                {
                                    buttonArr = [];//清空数组
                                    for (var i = 0; i < PJData.length; i++) {
                                        var checkrow = {
                                            "HMaterID": PJData[i].配件ID, "HMaterNumber": PJData[i].配件代码, "HMaterName": PJData[i].配件名称,
                                            "HUnitID": PJData[i].单位ID, "HUnitNumber": PJData[i].计量单位代码,
                                            "HUnitName": PJData[i].计量单位名称, "HQty": PJData[i].用量, "HQtyMust": PJData[i].标准用量,
                                            "HRemark": PJData[i].子备注1
                                        };
                                        buttonArr.push(checkrow);  //将之前的数据存储
                                    }
                                    table.reload("mainTable1", {
                                        data: buttonArr    //将数据重新载入表格
                                    })
                                }
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }
                    }
                })
            }
            //表格行内事件快捷键筛选
            function set_GridCellCheck1(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    if (event.key == "F7") {
                        if (obj.event === 'HMaterNumber')  //配件代码
@@ -298,306 +902,35 @@
                })
            }
            //新增
            form.on('submit(set_AddNew)', function (data) {
                $("#component-form-group")[0].reset();
                layui.form.render();
                set_AddFNew();
            });
            //保存
            form.on('submit(Saver)', function (data) {//保存
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr + ";" +sessionStorage["HUserName"];
                if (AllowLoadData(sSubStr)) {
                    $.ajax(
                        {
                            type: "POST",
                            url: GetWEBURL() + "/Sc_MouldMaintainPlanBill/SaveGetMouldMaintainPlanBillList", //方法所在页面和方法名
                            async: true,
                            data: { "msg": sMainSub },
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                    layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                                        parent.layer.close(index); //再执行关闭
                                    });
                                }
                                else {
                                    layer.alert(data.Message, { icon: 5 });
                                    //console.log("Reason" + sMainStr + "sub:" + JSON.stringify(layui.table.cache.mainTable));
                                }
                                layer.closeAll("loading");
                            },
                            error: function (err) {
                                layer.alert("错误:" + err, { icon: 5 });
                                //console.log("Reason" + sMainStr);
                            }
                        });
                }
            });
            //预览
            form.on("submit(view)", function (data) {
                window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainPlanBill&OpenTmp=器具保养计划条码");
            });
            //打印Printing
            form.on("submit(print)", function (data) {
                window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + linterid + "&Type=HMouldMaintainPlanBill&OpenTmp=器具保养计划条码");
            });
            //退出
            form.on('submit(Exit)', function (data) {//
                if (linterid == undefined) {
                    //关闭页签
                    Pub_Close(2);
                }
                else {
                    //关闭页签
                    Pub_Close(1);
                }
            });
            //#endregion
            //初始化表单插件
            function set_InitFrom() {
                //常规用法
                laydate.render({
                    elem: '#HDate'
                });
                laydate.render({
                    elem: '#HBeginDate'
                });
                laydate.render({
                    elem: '#HEndDate'
                });
            }
            //初始化表格
            function set_InitGrid() {
                //表头
                columns = [
                    { type: 'checkbox', fixed: 'left' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                    , { field: 'HMaterID', title: '配件ID', edit: 'text', hide: true }
                    , { field: 'HMaterNumber', title: '配件代码', edit: 'text', event: "HMaterNumber", }
                    , { field: 'HUnitID', title: '单位ID', edit: 'text', event: "", hide: true}
                    , { field: 'HUnitNumber', title: '单位代码', edit: 'text', event: "HUnitNumber" }
                    , { field: 'HQty', title: '实际用量', edit: 'text' }
                    , { field: 'HQtyMust', title: '单位用量', edit: 'text' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150 }
                ];
                option = {
                    id: 'mainTable'
                    , elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: false
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns]
                    , done: function (res, curr, count) {
                    }
                };
            }
            //无源单新增
            function set_AddFNew() {
                //获取最大单据号
                get_MAXNum();
                option.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark":"" }];
                table.render(option);
            }
            //编辑
            function set_EditFromGrid() {
                set_EditForm(linterid);  //编辑获取表头
                set_EditGrid(linterid);  //编辑获取表体
                option.data = [{ "HMaterID": 0, "HMaterNumber": "", "HMaterName": "", "HUnitID": "0 ", "HUnitNumber": "", "HUnitName": "", "HQty": "0   ", "HQtyMust": "0", "HRemark":""}];
                table.render(option);
            }
            //获取最大单据号及默认值赋值
            function get_MAXNum() {
                //获取最大单据号 new
                $("#HInterID").val("0");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '3819' },
                    success: function (d) {
                        $("#HInterID").val(0);
                        $("#HPlanInterID").val(0);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                        $("#HBeginDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                        $("#HEndDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                    }
                });
            }
            //编辑获取表头
            function set_EditForm(linterid) {
                //查询检验方案单是否存在
                $.ajax({
                    url: GetWEBURL() + "Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListCheckDetai",
                    type: "GET",
                    data: {
                        "HID": linterid
                    },
                    success: function (result) {
                        if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            var data = result.data.h_v_Sc_MouldMaintainPlanBillList[0];
                            form.val("component-form-group", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                                "HBillNo": data.单据号
                                , "HDate": data.日期
                                , "HInnerBillNo": data.内部单据号
                                , "HCycleUnit": data.周期单位
                                , "HCheckCycle": data.保养周期
                                , "HBeginDate": data.计划开始日期
                                , "HEndDate": data.计划结束日期
                                , "HExplanation": data.摘要
                                , "HRemark": data.备注
                            });
                        } else {
                            layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }, error: function () {
                        layer.alert("发生错误!", { icon: 5 });
                    }
                });
            }
            // ç¼–辑获取表头时时间格式矫正方式
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
                if (month.length < 2) month = '0' + month;
                if (day.length < 2) day = '0' + day;
                return [year, month, day].join('-');
            }
            // ç¼–辑获取表体
            function set_EditGrid(linterid) {
                $("#HInterID").val(linterid);//修改时主表ID
                //编辑加载数据
                $.ajax({
                    url: GetWEBURL() + 'Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and HInterID=" + linterid },
                    success: function (result) {
                        //console.log('gouba' + result);
                        if (result.count == 1) {
                            option.data = result.data;
                            table.render(option);
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index0);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //增加一行
            function btnAddLine(NewRow) {
                var tableBak = table.cache["mainTable"]; //获取之前编辑过的表格数据
                buttonArr = [];//清空数组
                for (var i = 0; i < tableBak.length; i++) {
                    buttonArr.push(tableBak[i]);  //将之前的数据存储
                }
                buttonArr.push(NewRow);  //在尾部加一行
                table.reload("mainTable", {
                    data: buttonArr    //将数据重新载入表格
                })
            }
            //复制一行
            function btnCopyLine(data) {
                var copydata = JSON.stringify(data);
                if (data.length <= 0) {
                    layer.msg("请选择需要复制的一行!");
                }
                else if (data.length > 1) {
                    layer.msg("只能选择复制一行!");
                }
                else {
                    var copydata2 = copydata.substring(1, copydata.length);//去除首行字符'['
                    var copyrow = copydata2.substring(0, copydata2.length - 1);//去除末尾字符']'
                    table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                    option.data = table.cache["mainTable"];//将数据绑定到data上
                    table.render(option);//将数据渲染到表格上
                }
            }
            //表格行内事件删除
            function set_GridDelete(obj) {
                var data = obj.data;
                if (obj.event === 'del') {
                    layer.confirm('真的删除行么', function (index) {
                        var rowIndex = $(obj.tr).attr("data-index");
                        option.data = table.cache["mainTable"];//将数据绑定到data上
                        obj.del();
                        option.data.splice(rowIndex, 1);//删除缓存的行
                        table.reload('mainTable', option);
                        layer.close(index);
                    });
                }
            }
        });
        function AllowLoadData(sSubStr) {  //非空验证
            if ($("#HBillNo").val() == '') {
                layer.msg("错误的单据号", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if ($("#HInterID").val() == '') {
                layer.msg("错误的内码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (typeof (sSubStr) == "undefined") {
                layer.msg("没有物料明细记录", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (!typeof (sSubStr) == "undefined") {
                for (var i = 0; i <= sSubStr.length - 1; i++) {   //判断扫码数量不能为0
                    if (parseFloat(sSubStr[i].HQty) > 0) {
                        s = 1;
                    }
                }
                if (s == 0) {
                    layer.msg("产品入库记录未扫码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            function AllowLoadData(sSubStr) {  //非空验证
                if ($("#HBillNo").val() == '') {
                    layer.msg("错误的单据号", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
                if ($("#HInterID").val() == '') {
                    layer.msg("错误的内码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
                if (typeof (sSubStr) == "undefined") {
                    layer.msg("没有物料明细记录", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return false;
                }
                if (!typeof (sSubStr) == "undefined") {
                    for (var i = 0; i <= sSubStr.length - 1; i++) {   //判断扫码数量不能为0
                        if (parseFloat(sSubStr[i].HQty) > 0) {
                            s = 1;
                        }
                    }
                    if (s == 0) {
                        layer.msg("产品入库记录未扫码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return false;
                    }
                }
                else {
                    return true;
                }
            }
            else {
                return true;
            }
        }
        })
    </script>
</body>
</html>
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_MouldMaintainPlanBillList.html
@@ -29,15 +29,15 @@
                                    </div>
                                </div>
                                <!--<div class="layui-inline">
                                    <label class="layui-form-label">单据类型</label>
                                    <div class="layui-input-block">
                                        <select name="HBillType" id="HBillType">
                                            <option value="">所有</option>
                                            <option value="ZHXJ">下架找货单</option>
                                            <option value="ZHSJ">上架归还单</option>
                                        </select>
                                    </div>
                                </div>-->
                <label class="layui-form-label">单据类型</label>
                <div class="layui-input-block">
                    <select name="HBillType" id="HBillType">
                        <option value="">所有</option>
                        <option value="ZHXJ">下架找货单</option>
                        <option value="ZHSJ">上架归还单</option>
                    </select>
                </div>
            </div>-->
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
@@ -71,6 +71,20 @@
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <div class="layui-tab layui-tab-card">
                            <ul class="layui-tab-title">
                                <li class="layui-this">保养项信息</li>
                                <li>配件信息</li>
                            </ul>
                            <div class="layui-tab-content">
                                <div class="layui-tab-item layui-show">
                                    <table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
                                </div>
                                <div class="layui-tab-item">
                                    <table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
                                </div>
                            </div>
                        </div>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>预览</button>-->
@@ -80,10 +94,14 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Refresh"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                            </div>
                        </script>
                        <script type="text/html" id="xuhao">
                            {{d.LAY_TABLE_INDEX+1}}
                        </script>
                        <script type="text/html" id="xuhao1">
                            {{d.LAY_TABLE_INDEX+1}}
                        </script>
                    </form>
                </div>
@@ -114,9 +132,17 @@
            var sWhere = "";
            //公用变量
            var option = [];
            var option1 = [];
            var option2 = [];
            $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
            $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
            //初始化表格
            set_InitGrid();
            //初始化表格(子表1)
            set_InitGrid1();
            //初始化表格(子表2)
            set_InitGrid2();
            //加载数据到网格
            get_Display(sWhere);
@@ -163,12 +189,37 @@
                };
            });
            //点击主表带出从表数据
            table.on('row(mainTable)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
                var datas = obj.data; //获得当前行数据
                var linterid = datas.hmainid;
                $.ajax({
                    url: GetWEBURL() + 'Sc_MouldMaintainPlanBill/Sc_MouldMaintainPlanBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and hmainid=" + linterid },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option1.data = data1.list[0];
                            table.render(option1);
                            option2.data = data1.list[1];
                            table.render(option2);
                        } else {
                            layer.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口失效!", { icon: 5 });
                    }
                });
            });
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //重置过滤条件
            function set_ClearQuery() {
                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HNumber").val("");
                $("#HName").val("");
                $("#HBillNo").val("");//单据号
@@ -205,7 +256,7 @@
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , height: 450
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
@@ -237,7 +288,7 @@
                        , { field: '关闭类型', title: '关闭类型', width: 200 }
                        , { field: '表体备注', title: '表体备注', width: 200, hide: true }
                        , { field: '制单人', title: '制单人', width: 115, hide: true }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期 'yyyy-MM-dd')}}</div>"}
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期 ,'yyyy-MM-dd')}}</div>"}
                        , { field: '审核人', title: '审核人', width: 200 }
                        , { field: '审核日期', title: '审核日期', width: 200, hide: true, templet: "<div>{{d.审核日期 ==null ?'':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd')}}</div>"}
                        , { field: '修改人', title: '修改人', width: 200, hide: true }
@@ -255,6 +306,69 @@
                }
            }
            //初始化表格(子表1)
            function set_InitGrid1() {
                var ajaxLoad = layer.load();
                option1 = {
                    elem: '#mainTable1'
                    //, toolbar: '#toolbarDemo'
                    , height: '250'
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        //{ type: 'checkbox', fixed: 'left' }
                        , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left' }
                        , { field: 'HMaintainItemID', title: '保养项目ID', width: 200, hide: true }
                        , { field: 'HMaintainItemNumber', title: '保养项目代码', width: 200 }
                        , { field: 'HMaintainItem', title: '保养项目', width: 200 }
                        , { field: 'HMaintainPart', title: '保养部位', width: 200 }
                        , { field: 'HClaim', title: '具体要求', width: 200 }
                        , { field: 'HManagerID', title: '负责人ID', width: 200, hide: true }
                        , { field: 'HManagerNumber', title: '负责人代码', width: 200 }
                        , { field: 'HManagerName', title: '负责人', width: 200 }
                        , { field: 'HRemark', title: '备注', width: 200 }
                    ]]
                };
                option1.data = [];
                table.render(option1);
                layer.close(ajaxLoad);
            }
            //初始化表格(子表2)
            function set_InitGrid2() {
                var ajaxLoad = layer.load();
                option2 = {
                    elem: '#mainTable2'
                    //, toolbar: '#toolbarDemo'
                    , height: '250'
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        //{ type: 'checkbox', fixed: 'left' }
                        , { templet: '#xuhao1', title: '序号', sort: true, fixed: 'left'}
                        , { field: 'HMaterID', title: '配件ID', width: 200, hide: true }
                        , { field: 'HMaterNumber', title: '配件代码', width: 200 }
                        , { field: 'HMaterName', title: '配件名称', width: 200 }
                        , { field: 'HMaterSpec', title: '规格型号', width: 200, hide: true }
                        , { field: 'HUnitID', title: '单位ID', width: 200, hide: true }
                        , { field: 'HUnitNumber', title: '单位代码', width: 200 }
                        , { field: 'HUnitName', title: '单位名称', width: 200 }
                        , { field: 'HManagerID', title: '负责人ID', width: 200, hide: true }
                        , { field: 'HManagerNumber', title: '负责人代码', width: 200 }
                        , { field: 'HManagerName', title: '负责人', width: 200 }
                        , { field: 'HQty', title: '实际用量', width: 200 }
                        , { field: 'HQtyMust', title: '标准用量', width: 200 }
                        , { field: 'HRemark', title: '备注', width: 200 }
                    ]]
                };
                option2.data = [];
                table.render(option2);
                layer.close(ajaxLoad);
            }
            //新增
            function set_AddNew() {
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_MouldMaintainRuleBillList.html
@@ -252,6 +252,8 @@
            //#region æ­¤é¡µé¢æ‰€æœ‰æ–¹æ³•
            function set_ClearBill() {
                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化表格(主表)
                set_InitGrid();
                //初始化表格(子表1)
@@ -610,7 +612,7 @@
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + BenginHCreateDate + "'";
                }
                if (EndHCreateDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + EndHCreateDate + "'";
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + EndHCreateDate + "'";
                }
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
@@ -621,8 +623,8 @@
                $("#HBillNo").val("");//单据号
                $("#HSourceBillNo").val("");//源单号
                $("#HCreateBy").val("");//制单人
                $("#BenginHCreateDate").val("");//开始制单时间
                $("#EndHCreateDate").val("");//结束制单时间
                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#btnSearch").click();
                $("#ColContent").val("");
                $("#ColName").val("0");
WebTM/views/Éú²ú¹ÜÀí/ÒªÁϼƻ®/JIT_NeedMaterPlanBillEdit.html
@@ -273,30 +273,7 @@
            //    }, function () { window.location.href = "../../user/login.html"; });
            //}
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  æ·»åŠ  ä¿å­˜
            var linterid = params[params[1]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            //判断是否新增
            if (linterid == null || linterid == -1) {
                OperationType = 1;
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '4609' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid);
                //RoadBillSub(linterid);
            }
            var HModName = "JIT_NeedMaterPlanBill";
            var option = {
                elem: '#mainTable'
@@ -346,10 +323,35 @@
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ]]
            }
            //初始加载表格
            option.data = rowdata;
            DisPlay_HideColumn();
            var params = getUrlVars();
            var OperationType = params[params[0]]; //从参数中获取 æ•°æ®ç±»åž‹  æ·»åŠ  ä¿å­˜
            var linterid = params[params[1]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            //判断是否新增
            if (linterid == null || linterid == -1) {
                OperationType = 1;
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '4609' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                    }
                });
            }
            else {//如果修改则走下面 new
                RoadBillMain(linterid);
                //RoadBillSub(linterid);
            }
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
@@ -871,6 +873,7 @@
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    async: false,
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.data.length != 0) {
@@ -956,6 +959,7 @@
                $.ajax({
                    url: GetWEBURL() + "/Sc_WorkDemandPlanBill/Sc_WorkDemandPlanBillList",
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (d) {
WebTM/views/¼Æ»®¹ÜÀí/¹¤ÒÕ·Ïß/Gy_RoutingBill.html
@@ -550,6 +550,8 @@
            //初始加载表格
            option.data = rowdata;
            table.render(option);
            //初始化表格
            DisPlay_HideColumn();
            //制单人
            $("#HMaker").val(sessionStorage["HUserName"]);
@@ -608,8 +610,7 @@
                //RoadBillSub(linterid);
            }
            //初始化表格
            DisPlay_HideColumn();
            //#endregion
@@ -1587,6 +1588,7 @@
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    async: false,
                    success: function (data1) {
                        if (data1.data.length != 0) {
WebTM/views/É豸¹ÜÀí/Sb_EquipMaintainPlanBillEdit.html
@@ -166,6 +166,9 @@
    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script type="text/html" id="barDemo1">
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del1">删除</a>
    </script>
    <script src="../../layuiadmin/layui/layui.js"></script>
    <script src="../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
@@ -414,12 +417,12 @@
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                    , { field: 'HMaintainItemID', title: '保养项目ID', edit: 'text', hide: true }
                    , { field: 'HMaintainItemNumber', title: '保养项目代码', edit: 'text', event: 'HMaintainItemNumber' }
                    , { field: 'HMaintainItem', title: '保养项目', edit: 'text' }
                    , { field: 'HMaintainItem', title: '保养项目' }
                    , { field: 'HMaintainPart', title: '保养部位', edit: 'text' }
                    , { field: 'HClaim', title: '具体要求', edit: 'text' }
                    , { field: 'HManagerID', title: '负责人ID', edit: 'text', hide: true }
                    , { field: 'HManagerNumber', title: '负责人代码', edit: 'text', event: 'HManagerNumber' }
                    , { field: 'HManagerName', title: '负责人', edit: 'text' }
                    , { field: 'HManagerName', title: '负责人' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo' }
                ];
@@ -453,7 +456,7 @@
                    , { field: 'HManagerName', title: '负责人', edit: 'text' }
                    , { field: 'HQty', title: '用量', edit: 'text' }
                    , { field: 'HRemark', title: '备注', edit: 'text' }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo', width: 150 }
                    , { fixed: 'right', title: '操作', toolbar: '#barDemo1', width: 150 }
                ];
                option1 = {
                    id: 'mainTable1'
@@ -646,8 +649,6 @@
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            //obj.del();
                            //layer.close(index);
                            var oldData = table.cache["mainTable"];
                            oldData.splice(obj.tr.data('index'), 1);
                            table.reload('mainTable', { data: oldData });
@@ -660,14 +661,12 @@
            function set_GridDelete1(obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                if (obj.event === 'del') {
                if (obj.event === 'del1') {
                    layer.confirm('真的删除行么', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            //obj.del();
                            //layer.close(index);
                            var oldData = table.cache["mainTable1"];
                            oldData.splice(obj.tr.data('index'), 1);
                            table.reload('mainTable1', { data: oldData });
WebTM/views/³µ¼ä¹ÜÀí/¹¤Ðò³öÕ¾»ã±¨µ¥/Cj_StationOutBill.html
@@ -1190,7 +1190,7 @@
                $.ajax({
                    type: "POST",
                    url: GetWEBURL() + "/Cj_StationOutBill/AddBill",
                    async: true,
                    async: false,
                    data: { "oMain": oMain },
                    dataType: "json",
                    success: function (data) {
@@ -1642,7 +1642,7 @@
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Sc_ProcessMangement/SaveICMOReportBill", //方法所在页面和方法名
                    async: true,
                    async: false,
                    data: { "InterID": InterID, "user": sessionStorage["HUserName"], "BillNo": BillNo, "OrganizationID": sessionStorage["OrganizationID"] },
                    dataType: "json",
                    success: function (data) {
@@ -1669,7 +1669,7 @@
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Sc_ProcessMangement/SaveProcdutInBill", //方法所在页面和方法名
                    async: true,
                    async: false,
                    data: { "BillNo": BillNo },
                    dataType: "json",
                    success: function (data) {
@@ -1695,7 +1695,7 @@
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/Sc_ProcessMangement/SaveBFBill", //方法所在页面和方法名
                    async: true,
                    async: false,
                    data: { "BillNo": BillNo },
                    dataType: "json",
                    success: function (data) {