1
沈泽
2021-08-27 fd05804a92f827d5c77ce1a16cfbf5cc1c8fb017
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξ߹ÜÀí/Sc_MouldDotCheckBillList.html
@@ -28,16 +28,6 @@
                                        <span>更多</span>
                                    </div>
                                </div>
                                <!--<div class="layui-inline">
                                    <label class="layui-form-label">单据类型</label>
                                    <div class="layui-input-block">
                                        <select name="HBillType" id="HBillType">
                                            <option value="">所有</option>
                                            <option value="ZHXJ">下架找货单</option>
                                            <option value="ZHSJ">上架归还单</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
@@ -45,16 +35,22 @@
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">制单人</label>
                                    <label class="layui-form-label">产品模具</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HCreateBy" id="HCreateBy">
                                        <input type="text" class="layui-input" name="PartModul" id="PartModul">
                                    </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="CheckItem" id="CheckItem">
                                    </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>
                                <!--<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>-->
                                <!--<div class="layui-colla-content">
                                <div class="layui-colla-content">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
@@ -72,7 +68,7 @@
                                            <input type="date" class="layui-input" name="EndHCreateDate" id="EndHCreateDate">
                                        </div>
                                    </div>
                                </div>-->
                                </div>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
@@ -100,12 +96,15 @@
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script>
        layui.config({
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
            //#region å…¬ç”¨å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
@@ -116,12 +115,17 @@
                , laydate = layui.laydate
                , util = layui.util
            var sWhere = "";
            //公用变量
            var option = [];
            //#endregion
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //初始化表格
            set_InitGrid();
            //加载数据到网格
            get_Display(sWhere);
            //#endregion
            //#region è§¦å‘事件:包括form.on(){}格式的所有点击事件、选择事件等
            //头工具栏事件
            table.on('toolbar(mainTable)', function (obj) {
                var checkStatus = table.checkStatus(obj.config.id);
@@ -158,16 +162,46 @@
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //#endregion
            //#region æœ¬é¡µé¢æ‰€æœ‰è¢«è°ƒç”¨çš„æ–¹æ³•
            //重置过滤条件
            function set_ClearQuery() {
                $("#HBillNo").val("");
                $("#PartModul").val("");
                $("#CheckItem").val("");
                $("#BenginHCreateDate").val("");
                $("#EndHCreateDate").val("");
            }
            //查询按钮
            form.on('submit(btnSearch)', function (data) {
                get_FastQuery(table, option);
                get_FastQuery();
            });
            //快速过滤
            function get_FastQuery(table, option) {
                var index = layer.load(0);
            function get_FastQuery() {
                var HBillNo = $("#HBillNo").val();//单据号
                var PartModul = $("#PartModul").val();//产品模具
                var CheckItem = $("#CheckItem").val();//点检项目
                var BenginHCreateDate = $("#BenginHCreateDate").val();//开始日期
                var EndHCreateDate = $("#EndHCreateDate").val();//结束日期
                if (HBillNo) {
                    sWhere += " and å•据号 like '%" + HBillNo + "%'";
                }
                if (PartModul) {
                    sWhere += " and äº§å“æ¨¡å…· like '%" + HBillNo + "%'";
                }
                if (CheckItem) {
                    sWhere += " and ç‚¹æ£€é¡¹ç›® like '%" + HBillNo + "%'";
                }
                if (BenginHCreateDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) >= '" + BenginHCreateDate + "'";
                }
                if (EndHCreateDate) {
                    sWhere += " and CONVERT(varchar(100),日期, 23) <= '" + EndHCreateDate + "'";
                }
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
@@ -182,40 +216,40 @@
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '日期', title: '日期', width: 160 }
                        , { 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: 160}
                        , { field: '点检计划编号', title: '点检计划编号', width: 200 }
                        , { field: '点检计划内码', title: '点检计划内码', width: 200, hide: true }
                        , { field: '点检计划内码', title: '点检计划内码', width: 200 }
                        , { field: 'HMouldID', title: 'HMouldID', width: 200, hide: true }
                        , { field: '产品模具代码', title: '产品模具代码', width: 200 }
                        , { field: '产品模具', title: '产品模具', width: 200 }
                        , { 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, 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: 'hsubid', title: 'hsubid', width: 200, hide: true }
                        , { field: '点检项目', title: '点检项目', width: 115, hide: true }
                        , { field: '点检项目', title: '点检项目', width: 115}
                        , { field: '点检部位', title: '点检部位', width: 200 }
                        , { field: '具体要求', title: '具体要求', width: 200 }
                        , { field: 'HManagerID', title: 'HManagerID', 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: 115 }
                        , { field: '关闭类型', title: '关闭类型', width: 200 }
                        , { field: '表体备注', title: '表体备注', width: 200, hide: true }
                        , { field: '制单人', title: '制单人', width: 115, hide: true }
                        , { 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')}}</div>"}
                        , { field: '审核人', title: '审核人', width: 200 }
                        , { field: '审核日期', title: '审核日期', width: 200, hide: true }
                        , { 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: 115, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd')}}</div>"}
                        , { field: '关闭人', title: '关闭人', width: 200 }
                        , { 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: 115, 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 }
@@ -224,7 +258,7 @@
                    ]]
                }
            };
            var index = layer.load(0);
            //新增
            function set_AddNew() {
                layer.open({
@@ -235,7 +269,7 @@
                    shift: 2,
                    area: ['100%', '100%'],
                    maxmin: true,
                    content: '../模治具管理/Sc_Add_MouldDotCheckBillList.html',
                    content: '../模治具管理/Sc_Add_MouldDotCheckBillList.html?OperationType=1&linterid=&HSouceBillType=',
                    end: function () {
                        //刷新页面,
                        location.reload();
@@ -259,7 +293,7 @@
                        , shade: 0.6 //遮罩透明度
                        , maxmin: true //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: '../模治具管理/Sc_Add_MouldDotCheckBillList.html?hID=' + hID
                        , content: '../模治具管理/Sc_Add_MouldDotCheckBillList.html?OperationType=3&linterid=' + hID + '&HSouceBillType='
                        , resize: false,
                        end: function () {
                            //刷新页面,
@@ -311,7 +345,9 @@
                    layer.msg('请选择一行数据删除!');
                }
            };
            //查询
            function get_Display(sWhere) {
                var ajaxLoad = layer.load();
                //进入页面显示的缓存列表
                $.ajax({
                    //url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
@@ -322,17 +358,19 @@
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(index);
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion
        });