1
cwjbxqmz
2023-11-10 293fb733b30362766e13023967452e6bf52cac6f
WebTM/views/É豸¹ÜÀí/Sb_EquipDotCheckPlanBillList.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;
@@ -82,6 +83,10 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back" id="btn_back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details" id="details"><i class="layui-icon layui-icon-form"></i>详情</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate" id="generate"><i class="layui-icon layui-icon-file"></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="btn-exit" id="exit"><i class="layui-icon layui-icon-return"></i>退出</button>
@@ -103,7 +108,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
@@ -114,6 +119,7 @@
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
                , soulTable = layui.soulTable
            var sWhere = "";
            var index = layer.load(0);
            var option = [];
@@ -158,6 +164,18 @@
                        var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                        var HBillType = "3904";
                        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 'btn-exit': Pub_Close(2);
@@ -223,47 +241,50 @@
                    , 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: '设备代码', title: '设备代码', width: 200 }
                        , { field: '设备名称', title: '设备名称', width: 200 }
                        , { field: '表头备注', title: '表头备注', width: 200, hide: true }
                        , { 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: 115, hide: true }
                        , { field: '点检部位', title: '点检部位', width: 200 }
                        , { field: '具体要求', title: '具体要求', width: 200 }
                        , { field: '负责人', title: '负责人', width: 200 }
                        , { field: 'hsubid', title: 'hsubid', 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, 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 }
                        , { 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: 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: '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: '设备代码', title: '设备代码', width: 200, sort: true }
                        , { field: '设备名称', title: '设备名称', width: 200, sort: true }
                        , { field: '表头备注', title: '表头备注', width: 200, hide: true, 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: 115, hide: true, sort: true }
                        , { field: '点检部位', title: '点检部位', width: 200, sort: true }
                        , { field: '具体要求', title: '具体要求', width: 200, sort: true }
                        , { field: '负责人', title: '负责人', width: 200, sort: true }
                        , { field: 'hsubid', title: 'hsubid', 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: '行关闭人', title: '行关闭人', width: 115, hide: true, 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, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '审核人', title: '审核人', width: 200, sort: true }
                        , { field: '审核日期', title: '审核日期', width: 200, hide: true, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '修改人', title: '修改人', width: 200, hide: true, sort: true }
                        , { field: '修改日期', title: '修改日期', width: 115, hide: true, 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, hide: true, sort: true }
                        , { field: '作废日期', title: '作废日期', width: 115, hide: true, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>", 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 }
                    ]]
                };
            }
@@ -388,6 +409,71 @@
                }
            }
            //审核/反审核
            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_EquipDotCheckPlanBill/CheckSb_EquipDotCheckPlanBill',
                            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_EquipDotCheckPlanBill/CloseSb_EquipDotCheckPlanBill',
                            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
        });