王 垚
2021-05-25 66144089fc037ee502ad4f9f7a251b13d7ea9122
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_MouldRepairCheckBillList.html
@@ -79,6 +79,9 @@
                        <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-Add"><i class="layui-icon layui-icon-add-1"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-edit"></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="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm" id="btn_confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button>
                                <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>
@@ -117,13 +120,14 @@
            var option = {
                elem: '#mainTable'
                //, toolbar: '#toolbarDemo'
                , toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , cols: [[
                    { field: 'hmainid', title: '单据ID', hide: true }
                    , { field: '日期', title: '日期', width: 160 }
                    { 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: 'HEmpID', title: 'HEmpID', width: 200, hide: true }
@@ -137,7 +141,7 @@
                    , { field: 'HMouldID', title: 'HMouldID', width: 160, hide: true }
                    , { field: '产品模具代码', title: '产品模具代码', width: 160 }
                    , { field: '产品模具', title: '产品模具', width: 200, hide: true }
                    , { 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: 200 }
                    , { field: '内部单据号', title: '内部单据号', width: 200 }
@@ -148,15 +152,15 @@
                    , { field: '关闭类型', title: '关闭类型', width: 200 }
                    , { field: '表体备注', title: '表体备注', width: 200, hide: true }
                    , { field: '制单人', title: '制单人', width: 115, hide: true }
                    , { 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: 200, hide: true }
                    , { 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 }
                    , { 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 }
                    , { 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 }
                    , { 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 }
@@ -173,10 +177,102 @@
            };
            var index = layer.load(0);
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
                        //页面层-自定义
                        layer.open({
                            type: 2,
                            skin: 'layui-layer-rim', //加上边框
                            title: '新增模具维修单',
                            closeBtn: false,
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../模治具管理/Sc_Add_MouldRepairCheckBillList.html',
                            end: function () {
                                //刷新页面,
                                location.reload();
                            },
                            success: function (layero, index) {
                            }
                        });
                        break;
                    case 'btn-Edit':
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
                            var hID = data[0].hmainid.toString();
                            //if (AllowLoadData(sSubStr) != false) {//非空验证
                            layer.open({
                                type: 2
                                , area: ['100%', '100%']
                                , title: '编辑模具维修单'
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../模治具管理/Sc_Add_MouldRepairCheckBillList.html?hID=' + hID
                                , resize: false,
                                end: function () {
                                    //刷新页面,
                                    location.reload();
                                }
                                , cancel: function () {
                                    //$(".layui-btn").removeClass("layui-btn-disabled");
                                }
                            })
                        } else {
                            layer.msg('请选择一行数据编辑!');
                        }
                        break;
                    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: "POST",
                                    url: GetWEBURL() + "/Sc_MouldRepairCheckBill/DeltetMouldRepairCheckBill", //方法所在页面和方法名
                                    data: { "HInterID": InterID },
                                    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('请选择一行数据删除!');
                        }
                        break;
                };
            });
            //进入页面显示的缓存列表
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/Sc_MouldRepairCheckBill/GetMouldRepairCheckBillList',
                url: GetWEBURL() + '/Sc_MouldRepairCheckBill/GetMouldRepairCheckBillList',
                type: "GET",
                data: { "sWhere": sWhere},
                success: function (data1) {
@@ -227,7 +323,7 @@
                var index = layer.load(0);
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL1() + '/Sc_MouldRepairCheckBill/GetMouldRepairCheckBillList',
                    url: GetWEBURL() + '/Sc_MouldRepairCheckBill/GetMouldRepairCheckBillList',
                    type: "GET",
                    data: { "sWhere": sWhere},
                    success: function (data1) {