WebTM/views/É豸¹ÜÀí/Sb_EquipMaintainPlanBillList.html
@@ -9,7 +9,8 @@
    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
    <script src="../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/HideButton.js"></script>
    <script src="../../layuiadmin/HideButton.js"></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
@@ -100,6 +101,10 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete" id="Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view" id="view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print" id="print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_CheckBill" id="CheckBill"><i class="layui-icon layui-icon-form"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AbandonCheck" id="AbandonCheck"><i class="layui-icon layui-icon-form"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_CloseBill" id="set_CloseBill"><i class="layui-icon layui-icon-form"></i>关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_CancelCloseBill" id="set_CancelCloseBill"><i class="layui-icon layui-icon-form"></i>反关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh" id="Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>按钮设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit" id="Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
@@ -129,7 +134,7 @@
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
            //#region å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
@@ -142,6 +147,7 @@
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
                , soulTable = layui.soulTable
            //查询条件
            var sWhere = "";
            var option = [];
@@ -191,7 +197,18 @@
                        var HBillType = "3902";
                        get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        break;
                    //审核
                    case 'set_CheckBill': set_CheckBill(1);
                        break;
                    //反审核
                    case 'set_AbandonCheck': set_CheckBill(2);
                        break;
                    //关闭
                    case 'set_CloseBill': set_CloseBill(1);
                        break;
                    //反关闭
                    case 'set_CancelCloseBill': set_CloseBill(2);
                        break;
                    //退出
                    case 'get_Exit':
                        Pub_Close(2);
@@ -258,37 +275,40 @@
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , done: function (res, curr, count) {
                        soulTable.render(this);
                    }
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: 'hmainid', hide: true }
                        , { 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: 'HEquipID', title: '设备ID', width: 160, hide: true }
                        , { 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: '内部单据号', title: '内部单据号', width: 200 }
                        , { 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, 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: 'hmainid', title: 'hmainid', hide: true, sort: true }
                        , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '单据号', title: '单据号', width: 160, sort: true }
                        , { field: '单据类型', title: '单据类型', width: 160, hide: true, sort: true }
                        , { field: 'HEquipID', title: '设备ID', width: 160, hide: true, sort: true }
                        , { field: '设备代码', title: '设备代码', width: 200, sort: true }
                        , { field: '设备名称', title: '设备名称', width: 200, sort: true }
                        , { field: '开始日期', title: '开始日期', width: 200, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '结束日期', title: '结束日期', width: 200, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '周期单位', title: '周期单位', width: 200, sort: true }
                        , { field: '保养周期', title: '保养周期', width: 200, sort: true }
                        , { field: '摘要', title: '摘要', width: 200, sort: true }
                        , { field: '内部单据号', title: '内部单据号', width: 200, sort: true }
                        , { field: '备注', title: '备注', width: 200, sort: true }
                        , { field: '制单人', title: '制单人', width: 115, sort: true }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '审核人', title: '审核人', width: 200, sort: true }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '修改人', title: '修改人', width: 200, sort: true }
                        , { field: '修改日期', title: '修改日期', width: 115, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '关闭人', title: '关闭人', width: 200, sort: true }
                        , { field: '关闭日期', title: '关闭日期', width: 200, sort: true }
                        , { field: '作废人', title: '作废人', width: 200, hide: true, sort: true }
                        , { field: '作废日期', title: '作废日期', width: 115, hide: true, sort: true }
                        , { field: '源单主内码', title: '源单主内码', width: 200, hide: true, sort: true }
                        , { field: '源单子内码', title: '源单子内码', width: 200, hide: true, sort: true }
                        , { field: '源单单号', title: '源单单号', width: 200, sort: true }
                        , { field: '源单类型', title: '源单类型', width: 200, sort: true }
                        , { field: 'hbilltype', title: 'hbilltype', width: 200, sort: true }
                    ]]
                }
            }
@@ -474,6 +494,73 @@
                    layer.msg('请选择一行数据编辑!');
                }
            }
            //审核/反审核
            function set_CheckBill(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (data.length == 1) {
                    layer.confirm("确认要审核吗?", function (index) {
                        var wait = layer.load();
                        var HInterID = data[0].hmainid;
                        $.ajax({
                            url: GetWEBURL() + '/Sb_EquipMaintainPlanBill/CheckSb_EquipMaintainPlanBill',
                            type: "GET",
                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.count == 1) {
                                    get_FastQuery();
                                    layer.msg(result.Message, { icon: 1 });
                                    layer.close(wait);
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                    layer.close(wait);
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                                layer.close(wait);
                            }
                        });
                    })
                } else {
                    layer.msg("请选择一条数据!");
                }
            }
            //关闭/反关闭
            function set_CloseBill(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (data.length == 1) {
                    layer.confirm("确认要关闭吗?", function (index) {
                        var wait = layer.load();
                        var HInterID = data[0].hmainid;
                        $.ajax({
                            url: GetWEBURL() + '/Sb_EquipMaintainPlanBill/CloseSb_EquipMaintainPlanBill',
                            type: "GET",
                            data: { "HInterID": HInterID, "Type": num, "user": sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { icon: 1 });
                                    layer.close(wait);
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                    layer.close(wait);
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                                layer.close(wait);
                            }
                        });
                    })
                }
                else {
                    layer.msg("请选择一条数据!");
                }
            }
            //预览
            function get_ViewReport() {
                var checkStatus = table.checkStatus('mainTable')