YL
2021-08-23 ea073d4c7cf10befc599193ee0acfd8ea552229c
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_MouldMaintainBillList.html
@@ -75,7 +75,22 @@
                                </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-getCheckData"><i class="layui-icon layui-icon-tips"></i>预览</button>-->
@@ -90,6 +105,12 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></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>
@@ -119,6 +140,8 @@
            //查询条件
            var sWhere = "";
            var option = [];
            var option1 = [];
            var option2 = [];
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
@@ -148,6 +171,35 @@
                };
            });
            //点击主表带出从表数据
            table.on('row(mainTable)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
                //var flag = !obj.tr.find(':checkbox:first').prop('checked');
                //obj.tr.find(':checkbox').prop('checked', flag);
                //if (flag) {
                //    obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked');
                //    obj.tr.next().find('.layui-form-checkbox').removeClass('layui-form-checked');
                //}
                var datas = obj.data; //获得当前行数据
                var linterid = datas.hmainid;
                $.ajax({
                    url: GetWEBURL() + 'Sc_MouldMaintainBill/Sc_MouldMaintainBillListProjectDetaiNew',
                    type: "GET",
                    data: { "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(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.alert("接口失效!", { icon: 5 });
                    }
                });
            });
            // æŸ¥è¯¢æŒ‰é’®
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery();
@@ -160,28 +212,32 @@
         //#endregion
            //#region å½“前页面加载所有方法
            // åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
         //#region å½“前页面加载所有方法
         // åˆå§‹åŒ–界面
         function set_ClearBill() {
                //初始化表格(主表)
                set_InitGrid();
                //初始化表格(子表)
                set_InitGrid1();
                //初始化表格(子表)
                set_InitGrid2();
                //查询
                get_Display(sWhere);
            }
            //初始化表格
            //初始化表格(主)
            function set_InitGrid() {
                 option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , height: '400'
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '日期', title: '日期', width: 160 }
                        , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>"}
                        , { field: '单据号', title: '单据号', width: 160 }
                        , { field: '单据类型', title: '单据类型', width: 160, hide: true }
                        , { field: '保养计划编号', title: '保养计划编号', width: 200 }
@@ -189,44 +245,85 @@
                        , { field: 'HMouldID', title: 'HMouldID', width: 200, hide: true }
                        , { field: '产品模具代码', title: '产品模具代码', width: 200 }
                        , { field: '产品模具', title: '产品模具', width: 200 }
                        , { field: '保养开始日期', title: '保养开始日期', width: 200 }
                        , { field: '保养结束日期', title: '保养结束日期', width: 200 }
                        , { 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 }
                        , { field: '备注', title: '备注', width: 200 }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: 'hmaterid', title: 'hmaterid', width: 115, hide: true }
                        , { field: '配件代码', title: '配件代码', width: 200 }
                        , { field: '配件名称', title: '配件名称', width: 200 }
                        , { field: 'hunitid', title: 'hunitid', width: 200, hide: true }
                        , { field: '单位代码', title: '单位代码', width: 200 }
                        , { field: '单位名称', title: '单位名称', width: 200 }
                        , { field: '实际用量', title: '实际用量', width: 115 }
                        , { field: '标准用量', title: '标准用量', width: 200 }
                        , { field: 'HManagerID', title: 'HManagerID', width: 200, hide: true }
                        , { field: '负责人代码', title: '负责人代码', width: 200 }
                        , { field: '负责人', title: '负责人', width: 200 }
                        , { field: '关联数量', title: '关联数量', width: 200 }
                        , { field: '行关闭人', title: '行关闭人', width: 115, hide: true }
                        , { field: '关闭类型', title: '关闭类型', width: 200 }
                        , { 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 }
                        , { 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 }
                        , { field: '修改日期', title: '修改日期', width: 115, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 200 }
                        , { field: '关闭日期', title: '关闭日期', width: 200 }
                        , { field: '作废人', title: '作废人', width: 200, hide: true }
                        , { field: '作废日期', title: '作废日期', width: 115, hide: true }
                        , { 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: '关闭日期', 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>" }
                    ]]
                };
                table.render(option);
            }
            //初始化表格(子表)
            function set_InitGrid1()
            {
                var ajaxLoad = layer.load();
                option1 = {
                    elem: '#mainTable1'
                    //, toolbar: '#toolbarDemo'
                    , height: '350'
                    , page: true
                    , cellMinWidth: 90
                    , cols: [[
                        //{ type: 'checkbox', fixed: 'left' }
                        , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
                        , { 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);
            }
            //初始化表格(子表)
            function set_InitGrid2() {
                var ajaxLoad = layer.load();
                option2 = {
                    elem: '#mainTable2'
                    //, toolbar: '#toolbarDemo'
                    , height: '350'
                    , page: true
                    , cellMinWidth: 90
                    , 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: 'HMaterSpec', 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: 'HManagerID', title: '负责人ID', width: 200, hide: true }
                        , { field: 'HManagerNumber', title: '负责人代码', width: 200}
                        , { field: 'HManagerName', title: '负责人', width: 200 }
                        , { field: 'HRemark', title: '备注', width: 200 }
                    ]]
                };
                option2.data = [];
                table.render(option2);
                layer.close(ajaxLoad);
            }
            //查询