duhe
2023-11-09 a8effe0ef3122ea93521cd2c65fdac2aa73bb0a1
WebTM/views/É豸¹ÜÀí/Sb_EqpRepairCheckBillList.html
@@ -9,7 +9,9 @@
    <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;
@@ -90,6 +92,10 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add" id="Add"><i class="layui-icon layui-icon-add-1"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit" id="Edit"><i class="layui-icon layui-icon-edit"></i>编辑</button>
                                <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="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="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>
@@ -111,7 +117,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.$
@@ -123,6 +129,8 @@
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
                , soulTable = layui.soulTable
            //查询条件
            var sWhere = "";
            var option = [];
@@ -161,6 +169,18 @@
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        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;
                };
            });
@@ -194,50 +214,53 @@
                    , 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: '单据ID', 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: 'HEquipID', width: 200, hide: true }
                        , { field: '设备代码', title: '设备代码', width: 200 }
                        , { field: '设备名称', title: '设备名称', width: 200 }
                        , { field: 'HEmpID', title: 'HEmpID', width: 200, hide: true }
                        , { field: '验收人代码', title: '验收人代码', width: 200 }
                        , { field: '验收人', title: '验收人', width: 200 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '维修部门代码', title: '维修部门代码', width: 115 }
                        , { field: '维修部门名称', title: '维修部门名称', width: 200 }
                        , { field: 'HManagerID', title: 'HManagerID', width: 115, hide: true }
                        , { field: '负责人代码', title: '负责人代码', width: 115 }
                        , { field: '负责人', title: '负责人', width: 200 }
                        , { field: '发生日期', title: '发生日期', width: 160, templet: "<div>{{d.发生日期 ==null ?'':layui.util.toDateString(d.发生日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '表头备注', title: '表头备注', width: 200 }
                        , { field: '内部单据号', title: '内部单据号', width: 115 }
                        , { field: '制单人', title: '制单人', width: 200 }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '审核人', title: '审核人', width: 200 }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 200 }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 200 }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '作废人', title: '作废人', width: 200 }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: 'HRepairCheckID1', title: 'HRepairCheckID1', width: 115, hide: true }
                        , { field: '表体负责人代码', title: '表体负责人代码', width: 200 }
                        , { field: '表体负责人', title: '表体负责人', width: 200 }
                        , { field: '行关闭人', title: '行关闭人', width: 200 }
                        , { field: '关闭类型', title: '关闭类型', width: 200 }
                        , { field: '表体备注', title: '表体备注', width: 200 }
                        , { field: '源单主内码', title: '源单主内码', width: 200, hide: true }
                        , { field: '源单子内码', title: '源单子内码', width: 200, hide: true }
                        , { field: '源单单号', title: '源单单号', width: 200 }
                        , { field: '源单类型', title: '源单类型', width: 200 }
                        , { field: '关联数量', title: '关联数量', width: 200 }
                        , { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
                        , { field: 'hmainid', title: '单据ID', 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: 'HEquipID', width: 200, hide: true, sort: true }
                        , { field: '设备代码', title: '设备代码', width: 200, sort: true }
                        , { field: '设备名称', title: '设备名称', width: 200, sort: true }
                        , { field: 'HEmpID', title: 'HEmpID', width: 200, hide: true, sort: true }
                        , { field: '验收人代码', title: '验收人代码', width: 200, sort: true }
                        , { field: '验收人', title: '验收人', width: 200, sort: true }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true, sort: true }
                        , { field: '维修部门代码', title: '维修部门代码', width: 115, sort: true }
                        , { field: '维修部门名称', title: '维修部门名称', width: 200, sort: true }
                        , { field: 'HManagerID', title: 'HManagerID', width: 115, hide: true, sort: true }
                        , { field: '负责人代码', title: '负责人代码', width: 115, sort: true }
                        , { field: '负责人', title: '负责人', width: 200, sort: true }
                        , { field: '发生日期', title: '发生日期', width: 160, templet: "<div>{{d.发生日期 ==null ?'':layui.util.toDateString(d.发生日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '表头备注', title: '表头备注', width: 200, sort: true }
                        , { field: '内部单据号', title: '内部单据号', width: 115, sort: true }
                        , { field: '制单人', title: '制单人', width: 200, sort: true }
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '审核人', title: '审核人', width: 200, sort: true }
                        , { field: '审核日期', title: '审核日期', width: 200, templet: "<div>{{d.审核日期 ==null ? '':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '修改人', title: '修改人', width: 200, sort: true }
                        , { field: '修改日期', title: '修改日期', width: 200, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '关闭人', title: '关闭人', width: 200, sort: true }
                        , { field: '关闭日期', title: '关闭日期', width: 200, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '作废人', title: '作废人', width: 200, sort: true }
                        , { field: '作废日期', title: '作废日期', width: 200, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: 'hsubid', title: 'hsubid', width: 200, hide: true, sort: true }
                        , { field: 'HRepairCheckID1', title: 'HRepairCheckID1', width: 115, hide: true, 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: 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: '关联数量', title: '关联数量', width: 200, sort: true }
                        , { field: 'HBillType', title: 'HBillType', width: 200, hide: true, sort: true }
                    ]]
                }
@@ -393,6 +416,73 @@
                sWhere = "";
                $("#btnSearch").click();
            }
            //审核/反审核
            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_EquipRepairCheckBill/CheckSb_EquipRepairCheckBill',
                            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_EquipRepairCheckBill/CloseSb_EquipRepairCheckBill',
                            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("请选择一条数据!");
                }
            }
            //#endregion
            //以上是layui模块