1
cwjbxqmz
2024-01-26 b742f00aac8e1e1bb628232383c35e67f4a41e4e
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Gy_MouldFileList.html
@@ -11,6 +11,7 @@
    <style type="text/css">
    </style>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
</head>
<body>
@@ -51,15 +52,15 @@
                            <div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btnAdd"><i class="layui-icon layui-icon-add-1"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btnModify"><i class="layui-icon layui-icon-edit"></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="btndelete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit"><i class="layui-icon layui-icon-radio"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit"><i class="layui-icon layui-icon-circle"></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>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Initialize"><i class="layui-icon layui-icon-share"></i>初始化</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_BatchGen"><i class="layui-icon layui-icon-add-1"></i>批量生成</button>
                            </div>
                        </script>
                    </form>
@@ -77,7 +78,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
@@ -87,6 +88,7 @@
            , element = layui.element
            , laypage = layui.laypage
            , laydate = layui.laydate
            , soulTable = layui.soulTable
            var sWhere = "";
            var option = [];
            //#endregion
@@ -101,6 +103,12 @@
                switch (obj.event) {
                    //新增按钮
                    case 'btnAdd': set_AddNew();
                        break;
                    //预览
                    case 'btn-view': get_ViewReport();
                        break;
                    //打印
                    case 'btn-print': get_PrintReport();
                        break;
                    //编辑按钮
                    case 'btnModify': set_ShowBill();
@@ -120,6 +128,12 @@
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                    //初始化按钮
                    case 'get_Initialize': get_Initialize();
                        break;
                    //批量生成按钮
                    case 'get_BatchGen': get_BatchGen();
                        break;
                };
            });
            //查询按钮
@@ -127,6 +141,10 @@
                get_FastQuery();
            });
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //#endregion
@@ -148,69 +166,70 @@
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , limits: [50,200,500,1000,5000,10000]
                    , limits: [50, 500, 5000, 20000]
                    , limit: 50 //每页默认显示的数量
                    , cellMinWidth: 200
                    , limit: 50
                    , limits: [50, 200, 500, 1000, 5000, 10000]
                    , done: function (res, curr, count) {
                        soulTable.render(this);
                    }
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        , { field: '日期', title: '日期', templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>"}
                        , { field: '条码编号', title: '条码编号' }
                        , { field: '对应ERP物料编码', title: '物料编号' }
                        , { field: '模具编号', title: '器具编号' }
                        , { field: '模具名称', title: '器具名称' }
                        , { field: '模具型号', title: '器具型号' }
                        , { field: '模具品类', title: '器具品类' }
                        , { field: '模具状态', title: '器具状态' }
                        , { field: '当前仓库', title: '当前仓库' }
                        , { field: '当前仓位', title: '当前仓位' }
                        , { field: '虚拟仓类型', title: '虚拟仓类型' }
                        , { field: '虚拟仓', title: '虚拟仓' }
                        , { field: '当前模具规格', title: '当前器具规格' }
                        , { field: '初始模具规格', title: '初始器具规格' }
                        , { field: '当前设计寿命', title: '当前设计寿命' }
                        , { field: '模具ERP物料', title: '器具ERP物料' }
                        , { field: '直径', title: '直径' }
                        , { field: '辅助属性', title: '辅助属性' }
                        , { field: '辅助属性2', title: '辅助属性2' }
                        , { field: '图号', title: '图号' }
                        , { field: '生产产品型号', title: '生产产品型号' }
                        , { field: 'HUnitID', title: 'HUnitID', hide: true }
                        , { field: '计量单位', title: '计量单位' }
                        , { field: '出厂日期', title: '出厂日期', templet: "<div>{{d.出厂日期 ==null ?'':layui.util.toDateString(d.出厂日期, 'yyyy-MM-dd')}}</div>"}
                        , { field: '出厂编号', title: '出厂编号'}
                        , { field: '使用部门代码', title: '使用部门代码' }
                        , { field: '使用部门', title: '使用部门' }
                        , { field: 'HSupID', title: 'HSupID', hide: true }
                        , { field: '供应商代码', title: '供应商代码' }
                        , { field: '供应商', title: '供应商' }
                        , { field: 'HWhID', title: 'HWhID', hide: true }
                        , { field: '默认仓库', title: '默认仓库' }
                        , { field: 'HSPID', title: 'HSPID', hide: true }
                        , { field: '默认仓位', title: '默认仓位' }
                        , { field: '版本', title: '版本' }
                        , { field: '初始设计寿命', title: '初始设计寿命' }
                        , { field: '使用寿命', title: '使用寿命' }
                        , { field: '剩余寿命', title: '剩余寿命' }
                        , { field: '已生产数量', title: '已生产数量' }
                        , { field: '已生产重量', title: '已生产重量' }
                        , { field: '备注', title: '备注' }
                        , { field: '关联数量', title: '关联数量' }
                        , { field: '制单人', title: '制单人' }
                        , { field: '制单日期', title: '制单日期', templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd')}}</div>"}
                        , { field: '审核人', title: '审核人' }
                        , { field: '审核日期', title: '审核日期', templet: "<div>{{d.审核日期 ==null ?'':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd')}}</div>"}
                        , { field: '修改人', title: '修改人' }
                        , { field: '修改日期', title: '修改日期', templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd')}}</div>"}
                        , { field: '关闭人', title: '关闭人' }
                        , { field: '关闭日期', title: '关闭日期', templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: 'hbilltype', title: 'hbilltype', hide: true }
                        , { field: '单据号', title: '单据号' }
                        , { field: '单据类型', title: '单据类型' }
                        , { field: 'HMoudType', title: 'HMoudType', hide: true }
                        , { field: 'hsubid', title: 'hsubid', hide: true }
                        , { field: '日期', title: '日期', templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>",sort:true}
                        , { field: '单据号', title: '单据号', sort: true }
                        , { field: '条码编号', title: '条码编号', sort: true }
                        , { field: '对应ERP物料编码', title: '物料编号', sort: true }
                        , { field: '模具编号', title: '器具编号', sort: true }
                        , { field: '模具名称', title: '器具名称', sort: true }
                        , { field: '模具型号', title: '器具型号', sort: true }
                        , { field: '模具品类', title: '器具品类', sort: true }
                        , { field: '模具状态', title: '器具状态', sort: true }
                        , { field: '对应ERP物料编码', title: '器具ERP物料', sort: true }
                        , { field: '直径', title: '直径', sort: true }
                        , { field: '辅助属性', title: '辅助属性', sort: true }
                        , { field: '辅助属性2', title: '辅助属性2', sort: true }
                        , { field: '图号', title: '图号', sort: true }
                        , { field: '生产产品型号', title: '生产产品型号', sort: true }
                        , { field: 'HUnitID', title: 'HUnitID', hide: true, sort: true }
                        , { field: '计量单位', title: '计量单位', sort: true }
                        , { field: '出厂日期', title: '出厂日期', templet: "<div>{{d.出厂日期 ==null ?'':layui.util.toDateString(d.出厂日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '出厂编号', title: '出厂编号', sort: true }
                        , { field: '使用部门代码', title: '使用部门代码', sort: true }
                        , { field: '使用部门', title: '使用部门', sort: true }
                        , { field: 'HSupID', title: 'HSupID', hide: true, sort: true }
                        , { field: '供应商代码', title: '供应商代码', sort: true }
                        , { field: '供应商', title: '供应商', sort: true }
                        , { field: 'HWhID', title: 'HWhID', hide: true, sort: true }
                        , { field: '默认仓库', title: '默认仓库', sort: true }
                        , { field: 'HSPID', title: 'HSPID', hide: true, sort: true }
                        , { field: '默认仓位', title: '默认仓位', sort: true }
                        , { field: '版本', title: '版本', sort: true }
                        , { field: '当前仓库', title: '当前仓库', sort: true }
                        , { field: '当前仓位', title: '当前仓位', sort: true }
                        , { field: '虚拟仓类型', title: '虚拟仓类型', sort: true }
                        , { field: '虚拟仓', title: '虚拟仓', sort: true }
                        , { field: '当前模具规格', title: '当前器具规格', sort: true }
                        , { field: '初始模具规格', title: '初始器具规格', sort: true }
                        , { field: '当前设计寿命', title: '当前设计寿命', sort: true }
                        , { field: '初始设计寿命', title: '初始设计寿命', sort: true }
                        , { field: '使用寿命', title: '使用寿命', sort: true }
                        , { field: '剩余寿命', title: '剩余寿命', sort: true }
                        , { field: '已生产数量', title: '已生产数量', sort: true }
                        , { field: '已生产重量', title: '已生产重量', sort: true }
                        , { field: '备注', title: '备注', sort: true }
                        , { field: '关联数量', title: '关联数量', sort: true }
                        , { field: '制单人', title: '制单人', sort: true }
                        , { field: '制单日期', title: '制单日期', templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '审核人', title: '审核人', sort: true }
                        , { field: '审核日期', title: '审核日期', templet: "<div>{{d.审核日期 ==null ?'':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '修改人', title: '修改人', sort: true }
                        , { field: '修改日期', title: '修改日期', templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: '关闭人', title: '关闭人', sort: true }
                        , { field: '关闭日期', title: '关闭日期', templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd')}}</div>", sort: true }
                        , { field: 'hbilltype', title: 'hbilltype', hide: true, sort: true }
                        , { field: '单据类型', title: '单据类型', hide: true, sort: true }
                        , { field: 'HMoudType', title: 'HMoudType', hide: true, sort: true }
                        , { field: 'hsubid', title: 'hsubid', hide: true, sort: true }
                    ]]
                };
            }
@@ -252,6 +271,14 @@
                }
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
            //重置过滤条件
            function set_ClearQuery() {
                $("#HNumber").val("")
                $("#HName").val("");
                sWhere = "";
                get_Display(sWhere);
            }
            //新增
@@ -426,6 +453,48 @@
            }
            //预览
            function get_ViewReport() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HEquipFileMainBill', 'yes']
                        , resize: false
                    })
                }
                else {
                    layer.msg('请选择一行数据打印!');
                }
            }
            //打印
            function get_PrintReport() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HEquipFileMainBill', 'yes']
                        , resize: false
                    })
                }
                else {
                    layer.msg('请选择一行数据打印!');
                }
            }
            //刷新
            function get_Refresh() {
                $("#HNumber").val("");
@@ -433,6 +502,69 @@
                $("#btnSearch").click();
            }
            //初始化
            function get_Initialize() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var HInterID = data[0].hmainid.toString();
                        $.ajax({
                            type: "GET",
                            url: GetWEBURL() + '/Gy_Material/InitializeProdInBill',
                            data: { "hmainid": HInterID, "user": sessionStorage["HUserName"], "userID": sessionStorage["OrganizationID"] },
                            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 });
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                            }
                        });
                    }
                else {
                    layer.msg('请选择一行数据删除!');
                }
            }
            //批量生成
            function get_BatchGen() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var HInterID = data[0].hmainid.toString();
                    //页面层-自定义
                    layer.open({
                        type: 2,
                        skin: 'layui-layer-rim', //加上边框
                        title: '批量新增器具档案',
                        closeBtn: false,
                        shift: 2,
                        area: ['70%', '70%'],
                        maxmin: true,
                        content: 'BatchGen_MouldFile.html?OperationType=3&linterid=' + HInterID + '&HSouceBillType=',
                        end: function () {
                            //刷新页面,
                            location.reload();
                        },
                        success: function (layero, index) {
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据!');
                }
            }
            //以上是layui模块
        });