wangxiaoming 6 år sedan
förälder
incheckning
487d7ed2d3

+ 1 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/address/AddressController.java

@@ -67,7 +67,7 @@ public class AddressController {
     public ResponseJson listDistrict(District district)throws Exception{
         ResponseJson rj =new ResponseJson(200, "查询成功", 200);
         List<District> districtList = addressService.listDistrict(district);
-        rj.addResponseKeyValue("cityList", districtList);
+        rj.addResponseKeyValue("districtList", districtList);
         if (districtList == null || districtList.size() < 1) {
             return new ResponseJson(500, "查询失败", 500);
         } else {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 18 - 12
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSalesOrderController.java


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

@@ -29,4 +29,5 @@
 <script type="text/javascript">
     var root_path = "${path}";
 </script>
-<script type="text/javascript" src="${path}/common/js/common/common.js"></script>
+<script type="text/javascript" src="${path}/common/js/common/common.js"></script>
+<script type="text/javascript" src="${path}/common/js/common/address.js"></script>

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

@@ -29,4 +29,5 @@
     var root_path = "${path}";
 </script>
 
-<script type="text/javascript" src="${path}/common/js/common/common.js"></script>
+<script type="text/javascript" src="${path}/common/js/common/common.js"></script>
+<script type="text/javascript" src="${path}/common/js/common/address.js"></script>

+ 0 - 44
watero-rst-web/src/main/webapp/WEB-INF/views/order/bacth/order_batch_list.ftl

@@ -105,50 +105,6 @@
         window.location.href= "${path}/admin/order/download_order_excel?orderBatchId="+batchId;
     }
 
-    /**
-     * 修改状态
-     * @param batchId
-     * @param status
-     */
-    function update_batch_status(batchId,produceId,status){
-        var statusMsg = '';
-        if(status == 1){
-            statusMsg = '使用该批次将会停止使用其他同产品的批次!';
-        }else{
-            statusMsg = '停用该批次,你需要立即使用同产品的其他批次,否则可能影响机器生产二维码!';
-        }
-
-        layer.confirm(statusMsg, {
-            btn: ['确定','取消'] //按钮
-        }, function(){
-            $.ajax({
-                type: "POST",
-                data: {
-                    batchId : batchId,
-                    produceId : produceId,
-                    batchStatus : status
-                },
-                url: "${path}/admin/batch/update_batch_status",
-                async: false,
-                success: function(data){
-                },
-                error: function(XmlHttpRequest, textStatus, errorThrown){
-                }
-            });
-            location.replace(location.href)
-        }, function(){
-            layer.closeAll();
-            return false;
-        });
-    }
-
-    /**
-     * 导出零件到excel
-     */
-    function toExcel(){
-        window.location.href= "${path}/admin/batch/generation_excel";
-    }
-
 </script>
 </body>
 </html>

+ 589 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/add_order.ftl

@@ -0,0 +1,589 @@
+<!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"/>
+    <#include "/base/add_base.ftl">
+
+    <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;}
+        .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_results li a span {float:right}
+        .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;}
+        .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;}
+        .msg-phone{height: 35px;line-height: 35px;}
+
+        .col-sm-1{width: 150px;}
+    </style>
+    <title>添加Bom - Bom管理 - RST</title>
+</head>
+<body>
+<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
+    <span class="c-gray en">&gt;</span> 订单管理
+    <span class="c-gray en">&gt;</span> 添加订单
+    <a class="btn radius r"
+       style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;"
+       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<article class="page-container" style="padding: 10px;">
+    <div class="pd-20 cl">
+        <form action="${path}/admin/customer/save_customer" method="post" class="form form-horizontal" id="form-customer-add"  onkeydown="if(event.keyCode==13)return false;">
+
+            <div class="row cl">
+                <label class="form-label col-3">
+                    <div class="tit-2">客诉基本信息</div>
+                </label>
+                <div class="formControls col-9">
+                </div>
+            </div>
+
+           <#-- private static final long serialVersionUID = -2015761953380110553L;
+            private Integer salesId;                //订单id
+            private String salesOrderId;            //订单号
+            private String salesOpenId;             //身份证号/openid
+            private Integer salesDiscountMoney;     //优惠金额
+            private Integer salesPledgeMoney;       //押金金额
+            private Integer salesRemainDeposit;     //待提取金额
+            private Integer salesStatus;            //确认状态
+            private Integer salesSendType;          //送货方式
+            private Date salesSendTime;             //发货时间
+            private Date salesSalesTime;            //订购时间
+            private String salesPostNum;            //快递单号
+            private String salesPostFirm;           //快递公司
+            private String salesAddressInfo;        //详细地址
+            private String
+            private Integer salesAmount;            //订单总金额
+            private Integer salesPayMoney;          //已付金额
+            private Integer salesPayType;           //付款方式
+            private Integer salesWaitMoney;         //待付金额
+            private Integer salesLastMoney;         //本次支付金额
+            private Integer salesShippingFee;       //邮费
+            private Date salesPayTime;              //支付时间
+            private Date salesCreateTime;           //创建时间
+            private String salesAdminRemark;        //后台的备注 -- 卖家备注
+            private String salesUserRemark;         //用户备注
+            private String salesPayNumber;          //交易尾号
+            private Integer salesStoreId;           //店铺id
+            private Integer salesCompanyId;         //销售公司id
+            private Integer salesType;              //订单类型
+            private String salesDealCode;           //交易号
+            private Integer salesOrderStatus;       //订单状态 订单状态:1:正常        2:换货 3:退货  4:维修  5:补发
+            private Integer salesShippingStatus;    //发货状态
+            private Integer salesPayStatus;         //付款状态
+            private Integer salesProcessStatus;     //单据状态
+            private Integer salesIsSend;            //是否通知配货
+            private Integer salesIsLocked;          //是否锁定
+            private Integer salesIsSeparate;        //是否缺货
+            private Integer salesIsDownload;        //是否下载过
+            private Integer salesMainOrderId;       //主订单id(拆单用)
+            private String orderNoteRemark;         //订单备注,推送到efast
+            private String storeEfast;              //Efast 的店铺id-->
+
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>批次编号:</label>
+                <div class="formControls col-4 col-sm-4"> <span class="select-box" style=" width: 625px;">
+                    <select class="my-select" name="order_batch" id="order_batch" matchSelect="订单编号|订单号|交易号|序号" style="height: 30px;width: 180px;margin: 0px;">
+                        <option value="1" >新增批次</option>
+                        <#list orderBatchs as orderBatch>
+                            <option value="${orderBatch.batchId}" >${orderBatch.batchId}</option>
+                        </#list>
+                    </select>
+				</span>
+                </div>
+            </div>
+
+            <div class="row cl" id="" style="">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="填写收件人姓名" id="salesAddressName" name="salesAddressName" datatype="*1-16" errormsg="联系人格式不正确!" >
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="填写收件人手机号" id="salesAddressTel" name="salesAddressTel" datatype="*1-11" errormsg="联系人电话格式不正确!">
+                </div>
+            </div>
+
+            <div class="row cl address_info" id="" style="">
+                <label class="form-label col-1 col-sm-1">地址信息:</label>
+                <div class="formControls col-2 col-sm-2" style="">
+                    <span class="select-box">
+                        <select class="select init_province" id="addressProvince">
+                        </select>
+				    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select  class="select init_city" id="addressCity">
+                        </select>
+                    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2" style="position: relative;">
+                    <span class="select-box">
+                        <select  class="select init_country" id="addressCountry">
+                        </select>
+				    </span>
+                </div>
+                <input type="hidden" name="salesAddressInfo" id="salesAddressInfo" >
+            </div>
+
+
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>来源入口:</label>
+                <div class="formControls col-10 col-sm-10 skin-minimal customerSourceType_text_all">
+                    <div class="radio-box">
+                        <input type="radio" id="tel-1" name="customerSourceType" value="1" >
+                        <label for="tel-1">400电话</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-2" name="customerSourceType" value="2" checked>
+                        <label for="tel-2">微信公众号</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-4" name="customerSourceType" value="4" >
+                        <label for="tel-4">QQ群</label>
+                        <input type="text" class="input-text trim_input customerSourceType_text_4"  value="" style="width: 100px;">
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-5" name="customerSourceType" value="5" >
+                        <label for="tel-5">微信群</label>
+                        <input type="text" class="input-text trim_input customerSourceType_text_5" value="" style="width: 100px;">
+                    </div>
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>咨询类型:</label>
+                <div class="formControls col-10 col-sm-10 skin-minimal">
+                    <div class="radio-box">
+                        <input type="radio" class="customerCounselType" id="customer-type-1" name="customerCounselType" value="1"  >
+                        <label for="customer-type-1">售前咨询</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" class="customerCounselType" id="customer-type-2" name="customerCounselType" value="2"  checked>
+                        <label for="customer-type-2">售后咨询</label>
+                    </div>
+                </div>
+            </div>
+
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>产品类型:</label>
+                <input type="hidden" id="typeCompany" name="typeCompany" value="">
+                <div class="formControls col-10 col-sm-10 skin-minimal produce_type_html" id="produceTypeHtml">
+                <#--<div class="radio-box">
+                        <input type="radio" id="tel-3" name="produceType" datatype="*" nullmsg="请选择产品类型!">
+                        <label for="tel-3">净水机</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="tel-3" name="produceType" datatype="*" nullmsg="请选择产品类型!">
+                        <label for="tel-4">冲奶机</label>
+                    </div>-->
+                </div>
+            </div>
+            <div class="row cl" id="salesChannelsSelect">
+                <input type="hidden" id="companyId" name="companyId" value="" >
+                <input type="hidden" id="storeId" name="storeId" value="" >
+                <label class="form-label col-1 col-sm-1">销售渠道:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                         <select id="selectCompany" class="select" name="">
+                         </select>
+                     </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                         <select id="selectStore" class="select" name="">
+                         </select>
+                     </span>
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1">客户信息:</label>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="微信昵称" id="customerWechatName" name="customerWechatName" value="">
+                </div>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text trim_input" placeholder="用户姓名" id="customerName" name="customerName" value="">
+                </div>
+                <div class="formControls col-2 col-sm-2 skin-minimal">
+                    <input type="text" class="input-text associated-phone" placeholder="用户电话" id="customerTel" name="customerTel" value="">
+                </div>
+            </div>
+            <input type="hidden" value="" id="customerLastId" name="customerLastId">
+            <input type="hidden" value="" id="customerInitialId" name="customerInitialId">
+            <div class="row cl">
+                <div class="formControls col-9 col-sm-9 text-c" style="display:none;" id="onCustomerTable">
+                    <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>
+                            <th style="text-align: center;" width="60">用户昵称</th>
+                            <th style="text-align: center;" width="60">用户电话</th>
+                            <th style="text-align: center;" width="60">处理方式</th>
+                            <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="onCustomer">
+
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="row cl" id="twiceSellEnd">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>二次售后:</label>
+                <div class="formControls col-10 col-sm-10 skin-minimal">
+                    <div class="radio-box">
+                        <input type="radio" id="customerSecondaryCustomer1"  name="customerSecondaryCustomer" value="1"  >
+                        <label for="customerSecondaryCustomer1">是</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="customerSecondaryCustomer2"  name="customerSecondaryCustomer" value="2" checked>
+                        <label for="customerSecondaryCustomer2">否</label>
+                    </div>
+                </div>
+            </div>
+            <div class="row cl" id="openTheLock">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>开箱损:</label>
+                <div class="formControls col-10 col-sm-10 skin-minimal">
+                    <div class="radio-box">
+                        <input type="radio" id="customerOutDamaged1" name="customerOutDamaged" value="1"  >
+                        <label for="customerOutDamaged1">是</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="customerOutDamaged2"  name="customerOutDamaged" value="2"  checked>
+                        <label for="customerOutDamaged2">否</label>
+                    </div>
+                </div>
+            </div>
+            <div class="row cl" style="position: relative;">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>客诉问题:</label>
+                <div class="formControls col-2 col-sm-2"> <span class="select-box">
+				<select name="complaintId" class="select">
+                    <option value="">请选择问题分类</option>
+                <#--<option value="0">使用操作</option>-->
+                <#--<option value="1">使用操作</option>-->
+				</select>
+				</span>
+                </div>
+                <div class="formControls col-2 col-sm-2"> <span class="select-box">
+				<select name="smallClassId" id="smallClassId" class="select">
+                    <option value="">请选择问题分类</option>
+                <#--<option value="0">使用操作制水出水</option>
+                <option value="1">使用操作制水出水</option>-->
+				</select>
+				</span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <div class="clearfix">
+                        <input type="text" placeholder="搜索关键词" class="input-text  ac_input trim_input" name="questionIdMsg" value="" id="search_text" autocomplete="off" style="width:60%"><button type="button" class="btn btn-primary" id="search_button">搜索</button>
+                    </div>
+                </div>
+
+                <div class="dalog-ask">
+                    <div class="tag">
+                        <em></em>
+                        <strong>相关QA</strong>
+                        <a href="javascript:void(0)" style="margin-left: 200px;" onclick="closeQA()">关闭</a>
+                        <ul id="question" style="padding-top: 15px">
+                        <#--<li class="ask">1、净水机面板操作不灵敏,是怎么回事?</li>
+                            <li class="answer">答:<span>4净水机面板操作不灵敏,是怎么回事。1、净水机面板操作不灵敏,是怎么回事?1、净水机面板操作不灵敏,是怎么回事?1、净水机面板操作不灵敏,是怎么回事?</span></li>-->
+                        </ul>
+                    </div>
+                </div>
+
+            </div>
+
+            <div class="row cl">
+                <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="text" class="input-text trim_input" style="width: 625px;" name="describeTitle" id="describeTitle" datatype="*1-50" errormsg="问题标题不正确!" >
+                </div>
+            </div>
+
+            <div class="row cl">
+                <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" value="">
+                    <script id="describeContentText" type="text/plain" style="width:983px;height:250px;"></script>
+                    </script>
+                    <input type="hidden" name="describeContent" id="describeContent" value="">
+                </div>
+            </div>
+
+            <div class="row cl">
+            <#--处理描述 - 客诉备注-->
+                <label class="form-label col-1 col-sm-1">问题描述:</label>
+                <div class="formControls col-5 col-sm-5">
+                    <span>问题描述详情,内部使用,不会对外公布。</span>
+                    <script id="describeHandleDescText" type="text/plain" style="width:983px;height:250px;"></script>
+                    </script>
+                    <input type="hidden" id="describeHandleDesc" name="describeHandleDesc">
+                </div>
+            </div>
+
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text associated-phone" value="" placeholder="请输入手机号" id="p-phone" name="">
+                </div>
+                <div class="formControls col-2 col-sm-2" style="width: 10%">
+                    <input type="button" class="btn btn-primary" value="发送问题回复给用户" onclick="sendPhone('p','p-msg');">
+                </div>
+                <div class="formControls col-2 col-sm-2" style="width: 10%;    margin-left: 40px;">
+                    <input type="button" class="btn btn-primary" value="保存QA" onclick="saveQuestion(1);">
+                </div>
+                <div class="formControls col-2 col-sm-2 msg-phone">
+                    <div id="p-msg" style="color: #e00"></div>
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1">
+                    <div class="tit">处理结果</div>
+                </label>
+                <div class="formControls col-10 col-sm-10">
+                </div>
+            </div>
+
+            <input type="hidden" id="sendProdcues" name="sendProdcuesJson" value="">
+            <input type="hidden" id="sendFittings" name="sendFittingsJson" value="">
+            <input type="hidden" id="closedProdcues" name="closedProdcuesJson" value="">
+            <input type="hidden" id="closedFittings" name="closedFittingsJson" value="">
+
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1">处理类型:</label>
+                <div class="formControls col-10 col-sm-10 skin-minimal">
+                    <div class="radio-box" id="solved">
+                        <input type="radio" id="customer-process-1" value="1" name="customerIsSolve" >
+                        <label for="customer-process-1">已解决</label>
+                    </div>
+                    <div class="radio-box" id="noSolved">
+                        <input type="radio" id="customer-process-2" value="2" name="customerIsSolve">
+                        <label for="customer-process-2">未解决</label>
+                    </div>
+                    <div class="radio-box" id="renewed" style="display: none">
+                        <input type="radio" id="customer-process-3" value="3" name="customerIsSolve" checked>
+                        <label for="customer-process-3">换新</label>
+                    </div>
+                    <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" 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" 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" style="display: none">
+                        <input type="radio" id="customer-process-7" value="7" name="customerIsSolve">
+                        <label for="customer-process-7">无理由退货</label>
+                    </div>
+                </div>
+            </div>
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-10 col-sm-10">
+                    <ul class="time-line-list" id="processResultStatus">
+                    <#-- <li><span class="arrow"></span><div class="number">1</div><div>录入客诉</div></li>
+                        <li><span class="arrow"></span><div class="number">2</div><div>督促用户寄回</div></li>
+                        <li><span class="arrow"></span><div class="number">3</div><div>录入快递单号</div></li>
+                        <li><span class="arrow"></span><div class="number">4</div><div>仓库收货</div></li>
+                        <li><span class="arrow"></span><div class="number">5</div><div>换新发货</div></li>
+                        <li><span class="arrow"></span><div class="number">6</div><div>发货通知用户</div></li>
+                        <li><span class="arrow"></span><div class="number">7</div><div>收货后回访</div></li>-->
+                    </ul>
+                </div>
+            </div>
+            <div class="row cl" id="orderHead" style="display: none;">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>订单信息:</label>
+                <div class="formControls col-1 col-sm-1">
+                    <button type="button" class="btn btn-primary" id="selectOrder">搜索订单</button>
+                </div>
+            </div>
+            <div class="row cl" id="order" style="display: none;">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-9 col-sm-9 text-c">
+                    <table class="table table-border table-bg table-bordered" >
+                        <thead>
+                        <tr>
+                            <th style="text-align: center;">销售公司</th>
+                            <th style="text-align: center;">店铺名称</th>
+                            <th style="text-align: center;">Efast订单号</th>
+                            <th style="text-align: center;">姓名</th>
+                            <th style="text-align: center;">电话</th>
+                            <th style="text-align: center;">订单金额</th>
+                            <th style="text-align: center;">购买产品</th>
+                            <th style="text-align: center;">购买日期</th>
+                            <th style="text-align: center;">收货地址</th>
+                        </tr>
+                        </thead>
+                        <tbody id="showSalesOrderId">
+                        <tr >
+                            <td style="text-align: center;" colspan="9">暂未选择订单</td>
+                        </tr>
+                        </tbody>
+                    </table>
+                    <input type="hidden" id="orderId" name="salesId" value="" >
+                    <input type="hidden" id="ids" name="ids" value="" >
+                </div>
+            </div>
+
+            <div class="row cl" id="recipientInfoTitle" style="display: none;">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>收件信息:</label>
+                <div class="formControls col-8 col-sm-8">请先选择订单,系统自动填充姓名,电话和地址信息。</div>
+            </div>
+
+            <div class="row cl" id="recipientInfo" style="display: none;">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text" value="" placeholder="填写收件人姓名" id="sendName" name="relationSendName" datatype="*1-16" errormsg="联系人格式不正确!" >
+                </div>
+                <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">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                         <select id="province" class="select" name="provinceNumber">
+                         </select>
+                     </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select id="city" class="select" name="cityNumber">
+                        </select>
+                    </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                        <select id="district" class="select" name="areaNumber">
+                        </select>
+                    </span>
+                </div>
+                <input type="hidden" name="relationSendMergeAddress" id="relationSendMergeAddress">
+            </div>
+            <div class="row cl" id="recipientAddressText" style="display: none;">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-5 col-sm-5">
+                    <textarea name="relationSendAddress" id="sendAddress" cols="" rows="2" datatype="*" errormsg="收货地址不正确!" class="textarea" placeholder="请填写详细地址,最多支持50字符" onKeyUp="$.Huitextarealength(this,50)"></textarea>
+                    <span id="addrssMsg"></span>
+                </div>
+            </div>
+
+            <div class="row cl" id="TDScollectShow" style="display: none;">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-6 col-sm-6">
+                    <span id="DTS-address"></span>
+                    &nbsp;&nbsp;&nbsp;&nbsp;<span id="DTS-in"></span>&nbsp;&nbsp;  <span id="DTS-out"></span>
+                </div>
+            </div>
+            <div class="row cl" id="customerCostsDiv" style="display: none;">
+                <label class="form-label col-1 col-sm-1">工厂报价:</label>
+                <div class="col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" placeholder="工厂报价" id="relationFactoryCosts" name="relationFactoryCosts" value="">
+                </div>
+                <label class="form-label col-1 col-sm-1">给客户报价:</label>
+                <div class="col-2 col-sm-2">
+                    <input type="text" class="input-text trim_input" placeholder="客户报价" id="relationCustomerCosts" name="relationCustomerCosts" value="">
+                </div>
+            </div>
+            <div class="row cl" id="sendAddressInfo">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>寄回信息:</label>
+                <div class="formControls col-5 col-sm-5" style="height: 240px" id="sendAddressSmsHtml">
+                <#-- <script id="sendAddressSms" type="text/plain" style="width:983px;height:200px;"></script>
+                    </script>-->
+                </div>
+            </div>
+
+            <div class="row cl" id="sendAddressByPhone" style="display: none;">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-2 col-sm-2">
+                    <input type="text" class="input-text associated-phone" value="" placeholder="请输入手机号" id="m-phone" name="">
+                </div>
+                <div class="formControls col-2 col-sm-2" style="width: 10%">
+                    <input type="button" class="btn btn-primary" value="发短信给用户" onclick="sendPhone('m','m-msg');">
+                </div>
+                <div class="formControls col-2 col-sm-2 msg-phone">
+                    <div id="m-msg" style="color: #e00"></div>
+                </div>
+            </div>
+            <div class="row cl" id="customerDescDiv">
+                <label class="form-label col-1 col-sm-1">备注:</label>
+                <div class="col-5 col-sm-5">
+                    <textarea type="text" placeholder="" id="customerDesc" name="customerDesc" style="width: 100%;height: 100px;"></textarea>
+                </div>
+            </div>
+
+            <div class="row cl">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访信息:</label>
+                <div class="formControls col-10 col-sm-10 skin-minimal">
+                    <div class="radio-box">
+                        <input type="radio" id="customer-visit-1" name="customerIsVisit" value="2" >
+                        <label for="customer-visit-1">需要回访</label>
+                    </div>
+                    <div class="radio-box">
+                        <input type="radio" id="customer-visit-2" name="customerIsVisit"  value="1" checked>
+                        <label for="customer-visit-2">不需要回访</label>
+                    </div>
+                </div>
+            </div>
+
+            <div class="row cl">
+                <div class="col-2 col-sm-2 col-offset-3">
+                    <button class="btn btn-block btn-primary size-XL" type="submit">确认录入</button>
+                </div>
+            </div>
+        </form>
+    </div>
+</article>
+
+<script type="text/javascript">
+    var url_path = "${path}";
+</script>
+
+<script type="text/javascript">
+
+    $('.skin-minimal input').iCheck({
+        checkboxClass: 'icheckbox-blue',
+        radioClass: 'iradio-blue',
+        increaseArea: '20%'
+    });
+
+    $(function(){
+//        initAddress($(".init_province"),$(".init_city"),$(".init_country"));
+        $(".address_info").initAddress();
+    })
+</script>
+</body>
+</html>

watero-rst-web/src/main/webapp/WEB-INF/views/cm/salesOrder/sales_order_detail.ftl → watero-rst-web/src/main/webapp/WEB-INF/views/order/salesOrder/sales_order_detail.ftl


+ 98 - 70
watero-rst-web/src/main/webapp/WEB-INF/views/cm/salesOrder/sales_order_list.ftl

@@ -20,19 +20,22 @@
         .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
         /*input[type=radio]{-webkit-appearance:none;appearance:none;background: url(/rst/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(/rst/common/images/pts/radio-2.png) center center no-repeat;background-size:auto 100%;width: 20px;height: 20px;margin-right: 10px;}*/
+
+        .my-order{left: 0px;cursor:pointer; position: absolute;border-bottom: 1px solid rgb(255, 255, 255);float: left;width: 110px;height: 36px;}
     </style>
 </head>
 <body>
 <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
-    <span class="c-gray en">&gt;</span> 客诉管理
+    <span class="c-gray en">&gt;</span> 订单管理
     <span class="c-gray en">&gt;</span> 订单列表
     <a class="btn radius r" style="line-height:1.6em;margin-top:3px;background: #32a3d8;color: #fff;border:1px solid #32a3d8;" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
 </nav>
 
-<!-- 同步订单状态 -->
+<!--  录入订单 -->
 <div class="layui-layer layui-anim layui-layer-iframe" id="layui-SynOrder" times="4" showtime="0" contype="string" style="display:none;z-index: 19891018; width: 400px; height: 260px; position: absolute; top: 100px; left: 379px;">
     <form action="" method="post" class="form form-horizontal" id="form-admin-SynOrder">
-        <div class="layui-layer-title" style="cursor: move;" move="ok">同步订单</div>
+
+        <div class="layui-layer-title" style="cursor: move;" move="ok">录入订单</div>
         <br>
         <div class="row cl">
             <label class="form-label col-3" style="float: left;"><span class="c-red">*</span>&nbsp;交易号:</label>
@@ -54,9 +57,17 @@
 		</span>
 </div>
 
+
+
 <div class="page-container">
     <div class="text-c">
         <form action="${path}/admin/salesOrder/list_order_page" method="post">
+                <div style="position: relative;float: left;display: block;width: 110px;height: 36px;" id="addOrderDiv" >
+                    <button type="button" style="top: 0px;" class="my-btn-search my-order" id="addOrderType" >录入订单</button>
+                    <button type="button" style="top: 36px;display: none;" class="my-btn-search my-order" id="addOrderManual" onclick="toAddOrderManual();">手动录入</button>
+                    <button type="button" style="top: 72px;display: none;" class="my-btn-search my-order" id="addOrderExcel" onclick="toAddOrderExcel();">Excel导入</button>
+                </div>
+
                 <select class="my-select" name="isHaveImport" id="isHaveImport" style="height: 36px;width: 120px;margin: 0px;margin-bottom: 10px;">
                     <option value ="">是否已导出过</option>
                     <option value ="2" <#if salesOrder.isHaveImport??><#if salesOrder.isHaveImport == "2" >selected="selected"</#if></#if>>是</option>
@@ -87,9 +98,7 @@
             <input type="text" class="my-input"  style="width:80px;margin-right: 0px;" value="${salesOrder.salesAddressTel!}" placeholder="收货人电话" name="salesAddressTel" id="salesAddressTel">
 
             <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 35px;" id=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
-            <#--<button onClick="downloadOrder();" &lt;#&ndash;onMouseOver="showDownloadOrderInfo();" onMouseOut="hideDownloadOrderInfo();"&ndash;&gt; class="btn radius" style="background: #32a3d8;color: #fff; height: 35px" type="button" title="下载第三方平台的发货信息"><i class="Hui-iconfont">&#xe640;</i> 下载订单</button>-->
             <button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 35px;" id="order_excel"><i class="Hui-iconfont">&#xe644;</i> 下载订单</button>
-            <#--<button type="button" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);height: 35px;" id="synOrder"><i class="Hui-iconfont">&#xe632;</i> 同步订单</button>-->
             <button onClick="upFiles();" class="btn radius" style="background: #32a3d8;color: #fff; height: 35px" type="button"><i class="Hui-iconfont">&#xe632;</i>上传第三方平台订单</button>
             <button onClick="upFiles2();"  class="btn radius" style="background: #32a3d8;color: #fff; height: 35px" type="button"><i class="Hui-iconfont">&#xe632;</i>上传发货信息</button>
             <button onClick="downloadOrder();" class="btn radius" style="background: #32a3d8;color: #fff;" type="button" title="下载第三方平台的发货信息"><i class="Hui-iconfont">&#xe640;</i> 下载发货后订单</button>
@@ -311,83 +320,102 @@
         myImage.open();
     }
 
-    $('#synOrder').click(function (e) {
-        $("#layui-SynOrder").show();
-    });
-
     // 关闭窗口
     function exitWindowsDiv(_this) {
         $(_this).parent().parent().hide();
     }
 
-    function submitSynOrder() {
-        var efastOrderId = $.trim($('#efastOrderId').val());
-        if(efastOrderId == null || efastOrderId == ""){
-            $("#msge").html("请输入百胜交易号!");
-            return false;
+   </script>
+
+    <script>
+        $(function(){
+
+            $(".my-order").mouseover(function(){
+                $("#addOrderManual").show();
+                $("#addOrderExcel").show();
+            });
+            $(".my-order").mouseout(function(){
+                $("#addOrderManual").hide();
+                $("#addOrderExcel").hide();
+            });
+
+        })
+
+        /**
+         *  手动添加订单
+         * */
+        function toAddOrderManual() {
+            window.location.href=root_path + '/admin/salesOrder/to_add_order';
         }
-        $.ajax({
-            type:'POST',
-            url: '${path}/admin/salesOrder/sync_efast_order',
-            data:{
-                "salesDealCode" : efastOrderId
-            },
-            dataType: 'json',
-            success:function(res) {
-                if(res.resultCode == 200){
-                    $("#msge").html(res.resultMsg);
-                    location.reload();
-                }else{
-                    $("#msge").html(res.resultMsg);
-                }
+
+
+       /* function submitSynOrder() {
+            var efastOrderId = $.trim($('#efastOrderId').val());
+            if(efastOrderId == null || efastOrderId == ""){
+                $("#msge").html("请输入百胜交易号!");
                 return false;
             }
-        });
-    }
+            $.ajax({
+                type:'POST',
+                url: '${path}/admin/salesOrder/sync_efast_order',
+                data:{
+                    "salesDealCode" : efastOrderId
+                },
+                dataType: 'json',
+                success:function(res) {
+                    if(res.resultCode == 200){
+                        $("#msge").html(res.resultMsg);
+                        location.reload();
+                    }else{
+                        $("#msge").html(res.resultMsg);
+                    }
+                    return false;
+                }
+            });
+        }*/
 
-    /*导出上传到efast的Excel*/
-    $('#order_excel').click(function (e) {
-        var isHaveImport = $("#isHaveImport").val(); //是否导出
-        var isDeliverGoods = $("#isDeliverGoods").val(); //是否已发货
-        var salesStoreId = $("#salesStoreId").val(); //店铺
-        var startDate = $("#startDate").val();
-        var endDate = $("#endDate").val();
-        var salesOrderId = $("#salesOrderId").val();
-        var salesDealCode = $("#salesDealCode").val();
-        var salesAddressName = $("#salesAddressName").val();
-        var salesAddressTel = $("#salesAddressTel").val();
-        var salesBatchId = $("#salesBatchId").val();
+        /*导出上传到efast的Excel*/
+        $('#order_excel').click(function (e) {
+            var isHaveImport = $("#isHaveImport").val(); //是否导出
+            var isDeliverGoods = $("#isDeliverGoods").val(); //是否已发货
+            var salesStoreId = $("#salesStoreId").val(); //店铺
+            var startDate = $("#startDate").val();
+            var endDate = $("#endDate").val();
+            var salesOrderId = $("#salesOrderId").val();
+            var salesDealCode = $("#salesDealCode").val();
+            var salesAddressName = $("#salesAddressName").val();
+            var salesAddressTel = $("#salesAddressTel").val();
+            var salesBatchId = $("#salesBatchId").val();
 
-        $.ajax({
-            type:'POST',
-            url: '${path}/admin/salesOrder/sync_efast_order_num',
-            data:{
-                "isHaveImport" : isHaveImport,
-                "isDeliverGoods" : isDeliverGoods,
-                "salesStoreId" : salesStoreId,
-                "startDate" : startDate,
-                "endDate" : endDate,
-                "salesOrderId" : salesOrderId,
-                "salesDealCode" : salesDealCode,
-                "salesAddressName" : salesAddressName,
-                "salesAddressTel" : salesAddressTel,
-                "salesBatchId" : salesBatchId
+            $.ajax({
+                type:'POST',
+                url: '${path}/admin/salesOrder/sync_efast_order_num',
+                data:{
+                    "isHaveImport" : isHaveImport,
+                    "isDeliverGoods" : isDeliverGoods,
+                    "salesStoreId" : salesStoreId,
+                    "startDate" : startDate,
+                    "endDate" : endDate,
+                    "salesOrderId" : salesOrderId,
+                    "salesDealCode" : salesDealCode,
+                    "salesAddressName" : salesAddressName,
+                    "salesAddressTel" : salesAddressTel,
+                    "salesBatchId" : salesBatchId
 
-            },
-            dataType: 'json',
-            async: false,
-            success:function(res) {
-                if(res.resultCode != 200){
-                    layer.msg(res.resultMsg,{icon: 2,time:3000});
-                    return false;
-                }else{
-                    window.location="${path}/admin/salesOrder/download_efast_order?isHaveImport="+isHaveImport+"&isDeliverGoods="+isDeliverGoods+"&salesStoreId="+salesStoreId+"&startDate="+startDate+"&endDate="+endDate+"&salesOrderId="+salesOrderId+"&salesDealCode="+salesDealCode+"&salesAddressName="+salesAddressName+"&salesAddressTel="+salesAddressTel+"&salesBatchId="+salesBatchId;
+                },
+                dataType: 'json',
+                async: false,
+                success:function(res) {
+                    if(res.resultCode != 200){
+                        layer.msg(res.resultMsg,{icon: 2,time:3000});
+                        return false;
+                    }else{
+                        window.location="${path}/admin/salesOrder/download_efast_order?isHaveImport="+isHaveImport+"&isDeliverGoods="+isDeliverGoods+"&salesStoreId="+salesStoreId+"&startDate="+startDate+"&endDate="+endDate+"&salesOrderId="+salesOrderId+"&salesDealCode="+salesDealCode+"&salesAddressName="+salesAddressName+"&salesAddressTel="+salesAddressTel+"&salesBatchId="+salesBatchId;
+                    }
                 }
-            }
-        });
-
-    })
+            });
 
-</script>
+        })
+    </script>
 </body>
 </html>

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

@@ -0,0 +1,236 @@
+/*** 没事的时候多写写代码 -- ljk */
+;(function($,window,document,undefined){
+    //定义Address的构造函数
+    var Address = function(ele,opt) {
+        this.$element = ele,
+        this.addressInfo = {
+            provinceNode : ele.find(".init_province"),
+            cityNode : ele.find(".init_city"),
+            countryNode : ele.find(".init_country")
+        }
+        this.options = $.extend({}, this.defaults, opt)
+    }
+    //定义Address的方法
+    Address.prototype = {
+        create: function() {
+            this.provinceNode =  this.options.provinceNode;
+            this.cityNode =  this.options.cityNode;
+            this.countryNode =  this.options.countryNode;
+            return this;
+        },
+        init: function() {
+            var provinceArray = this.initProvince();
+            return this;
+        },
+        initProvince:function(){
+            var address = this;
+            var $provinceNode = $(this.addressInfo.provinceNode);
+            $.get(root_path +"/address/list_province", function(result){
+                if (result.returnCode == 200) {
+                    $provinceNode.empty();    //清空下拉框
+                    $(result.returnMsg.provinceList).each(function (){
+                        $provinceNode.append("<option value='"+ this.provinceId +"'>"+ this.province +"</option>");
+                    })
+                    $provinceNode.change(function (){
+                        address.initCity($provinceNode.val());
+                    })
+                    address.initCity(result.returnMsg.provinceList[0].provinceId);
+                }else{
+                    console.log("省份查询失败");
+                }
+            });
+        },
+        initCity:function(provinceId){
+            var address = this;
+            var $cityNode = $(this.addressInfo.cityNode);
+            provinceId = this.cufte(provinceId);
+            $.get(root_path +"/address/list_city?provinceId="+provinceId, function(result){
+                if (result.returnCode == 200) {
+                    $cityNode.empty();    //清空下拉框
+                    $(result.returnMsg.cityList).each(function (){
+                        $cityNode.append("<option value='"+ this.cityId +"'>"+ this.city +"</option>");
+                    })
+                    $cityNode.change(function (){
+                        address.initCountry($cityNode.val());
+                    })
+                    address.initCountry(result.returnMsg.cityList[0].cityId);
+                }else{
+                    console.log("城市查询失败");
+                }
+            });
+        },
+        initCountry:function(cityId){
+            var address = this;
+            var $countryNode = $(this.addressInfo.countryNode);
+            cityId = this.cufte(cityId);
+            $.get(root_path +"/address/list_district?cityId="+cityId, function(result){
+                if (result.returnCode == 200) {
+                    $countryNode.empty();    //清空下拉框
+                    $(result.returnMsg.districtList).each(function (){
+                        $countryNode.append("<option value='"+ this.districtId +"'>"+ this.district +"</option>");
+                    })
+                }else{
+                    console.log("区县查询失败");
+                }
+            });
+        },
+        cufte:function(val) {
+            if (undefined == val || null == val||typeof val == undefined || typeof val == 'undefined'|| 'undefined' == val) {
+                val = "";
+            }
+            return val;
+        }
+    }
+    // initAddress 调用
+    $.fn.initAddress = function(options) {
+        var address = new Address(this, options);
+        address.init();
+    }
+})(jQuery,window,document);
+
+
+/**
+ *  初始化省市区
+ * @param provinceNode
+ * @param cityNode
+ * @param countryNode
+ */
+function initAddress(provinceNode,cityNode,countryNode){
+    initAddressProvince(provinceNode,cityNode,countryNode);
+    $(provinceNode).change(function (){
+        initAddresscity(this.val());
+    })
+
+    $(cityNode).change(function (){
+        initAddressCountry(this.val());
+    })
+}
+
+/**
+ * 初始化省
+ * @param provinceNode
+ */
+function initAddressProvince(provinceNode,cityNode,countryNode){
+    var infoArray = listProvince();
+    $(provinceNode).empty();    //清空
+    $(infoArray).each(function (){
+        $(provinceNode).append("<option value='"+ this.provinceId +"'>"+ this.province +"</option>");
+    })
+    var proId = $(provinceNode).val();
+    initAddresscity(proId,cityNode,countryNode);
+}
+
+/**
+ * 初始化市
+ * @param provinceNode
+ */
+function initAddresscity(proId,cityNode,countryNode){
+    var infoArray = listCity(proId);
+    $(cityNode).empty();    //清空
+    $(infoArray).each(function (){
+        $(cityNode).append("<option value='"+ this.provinceId +"'>"+ this.province +"</option>");
+    })
+    var cityId = $(cityNode).val();
+    initAddressCountry(cityId,countryNode);
+}
+
+/**
+ * 初始化区
+ * @param provinceNode
+ */
+function initAddressCountry(countryNode){
+    var infoArray = listDistrict();
+    $(countryNode).empty();    //清空
+    $(infoArray).each(function (){
+        $(countryNode).append("<option value='Value'>Text</option>");
+    })
+}
+
+/**
+ * 获取省
+ * @param provinceId 省id
+ * @param province 省名称(模糊搜索)
+ * @returns {{}}
+ */
+function listProvince(provinceId,provinceName){
+    provinceId = cufte(provinceId);
+    provinceName = cufte(provinceName);
+    var province = new Array();
+    $.ajax({
+        type: "get",
+        data: {
+            provinceId : provinceId,
+            province : provinceName
+        },
+        dataType: "json",
+        contentType:"application/json; charset=utf-8",
+        url: root_path +"/address/list_province",
+        async: false,
+        success: function(data){
+            if (data.returnCode == 200) {
+                province = data.returnMsg.provinceList;
+            }else{
+                console.log("查询失败");
+            }
+        },
+        error: function(XmlHttpRequest, textStatus, errorThrown){
+        }
+    });
+    return province;
+}
+
+/**
+ * 获取市
+ */
+function listCity(provinceId,cityName){
+    provinceId = cufte(provinceId);
+    cityName = cufte(cityName);
+    var city = new Array();
+    $.ajax({
+        type: "get",
+        data: {
+            provinceId : provinceId,
+            city : cityName
+        },
+        url: root_path +"/address/list_city",
+        async: false,
+        success: function(data){
+            if (data.returnCode == 200) {
+                city = data.returnMsg.cityList;
+            }else{
+                console.log("查询失败");
+            }
+        },
+        error: function(XmlHttpRequest, textStatus, errorThrown){
+        }
+    });
+    return city;
+}
+
+/**
+ * 获取区
+ */
+function listDistrict(cityId,districtName){
+    cityId = cufte(cityId);
+    districtName = cufte(districtName);
+    var district = new Array();
+    $.ajax({
+        type: "get",
+        data: {
+            cityId : cityId,
+            district : districtName
+        },
+        url: root_path +"/address/list_district",
+        async: false,
+        success: function(data){
+            if (data.returnCode == 200) {
+                district = data.returnMsg.districtList;
+            }else{
+                console.log("查询失败");
+            }
+        },
+        error: function(XmlHttpRequest, textStatus, errorThrown){
+        }
+    });
+    return district;
+}

+ 8 - 85
watero-rst-web/src/main/webapp/common/js/common/common.js

@@ -34,10 +34,8 @@ var formatDate = function(date, format) {
     });
 };
 
-
 /**
  * 该方法用于将Undefined转换为空值
- *
  * @param val
  */
 function convertUndefinedToEmpty(val) {
@@ -48,6 +46,14 @@ function convertUndefinedToEmpty(val) {
 }
 
 /**
+ * 该方法用于将Undefined转换为空值
+ * @param val
+ */
+function cufte(val) {
+    return convertUndefinedToEmpty(val);
+}
+
+/**
  * 截取字符串显示
  * @param val
  * @param length  长度
@@ -76,89 +82,6 @@ function Trim(str)
 }
 
 /**
- * 获取省
- * @param provinceId 省id
- * @param province 省名称(模糊搜索)
- * @returns {{}}
- */
-function listProvince(provinceId,provinceName){
-    var province = new Array();
-    $.ajax({
-        type: "get",
-        data: {
-            provinceId : provinceId,
-            province : provinceName
-        },
-        dataType: "json",
-        contentType:"application/json; charset=utf-8",
-        url: root_path +"/address/list_province",
-        async: false,
-        success: function(data){
-            if (data.returnCode == 200) {
-                province = data.returnMsg.provinceList;
-            }else{
-                console.log("查询失败");
-            }
-        },
-        error: function(XmlHttpRequest, textStatus, errorThrown){
-        }
-    });
-    return province;
-}
-
-/**
- * 获取市
- */
-function listCity(provinceId,cityName){
-    var city = new Array();
-    $.ajax({
-        type: "get",
-        data: {
-            provinceId : provinceId,
-            city : cityName
-        },
-        url: root_path +"/address/list_city",
-        async: false,
-        success: function(data){
-            if (data.returnCode == 200) {
-                city = data.returnMsg.cityList;
-            }else{
-                console.log("查询失败");
-            }
-        },
-        error: function(XmlHttpRequest, textStatus, errorThrown){
-        }
-    });
-    return city;
-}
-
-/**
- * 获取区
- */
-function listDistrict(cityId,districtName){
-    var district = new Array();
-    $.ajax({
-        type: "get",
-        data: {
-            cityId : cityId,
-            district : districtName
-        },
-        url: root_path +"/address/list_district",
-        async: false,
-        success: function(data){
-            if (data.returnCode == 200) {
-                district = data.returnMsg.cityList;
-            }else{
-                console.log("查询失败");
-            }
-        },
-        error: function(XmlHttpRequest, textStatus, errorThrown){
-        }
-    });
-    return district;
-}
-
-/**
  * 获取当前节点,将当前节点的val值除了数字其他的删掉
  * @param node
  * @param maxNumber  最大值