沈泽
2021-09-02 af5ddf873da1981fed8fb0f8dfcdaafb97f47d17
WebTM/views/É豸¹ÜÀí/Sb_EqpConkBookBillList.html
@@ -49,19 +49,14 @@
                                            <option value="ZHSJ">上架归还单</option>
                                        </select>
                                    </div>
                                </div>
                                </div>-->
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">制单人</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HCreateBy" id="HCreateBy">
                                    </div>
                                </div>-->
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
@@ -72,12 +67,7 @@
                                            <span>其他条件></span>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">单据号</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HBillNo" id="HBillNo">
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
@@ -85,9 +75,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="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="btndelete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                            </div>
@@ -107,6 +97,7 @@
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
            //#region  å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
@@ -118,8 +109,62 @@
                , util = layui.util
            //查询条件
            var sWhere = "";
            var option = [];
            //#endregion
            var option = {
            //#region è¿›å…¥é¡µé¢æ—¢åŠ è½½
            //初始化界面
            set_ClearBill();
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    //新增
                    case 'btnAdd': set_AddNew();
                        break;
                    //编辑
                    case 'btnModify': set_ShowBill();
                        break;
                    //删除
                    case 'btndelete': set_DeleteBill();
                        break;
                    //禁用
                    case 'btnJY': set_AuditBill();
                        break;
                    //反禁用
                    case 'btnFJY': set_DeAuditBill();
                        break;
                };
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery();
            });
            // é‡ç½®æŒ‰é’®
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰æ–¹æ³•
            // åˆå§‹åŒ–界面
            function set_ClearBill() {
                //初始化表格
                set_InitGrid();
                //查询
                get_Display(sWhere);
            }
            //初始化表格
            function set_InitGrid() {
                option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , height: 'full-50'
@@ -177,16 +222,37 @@
                    , { field: '源单类型', title: '源单类型', width: 200 }
                    , { field: '关联数量', title: '关联数量', width: 200 }
                    , { field: 'HBillType', title: 'HBillType', width: 200, hide: true }
                ]]
            };
            }
            var index = layer.load(0);
            //查询
            function get_Display() {
                var index = layer.load(0, { shade: false });
                //进入页面显示的缓存列表
                $.ajax({
                    url: GetWEBURL() + '/Sb_EqpRepairWorkBill/GetEqpConkBookBillList',
                    type: "GET",
                    data: { "sWhere": sWhere },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                        } else {
                            layer.close(index);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
                switch (obj.event) {
                    case 'btn-Add':
            //新增
            function set_AddNew() {
                        //页面层-自定义
                        layer.open({
                            type: 2,
@@ -196,7 +262,7 @@
                            shift: 2,
                            area: ['100%', '100%'],
                            maxmin: true,
                            content: '../设备管理/Sb_Add_EqpConkBookBillList.html',
                    content: '../设备管理/Sb_Add_EqpConkBookBillList.html?OperationType=1&linterid=&HSouceBillType=',
                            end: function () {
                                //刷新页面,
                                location.reload();
@@ -205,8 +271,10 @@
                            }
                        });
                        break;
                    case 'btn-Edit':
            }
            //编辑
            function set_ShowBill() {
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
@@ -220,7 +288,7 @@
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: '../设备管理/Sb_Add_EqpConkBookBillList.html?hID=' + hID
                        , content: '../设备管理/Sb_Add_EqpConkBookBillList.html?OperationType=3&linterid=' + hID + '&HSouceBillType='
                                , resize: false,
                                end: function () {
                                    //刷新页面,
@@ -234,9 +302,10 @@
                        } else {
                            layer.msg('请选择一行数据编辑!');
                        }
            }
                        break;
                    case 'btn-Delete':
            //删除
            function set_DeleteBill() {
                        var checkStatus = table.checkStatus('mainTable')
                            , data = checkStatus.data;
                        if (checkStatus.data.length === 1) {
@@ -270,41 +339,10 @@
                        else {
                            layer.msg('请选择一行数据删除!');
                        }
                        break;
                };
            });
            //进入页面显示的缓存列表
            $.ajax({
                //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                url: GetWEBURL() + '/Sb_EqpRepairWorkBill/GetEqpConkBookBillList',
                type: "GET",
                data: { "sWhere": sWhere},
                success: function (data1) {
                    if (data1.count == 1) {
                        option.data = data1.data;
                        table.render(option);
                        layer.close(index);
                    } else {
                        layer.close(index);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(index);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
            //重置按钮
            form.on('submit(btnReSearch)', function (data) {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//单据号
                $("#btnSearch").click();
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {//选择仓位
            //快速过滤
            function get_FastQuery() {
                var HDate = $("#HDate").val();//开始日期
                var HDate1 = $("#HDate1").val();//结束日期
                var HBillNo = $("#HBillNo").val();//单据号
@@ -317,55 +355,23 @@
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                var index = layer.load(0);
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
                    url: GetWEBURL() + '/Sb_EqpRepairWorkBill/GetEqpConkBookBillList',
                    type: "GET",
                    data: { "sWhere": sWhere},
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                            layer.alert("查询成功", { icon: 1 });
                        } else {
                            layer.close(index);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.alert("接口失效!", { icon: 5 });
            //重置
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HBillNo").val("");//单据号
                $("#btnSearch").click();
                    }
                });
                //调用接口后清空sWhere缓存
                sWhere = "";
                //$("#HBillType").val("");//单据类型
                //$("#HBillNo").val("");//单据号
                //$("#HSourceBillNo").val("");//源单号
                //$("#HCreateBy").val("");//制单人
                //$("#BenginHCreateDate").val("");//开始制单时间
                //$("#EndHCreateDate").val("");//结束制单时间
            });
            //监听行双击事件
            table.on('rowDouble(mainTable)', function (obj) {
                layer.alert("双击事件", { icon: 1 });
            });
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //#endregion
            //以上是layui模块
        });
    </script>