Sfoglia il codice sorgente

随身邦订单列表增加时间范围选项

qxp 4 anni fa
parent
commit
3f619cc4f5

+ 6 - 0
suishenbang-order/src/main/resources/mapper/order/MetaHanaSalesOrderMapper.xml

@@ -79,6 +79,12 @@
             <if test="docType != null  and docType != ''"> and mhso.DOC_TYPE = #{docType}</if>
             <if test="creditStatus != null  and creditStatus != ''"> and mhso.CREDIT_STATUS = #{creditStatus}</if>
             <if test="expectedTimeStr != null  and expectedTimeStr != ''"> and sob.expected_time like concat('%', #{expectedTimeStr}, '%')</if>
+            <if test="params.start_expectedTime != null and params.start_expectedTime != ''"><!-- 开始时间检索 -->
+                and date_format(expected_time,'%y%m%d') &gt;= date_format(#{params.start_expectedTime},'%y%m%d')
+            </if>
+            <if test="params.end_expectedTime != null and params.end_expectedTime != ''"><!-- 结束时间检索 -->
+                and date_format(expected_time,'%y%m%d') &lt;= date_format(#{params.end_expectedTime},'%y%m%d')
+            </if>
         </where>
     </select>
 

+ 23 - 48
suishenbang-order/src/main/resources/templates/order/orderbase/orderbase.html

@@ -3,9 +3,7 @@
 <head>
     <th:block th:include="include :: header('订单基础信息')" />
     <th:block th:include="include :: datetimepicker-css" />
-    <style type='text/css'>
-        .control-label{padding-right : 0px}
-    </style>
+
 </head>
 <body class="gray-bg">
     <div class="container-div">
@@ -57,22 +55,19 @@
                                 </select>
                             </div>
                         </div>
-                        <div class="form-group col-sm-4 row">
-                            <!--<label class="control-label col-sm-4">期望到货时间:</label>-->
-                            <!--<div class="input-group col-sm-8">-->
-                            <!--<input class="form-control" type="text" name="salesOrgName"/>-->
-                            <!--</div>-->
-                            <label class="control-label col-sm-4">期望到货时间:</label>
-                            <div class="input-group col-sm-8">
-                                <input id="date"
-                                       class="form-control"
-                                       type="text"
-                                       name="expectedTime"
-                                       value=""
-                                       placeholder="查询年月日" >
+
+
+                        <div class="form-group col-sm-4 ">
+                            <label class="control-label col-sm-4">期望时间:</label>
+                            <div class="col-sm-4" style="padding: 0;">
+                                <input type="text" class="form-control"  name="params[start_expectedTime]" placeholder="起始日期">
+                            </div>
+                            <div class="col-sm-4" style="padding: 0;">
+                                <input type="text" class="form-control"  name="params[end_expectedTime]" placeholder="终止日期">
                             </div>
                         </div>
 
+
                         <div class="form-group col-sm-4 row">
                             <div class="form-group" style="float: right;">
                                 <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@@ -108,19 +103,6 @@
     <th:block th:include="include :: footer" />
     <th:block th:include="include :: datetimepicker-js" />
     <script th:inline="javascript">
-         $('#date').datetimepicker({
-            forceParse: 0,//设置为0,时间不会跳转1899,会显示当前时间。
-            language: 'zh-CN',//显示中文
-            format: 'yyyy-mm-dd',//显示格式
-            minView: "month",//设置只显示到月份
-            initialDate: new Date(),//初始化当前日期
-            autoclose: true,//选中自动关闭
-            todayBtn: true//显示今日按钮
-        })
-        //$("#date").datetimepicker("setDate", new Date() );  //设置显示默认当天的时间
-
-        //var editFlag = [[${@permission.hasPermi('order:orderbase:edit')}]];
-        //var removeFlag = [[${@permission.hasPermi('order:orderbase:remove')}]];
         var orderStatusDatas = [[${@dict.getType('order_type')}]];
         var prefix = ctx + "order/orderbase";
 
@@ -190,27 +172,20 @@
                 val = val.replace(/^\s+|\s+$/g,"")
                 $(event.target).val(val);
             })
+
+
+            $("input[name='params[end_expectedTime]']").datetimepicker({
+                format: "yyyy-mm-dd",
+                minView: "month",
+                autoclose: true
+            });
+            $("input[name='params[start_expectedTime]']").datetimepicker({
+                format: "yyyy-mm-dd",
+                minView: "month",
+                autoclose: true
+            });
         });
 
-        function dateFormat(fmt, date) {
-            var ret;
-            var opt = {
-                "Y+": date.getFullYear().toString(),        // 年
-                "m+": (date.getMonth() + 1).toString(),     // 月
-                "d+": date.getDate().toString(),            // 日
-                "H+": date.getHours().toString(),           // 时
-                "M+": date.getMinutes().toString(),         // 分
-                "S+": date.getSeconds().toString()          // 秒
-                // 有其他格式化字符需求可以继续添加,必须转化成字符串
-            };
-            for (var k in opt) {
-                ret = new RegExp("(" + k + ")").exec(fmt);
-                if (ret) {
-                    fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
-                };
-            };
-            return fmt;
-        }
     </script>
 </body>
 </html>