浏览代码

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

# Conflicts:
#	watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java
wangxiaoming 7 年之前
父节点
当前提交
267c261bfa

+ 23 - 12
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -131,6 +131,9 @@ public class CustomerServiceImpl implements CustomerService {
             customerCommon.setOrderId(salesOrder.getSalesId()); //订单id
             customerCommon.setTransactionNumber(customerInfo.getTransactionNumber());   //外部交易号
 
+            customerCommon.setRelationIsTransfer(0);    //是否已转账邮费  0:不需要
+            customerCommon.setRelationBackPostage(0);   //邮费默认为0
+
             /*  初始化产品类型,名称,配件名称 */
             this.setName(customerCommon);
 
@@ -343,21 +346,25 @@ public class CustomerServiceImpl implements CustomerService {
         awaitingSignclosedProductInfo.setSignclosedProductType(1); //类型为产品
         for(int i=0 ;i< customerCommon.getClosedProdcues().size();i++){
             ClosedProdcue closedProdcue = customerCommon.getClosedProdcues().get(i);
-            awaitingSignclosedProductInfo.setProductNum(closedProdcue.getClosedProdcueNumber());
-            awaitingSignclosedProductInfo.setSignclosedProductId(closedProdcue.getProductId());         //产品id
-            awaitingSignclosedProductInfo.setSignclosedProductColor(closedProdcue.getColorId());        //颜色id
-            awaitingSignclosedProductInfo.setProductName(closedProdcue.getClosedProductName());         //产品名称
-            awaitingSignclosedProductInfoArrayList.add(awaitingSignclosedProductInfo);
+            for(int k=0;k<closedProdcue.getClosedProdcueNumber();k++){
+                awaitingSignclosedProductInfo.setProductNum(1);
+                awaitingSignclosedProductInfo.setSignclosedProductId(closedProdcue.getProductId());         //产品id
+                awaitingSignclosedProductInfo.setSignclosedProductColor(closedProdcue.getColorId());        //颜色id
+                awaitingSignclosedProductInfo.setProductName(closedProdcue.getClosedProductName());         //产品名称
+                awaitingSignclosedProductInfoArrayList.add(awaitingSignclosedProductInfo);
+            }
         }
 
         awaitingSignclosedProductInfo.setSignclosedProductType(2);  //类型为配件
         for(int i=0 ;i< customerCommon.getClosedFittings().size();i++){
             ClosedFitting closedFitting = customerCommon.getClosedFittings().get(i);
-            awaitingSignclosedProductInfo.setProductNum(closedFitting.getClosedFittingNumber());
-            awaitingSignclosedProductInfo.setSignclosedProductId(closedFitting.getFittingsId());         //配件id
-            awaitingSignclosedProductInfo.setSignclosedProductColor(null);
-            awaitingSignclosedProductInfo.setProductName(closedFitting.getFittingName());       //配件名称
-            awaitingSignclosedProductInfoArrayList.add(awaitingSignclosedProductInfo);
+            for(int k=0;k<closedFitting.getClosedFittingNumber();k++){
+                awaitingSignclosedProductInfo.setProductNum(1);
+                awaitingSignclosedProductInfo.setSignclosedProductId(closedFitting.getFittingsId());         //配件id
+                awaitingSignclosedProductInfo.setSignclosedProductColor(null);
+                awaitingSignclosedProductInfo.setProductName(closedFitting.getFittingName());       //配件名称
+                awaitingSignclosedProductInfoArrayList.add(awaitingSignclosedProductInfo);
+            }
         }
 
         flag = complaintSignclosedProductInfoMapper.insertList(awaitingSignclosedProductInfoArrayList);
@@ -451,7 +458,9 @@ public class CustomerServiceImpl implements CustomerService {
             status = 0;
         }
         map.put("status",status);
-        map.put("EfastOrderId",oList.get(0).getOrderId());
+        if(oList != null && oList.size() > 0){
+            map.put("EfastOrderId",oList.get(0).getOrderId());
+        }
         return map;
     }
 
@@ -544,8 +553,10 @@ public class CustomerServiceImpl implements CustomerService {
         if(oList == null || oList.size() < 1){
             status = 0;
         }
+        if(oList != null && oList.size() > 0){
+            map.put("EfastOrderId",oList.get(0).getOrderId());
+        }
         map.put("status",status);
-        map.put("EfastOrderId",oList.get(0).getOrderId());
         return map;
     }
 

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

@@ -229,8 +229,6 @@ public class AdminCustomerController {
     }
 
 
-
-
     /**
      * 获取店铺集合
      *

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

@@ -103,7 +103,8 @@
                     <div class="radio-box">
                         <input type="radio" id="tel-3" name="customerSourceType" value="3">
                         <label for="tel-3">其他</label>
-                        <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" value="" placeholder="" id="customerSource" name="customerSource">
+                        <input type="text" style="width: 150px;margin-left: 10px;" class="input-text" value="" placeholder="" id="customerSourceOld" name="customerSourceOld" placeholder="">
+                        <input type="hidden" value="" placeholder="" id="customerSource" name="customerSource">
                     </div>
                 </div>
             </div>
@@ -181,7 +182,7 @@
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题内容:</label>
                 <div class="formControls col-5 col-sm-5">
                     <input type="hidden" name="questionId" id="questionId">
-                    <script id="describeContentText" type="text/plain" style="width:650px;height:250px;"></script>
+                    <script id="describeContentText" type="text/plain" style="width:621px;height:250px;"></script>
                     </script>
                     <input type="hidden" name="describeContent" id="describeContent">
                 </div>
@@ -224,23 +225,23 @@
                         <input type="radio" id="customer-process-2" value="2" name="customerIsSolve">
                         <label for="customer-process-2">未解决</label>
                     </div>
-                    <div class="radio-box" id="renewed">
+                    <div class="radio-box" id="renewed" style="display: none">
                         <input type="radio" id="customer-process-3" value="3" name="customerIsSolve">
                         <label for="customer-process-3">换新</label>
                     </div>
-                    <div class="radio-box" id="maintain">
+                    <div class="radio-box" id="maintain" style="display: none">
                         <input type="radio" id="customer-process-4" value="4" name="customerIsSolve">
                         <label for="customer-process-4">维修</label>
                     </div>
-                    <div class="radio-box" id="reissue">
+                    <div class="radio-box" id="reissue" style="display: none">
                         <input type="radio" id="customer-process-5" value="5" name="customerIsSolve">
                         <label for="customer-process-5">补发</label>
                     </div>
-                    <div class="radio-box" id="backGoods">
+                    <div class="radio-box" id="backGoods" style="display: none">
                         <input type="radio" id="customer-process-6" value="6" name="customerIsSolve">
                         <label for="customer-process-6">退货</label>
                     </div>
-                    <div class="radio-box" id="noReasonBack">
+                    <div class="radio-box" id="noReasonBack" style="display: none">
                         <input type="radio" id="customer-process-7" value="7" name="customerIsSolve">
                         <label for="customer-process-7">无理由退货</label>
                     </div>
@@ -304,6 +305,9 @@
                 <div class="formControls col-2 col-sm-2">
                     <input type="text" class="input-text" value="" placeholder="填写收件人手机号" id="sendTel" name="relationSendTel" datatype="m" errormsg="联系人电话格式不正确!">
                 </div>
+                <div class="formControls col-2 col-sm-2"  id="postageAccount">
+                    <input type="text" class="input-text" value="" placeholder="邮费转账账户" id="relationAlipay" name="relationAlipay" errormsg="邮费转账账户!">
+                </div>
             </div>
             <div class="row cl" id="recipientAddress" style="display: none;">
                 <input type="hidden" id="addressInfo">
@@ -620,10 +624,8 @@
 
     /*初始化页面参数*/
     $(function () {
-
-
         /* 初始化单选框样式 */
-        initCheck();
+        //initCheck();
 
         /*初始化产品类型 --  客诉头部的产品类型单选 */
         initProduceType();
@@ -913,6 +915,7 @@
                     $("#sendAddressInfo").show();
                     $("#sendAddressByPhone").show();
                     $("#updateProduct").show();
+                    $("#postageAccount").show();    //邮费转账账户
                     break;
                 case 4: //维修
                     result = isSolve.maintain;
@@ -929,6 +932,7 @@
                     $("#sendAddressInfo").show();
                     $("#sendAddressByPhone").show();
                     $("#updateProduct").show();
+                    $("#postageAccount").show();    //邮费转账账户
                     break;
                 case 5://补发
                     result = isSolve.reissue;
@@ -945,6 +949,7 @@
                     $("#sendAddressInfo").hide();
                     $("#sendAddressByPhone").hide();
                     $("#updateProduct").hide();
+                    $("#postageAccount").hide();    //邮费转账账户 -- 隐藏
                     break;
                 case 6: //退货
                     result = isSolve.backGoods;
@@ -961,6 +966,7 @@
                     $("#sendAddressInfo").show();
                     $("#sendAddressByPhone").show();
                     $("#updateProduct").hide();
+                    $("#postageAccount").show();    //邮费转账账户
                     break;
                 case 7://无理由退货
                     result = isSolve.noReasonBack;
@@ -977,6 +983,7 @@
                     $("#sendAddressInfo").show();
                     $("#sendAddressByPhone").show();
                     $("#updateProduct").hide();
+                    $("#postageAccount").show();    //邮费转账账户
                     break;
                 default:
                     break;
@@ -1640,6 +1647,19 @@
     /* 添加客诉的准备 */
     function addCustomerReady(){
 
+        var customerSourceType = $("input:radio[name='customerSourceType']:checked").val();
+        if(customerSourceType == 3){
+            var customerSourceOld = $("#customerSourceOld").val();
+            if(customerSourceOld == null || customerSourceOld == "" || typeof(customerSourceOld)=="undefined"){
+
+                vailErrorMsg($("#customerSourceOld"),"未填写来源入口");
+
+                return false;
+            }else{
+                $("#customerSource").val(customerSourceOld);
+            }
+        }
+
         /*----TDS收集模块--start-----*/
         var valicity = $(".ac_result_tip").html();
         if(valicity == null || valicity == "" || typeof(valicity)=="undefined"){

+ 0 - 395
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/order_add.ftl

@@ -1,395 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-    <meta charset="utf-8">
-    <meta name="renderer" content="webkit|ie-comp|ie-stand">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
-    <meta http-equiv="Cache-Control" content="no-siteapp" />
-    <link rel="Bookmark" href="/favicon.ico" >
-    <link rel="Shortcut Icon" href="/favicon.ico" />
-<#include "/base/add_base.ftl">
-    <title>添加订单</title>
-    <style>
-        .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%); 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{ }
-        .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{ }
-        .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%; }
-        .input-produce{height: 25px;line-height: 25px}
-        .color-div{height: 30px;}
-        .table-td-color{}
-        .msg-phone{height: 35px;line-height: 35px;}
-    </style>
-</head>
-<body>
-<div class="page-container">
-    <form action="${path}/admin/customer/add_order_info" method="post" class="form form-horizontal" id="form-order-add"  onkeydown="if(event.keyCode==13)return false;">
-    <div id="addOrder" >
-
-        <input type="hidden" name="itemJson" id="itemJson" value="">
-        <input type="hidden" name="salesStoreId" id="salesStoreId" value="0">
-        <input type="hidden" name="salesCompanyId" id="salesCompanyId" value="0">
-        <input type="hidden" name="salesPayType" id="salesPayType" value="1">
-        <input type="hidden" name="salesSendType" id="salesSendType" value="2">
-
-        <div style="">
-            <div class="row cl" id="productInfo" style="">
-                <label class="form-label col-1 col-sm-1" style="width: 110px;"><span class="c-red">*</span>购买信息:</label>
-                <div class="formControls col-10 col-sm-10">
-
-                    <table class="table table-border table-bg table-bordered">
-                        <thead>
-                        <tr class="text-c">
-                            <th style="text-align: center;" width="60">产品名称</th>
-                            <th style="text-align: center;" width="60">产品颜色</th>
-                            <th style="text-align: center;" width="60">产品配件</th>
-                        </tr>
-                        </thead>
-                        <tbody id="addProduct">
-
-                        </tbody>
-                    </table>
-
-                </div>
-            </div>
-
-            <div class="row cl" id="recipientInfo" style=" margin-top: 20px;">
-                <label class="form-label col-1 col-sm-1" style="width: 110px;"><span class="c-red">*</span>购买信息:</label>
-                <div class="formControls col-3 col-sm-3">
-                    <input type="text" class="input-text" value="" placeholder="填写收件人姓名" id="sendName" name="salesAddressName" datatype="s1-20" errormsg="联系人格式不正确!" >
-                </div>
-                <div class="formControls col-3 col-sm-3">
-                    <input type="text" class="input-text associated-phone" value="" placeholder="填写收件人手机号" id="sendTel" name="salesAddressTel" datatype="m" errormsg="联系人电话格式不正确!">
-                </div>
-                <div class="formControls col-3 col-sm-3">
-                    <input type="text" placeholder="购买日期" id="salesPayTime"  name="salesPayTime" datatype="*" class="input-text Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss'})"  readonly="readonly">
-                </div>
-            </div>
-            <div class="row cl" id="recipientAddress" style=" margin-top: 20px;">
-                <input type="hidden" id="addressInfo">
-                <label class="form-label col-1 col-sm-1" style="width: 110px;"><span class="c-red">*</span>收货地址:</label>
-                <div class="formControls col-3 col-sm-3">
-                            <span class="select-box">
-                                 <select id="province" class="select" name="provinceNumber">
-                                 </select>
-                             </span>
-                </div>
-                <div class="formControls col-3 col-sm-3">
-                            <span class="select-box">
-                                <select id="city" class="select" name="cityNumber">
-                                </select>
-                            </span>
-                </div>
-                <div class="formControls col-3 col-sm-3">
-                            <span class="select-box">
-                                <select id="district" class="select" name="areaNumber">
-                                </select>
-                            </span>
-                </div>
-
-                <input type="hidden" name="salesAddressInfo" id="salesAddressInfo">
-            </div>
-            <div class="row cl" id="recipientAddressText" style=" margin-top: 20px;">
-                <label class="form-label col-1 col-sm-1" style="width: 110px;"></label>
-                <div class="formControls col-10 col-sm-10">
-                    <textarea name="relationSendAddress" id="sendAddress" cols="" rows="2" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)"></textarea>
-                    <span id="addrssMsg"></span>
-                </div>
-            </div>
-
-            <div class="row cl" id="addOrderButton" style=" margin-top: 20px;">
-                <div class="col-2 col-sm-2 col-offset-3">
-                    <button class="btn btn-block btn-primary size-XL" type="submit">添加订单</button>
-                </div>
-            </div>
-        </div>
-    </div>
-    </form>
-</div>
-
-
-<tfoot>
-<#--<#include "/base/page_util.ftl">-->
-</tfoot>
-
-<#--时间控件-->
-<script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
-
-<script>
-
-    $(function () {
-
-        /*初始化产品*/
-        setProduce();
-
-        var provicesId = setAddressPro();
-        var cityId = setAddressCity(provicesId);
-        setAddressDis(cityId);
-
-        /*监听省选择事件*/
-        $(document).on('change', '#province', function() {
-            var proId = $("#province").val();
-            var city = setAddressCity(proId);
-            setAddressDis(city);
-        });
-
-        /*监听市选择事件*/
-        $(document).on('change', '#city', function() {
-            var city = $("#city").val();
-            setAddressDis(city);
-        });
-    })
-
-    $(function (){
-            $("#form-order-add").Validform({
-                tiptype: function (msg, o, cssctl) {
-                    if (o.type == 3) {//失败
-                        layer.msg(msg, {icon: 5, time: 3000});
-                        $(window).scrollTop(o.obj.offset().top - 40);
-                    }
-                },
-                datatype: {//自定义验证类型
-
-                },
-                ignoreHidden: true,
-                tipSweep: true, //若为true,则只在表单提交时验证
-                ajaxPost: true, //异步提交
-                beforeCheck: function (curform) {  //验证通过之前执行的函数
-
-                },
-                beforeSubmit: function (curform) {  //验证通过之后执行的函数
-                    var pro = $("#province").find("option:selected").text();
-                    var city = $("#city").find("option:selected").text();
-                    var dis = $("#district").find("option:selected").text();
-                    var addres = $("#sendAddress").val();
-                    if(addres == null || addres == ""){
-                        layer.msg("未填写详细地址", {icon: 5, time: 3000});
-                        return  false;
-                    }
-                    $("#salesAddressInfo").val(pro + "-" + city + "-" + dis + "-" + addres);
-
-                    var itemList = new Array()
-                    $("#addProduct").find(".input-color-number").each(function(){
-                        var number = $(this).val();
-                        if(number != null && number != ""){
-                            var salesOrderItem = new Object();
-                            salesOrderItem.itemProductId = $(this).parent().find(".input-produce-id").val();
-                            salesOrderItem.itemColorId = $(this).parent().find(".input-color-id").val();
-                            salesOrderItem.itemNum = number;
-                            itemList.push(salesOrderItem);
-                        }
-                    })
-                    $("#itemJson").val(JSON.stringify(itemList));
-                },
-                callback: function (data) {//异步回调函数
-                    if (data) {
-                        var index = layer.alert(data.resultMsg, function () {
-                            if (data.resultCode == 200) {
-                                addSaleOrder(data.returnMsg.orderId);
-                            } else {
-                                layer.close(index);
-                            }
-                            return ;
-                        });
-                    }
-                }
-        })
-    })
-
-    /* 添加订单 */
-    function addSaleOrder(orderId){
-        parent.selectOrderInfo(orderId);
-        parent.layer.close(parent.layer.getFrameIndex(window.name));
-    }
-
-    /*设置省*/
-    function setAddressPro(){
-        var provinceHtml = "";
-        var provices = listProvince();
-        for(var i=0;i<provices.length;i++){
-            provinceHtml += '<option value="'+ provices[i].provinceId +'">'+ provices[i].province +'</option>';
-        }
-        $("#province").html(provinceHtml);
-        return provices[0].provinceId;
-    }
-
-    /*设置市*/
-    function setAddressCity(proId){
-        var cityHtml = ''
-        var city = listCity( proId,"");
-        for(var i=0;i<city.length;i++){
-            cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
-        }
-        $("#city").html(cityHtml);
-        return  city[0].cityId;
-    }
-    /*设置区*/
-    function setAddressDis(cityId){
-        var districtHtml = ''
-        var district = listDistrict(cityId ,"");
-        for(var i=0;i<district.length;i++){
-            districtHtml += '<option value="'+ district[i].districtId +'">'+ district[i].district +'</option>';
-        }
-        $("#district").html(districtHtml);
-    }
-
-    /**
-     * 展示产品
-     * @param orderItemList
-     */
-    function setProduce() {
-        var productList = getProduct() ; //所有产品
-        var html = "";
-        var productTypeNo = 0;
-
-        for(var i=0;i<productList.length;i++) {
-            var product = productList[i];
-            var produceFittings = getProduceFittings(product.productId);  //获取该产品的所有配件
-            var colorList = product.colorList;  //该产品的所有颜色
-
-            var productType = product.productType;
-
-            var colorHtml = '';
-            if(colorList != null && colorList.length >0 ){
-                colorHtml += '<table style="height: 100%;">';
-                for(var j=0;j<colorList.length;j++){
-                    var number = "";
-                    var color = colorList[j];
-//                    for(var k=0;k<orderItemList.length;k++){
-//                        var item = orderItemList[k];
-//                        if(item.itemColorId == color.colorId){
-//                            number = item.itemNum;
-//                        }
-//                    }
-                    var fristInputStyle = "border-top: 1px solid #ddd;";
-                    if(color.colorProductId == product.productId) {
-                        colorHtml += '<tr >' +
-                                '         <td width="85" style="border-left: none;text-align: center;'+ fristInputStyle +'">' + color.colorName + '</td>' +
-                                '         <td width="15" style="'+ fristInputStyle +'">' +
-                                '             <input type="hidden" class="input-produce-id" value="' + color.colorProductId + '">' +
-                                '             <input type="hidden" class="input-color-id" value="' + color.colorId + '">' +
-                                '             <input type="text" class="input-text input-color-number number-input" style="width: 100%;" value="'+ number +'" placeholder="数量"  id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
-                                '         </td>' +
-                                '     </tr>';
-                        fristInputStyle = "";
-                    }
-
-                }
-                colorHtml += '</table>';
-            }else{
-                colorHtml += '<span>暂无该产品的颜色!<span>';
-            }
-
-            var produceFittingsHtml = '';
-            if(produceFittings != null && produceFittings.length > 0){
-                produceFittingsHtml += '<table style="height: 100%;">';
-                for(var m=0;m<produceFittings.length;m++){
-                    var produceFit = produceFittings[m];
-                    if(produceFit.productId == product.productId) {
-                        var fristInputStyle = "border-top: 1px solid #ddd;";
-                        produceFittingsHtml += '<tr >' +
-                                '         <td width="85" style="border-left: none;text-align: center; '+ fristInputStyle +'">' + produceFit.fittingsName +'</td>' +
-                                '         <td width="15" style="'+ fristInputStyle +'">' +
-                                '             <input type="hidden" class="input-produce-id" value="' + produceFit.productId + '">' +
-                                '             <input type="hidden" class="input-fittings-id" value="' + produceFit.fittingsId +'">' +
-                                '             <input type="text" class="input-text input-fittings-number" style="width: 100%;" value="'+ number +'" placeholder="数量" id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
-                                '         </td>' +
-                                '     </tr>';
-                        fristInputStyle = "";
-                    }
-                }
-                produceFittingsHtml += '</table>';
-            }else{
-                produceFittingsHtml += '<span>暂无产品配件!<span>';
-            }
-
-            var produceHtml = '<input type="hidden" value="'+ product.productId +'">' +
-                    '<span>'+  product.productName +'</span>';
-
-            html += ' <tr >' +
-                    '    <td width="80">'+ produceHtml +'</td>' +
-                    '    <td style="padding: 0px;text-align: center;">' +
-                    colorHtml +
-                    '   </td>' +
-                    '    <td style="padding: 0px;text-align: center;">' +
-                    produceFittingsHtml +
-                    '    </td>' +
-                    '</tr>';
-        }
-
-        $("#addProduct").html(html);
-    }
-
-    /*获取产品*/
-    function getProduct(){
-        var productList;
-        $.ajax({
-            type: "POST",
-            data: {
-            },
-            url: "${path}/admin/customer/select_produce",
-            async: false,
-            success: function(data){
-                if (data.returnCode == 200) {
-                    productList = data.returnMsg.productList;
-                }
-            },
-            error: function(XmlHttpRequest, textStatus, errorThrown){
-            }
-        });
-        return productList;
-    }
-
-    /*获取产品配件*/
-    function getProduceFittings(productId){
-        var produceFittings;
-        $.ajax({
-            type: "get",
-            data: {
-                productId : productId
-            },
-            url: "${path}/admin/customer/select_produce_fittings",
-            async: false,
-            success: function(data){
-                if (data.returnCode == 200) {
-                    produceFittings = data.returnMsg.produceFittingsList;
-                }
-            },
-            error: function(XmlHttpRequest, textStatus, errorThrown){
-            }
-        });
-        return produceFittings;
-    }
-</script>
-</body>
-</html>

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

@@ -8,7 +8,7 @@
     <meta http-equiv="Cache-Control" content="no-siteapp" />
     <link rel="Bookmark" href="/favicon.ico" >
     <link rel="Shortcut Icon" href="/favicon.ico" />
-<#include "/base/list_base.ftl">
+<#include "/base/add_base.ftl">
     <title>客诉列表</title>
     <style>
         .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
@@ -56,113 +56,187 @@
 </head>
 <body>
 <div class="page-container">
-    <div class="text-c">
-        <form action="" method="post">
-            <div class="row cl">
 
-                <div class="formControls col-1 col-sm-1" style="margin-right: 30px;">
-                    <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name="" onclick="addOrder()">添加订单</button>
-                </div>
+    <div class="order-list">
+        <div class="text-c">
+            <form action="" method="post">
+                <div class="row cl">
 
-                <div class="formControls col-2 col-sm-2" > <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>
-                            </#list>
-                        </#if>
-                    </select>
-                    </span>
-                </div>
-                <div class="formControls col-2 col-sm-2" > <span class="select-box">
-                    <select name="" class="select" id="storeId">
-                    </select>
-                    </span>
-                </div>
-                <div class="formControls col-2 col-sm-2"> <span class="select-box">
-                    <select name="" class="select" id="storeId">
-                        <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" >
-                    <input type="text" class="input-text" value="" placeholder="订单编号" id="salesId" name="">
+                 <#--   <div class="formControls col-1 col-sm-1" style="margin-right: 30px;">
+                        <button type="button" class="btn btn-primary" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name="" onclick="addOrder()">添加订单</button>
+                    </div>-->
+                    <div class="formControls col-2 col-sm-2" > <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>
+                                </#list>
+                            </#if>
+                        </select>
+                        </span>
+                    </div>
+                    <div class="formControls col-2 col-sm-2" > <span class="select-box">
+                        <select name="" class="select" id="storeId">
+                        </select>
+                        </span>
+                    </div>
+                    <div class="formControls col-2 col-sm-2"> <span class="select-box">
+                        <select name="" class="select" id="storeId">
+                            <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" >
+                        <input type="text" class="input-text" value="" placeholder="订单编号" id="salesId" name="">
+                    </div>
                 </div>
-            </div>
 
-            <div class="row cl" style="margin-top: 10px;">
+                <div class="row cl" style="margin-top: 10px;">
 
-                <div class="formControls col-2 col-sm-2" >
-                    <input type="text" class="input-text" value="" placeholder="收货人姓名" id="salesAddressName" name="">
-                </div>
-                <div class="formControls col-2 col-sm-2">
-                    <input type="text" class="input-text" value="" placeholder="收货人电话" id="salesAddressTel" name="">
+                    <div class="formControls col-2 col-sm-2" >
+                        <input type="text" class="input-text" value="" placeholder="收货人姓名" id="salesAddressName" name="">
+                    </div>
+                    <div class="formControls col-2 col-sm-2">
+                        <input type="text" class="input-text" value="" placeholder="收货人电话" id="salesAddressTel" name="">
+                    </div>
+                    <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>
-                <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>
+            </form>
+        </div>
+
+        <div class="mt-20 ">
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
+                <thead>
+                <tr class="text-c">
+                    <th width="50">渠道商</th>
+                    <th width="60">订单编号</th>
+                    <th width="100">收货人姓名</th>
+                    <th width="80">收货人电话</th>
+                    <th width="80">订单金额</th>
+                    <th width="80">购买产品</th>
+                    <th width="80">购买日期</th>
+                    <th width="100">收货地址</th>
+                    <th width="80">操作</th>
+                </tr>
+                </thead>
+                <tbody id="orderAll">
+
+                </tbody>
+            </table>
+        </div>
+    </div>
+
+
+    <div class="order-add" style="display: none">
+        <form action="${path}/admin/customer/add_order_info" method="post" class="form form-horizontal" id="form-order-add"  onkeydown="if(event.keyCode==13)return false;">
+            <div id="addOrder" >
+                <input type="hidden" name="itemJson" id="itemJson" value="">
+                <input type="hidden" name="salesStoreId" id="salesStoreId" value="0">
+                <input type="hidden" name="salesCompanyId" id="salesCompanyId" value="0">
+                <input type="hidden" name="salesPayType" id="salesPayType" value="1">
+                <input type="hidden" name="salesSendType" id="salesSendType" value="2">
+
+                <div style="">
+                    <div class="row cl" id="productInfo" style="">
+                        <label class="form-label col-1 col-sm-1" style="width: 110px;"><span class="c-red">*</span>购买信息:</label>
+                        <div class="formControls col-10 col-sm-10">
+
+                            <table class="table table-border table-bg table-bordered">
+                                <thead>
+                                <tr class="text-c">
+                                    <th style="text-align: center;" width="60">产品名称</th>
+                                    <th style="text-align: center;" width="60">产品颜色</th>
+                                    <th style="text-align: center;" width="60">产品配件</th>
+                                </tr>
+                                </thead>
+                                <tbody id="addProduct">
+
+                                </tbody>
+                            </table>
+
+                        </div>
+                    </div>
+
+                    <div class="row cl" id="recipientInfo" style=" margin-top: 20px;">
+                        <label class="form-label col-1 col-sm-1" style="width: 110px;"><span class="c-red">*</span>购买信息:</label>
+                        <div class="formControls col-3 col-sm-3">
+                            <input type="text" class="input-text" value="" placeholder="填写收件人姓名" id="sendName" name="salesAddressName" datatype="s1-20" errormsg="联系人格式不正确!" >
+                        </div>
+                        <div class="formControls col-3 col-sm-3">
+                            <input type="text" class="input-text associated-phone" value="" placeholder="填写收件人手机号" id="sendTel" name="salesAddressTel" datatype="m" errormsg="联系人电话格式不正确!">
+                        </div>
+                        <div class="formControls col-3 col-sm-3">
+                            <input type="text" placeholder="购买日期" id="salesPayTime"  name="salesPayTime" datatype="*" class="input-text Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt: 'yyyy-MM-dd HH:mm:ss'})"  readonly="readonly">
+                        </div>
+                    </div>
+                    <div class="row cl" id="recipientAddress" style=" margin-top: 20px;">
+                        <input type="hidden" id="addressInfo">
+                        <label class="form-label col-1 col-sm-1" style="width: 110px;"><span class="c-red">*</span>收货地址:</label>
+                        <div class="formControls col-3 col-sm-3">
+                            <span class="select-box">
+                                 <select id="province" class="select" name="provinceNumber">
+                                 </select>
+                             </span>
+                        </div>
+                        <div class="formControls col-3 col-sm-3">
+                            <span class="select-box">
+                                <select id="city" class="select" name="cityNumber">
+                                </select>
+                            </span>
+                        </div>
+                        <div class="formControls col-3 col-sm-3">
+                            <span class="select-box">
+                                <select id="district" class="select" name="areaNumber">
+                                </select>
+                            </span>
+                        </div>
+
+                        <input type="hidden" name="salesAddressInfo" id="salesAddressInfo">
+                    </div>
+                    <div class="row cl" id="recipientAddressText" style=" margin-top: 20px;">
+                        <label class="form-label col-1 col-sm-1" style="width: 110px;"></label>
+                        <div class="formControls col-10 col-sm-10">
+                            <textarea name="relationSendAddress" id="sendAddress" cols="" rows="2" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)"></textarea>
+                            <span id="addrssMsg"></span>
+                        </div>
+                    </div>
+
+                    <div class="row cl"  margin-top: 20px;">
+                        <label class="form-label col-1 col-sm-1" style="width: 110px;"></label>
+                        <div class="formControls col-2 col-sm-2">
+                            <button style="height: 40px;font-size: 15px;" class="btn btn-block btn-primary size-XL" type="submit">添加订单</button>
+                        </div>
+                        <div class="formControls col-2 col-sm-2">
+                            <button style="height: 40px;font-size: 15px;" class="btn btn-block btn-primary size-XL" type="button" onclick="toSearch()">去搜索</button>
+                        </div>
+                    </div>
+
                 </div>
             </div>
         </form>
     </div>
 
-    <div class="mt-20">
-        <table class="table table-border table-bordered table-bg table-hover table-sort">
-        <thead>
-        <tr class="text-c">
-            <th width="50">渠道商</th>
-            <th width="60">订单编号</th>
-            <th width="100">收货人姓名</th>
-            <th width="80">收货人电话</th>
-            <th width="80">订单金额</th>
-            <th width="80">购买产品</th>
-            <th width="80">购买日期</th>
-            <th width="100">收货地址</th>
-            <th width="80">操作</th>
-        </tr>
-        </thead>
-        <tbody id="orderAll">
-            <#--<#if page.dataList?? &&  (page.dataList?size > 0) >
-                    <#list page.dataList as customer>
-                        <tr class="text-c">
-                            &lt;#&ndash;<td>${customer.customerId!''}</td>&ndash;&gt;
-                            <td>${customer.produceName!''}</td>
-                            <td>${customer.customerName!''}</td>
-                            <td>${customer.customerVersion!''}</td>
-                            <td>${customer.componentsQuantity!'0'}</td>
-                            <td><#if customer.allComponentsCost?? >${customer.allComponentsCost/100}</#if></td>
-                            <td><#if customer.allComponentsWeight?? >${customer.allComponentsWeight}</#if></td>
-                            <td>${customer.customerRemarks!''}</td>
-                            <td>${(customer.customerUpdateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
-                            <td>${(customer.customerCreateTime?string("yyyy-MM-dd HH:mm:ss"))!''}</td>
-                        </tr>
-                    </#list>
-            <#else>
-                <tr><td colspan="10" class="td-manage text-c" >暂时没有Customer,请添加!</td></tr>
-            </#if>-->
-        </tbody>
-    </table>
-    </div>
 
 </div>
 
-
-
 <tfoot>
 <#--<#include "/base/page_util.ftl">-->
 </tfoot>
@@ -243,7 +317,7 @@
             async: true,
             success: function(data){
                 var html = "";
-                if (data.returnCode == 200) {
+                if (data.returnCode == 200 && data.returnMsg.salesOrderList.length > 0 ) {
                     for(var i=0;i<data.returnMsg.salesOrderList.length;i++){
                         var salesOrder = data.returnMsg.salesOrderList[i];
 
@@ -271,8 +345,9 @@
                                 ' </tr>';
                     }
                 }else{
-                    html = '';
+                    html = "";
                 }
+                html += '<tr class="text-c"><td colspan="9">没有搜索到订单~  <a src="javascript:void(0)" style="color: #00e;text-decoration: underline;" onclick="addOrder()">去添加</a></td></tr>';
                 $("#orderAll").html(html);
                 layer.close(index);
             },
@@ -290,12 +365,255 @@
         parent.layer.close(parent.layer.getFrameIndex(window.name));
     }
 
+    function toSearch(){
+        $(".order-add").hide();
+        $(".order-list").show();
+    }
+</script>
+
+
+<script>
+    $(function (){
+        $("#form-order-add").Validform({
+            tiptype: function (msg, o, cssctl) {
+                if (o.type == 3) {//失败
+                    layer.msg(msg, {icon: 5, time: 3000});
+                    $(window).scrollTop(o.obj.offset().top - 40);
+                }
+            },
+            datatype: {//自定义验证类型
+            },
+            ignoreHidden: true,
+            tipSweep: true, //若为true,则只在表单提交时验证
+            ajaxPost: true, //异步提交
+            beforeCheck: function (curform) {  //验证通过之前执行的函数
+            },
+            beforeSubmit: function (curform) {  //验证通过之后执行的函数
+                var pro = $("#province").find("option:selected").text();
+                var city = $("#city").find("option:selected").text();
+                var dis = $("#district").find("option:selected").text();
+                var addres = $("#sendAddress").val();
+                if(addres == null || addres == ""){
+                    layer.msg("未填写详细地址", {icon: 5, time: 3000});
+                    return  false;
+                }
+                $("#salesAddressInfo").val(pro + "-" + city + "-" + dis + "-" + addres);
+
+                var itemList = new Array()
+                $("#addProduct").find(".input-color-number").each(function(){
+                    var number = $(this).val();
+                    if(number != null && number != ""){
+                        var salesOrderItem = new Object();
+                        salesOrderItem.itemProductId = $(this).parent().find(".input-produce-id").val();
+                        salesOrderItem.itemColorId = $(this).parent().find(".input-color-id").val();
+                        salesOrderItem.itemNum = number;
+                        itemList.push(salesOrderItem);
+                    }
+                })
+                $("#itemJson").val(JSON.stringify(itemList));
+            },
+            callback: function (data) {//异步回调函数
+                if (data) {
+                    var index = layer.alert(data.resultMsg, function () {
+                        if (data.resultCode == 200) {
+                            selectOrderInfo(data.returnMsg.orderId);
+                        } else {
+                            layer.close(index);
+                        }
+                        return ;
+                    });
+                }
+            }
+        })
+    })
+
     /**
      * 打开添加订单的页面
      */
     function addOrder(){
-        layer_show("添加订单信息","${path}/admin/customer/add_order","900","380");
+        $(".order-add").show();
+        $(".order-list").hide();
+
+        /*初始化产品*/
+        setProduce();
+
+        var provicesId = setAddressPro();
+        var cityId = setAddressCity(provicesId);
+        setAddressDis(cityId);
+
+        /*监听省选择事件*/
+        $(document).on('change', '#province', function() {
+            var proId = $("#province").val();
+            var city = setAddressCity(proId);
+            setAddressDis(city);
+        });
+
+        /*监听市选择事件*/
+        $(document).on('change', '#city', function() {
+            var city = $("#city").val();
+            setAddressDis(city);
+        });
+    }
+
+    /*设置省*/
+    function setAddressPro(){
+        var provinceHtml = "";
+        var provices = listProvince();
+        for(var i=0;i<provices.length;i++){
+            provinceHtml += '<option value="'+ provices[i].provinceId +'">'+ provices[i].province +'</option>';
+        }
+        $("#province").html(provinceHtml);
+        return provices[0].provinceId;
     }
+
+    /*设置市*/
+    function setAddressCity(proId){
+        var cityHtml = ''
+        var city = listCity( proId,"");
+        for(var i=0;i<city.length;i++){
+            cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
+        }
+        $("#city").html(cityHtml);
+        return  city[0].cityId;
+    }
+    /*设置区*/
+    function setAddressDis(cityId){
+        var districtHtml = ''
+        var district = listDistrict(cityId ,"");
+        for(var i=0;i<district.length;i++){
+            districtHtml += '<option value="'+ district[i].districtId +'">'+ district[i].district +'</option>';
+        }
+        $("#district").html(districtHtml);
+    }
+
+    /**
+     * 展示产品
+     * @param orderItemList
+     */
+    function setProduce() {
+        var productList = getProduct() ; //所有产品
+        var html = "";
+        var productTypeNo = 0;
+
+        for(var i=0;i<productList.length;i++) {
+            var product = productList[i];
+            var produceFittings = getProduceFittings(product.productId);  //获取该产品的所有配件
+            var colorList = product.colorList;  //该产品的所有颜色
+
+            var productType = product.productType;
+
+            var colorHtml = '';
+            if(colorList != null && colorList.length >0 ){
+                colorHtml += '<table style="height: 100%;">';
+                for(var j=0;j<colorList.length;j++){
+                    var number = "";
+                    var color = colorList[j];
+//                    for(var k=0;k<orderItemList.length;k++){
+//                        var item = orderItemList[k];
+//                        if(item.itemColorId == color.colorId){
+//                            number = item.itemNum;
+//                        }
+//                    }
+                    var fristInputStyle = "border-top: 1px solid #ddd;";
+                    if(color.colorProductId == product.productId) {
+                        colorHtml += '<tr >' +
+                                '         <td width="85" style="border-left: none;text-align: center;'+ fristInputStyle +'">' + color.colorName + '</td>' +
+                                '         <td width="15" style="'+ fristInputStyle +'">' +
+                                '             <input type="hidden" class="input-produce-id" value="' + color.colorProductId + '">' +
+                                '             <input type="hidden" class="input-color-id" value="' + color.colorId + '">' +
+                                '             <input type="text" class="input-text input-color-number number-input" style="width: 100%;" value="'+ number +'" placeholder="数量"  id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
+                                '         </td>' +
+                                '     </tr>';
+                        fristInputStyle = "";
+                    }
+
+                }
+                colorHtml += '</table>';
+            }else{
+                colorHtml += '<span>暂无该产品的颜色!<span>';
+            }
+
+            var produceFittingsHtml = '';
+            if(produceFittings != null && produceFittings.length > 0){
+                produceFittingsHtml += '<table style="height: 100%;">';
+                for(var m=0;m<produceFittings.length;m++){
+                    var produceFit = produceFittings[m];
+                    if(produceFit.productId == product.productId) {
+                        var fristInputStyle = "border-top: 1px solid #ddd;";
+                        produceFittingsHtml += '<tr >' +
+                                '         <td width="85" style="border-left: none;text-align: center; '+ fristInputStyle +'">' + produceFit.fittingsName +'</td>' +
+                                '         <td width="15" style="'+ fristInputStyle +'">' +
+                                '             <input type="hidden" class="input-produce-id" value="' + produceFit.productId + '">' +
+                                '             <input type="hidden" class="input-fittings-id" value="' + produceFit.fittingsId +'">' +
+                                '             <input type="text" class="input-text input-fittings-number" style="width: 100%;" value="'+ number +'" placeholder="数量" id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
+                                '         </td>' +
+                                '     </tr>';
+                        fristInputStyle = "";
+                    }
+                }
+                produceFittingsHtml += '</table>';
+            }else{
+                produceFittingsHtml += '<span>暂无产品配件!<span>';
+            }
+
+            var produceHtml = '<input type="hidden" value="'+ product.productId +'">' +
+                    '<span>'+  product.productName +'</span>';
+
+            html += ' <tr >' +
+                    '    <td width="80">'+ produceHtml +'</td>' +
+                    '    <td style="padding: 0px;text-align: center;">' +
+                    colorHtml +
+                    '   </td>' +
+                    '    <td style="padding: 0px;text-align: center;">' +
+                    produceFittingsHtml +
+                    '    </td>' +
+                    '</tr>';
+        }
+
+        $("#addProduct").html(html);
+    }
+
+    /*获取产品*/
+    function getProduct(){
+        var productList;
+        $.ajax({
+            type: "POST",
+            data: {
+            },
+            url: "${path}/admin/customer/select_produce",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    productList = data.returnMsg.productList;
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+        return productList;
+    }
+
+    /*获取产品配件*/
+    function getProduceFittings(productId){
+        var produceFittings;
+        $.ajax({
+            type: "get",
+            data: {
+                productId : productId
+            },
+            url: "${path}/admin/customer/select_produce_fittings",
+            async: false,
+            success: function(data){
+                if (data.returnCode == 200) {
+                    produceFittings = data.returnMsg.produceFittingsList;
+                }
+            },
+            error: function(XmlHttpRequest, textStatus, errorThrown){
+            }
+        });
+        return produceFittings;
+    }
+
 </script>
 </body>
 </html>

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

@@ -153,6 +153,18 @@ function keyFun(node){
     }
 }
 
+/**
+ * 用于展示错误信息,并让该节点得到焦点
+ */
+function vailErrorMsg(node,msg){
+    layer.msg(msg, {icon: 5, time: 3000});
+    node.select();
+    window.setTimeout(function(){
+        node.focus();
+    },0);
+    $("html,body").animate({scrollTop:node.offset().top},300);//1000是ms,也可以用slow代替
+}
+
 
 /**物流名称替换**/
 function replace(code) {