zzr99
2022-07-28 e570b232bc6b7aa8c46c73f87caa1cb89f90dcff
WebTM/views/É豸¹ÜÀí/Sb_EquipMaintainPlanBillList.html
@@ -97,6 +97,10 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-add-1"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-edit"></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-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <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="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                            </div>
                        </script>
@@ -116,6 +120,8 @@
    <script src="../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../layuiadmin/PubCustom.js"></script>
    <script src="../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script>
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
@@ -160,17 +166,36 @@
                    case 'btn-Edit':
                        set_ShowBill();
                        break;
                    //删除
                    case 'btn-Delete':
                        set_DeleteBill();
                        break;
                    //浏览
                    case 'btn-view':
                        get_ViewReport();
                        break;
                    //打印
                    case 'btn-print':
                        get_PrintReport();
                        break;
                    //刷新
                    case 'get_Refresh':
                        set_Refresh();
                        break;
                    //退出
                    case 'get_Exit':
                        Pub_Close(2);
                        break;
                };
            });
            //点击主表带出从表数据
            table.on('row(mainTable)', function (obj) { //注:tool æ˜¯å·¥å…·æ¡äº‹ä»¶åï¼Œtest æ˜¯ table åŽŸå§‹å®¹å™¨çš„å±žæ€§ lay-filter="对应的值"
                var datas = obj.data; //获得当前行数据
                var linterid = datas.hmainid;
                $.ajax({
                    url: GetWEBURL() + 'Sb_EquipMaintainPlanBill/Sb_EquipMaintainBillListProjectDetaiNew',
                    url: GetWEBURL() + 'Sb_EquipMaintainPlanBill/Sb_EquipMaintainPlanBillListProjectDetaiNew',
                    type: "GET",
                    data: { "HInterID": linterid },
                    success: function (data1) {
@@ -219,6 +244,8 @@
                    , height: '400'
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: 'hmainid', hide: true }
@@ -262,6 +289,8 @@
                    , height: '350'
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        //{ type: 'checkbox', fixed: 'left' }
                        , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe" }
@@ -289,21 +318,23 @@
                    , height: '350'
                    , page: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , 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: '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: 'HQty', title: '实际用量', width: 200 }
                        , { field: 'HQtyMust', title: '标准用量', width: 200 }
                        , { field: 'HManagerID', title: '负责人ID', width: 200, hide: true }
                        , { 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 }
                    ]]
                };
@@ -319,15 +350,17 @@
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL() + '/Sb_EquipMaintainPlanBill/GetEquipMaintainPlanBillList',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                        } else {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                            layer.alert("暂无数据", { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
@@ -369,7 +402,7 @@
                        $.ajax({
                            type: "GET",
                            url: GetWEBURL() + "/Sb_EquipMaintainPlanBill/DeltetEquipMaintainPlanBillList", //方法所在页面和方法名
                            data: { "HInterID": HInterID },
                            data: { "HInterID": HInterID, "user": sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
@@ -423,6 +456,36 @@
                    layer.msg('请选择一行数据编辑!');
                }
            }
            //预览
            function get_ViewReport() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + InterID + "&Type=HEquipMaintainPlanBill&OpenTmp=设备保养计划条码");
                }
                else {
                    layer.msg('请选择一行数据打印!');
                }
            }
            //打印
            function get_PrintReport() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + InterID + "&Type=HEquipMaintainPlanBill&OpenTmp=设备保养计划条码");
                }
                else {
                    layer.msg('请选择一行数据打印!');
                }
            }
            //刷新
            function set_Refresh() {
                $("#btnSearch").click();
            }
            //快速过滤
            function get_FastQuery(table, option) {
                //var HBillType = $("#HBillType").val();//单据类型
@@ -456,7 +519,6 @@
                sWhere = "";
                $("#btnSearch").click();
            }
            //#endregion