Parcourir la source

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

liuzhiwei il y a 7 ans
Parent
commit
6672b91c6e

+ 19 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/SalesOrder.java

@@ -56,6 +56,9 @@ public class SalesOrder implements Serializable {
     private Integer salesIsSeparate;        //是否缺货
 
 
+    private String companyName;             //销售公司名称
+    private String storeName;               //店铺名称
+
     private List<SalesOrderItem> salesOrderItemList = new ArrayList<SalesOrderItem>();
 
     public String getSalesDealCode() {
@@ -361,4 +364,20 @@ public class SalesOrder implements Serializable {
     public void setSalesOrderItemList(List<SalesOrderItem> salesOrderItemList) {
         this.salesOrderItemList = salesOrderItemList;
     }
+
+    public String getCompanyName() {
+        return companyName;
+    }
+
+    public void setCompanyName(String companyName) {
+        this.companyName = companyName;
+    }
+
+    public String getStoreName() {
+        return storeName;
+    }
+
+    public void setStoreName(String storeName) {
+        this.storeName = storeName;
+    }
 }

+ 27 - 21
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/salesOrderMapper.xml

@@ -49,27 +49,15 @@
     where sales_id = #{salesId,jdbcType=INTEGER}
   </select>
 
-  <!-- 根据条件查询订单数量 -->
-  <select id="getOrderInfoCount" resultType="Integer" parameterType="SalesOrder" >
-    select
-      count(sales_id)
-    from
-      tb_rst_sales_order_info
-    <where>
-      <if test="salesDealCode != null">
-        sales_deal_code = #{salesDealCode}
-      </if>
-      <if test="salesOrderId != null">
-        and sales_orderId = #{salesOrderId}
-      </if>
-    </where>
-  </select>
-
   <!-- 订单集合 -->
   <select id="listSalesOrder" resultType="SalesOrder" parameterType="SalesOrder" >
     select
-      *
+    tb_rst_sales_order_info.*,
+    trsc.company_name companyName,
+    trsi.store_name  storeName
     from tb_rst_sales_order_info
+    LEFT JOIN tb_rst_sales_company trsc ON tb_rst_sales_order_info.sales_company_id = trsc.company_id
+    LEFT JOIN tb_rst_store_info trsi ON tb_rst_sales_order_info.sales_store_id = trsi.store_id
     <where>
       <if test="salesStatus !=null and salesStatus !=''">
         AND sales_status = #{salesStatus}
@@ -97,10 +85,28 @@
   </select>
 
   <!-- 订单项集合 -->
-  <select id="listSalesOrderItem" resultType="SalesOrder" parameterType="SalesOrder" >
-    select
-    <include refid="salesOrderInfo" />
-    from tb_rst_sales_order_info
+  <select id="listSalesOrderItem" resultType="SalesOrderItem" parameterType="SalesOrderItem" >
+        SELECT
+            item_id,
+            item_order_id,
+            item_product_id,
+            item_num,
+            item_color_id,
+            item_product_type,
+            item_product_name,
+            item_product_pic,
+            item_product_color,
+            item_color_bar,
+            item_product_price,
+            item_product_discount,
+            item_create_time
+        FROM
+            tb_rst_sales_order_item
+      <where>
+          <if test="itemOrderId !=null and itemOrderId !=''">
+              AND item_order_id = #{itemOrderId}
+          </if>
+      </where>
   </select>
 
   <!-- 添加订单信息 -->

+ 1 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -140,6 +140,7 @@ public class AdminCustomerController {
 
         for(SalesOrder order : salesOrderList){
             SalesOrderItem salesOrderItem = new SalesOrderItem();
+            salesOrderItem.setItemOrderId(order.getSalesId());
             List<SalesOrderItem> salesOrderItemList = salesOrderService.listSalesOrderItem(salesOrderItem);
             order.setSalesOrderItemList(salesOrderItemList);
         }

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/mq/MQTask.java

@@ -89,7 +89,7 @@ public class MQTask implements InitializingBean {
 	 * @throws Exception
 	 */
 	//@Scheduled(cron = "0 0 */1 * * ?")//每小时执行一次
-	@Scheduled(cron = "*/10 * * * * ?")
+	//@Scheduled(cron = "*/10 * * * * ?")
 	public void syncEfastOrderList() throws Exception {
 		int pageNo = 1;
 		int pageSize = 20;

+ 2 - 1
watero-rst-web/src/main/webapp/WEB-INF/views/base/add_base.ftl

@@ -25,7 +25,8 @@
 <script type="text/javascript" src="${path}/common/lib/jquery.validation/1.14.0/messages_zh.js"></script>
 <script type="text/javascript" src="${path}/common/lib/Validform/Validform_v5.3.2.js"></script>
 
+<script type="text/javascript" src="${path}/common/js/common/common.js"></script>
 <script type="text/javascript">
-    // 判断
+    // 判断<script type="text/javascript" src="${path}/common/js/common/common.js"></script>
     var root_path = "${path}";
 </script>

+ 2 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/base/list_base.ftl

@@ -22,6 +22,8 @@
 <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
 <script type="text/javascript" src="${path}/common/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
 <script type="text/javascript" src="${path}/common/lib/laypage/1.2/laypage.js"></script>
+
+<script type="text/javascript" src="${path}/common/js/common/common.js"></script>
 <script type="text/javascript">
     // 判断
     var root_path = "${path}";

+ 74 - 4
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/add_customer.ftl

@@ -234,8 +234,16 @@
                         <tr>
                             <th>销售</th><th>订单号</th><th>姓名</th><th>电话</th><th>订单金额</th><th>购买产品</th><th>购买日期</th>
                         </tr>
-                        <tr>
-                            <td>爱贝源-微信商城</td><td>1290387806</td><td>何小小</td><td>1882222888</td><td>¥3680</td><td>Watero净水机</td><td>2017-06-06</td>
+                        <tr id="showOrder">
+                            <td>爱贝源-微信商城</td>
+                            <td>1290387806</td>
+                            <td>何小小</td>
+                            <td>1882222888</td>
+                            <td>¥3680</td>
+                            <td>Watero净水机</td>
+                            <td>2017-06-06</td>
+                        </tr>
+                        <tr id="showOrderAddress">
                         </tr>
                     </table>
                 </div>
@@ -602,12 +610,74 @@
 
     }
 
-    /*搜索订单框*/
+    /***
+     * 打开搜索订单框
+     */
     function selectOrder(){
-        layer_show("搜索订单","${path}/admin/customer/select_order","800","350");
+        layer_show("搜索订单","${path}/admin/customer/select_order","1000","350");
+    }
+
+    /**
+     * 显示选择的订单
+     */
+    function setSelectOrder(orderId){
+        var html = '';
+        $.ajax({
+            type: "POST",
+            data: {
+                salesId : orderId
+            },
+            url: "${path}/admin/customer/select_salesOrder",
+            async: false,
+            success: function(data){
+                var address; //地址
+                if (data.returnCode == 200) {
+                    for(var i=0;i<data.returnMsg.salesOrderList.length;i++){
+                        var salesOrder = data.returnMsg.salesOrderList[i];
+
+                        var productsHtml = '';
+                        var salesOrderItem = salesOrder.salesOrderItemList
+                        for(var j=0;j<salesOrderItem.length;j++){
+                            var item = salesOrderItem[j].itemProductName + "*" + salesOrderItem[j].itemNum;
+                            if(j==0){
+                                productsHtml += item
+                            }else{
+                                productsHtml += '<br>'+ item
+                            }
+                        }
+                        var time = formatDate(new Date(salesOrder.salesCreateTime),"yyyy-MM-dd");
+                        html += '' +
+                                ' <td>'+ convertUndefinedToEmpty(salesOrder.companyName) +'-'+ convertUndefinedToEmpty(salesOrder.storeName) +'</td>' +
+                                ' <td>'+ salesOrder.salesId +'</td>' +
+                                ' <td>'+ salesOrder.salesAddressName +'</td>' +
+                                ' <td>'+ salesOrder.salesAddressTel +'</td>' +
+                                ' <td>'+ salesOrder.salesAmount +'</td>' +
+                                ' <td>'+ productsHtml +'</td>' +
+                                ' <td>'+ time +'</td>' +
+                                '';
+                        address = '<td colspan="1">收货地址</td><td colspan="6" class="td-manage text-c" >'+ salesOrder.salesAddressInfo +'&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #0a6999;text-decoration: underline;" href="javascript:void(0);" title="编辑" onclick="updateAdress()">修改地址</a></td>' ;
+                    }
+                    $("#showOrderAddress").html(address);
+                }else{
+                    html = '';
+                }
+                $("#showOrder").html(html);
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
     }
 
+    /**
+     * 设置地址
+     */
+    function setAdress(){
 
+    }
+    
+    function setPro() {
+        
+    }
 </script>
 <!--/请在上方写此页面业务相关的脚本-->
 </body>

+ 91 - 55
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/order_list.ftl

@@ -11,24 +11,50 @@
 <#include "/base/list_base.ftl">
     <title>客诉列表</title>
     <style>
-        *{padding: 0;margin: 0;}
-        .my-input{border: 1px solid rgba(0,0,0,.1);padding: 1px 5px;height: 32px;margin-right: 10px;}
-        /*.my-input::-webkit-input-placeholder,.my-select{color: #dcdcdc;}*/
-        .my-select{border: 1px solid rgba(0,0,0,.1);padding:6px 50px 6px 15px;height: 34px;margin: 0 10px; -webkit-appearance:none;appearance:none;background: url(/common/images/pts/select-1.png) right center no-repeat;background-size:auto 100%;}
-        .my-btn-search{border: 1px solid #32a3d8;padding: 1px 25px;height: 32px;background-color: #32a3d8;color: #fff;}
-        .barcodeImg{margin:10px 0px}
-        .table-bg thead th{background-color: #e2f6ff;}
-        input[type=radio]{-webkit-appearance:none;appearance:none;background: url(/common/images/pts/radio-1.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
-        input[type=radio]:checked{-webkit-appearance:none;appearance:none;background: url(/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}
+        .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        .tit-2{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
+        .tit-2:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
+        #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
+
+        #suggest, #suggest2 {width:200px}
+        .gray {color:gray}
+        .ac_results {background:#fff;border:1px solid #7f9db9;position: absolute;z-index: 10000;display: none}
+        .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
+        .ac_results li {border:1px solid #fff}
+        .ac_over, .ac_results li a:hover {background:#c8e3fc}
+        .ac_results li a span {float:right}
+        .ac_result_tip {border-bottom:1px dashed #666;padding:3px}
+
+        .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
+        .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 25px;}
+        .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
+        .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
+        .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent  #32a3d8 transparent transparent;font-size:0; line-height:0;}
+        .dalog-ask .ask{color: #000;margin: 10px 0 5px 0;}
+        .dalog-ask .answer{color: #666;margin-bottom: 10px;}
+        .dalog-ask .answer:hover{color: #32a3d8;cursor: pointer;}
+        .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
+        .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
+        .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
+        .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
+        .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
+        .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
+        .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent  transparent  transparent #32a3d8;font-size:0; line-height:0;}
+        .time-line-list>li:first-child .arrow{display: none;}
+        .table-bg th{background-color: #e2f6ff;}
+        .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
+        .my-search-input{padding-left: 30px;background: url(${path}/common/images/cm/search.png) 6px center no-repeat;background-size: auto 60%; }
     </style>
 </head>
 <body>
 <div class="page-container">
     <div class="text-c">
-        <form action="${path}/admin/customer/_customer_list" method="post">
+        <form action="" method="post">
             <div class="row cl">
                 <div class="formControls col-4 col-sm-4" style="width: 150px;"> <span class="select-box">
                     <select name="" class="select" id="companyId">
+                         <option value="">销售公司</option>
                         <#if companyInfoList?? &&  (companyInfoList?size > 0) >
                             <#list companyInfoList as companyInfo>
                                 <option value ="${companyInfo.companyId!""}">${companyInfo.companyName!""}</option>
@@ -44,31 +70,37 @@
                 </div>
                 <div class="formControls col-4 col-sm-4" style="width: 150px;"> <span class="select-box">
                     <select name="" class="select" id="storeId">
-                        <option value="1">取消订单</option>
-                        <option value="2">待支付</option>
-                        <#--<option value="3"></option>
-                        <option value="4"></option>
-                        <option value="5"></option>
-                        <option value="6"></option>
-                        <option value="7"></option>
-                        <option value="8"></option>
-                        <option value="9"></option>
-                        <option value="10"></option>
-                        <option value="11"></option>
-                        <option value="12"></option>-->
+                        <option value="">所有类型</option>
+                        <option value="0">取消订单</option>
+                        <option value="1">待支付</option>
+                        <option value="2">已支付</option>
+                        <option value="3">退款申请中</option>
+                        <option value="4">已退款</option>
+                        <option value="5">已发货</option>
+                        <option value="6">申请退货中</option>
+                        <option value="7">退货中</option>
+                        <option value="8">订单退货,订单关闭</option>
+                        <option value="9">换货中</option>
+                        <option value="10">换货完成</option>
+                        <option value="11">申请换货中</option>
+                        <option value="12">已完成</option>
+                        <option value="13">全额付款</option>
+                        <option value="14">定金付款</option>
                     </select>
                     </span>
                 </div>
-                <div class="formControls col-2 col-sm-2">
+                <div class="formControls col-2 col-sm-2" style="width: 150px;">
                     <input type="text" class="input-text" value="" placeholder="订单编号" id="salesId" name="">
                 </div>
-                <div class="formControls col-2 col-sm-2">
+                <div class="formControls col-2 col-sm-2" style="width: 150px;">
                     <input type="text" class="input-text" value="" placeholder="收货人姓名" id="salesAddressName" name="">
                 </div>
-                <div class="formControls col-2 col-sm-2">
+                <div class="formControls col-2 col-sm-2" style="width: 150px;">
                     <input type="text" class="input-text" value="" placeholder="收货人电话" id="salesAddressTel" name="">
                 </div>
-                <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="searchOrder" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+                <div class="formControls col-1 col-sm-1">
+                    <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="searchOrder" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
+                </div>
             </div>
         </form>
     </div>
@@ -114,6 +146,7 @@
 <tfoot>
 <#--<#include "/base/page_util.ftl">-->
 </tfoot>
+
 <script>
 
     $(function () {
@@ -129,7 +162,7 @@
     /*获取销售公司下的所有店铺*/
     function selectStoreInfo() {
         var companyId = $("#companyId").val();
-        var html = "";
+        var html = '<option value="">店铺</option>';
         $.ajax({
             type: "POST",
             data: {
@@ -158,12 +191,12 @@
      * 搜索订单
      */
     function searchOrder(){
-        var salesCompanyId = $("#companyId").val();
-        var salesStoreId = $("#storeId").val();
-        var salesStatus = $("#salesStatus").val();
-        var salesId = $("#salesId").val();
-        var salesAddressName = $("#salesAddressName").val();
-        var salesAddressTel = $("#salesAddressTel").val();
+        var salesCompanyId = convertUndefinedToEmpty($("#companyId").val());
+        var salesStoreId = convertUndefinedToEmpty($("#storeId").val());
+        var salesStatus = convertUndefinedToEmpty($("#salesStatus").val());
+        var salesId = convertUndefinedToEmpty($("#salesId").val());
+        var salesAddressName =convertUndefinedToEmpty($("#salesAddressName").val());
+        var salesAddressTel = convertUndefinedToEmpty($("#salesAddressTel").val());
         var html = "";
         $.ajax({
             type: "POST",
@@ -181,16 +214,28 @@
                 if (data.returnCode == 200) {
                     for(var i=0;i<data.returnMsg.salesOrderList.length;i++){
                         var salesOrder = data.returnMsg.salesOrderList[i];
+
+                        var productsHtml = '';
+                        var salesOrderItem = salesOrder.salesOrderItemList
+                        for(var j=0;j<salesOrderItem.length;j++){
+                            var item = salesOrderItem[j].itemProductName + "*" + salesOrderItem[j].itemNum;
+                            if(j==0){
+                                productsHtml += item
+                            }else{
+                                productsHtml += '<br>'+ item
+                            }
+                        }
+                        var time = formatDate(new Date(salesOrder.salesCreateTime),"yyyy-MM-dd");
                         html += '<tr class="text-c">' +
-                                ' <td></td>' +
-                                ' <td></td>' +
-                                ' <td></td>' +
-                                ' <td></td>' +
-                                ' <td></td>' +
-                                ' <td></td>' +
-                                ' <td></td>' +
-                                ' <td></td>' +
-                                ' <td></td>' +
+                                ' <td>'+ convertUndefinedToEmpty(salesOrder.companyName) +'-'+ convertUndefinedToEmpty(salesOrder.storeName) +'</td>' +
+                                ' <td>'+ salesOrder.salesId +'</td>' +
+                                ' <td>'+ salesOrder.salesAddressName +'</td>' +
+                                ' <td>'+ salesOrder.salesAddressTel +'</td>' +
+                                ' <td>'+ salesOrder.salesAmount +'</td>' +
+                                ' <td>'+ productsHtml +'</td>' +
+                                ' <td>'+ time +'</td>' +
+                                ' <td>'+ salesOrder.salesAddressInfo +'</td>' +
+                                ' <td><a style="text-decoration:none" href="javascript:void(0);" title="选择订单" onclick="selectOrderInfo('+ salesOrder.salesId +')" >选择订单</a></td>' +
                                 ' </tr>';
                     }
                 }else{
@@ -204,21 +249,12 @@
     }
 
     /**
-     *跳转到编辑页面
-     * @param employee
+     * 选择订单,返回订单内容到父级
      */
-    function admin_update_customer(customerId) {
-        window.location.href= "${path}/admin/customer/to_update_customer?customerId="+customerId;
+    function selectOrderInfo(orderId) {
+        parent.setSelectOrder(orderId);
+        parent.layer.close(parent.layer.getFrameIndex(window.name));
     }
-
-    /**
-     *跳转到详情页面
-     * @param employee
-     */
-    function admin_details_customer(customerId) {
-        window.location.href= "${path}/admin/customer/to_details_customer?customerId="+customerId;
-    }
-
 </script>
 </body>
 </html>

+ 10 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/login.ftl

@@ -16,6 +16,9 @@
     <link href="${path}/common/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css" />
     <!--[if IE 6]>
     <script type="text/javascript" src="${path}/common/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
+
+    <script type="text/javascript" src="${path}/common/js/common/common.js"></script>
+
     <script>DD_belatedPNG.fix('*');</script>
     <![endif]-->
     <title>售后实时跟踪系统 - RST</title>
@@ -66,11 +69,18 @@
         </form>
     </div>
 </div>
+<script type="text/javascript" src="${path}/common/js/common/common.js"></script>
 <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery.min.js"></script>
 <script type="text/javascript" src="${path}/common/static/h-ui/js/H-ui.js"></script>
 <script type="text/javascript" src="${path}/common/lib/layer/2.4/layer.js"></script>
 <script type="text/javascript" src="${path}/common/lib/md5/md5.js"></script>
 <script>
+
+    /*实时监听文本框-- 员工编号*/
+    document.getElementById("login_code").addEventListener("input", function(){
+        $("#login_code").val(Trim(this.value));
+    });
+
     // 密码
     var pwd = null;
     // 换一张验证码实现

+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/addRenovationMachine.ftl

@@ -79,8 +79,8 @@
             </label>
         </div>
 
-        <div class="input-box"><span class="input-dic spanhidth">拉线:</span><input class="my-input" type="text" style="width: 76%;"  name="machineLine" id="machineLine" /> </div>
-        <div class="input-box"><span class="input-dic spanhidth">机器数量:</span><input class="my-input" type="text" style="width: 76%;"  name="number" id="number" placeholder="每次最少生成一个机器"/> </div>
+        <div class="input-box"><span class="input-dic spanhidth">拉线:</span><input class="my-input" type="text" style="width: 76%;"  name="machineLine" id="machineLine" value="A1"/> </div>
+        <div class="input-box"><span class="input-dic spanhidth">机器数量:</span><input class="my-input" type="text" style="width: 76%;"  name="number" id="number" value="10" placeholder="每次最少生成一个机器"/> </div>
 
         <div class="input-box">
             <span class="input-dic spanhidth"></span>

+ 34 - 28
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machine/machine_print_List.ftl

@@ -45,9 +45,10 @@
                     <thead>
                     <tr class="text-c">
                         <th width="1"><input name='checkbox' type='checkbox' value='' id="all" ></th>
-                        <th width="10">设备尾号</th>
-                        <th width="10">产品条码</th>
-                        <th width="6">机器类型</th>
+                        <th width="25">设备尾号</th>
+                        <th width="40">产品条码</th>
+                        <th width="25">所属产品</th>
+                        <th width="10">生产时间</th>
                         <th width="20">操作</th>
                     </tr>
                     </thead>
@@ -57,31 +58,36 @@
                         <#else >
                             <#assign machineList = page.dataList />
                         </#if>
-                        <#list machineList as list>
-                            <tr class="text-c" id="${list.machineBarcode }">
-                                <td width="2">
-                                    <input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' machineId="${list.machineId }">
-                                    <input type="hidden" value="${list.machineId + 1000000 }" id="${list.machineBarcode + 'Id'}">
-                                </td>
-                                <td class="text-c" style="font-size: 24px" width="10">${list.machineBarcode?substring(list.machineBarcode?length-4) }</td>
-                                <td class="text-c" width="10">${list.machineBarcode }</td>
-                                <td class="text-c" width="6">
-                                    <#if list.machineProduceType == 1>
-                                        净水机
-                                    </#if>
-                                    <#if list.machineProduceType == 2>
-                                        冲奶机
-                                    </#if>
-                                </td>
-                                <!-- 遍历操作 -->
-                                <td class="td-manage text-c">
-                                    <#if machineIsPrint == '1'>
-                                    <a onclick="updatePrint('${list.machineBarcode}');" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a>
-                                    </#if>
-                                    <a onclick="barCodePrint('${list.machineBarcode }'+'${list.machineQrcode }'+'${list.machineProduceType }','${list.machineId }');" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
-                                </td>
-                            </tr>
-                        </#list>
+                        <#if machineList?? &&  (machineList?size > 0) >
+                            <#list machineList as list>
+                                <tr class="text-c" id="${list.machineBarcode }">
+                                    <td width="2">
+                                        <input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' machineId="${list.machineId }">
+                                        <input type="hidden" value="${list.machineId + 1000000 }" id="${list.machineBarcode + 'Id'}">
+                                    </td>
+                                    <td class="text-c" style="font-size: 24px" width="10">${list.machineBarcode?substring(list.machineBarcode?length-4) }</td>
+                                    <td class="text-c" width="10">${list.machineBarcode }</td>
+                                    <td class="text-c" width="6">
+                                        <#if list.machineProduceType == 1>
+                                            净水机
+                                        </#if>
+                                        <#if list.machineProduceType == 2>
+                                            冲奶机
+                                        </#if>
+                                    </td>
+                                    <td>${(list.machineCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
+                                    <!-- 遍历操作 -->
+                                    <td class="td-manage text-c">
+                                        <#if machineIsPrint == '1'>
+                                        <a onclick="updatePrint('${list.machineBarcode}');" title="修改为已打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6a7;</i></a>
+                                        </#if>
+                                        <a onclick="barCodePrint('${list.machineBarcode }'+'${list.machineQrcode }'+'${list.machineProduceType }','${list.machineId }');" title="打印" href="javascript:;"  class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe652;</i></a>
+                                    </td>
+                                </tr>
+                            </#list>
+                        <#else>
+                            <tr><td colspan="5" class="td-manage text-c" >暂时没有机器,请添加!</td></tr>
+                        </#if>
                     </tbody>
                 </table>
 

+ 11 - 11
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/save_produce.ftl

@@ -38,8 +38,8 @@
     <form class="form form-horizontal" id="form-admin-addProduce">
         <div style="padding: 10px;width: 600px;margin: 0 auto;" class="">
             <div class="my-title">产品信息</div>
-            <div class="input-box"><span class="input-dic">产品名称</span><input class="my-input" name="produceName" id="produceName" type="text" value="" placeholder="请输入产品名称,2-20位中文、英文、数字组合" required   maxlength="20" minlength="2"/> </div>
-            <div class="input-box"><span class="input-dic">产品描述</span><input class="my-input" type="text" name="produceRemake" id="produceRemake" value="" placeholder="请输入产品描述,2-100位中文、英文、数字组合" required  maxlength="100" minlength="2"/> </div>
+            <div class="input-box"><span class="input-dic">产品名称</span><input class="my-input" name="produceName" id="produceName" type="text" value="" placeholder="请输入产品名称,2-20位字符" required   maxlength="20" minlength="2"/> </div>
+            <div class="input-box"><span class="input-dic">产品描述</span><input class="my-input" type="text" name="produceRemake" id="produceRemake" value="" placeholder="请输入产品描述,2-100位字符" required  maxlength="100" minlength="2"/> </div>
 
             <div class="input-box "><span class="input-dic">产品特性</span>
                 <select class="" style="width: 290px;" id="produceFeature" name="produceFeature">
@@ -49,7 +49,7 @@
                     <option value="D">其他(D)</option>
                 </select>
             </div>
-            <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" value="" placeholder="2位英文、数字组合" required  maxlength="2" minlength="2"/>-<input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="" placeholder="2位英文、数字组合" required  maxlength="2" minlength="2"/>  </div>
+            <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" value="" placeholder="2-3位英文、数字组合" required  maxlength="3" minlength="2"/>-<input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="" placeholder="2-3位英文、数字组合" required  maxlength="3" minlength="2"/>  </div>
 
             <div class="input-box"><span class="input-dic">产品类型</span>
                 <label><input type="radio" name="produceType" value="1" checked>净水机</label>
@@ -114,16 +114,16 @@
         $("#form-admin-addProduce").submit(function(){
 
             var produceName = $("#produceName").val();
-            if(!(cnen_name.test(produceName))){
-                layer.msg('产品名称输入格式不正确', {icon: 5, time: 1000});
-                return false;
-            }
+//            if(!(cnen_name.test(produceName))){
+//                layer.msg('产品名称输入格式不正确', {icon: 5, time: 1000});
+//                return false;
+//            }
 
             var produceRemake = $("#produceRemake").val();
-            if(!(cnen_name.test(produceRemake))){
-                layer.msg('产品描述输入格式不正确', {icon: 5, time: 1000});
-                return false;
-            }
+//            if(!(cnen_name.test(produceRemake))){
+//                layer.msg('产品描述输入格式不正确', {icon: 5, time: 1000});
+//                return false;
+//            }
 
             var producePattern = $("#producePattern").val();
             if(!(en_name.test(producePattern))){

+ 12 - 12
watero-rst-web/src/main/webapp/WEB-INF/views/pts/produce/update_produce.ftl

@@ -39,8 +39,8 @@
         <div style="padding: 10px;width: 600px;margin: 0 auto;" class="">
             <div class="my-title">产品信息</div>
             <input type="hidden" name="produceId" value="${produce.produceId!}">
-            <div class="input-box"><span class="input-dic">产品名称</span><input class="my-input" name="produceName" type="text" value="${produce.produceName!}" placeholder="请输入产品名称,2-20位中文、英文、数字组合" maxlength="20"  required /> </div>
-            <div class="input-box"><span class="input-dic">产品描述</span><input class="my-input" type="text" name="produceRemake" value="${produce.produceRemake!}" placeholder="请输入产品描述,2-100位中文、英文、数字组合" maxlength="100"  required /> </div>
+            <div class="input-box"><span class="input-dic">产品名称</span><input class="my-input" name="produceName" type="text" value="${produce.produceName!}" placeholder="请输入产品名称,2-20位字符" maxlength="20"  required /> </div>
+            <div class="input-box"><span class="input-dic">产品描述</span><input class="my-input" type="text" name="produceRemake" value="${produce.produceRemake!}" placeholder="请输入产品描述,2-100位字符" maxlength="100"  required /> </div>
 
             <div class="input-box "><span class="input-dic">产品特性</span>
                 <select class="" style="width: 290px;" id="produceFeature" name="produceFeature">
@@ -50,8 +50,8 @@
                     <option value ="D" <#if produce.produceFeature??><#if produce.produceFeature == 'D'>selected="selected"</#if></#if>>其他(D)</option>
                 </select>
             </div>
-            <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" placeholder="2位英文、数字组合" value="${produce.producePattern!}" placeholder="" required  maxlength="2" minlength="2"/>-
-                <input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="${produce.produceModel!}" placeholder="2位英文、数字组合" required  maxlength="2" minlength="2"/>  </div>
+            <div class="input-box"><span class="input-dic">产品型号</span><input class="my-input" style="width: 120px;" type="text" name="producePattern" id="producePattern" placeholder="2-3位英文、数字组合" value="${produce.producePattern!}" placeholder="" required  maxlength="3" minlength="2"/>-
+                <input class="my-input" style="width: 120px;" type="text" name="produceModel" id="produceModel" value="${produce.produceModel!}" placeholder="2-3位英文、数字组合" required  maxlength="3" minlength="2"/>  </div>
 
             <div class="input-box"><span class="input-dic">产品类型</span>
                 <label><input type="radio" name="produceType" value="1" <#if produce.produceType == 1>checked</#if>>净水机</label>
@@ -124,16 +124,16 @@
         $("#form-admin-addProduce").submit(function(){
 
             var produceName = $("#produceName").val();
-            if(!(cnen_name.test(produceName))){
-                layer.msg('产品名称输入格式不正确', {icon: 5, time: 1000});
-                return false;
-            }
+//            if(!(cnen_name.test(produceName))){
+//                layer.msg('产品名称输入格式不正确', {icon: 5, time: 1000});
+//                return false;
+//            }
 
             var produceRemake = $("#produceRemake").val();
-            if(!(cnen_name.test(produceRemake))){
-                layer.msg('产品描述输入格式不正确', {icon: 5, time: 1000});
-                return false;
-            }
+//            if(!(cnen_name.test(produceRemake))){
+//                layer.msg('产品描述输入格式不正确', {icon: 5, time: 1000});
+//                return false;
+//            }
 
             var producePattern = $("#producePattern").val();
             if(!(en_name.test(producePattern))){

+ 60 - 0
watero-rst-web/src/main/webapp/common/js/common/common.js

@@ -0,0 +1,60 @@
+/**
+ * 格式化日期
+ * @param date
+ * @param format
+ * @returns {*|XML|string|void}
+ */
+var formatDate = function(date, format) {
+    if (!date) return;
+    if (!format) format = "yyyy-MM-dd";
+    switch(typeof date) {
+        case "string":
+            date = new Date(date.replace(/-/, "/"));
+            break;
+        case "number":
+            date = new Date(date);
+            break;
+    }
+    if (!date instanceof Date) return;
+    var dict = {
+        "yyyy": date.getFullYear(),
+        "M": date.getMonth() + 1,
+        "d": date.getDate(),
+        "H": date.getHours(),
+        "m": date.getMinutes(),
+        "s": date.getSeconds(),
+        "MM": ("" + (date.getMonth() + 101)).substr(1),
+        "dd": ("" + (date.getDate() + 100)).substr(1),
+        "HH": ("" + (date.getHours() + 100)).substr(1),
+        "mm": ("" + (date.getMinutes() + 100)).substr(1),
+        "ss": ("" + (date.getSeconds() + 100)).substr(1)
+    };
+    return format.replace(/(yyyy|MM?|dd?|HH?|ss?|mm?)/g, function() {
+        return dict[arguments[0]];
+    });
+};
+
+
+/**
+ * 该方法用于将Undefined转换为空值
+ *
+ * @param val
+ */
+function convertUndefinedToEmpty(val) {
+    if (undefined == val || null == val||typeof val == undefined || typeof val == 'undefined'|| 'undefined' == val) {
+        val = "";
+    }
+    return val;
+}
+
+/**
+ * 去除空格
+ * @param str
+ * @constructor
+ */
+function Trim(str)
+{
+   // return str.replace(/(^\s*)|(\s*$)/g, "");
+    return str.replace(/\s+/g, "");
+}
+