1
cwjbxqmz
2024-01-26 b742f00aac8e1e1bb628232383c35e67f4a41e4e
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Gy_BarCodeBillList.html
@@ -15,6 +15,8 @@
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.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;
@@ -23,8 +25,8 @@
        /*       .layui-table-cell {
            height: auto;
            white-space: normal;
        } */
  </style>
        } */
    </style>
</head>
<body>
    <div class="layui-fluid">
@@ -90,13 +92,13 @@
                        <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>-->
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></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="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-reload" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-view" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-print" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-Delete" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="set_HideColumn" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>按钮设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" id="btn-exit" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button>
                            </div>
                        </script>
                    </form>
@@ -109,7 +111,7 @@
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate','soulTable'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
@@ -119,6 +121,7 @@
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
                , soulTable = layui.soulTable
            //查询条件
            var sWhere = "";
            var option = [];
@@ -134,40 +137,50 @@
                    //列设置
                    case 'set_HideColumn': get_HideColumn();
                        break;
                    case 'btn-Delete':
                    case 'btn-Delete':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var InterID = data[0].hmainid.toString();
                            //逻辑删除方法
                            layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                                $.ajax({
                                    type: "GET",
                                    url: GetWEBURL() + "Gy_MaterialController/DeltetBarCodeBill", //方法所在页面和方法名
                                    data: { "HInterID": InterID, "user": sessionStorage["HUserName"] },
                                    success: function (result) {
                                        if (result.count == 1) {
                                            layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                                // å¾—到frame索引
                                                var index = layer.getFrameIndex(window.name);
                                                //关闭当前frame
                                                layer.close(index);
                                                //修改为功后刷新界面
                                                window.location.reload();
                                            });
                        if (checkStatus.data.length == 0 || checkStatus.data.length > 300) {
                            layer.msg('请选择要删除的数据,且选中行数不能超过300行!');
                            return;
                        }
                        var mainid = "";
                        var BarCode = "";
                        for (i = 0; i < data.length; i++) {
                            mainid += data[i].hmainid.toString() + ",";
                            BarCode += data[i].条码编号.toString() + ",";
                        }
                                        } else {
                                            layer.alert(result.code + result.Message, { icon: 5 });
                                        }
                                    }, error: function () {
                                        layer.alert("接口请求失败!", { icon: 5 });
                        mainid = mainid.substring(0, mainid.length - 1)
                        BarCode = BarCode.substring(0, BarCode.length - 1)
                        var oData = JSON.stringify(mainid) + ";" + sessionStorage["HUserName"] + ";" + JSON.stringify(BarCode);
                        //逻辑删除方法
                        layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                            $.ajax({
                                type: "POST",
                                url: GetWEBURL() + "Gy_MaterialController/DeltetBarCodeBill", //方法所在页面和方法名
                                data: { "oData": oData },
                                success: function (result) {
                                    if (result.count == 1) {
                                        layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                            // å¾—到frame索引
                                            var index = layer.getFrameIndex(window.name);
                                            //关闭当前frame
                                            layer.close(index);
                                            //修改为功后刷新界面
                                            window.location.reload();
                                        });
                                    } else {
                                        layer.alert(result.code + result.Message, { icon: 5 });
                                    }
                                });
                            })
                        }
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                                }, error: function () {
                                    layer.alert("接口请求失败!", { icon: 5 });
                                }
                            });
                        })
                        break;
                    case 'btn-print':
                        var checkStatus = table.checkStatus('mainTable')
@@ -202,6 +215,12 @@
                        break;
                    //退出按钮
                    case 'btn-exit': Pub_Close(2);
                        break;
                    //按钮设置
                    case 'set_HideButton':
                        var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                        var HBillType = "条码主档";
                        get_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        break;
                };
            });
@@ -274,47 +293,57 @@
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , limits: [50, 500, 5000, 20000]
                    , limit: 50
                    , limits: [50, 500, 5000, 20000,50000]
                     , limit: 50
                     , done: function (res, curr, count) {
                         soulTable.render(this);
                     }
                     , cols: [[
                         { type: 'checkbox', fixed: 'left' }
                        ,{ field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '条码类型', title: '条码类型', width: 160 }
                        , { field: '条码编号', title: '条码编号', width: 160 }
                        , { field: 'HMaterID', title: 'HMaterID', width: 160, hide: true }
                        , { field: '物料代码', title: '物料代码', width: 200 }
                        , { field: '物料名称', title: '物料名称', width: 250 }
                        , { field: '规格型号', title: '规格型号', width: 250 }
                        , { field: '计量单位代码', title: '计量单位代码', width: 200 }
                        , { field: '计量单位', title: '计量单位', width: 200 }
                        , { field: 'HAuxPropID', title: 'HAuxPropID', width: 200 }
                        , { field: '辅助属性代码', title: '辅助属性代码', width: 160 }
                        , { field: '辅助属性', title: '辅助属性', width: 160 }
                        , { field: '批号', title: '批号', width: 160 }
                        , { field: '数量', title: '数量', width: 200 }
                        , { field: '计划跟踪号', title: '计划跟踪号', width: 200 }
                        , { field: '源单单号', title: '源单单号', width: 200 }
                        , { field: 'HSupID', title: 'HSupID', width: 200, hide: true }
                        , { field: '供应商代码', title: '供应商代码', width: 200 }
                        , { field: '供应商', title: '供应商', width: 200 }
                        , { field: '进料日期', title: '进料日期', width: 200 }
                        , { field: '进料日期周', title: '进料日期周', width: 115 }
                        , { field: '客户型号', title: '客户型号', width: 115 }
                        , { field: '往来单位', title: '往来单位', width: 200 }
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '车间', title: '车间', width: 115 }
                        , { 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 HH:mm:ss')}}</div>"  }
                        , { 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 HH:mm:ss')}}</div>" }
                         , { field: '销售出库日期', title: '销售出库日期', width: 200, templet: "<div>{{d.销售出库日期 ==null ?'':layui.util.toDateString(d.销售出库日期, 'yyyy-MM-dd HH:mm:ss')}}</div>"  }
                    ]]
                         , { field: 'hmainid', title: '单据ID', hide: true, sort: true }
                         , { field: '条码类型', title: '条码类型', width: 160, sort: true }
                         , { field: '条码编号', title: '条码编号', width: 160, sort: true }
                         , { field: 'HMaterID', title: 'HMaterID', width: 160, hide: true, sort: true }
                         , { field: '物料代码', title: '物料代码', width: 200, sort: true }
                         , { field: '物料名称', title: '物料名称', width: 250, sort: true }
                         , { field: '规格型号', title: '规格型号', width: 250, 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, 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, templet: "<div>{{d.保质期至 ==null ?'':layui.util.toDateString(d.保质期至, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                         , { field: 'HAuxPropID', title: 'HAuxPropID', width: 200, sort: true }
                         , { field: '辅助属性代码', title: '辅助属性代码', width: 160, sort: true }
                         , { field: '辅助属性', title: '辅助属性', width: 160, sort: true }
                         , { field: '批号', title: '批号', width: 160, sort: true }
                         , { field: '数量', title: '数量', width: 200, sort: true }
                         , { field: '计划跟踪号', title: '计划跟踪号', width: 200, sort: true }
                         , { field: '源单单号', title: '源单单号', width: 200, sort: true }
                         , { field: 'HSupID', title: 'HSupID', 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, sort: true }
                         , { field: '客户型号', title: '客户型号', width: 115, 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: '拖号', 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 HH:mm:ss')}}</div>", 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 HH:mm:ss')}}</div>", sort: true }
                         , { field: '销售出库日期', title: '销售出库日期', width: 200, templet: "<div>{{d.销售出库日期 ==null ?'':layui.util.toDateString(d.销售出库日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                     ]]
                };
            }
@@ -337,6 +366,10 @@
                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                                ColFilter();
                            }
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                            var HBillType = "条码主档";
                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        } else {
                            layer.close(index);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
@@ -454,6 +487,12 @@
                        } else {
                            table.render(option);
                        }
                        //刷新按钮显示
                        var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                        var HBillType = "条码主档";
                        Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }