yangle
2022-12-22 bbf86ad94b7fca578df846de4b8849cdf3463775
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_MouldDotCheckPlanBillList.html
@@ -58,16 +58,30 @@
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <!--<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>-->
                                <!--<div class="layui-colla-content">
        <div class="layui-inline">
            <div class="layui-inline">
                <span>其他条件></span>
            </div>
        </div>
                <div class="layui-inline">
                    <div class="layui-inline">
                        <span>其他条件></span>
                    </div>
                </div>
    </div>-->
            </div>-->
                            </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-Add"><i class="layui-icon layui-icon-add-1"></i>新增</button>
@@ -79,6 +93,12 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></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>
@@ -110,8 +130,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);
            //头工具栏事件
@@ -196,20 +225,45 @@
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //点击主表带出从表数据
            table.on('row(mainTable)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
                var datas = obj.data; //获得当前行数据
                var linterid = datas.hmainid;
                $.ajax({
                    url: GetWEBURL() + '/Sc_MouldDotCheckPlanBill/Sc_MouldDotCheckPlanBillListProjectDetai',
                    type: "GET",
                    data: { "sqlWhere": "and HInterID=" + 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("获取失败", { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口失效!", { icon: 5 });
                    }
                });
            });
            //重置过滤条件
            function set_ClearQuery() {
                $("#HNumber").val("");
                $("#HName").val("");
                $("#BenginHCreateDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#EndHCreateDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HBillNo").val("");
                $("#PartModul").val("");
                sWhere = "";
                get_Display(sWhere);
            }
            function set_InitGrid() {
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , height: 450
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
@@ -231,7 +285,7 @@
                        , { field: '内部单据号', title: '内部单据号', width: 200 }
                        , { field: '备注', title: '备注', width: 200 }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: '点检项目', title: '点检项目', width: 115, hide: true }
                        , { field: '点检项目', title: '点检项目', width: 115 }
                        , { field: '点检部位', title: '点检部位', width: 200 }
                        , { field: '具体要求', title: '具体要求', width: 200 }
                        , { field: 'HManagerID', title: 'HManagerID', width: 200, hide: true }
@@ -240,28 +294,90 @@
                        , { field: '关联数量', title: '关联数量', width: 115 }
                        , { field: '行关闭人', title: '行关闭人', width: 200 }
                        , { field: '关闭类型', title: '关闭类型', width: 200, hide: true }
                        , { field: '表体备注', title: '表体备注', width: 200, hide: true }
                        , { field: '制单人', title: '制单人', width: 115, hide: true }
                        , { field: '表体备注', title: '表体备注', width: 200 }
                        , { field: '制单人', title: '制单人', width: 115 }
                        , { 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 }
                        , { field: '修改日期', title: '修改日期', width: 115, hide: true, 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: 115, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 200 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 200, hide: true }
                        , { field: '作废人', title: '作废人', width: 200 }
                        , { field: '作废日期', title: '作废日期', width: 115, hide: true, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd')}}</div>"}
                        , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
                        , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
                        , { field: '源单单号', title: '源单单号', width: 200 }
                        , { field: '源单类型', title: '源单类型', width: 200 }
                        , { field: 'hbilltype', title: 'hbilltype', width: 200 }
                        , { field: 'hbilltype', title: 'hbilltype', width: 200, hide: true }
                    ]]
                };
            }
            var index = layer.load(0);
            //初始化表格(子表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]
                    , loading: false
                    , cols: [[
                        //{ type: 'checkbox', fixed: 'left' }
                        , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left' }
                        , { field: 'HDotCheckItemID', title: '点检项目ID', width: 200, hide: true }
                        , { field: 'HDotCheckItem', title: '点检项目', width: 200 }
                        , { field: 'HDotCheckPart', 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]
                    , loading: false
                    , cols: [[
                        //{ type: 'checkbox', fixed: 'left' }
                        , { templet: '#xuhao1', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                        , { field: 'HMaterID', title: '配件ID', width: 200, hide: true }
                        , { field: 'HMaterNumber', title: '配件代码', width: 200 }
                        , { field: 'HMaterName', title: '配件名称', width: 200 }
                        , { field: 'HUnitID', title: '单位ID', width: 200, hide: true }
                        , { field: 'HUnitNumber', title: '计量单位代码', width: 200 }
                        , { field: 'HUnitName', 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 get_Display(sWhere) {
                var index = layer.load(0);
                $.ajax({
                    url: GetWEBURL() + '/Sc_MouldDotCheckPlanBill/GetMouldDotCheckPlanBillList',
                    type: "GET",