Bladeren bron

Merge remote-tracking branch 'liujiankang/master'

# Conflicts:
#	watero-rst-web/src/main/java/com/iamberry/rst/utils/test.java
liujiankang 7 jaren geleden
bovenliggende
commit
3fd1538dab

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

@@ -144,7 +144,7 @@ public class CustomerServiceImpl implements CustomerService {
             switch (customerInfo.getCustomerIsSolve()) {  //处理结果: 1:已解决  2:未解决 3:换新  4:维修 5:补发 6:退货 7:无理由退货
                 case 3: //换新
 
-                    isReturn = this.chargebackEfastOrder(customerCommon,salesOrder);    //原订单生成退单
+                    isReturn = this.chargebackEfastOrder(customerCommon,salesOrder,2);    //原订单生成退单
 
                     map = this.sendEfastOrder(customerCommon,salesOrder);  //换新需要向Efast推送一条换新发货的订单
                     if(map.get("status") == 1){
@@ -160,7 +160,7 @@ public class CustomerServiceImpl implements CustomerService {
                     break;
                 case 4: //维修
 
-                    isReturn = this.chargebackEfastOrder(customerCommon,salesOrder);    //原订单生成退单
+                    isReturn = this.chargebackEfastOrder(customerCommon,salesOrder,2);    //原订单生成退单
 
                     map = this.sendEfastOrder(customerCommon,salesOrder);  //维修需要向Efast推送一条维修发货的订单
                     if(map.get("status") == 1){
@@ -184,12 +184,18 @@ public class CustomerServiceImpl implements CustomerService {
                     }
                     break;
                 case 6: //退货
+
+                    isReturn = this.chargebackEfastOrder(customerCommon,salesOrder,3);    //原订单生成退单
+
                     complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());    //原有订单的Efast的订单编号
                     this.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);//创建仓储任务
                     complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储签收id
                     this.saveComplaintDetectInfo(complaintDetectInfo,customerCommon);   //创建品检
                     break;
                 case 7: //无理由退货
+
+                    isReturn = this.chargebackEfastOrder(customerCommon,salesOrder,3);    //原订单生成退单
+
                     complaintSignclosedInfo.setOldEfastId(salesOrder.getSalesOrderId());    //原有订单的Efast的订单编号
                     this.saveComplaintSignclosedInfo(complaintSignclosedInfo,customerCommon);//创建仓储任务
                     complaintDetectInfo.setSignclosedId(complaintSignclosedInfo.getSignclosedId()); //设置仓储签收id
@@ -253,7 +259,7 @@ public class CustomerServiceImpl implements CustomerService {
 
 
     /**
-     * 初始化
+     * 产品配件初始化
      * @param cc
      */
     private void setName(CustomerCommon cc){
@@ -460,6 +466,7 @@ public class CustomerServiceImpl implements CustomerService {
         map.put("status",status);
         if(oList != null && oList.size() > 0){
             map.put("EfastOrderId",oList.get(0).getOrderId());
+            logger.info("换新,维修 ,补发向Efast 推送订单,订单号为:" + oList.get(0).getOrderId());
         }
         return map;
     }
@@ -568,11 +575,11 @@ public class CustomerServiceImpl implements CustomerService {
      * @throws Exception
      */
     @Transactional
-    boolean chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder) throws Exception{
+    boolean chargebackEfastOrder(CustomerCommon customerCommon, SalesOrder salesOrder,Integer status) throws Exception{
 
         SalesOrder order = new SalesOrder();
         order.setSalesId(salesOrder.getSalesId());
-        order.setSalesStatus(8);
+        order.setSalesOrderStatus(status); //换货状态
         Integer flag = salesOrderMapper.updateSalesOrder(order);
 //        if(flag < 0){
 //            throw new Exception("退货失败");

+ 2 - 2
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintSignclosedProductInfoMapper.xml

@@ -60,12 +60,12 @@
   <insert id="insertList" parameterType="SignclosedProductInfo" >
     insert into tb_rst_complaint_awaiting_signclosed_product
       (
-          signclosed_id, product_name,product_num,signclosed_product_type,signclosed_product_id,signclosed_product_color,machine_no
+          signclosed_id, product_name,product_num,signclosed_product_type,signclosed_product_id,signclosed_product_color
       )
     values
     <foreach collection="list" item="node" index="index" separator="," open="" close="">
       (
-        #{node.signclosedId}, #{node.productName},#{node.productNum},#{node.signclosedProductType}, #{node.signclosedProductId}, #{node.signclosedProductColor}, #{node.machineNo}
+        #{node.signclosedId}, #{node.productName},#{node.productNum},#{node.signclosedProductType}, #{node.signclosedProductId}, #{node.signclosedProductColor}
       )
     </foreach>
   </insert>

+ 29 - 25
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -192,13 +192,10 @@ public class AdminCustomerController {
         salesOrder.setSalesOpenId("0");
         salesOrder.setSalesAmount(salesAmount);
         salesOrder.setSalesPayMoney(salesAmount);
-        salesOrder.setSalesPayStatus(2);
-        salesOrder.setSalesShippingStatus(5);
-        salesOrder.setSalesStatus(0);
         salesOrder.setSalesOrderStatus(1);
         salesOrder.setSalesCreateTime(new Date());
         //salesOrder.setSalesPayTime(new Date());
-        salesOrder.setSalesShippingFee(0);
+
         salesOrder.setSalesLastMoney(salesAmount);
         salesOrder.setSalesWaitMoney(0);
         salesOrder.setSalesPayMoney(salesAmount);
@@ -208,6 +205,15 @@ public class AdminCustomerController {
         salesOrder.setSalesRemainDeposit(0);
         salesOrder.setSalesType(1);
 
+        salesOrder.setSalesStatus(0);//确认状态:0(未确认)1(确认)2(挂起)3(作废)
+        salesOrder.setSalesShippingStatus(0);    //发货状态: 0(未发货)1(已发货,即已扫描出库)3(备货中)
+        salesOrder.setSalesPayStatus(2);   //已付款
+        salesOrder.setSalesProcessStatus(0);  //单据状态:0(正常单)1(问题单)
+        salesOrder.setSalesIsSend(0);        //0:否 1:是  是否通知配货
+        salesOrder.setSalesIsLocked(0); //是否锁定 0:否 1:是
+        salesOrder.setSalesIsSeparate(0);   //是否缺货  0:否 1:是
+        salesOrder.setSalesShippingFee(0); //邮费
+
         Integer adminId = AdminUtils.getLoginAdminId();
         String orderCode = OrderNoUtil.createOrderCode(adminId);
         salesOrder.setSalesDealCode(orderCode);
@@ -633,49 +639,49 @@ public class AdminCustomerController {
             return new ResponseJson(500, "未获取到产品类型!", 500);
         }
 
+        if(complaintQuestionInfo.getQuestionId() == null){
+            return new ResponseJson(500, "未获取到问题信息或邮寄信息!", 500);
+        }
+
+        flag =  complaintQuestionInfoService.updateQuestionById(complaintQuestionInfo);
+        if (flag < 1) {
+            return new ResponseJson(500, "问题修改失败!", 500);
+        }
+
         String con = "";
         if(type != null && !"".equals(type)){
-            if( "p".equals(type)){
-                url += "/problem?questionId="+complaintQuestionInfo.getQuestionId();
-
+            if( "p".equals(type)){ //problem" 问题处理;  mailAddress:邮寄地址;
+                url += "/"+complaintQuestionInfo.getQuestionId();
                 switch (typeCompany){
                     case 1:
-                        con = SmsConfig.SEND_PRODUCT_SMS_WATERO;
+                        con = SmsConfig.SEND_PRODUCT_SEND_WATERO;
                         break;
                     case 2:
-                        con = SmsConfig.SEND_PRODUCT_SMS_SHANGDUO;
+                        con = SmsConfig.SEND_PRODUCT_SEND_SHANGDUO;
                         break;
                     case 3:
-                        con = SmsConfig.SEND_PRODUCT_SMS_YULIA;
+                        con = SmsConfig.SEND_PRODUCT_SEND_YULIA;
                         break;
                 }
-
             }else if( "m".equals(type)){
                 complaintQuestionInfo.setQuestionName(null);
-                url += "/address";
-
+                url += "/5";
                 switch (typeCompany){
                     case 1:
-                        con = SmsConfig.SEND_PRODUCT_SEND_WATERO;
+                        con = SmsConfig.SEND_PRODUCT_SMS_WATERO;
                         break;
                     case 2:
-                        con = SmsConfig.SEND_PRODUCT_SEND_SHANGDUO;
+                        con = SmsConfig.SEND_PRODUCT_SMS_SHANGDUO;
                         break;
                     case 3:
-                        con = SmsConfig.SEND_PRODUCT_SEND_YULIA;
+                        con = SmsConfig.SEND_PRODUCT_SMS_YULIA;
                         break;
                 }
-
             }
         }
 
-        logger.info("发送短信url地址:" + url);
-
-        flag =  complaintQuestionInfoService.updateQuestionById(complaintQuestionInfo);
-        if (flag < 1) {
-            return new ResponseJson(500, "问题修改失败!", 500);
-        }
         String text = MessageFormat.format(con, url);
+        logger.info("给 "+ phone +" 手机用户发送短信:" + text );
         String result = smsService.sendOtherCMS(phone, text);
 
         if("SUCCESS".equals(result)){
@@ -683,8 +689,6 @@ public class AdminCustomerController {
         }else{
             return new ResponseJson(200, "发送短信失败", 200);
         }
-
-
     }
 
     /**

+ 16 - 12
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AppComplaintQuestionInfoController.java

@@ -5,6 +5,7 @@ import com.iamberry.rst.faces.cm.ComplaintQuestionInfoService;
 import com.iamberry.wechat.tools.ResponseJson;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
@@ -16,7 +17,6 @@ import javax.servlet.http.HttpServletRequest;
  * 问题
  */
 @Controller
-@RequestMapping("/QA")
 public class AppComplaintQuestionInfoController {
 
     /**
@@ -36,12 +36,16 @@ public class AppComplaintQuestionInfoController {
      * @return
      * @throws Exception
      */
-    @RequestMapping("/problem")
-    public ModelAndView problem(HttpServletRequest request) throws Exception {
-        ModelAndView mv = new ModelAndView("wap/cm/request_message");
-        String questionId = request.getParameter("questionId");
-        mv.addObject("questionId", questionId);
-        return mv;
+    @RequestMapping("/QA/{id}")
+    public ModelAndView problem( @PathVariable("id") Integer id, HttpServletRequest request) throws Exception {
+        if(id == backOutQuestionId){
+            ModelAndView mv = new ModelAndView("wap/cm/send_message");
+            return mv;
+        }else{
+            ModelAndView mv = new ModelAndView("wap/cm/request_message");
+            mv.addObject("questionId", id);
+            return mv;
+        }
     }
 
     /**
@@ -51,11 +55,11 @@ public class AppComplaintQuestionInfoController {
      * @return
      * @throws Exception
      */
-    @RequestMapping("/address")
-    public ModelAndView adress(HttpServletRequest request) throws Exception {
-        ModelAndView mv = new ModelAndView("wap/cm/send_message");
-        return mv;
-    }
+//    @RequestMapping("/address")
+//    public ModelAndView adress(HttpServletRequest request) throws Exception {
+//        ModelAndView mv = new ModelAndView("wap/cm/send_message");
+//        return mv;
+//    }
 
     /**
      * 查询退回短信客诉问题

+ 2 - 0
watero-rst-web/src/main/java/com/iamberry/rst/utils/test.java

@@ -1,5 +1,6 @@
 package com.iamberry.rst.utils;
 import com.alibaba.dubbo.common.json.JSON;
+
 import com.auth0.jwt.internal.org.apache.commons.codec.binary.Base64;
 import com.auth0.jwt.internal.org.apache.commons.codec.binary.StringUtils;
 import net.sf.json.JSONArray;
@@ -14,6 +15,7 @@ import java.util.Map;
 
 import javax.crypto.Cipher;
 import javax.crypto.spec.SecretKeySpec;
+import java.security.Key;
 
 
 public class test {

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

@@ -82,10 +82,9 @@
             </div>
             <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">
-				<select name="adminId" id="adminId" class="select">
-
-				</select>
+                <div class="formControls col-4 col-sm-4"> <span class="select-box" style=" width: 625px;">
+                    <select name="adminId" id="adminId" class="select">
+                    </select>
 				</span>
                 </div>
             </div>
@@ -103,7 +102,7 @@
                     <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="customerSourceOld" name="customerSourceOld" placeholder="">
+                        <input type="text" style="width: 321px;margin-left: 10px;" class="input-text" value="" placeholder="" id="customerSourceOld" name="customerSourceOld" placeholder="">
                         <input type="hidden" value="" placeholder="" id="customerSource" name="customerSource">
                     </div>
                 </div>
@@ -182,7 +181,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:621px;height:250px;"></script>
+                    <script id="describeContentText" type="text/plain" style="width:983px;height:250px;"></script>
                     </script>
                     <input type="hidden" name="describeContent" id="describeContent">
                 </div>
@@ -281,16 +280,8 @@
                             <th style="text-align: center;">购买日期</th>
                         </tr>
                         <tr id="showOrder">
-                          <#--  <td>爱贝源-微信商城</td>
-                            <td>1290387806</td>
-                            <td>何小小</td>
-                            <td>1882222888</td>
-                            <td>¥3680</td>
-                            <td>Watero净水机</td>
-                            <td>2017-06-06</td>-->
+                            <td style="text-align: center;" colspan="7">暂未选择订单</td>
                         </tr>
-                        <#--<tr id="showOrderAddress">-->
-                        <#--</tr>-->
                     </table>
                     <input type="hidden" id="companyId" name="companyId" value="" >
                     <input type="hidden" id="storeId" name="storeId" value="" >
@@ -354,29 +345,9 @@
                             </tr>
                         </thead>
                         <tbody id="addProduct">
-                            <#--<tr >
-                                <td>冲奶机</td>
-                                <td>
-                                    <div>
-                                        白色
-                                        <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                                    </div>
-                                    <div>
-                                        白色
-                                        <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                                    </div>
-                                </td>
-                                <td>
-                                    <div>
-                                        水箱
-                                        <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                                    </div>
-                                    <div>
-                                        水箱
-                                        <input type="text" class="input-text" style="width: 40px;text-align: center;" value="1" placeholder="" id="" name="">
-                                    </div>
-                                </td>
-                            </tr>-->
+                            <tr id="showOrder">
+                                <td style="text-align: center;" colspan="3">请选择订单之后再选择产品</td>
+                            </tr>
                         </tbody>
                     </table>
 
@@ -408,14 +379,14 @@
             <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">
-                    TDS收集:<span id="DTS-address"></span>
-                    &nbsp;&nbsp;&nbsp;&nbsp;进水:<span id="DTS-in"></span>PPM   出水:<span id="DTS-out"></span>PPM
+                    <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="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: 250px">
-                    <script id="sendAddressSms" type="text/plain" style="width:1000px;height:200px;"></script>
+                    <script id="sendAddressSms" type="text/plain" style="width:983px;height:200px;"></script>
                     </script>
                 </div>
             </div>
@@ -444,16 +415,18 @@
                         </tr>
                         </thead>
                         <tbody id="back-product">
-
+                            <tr id="showOrder">
+                                <td style="text-align: center;" colspan="3">请选择订单之后再选择产品</td>
+                            </tr>
                         </tbody>
                     </table>
                 </div>
 
             </div>
             <div class="row cl">
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>处理描述:</label>
+                <label class="form-label col-1 col-sm-1">处理描述:</label>
                 <div class="formControls col-5 col-sm-5">
-                    <script id="describeHandleDescText" type="text/plain" style="width:1000px;height:250px;"></script>
+                    <script id="describeHandleDescText" type="text/plain" style="width:983px;height:250px;"></script>
                     </script>
                     <input type="hidden" id="describeHandleDesc" name="describeHandleDesc">
                 </div>
@@ -462,16 +435,16 @@
                 <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" checked>
+                        <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">
+                        <input type="radio" id="customer-visit-2" name="customerIsVisit"  value="1" checked>
                         <label for="customer-visit-2">不需要回访</label>
                     </div>
                 </div>
             </div>
-            <div id="needToVisit">
+            <div id="needToVisit" style="display: none;">
                 <div class="row cl">
                     <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访人:</label>
                     <div class="formControls col-2 col-sm-2">
@@ -578,20 +551,122 @@
         //$("#answer-textarea").text();
         $(".dalog-ask").hide(); //隐藏qa
     });
-
-    /*实时监听文本框-- 员工编号*/
-    document.getElementById("suggest").addEventListener("div", function(){
-        alert(1);
-    });
 </script>
 
 <script>
+
+    var tool = [
+        'anchor', //锚点
+        'undo', //撤销
+        'redo', //重做
+        'bold', //加粗
+        'indent', //首行缩进
+        'snapscreen', //截图
+        'italic', //斜体
+        'underline', //下划线
+        'strikethrough', //删除线
+        'subscript', //下标
+        'fontborder', //字符边框
+        'superscript', //上标
+        'formatmatch', //格式刷
+        //'source', //源代码
+        'blockquote', //引用
+        'pasteplain', //纯文本粘贴模式
+        'selectall', //全选
+        'print', //打印
+        'preview', //预览
+        'horizontal', //分隔线
+        'removeformat', //清除格式
+        'time', //时间
+        'date', //日期
+        'unlink', //取消链接
+        'insertrow', //前插入行
+        'insertcol', //前插入列
+        'mergeright', //右合并单元格
+        'mergedown', //下合并单元格
+        'deleterow', //删除行
+        'deletecol', //删除列
+        'splittorows', //拆分成行
+        'splittocols', //拆分成列
+        'splittocells', //完全拆分单元格
+        'deletecaption', //删除表格标题
+        'inserttitle', //插入标题
+        'mergecells', //合并多个单元格
+        'deletetable', //删除表格
+        'cleardoc', //清空文档
+        'insertparagraphbeforetable', //"表格前插入行"
+        //'insertcode', //代码语言
+        'fontfamily', //字体
+        'fontsize', //字号
+        'paragraph', //段落格式
+        'simpleupload', //单图上传
+        'insertimage', //多图上传
+        'edittable', //表格属性
+        'edittd', //单元格属性
+        'link', //超链接
+        'emotion', //表情
+        'spechars', //特殊字符
+        'searchreplace', //查询替换
+        'map', //Baidu地图
+        'gmap', //Google地图
+        'insertvideo', //视频
+        'help', //帮助
+        'justifyleft', //居左对齐
+        'justifyright', //居右对齐
+        'justifycenter', //居中对齐
+        'justifyjustify', //两端对齐
+        'forecolor', //字体颜色
+        'backcolor', //背景色
+        'insertorderedlist', //有序列表
+        'insertunorderedlist', //无序列表
+        'fullscreen', //全屏
+        'directionalityltr', //从左向右输入
+        'directionalityrtl', //从右向左输入
+        'rowspacingtop', //段前距
+        'rowspacingbottom', //段后距
+        'pagebreak', //分页
+        'insertframe', //插入Iframe
+        'imagenone', //默认
+        'imageleft', //左浮动
+        'imageright', //右浮动
+        'attachment', //附件
+        'imagecenter', //居中
+        'wordimage', //图片转存
+        'lineheight', //行间距
+        'edittip ', //编辑提示
+        'customstyle', //自定义标题
+        'autotypeset', //自动排版
+       // 'webapp', //百度应用
+        'touppercase', //字母大写
+        'tolowercase', //字母小写
+        'background', //背景
+        'template', //模板
+       // 'scrawl', //涂鸦
+        'music', //音乐
+        'inserttable', //插入表格
+        'drafts', // 从草稿箱加载
+        'charts' // 图表
+    ];
+
     /*问题描述*/
-    var describeContentText = UE.getEditor('describeContentText');
+    var describeContentText = UE.getEditor('describeContentText', {
+        toolbars: [tool],
+        autoHeightEnabled: true,
+        autoFloatEnabled: true,
+        zIndex : 5
+    });
     /*处理描述*/
-    var describeHandleDescText = UE.getEditor('describeHandleDescText');
+    var describeHandleDescText = UE.getEditor('describeHandleDescText', {
+        toolbars: [tool],
+        autoHeightEnabled: true,
+        autoFloatEnabled: true
+    });
     /*邮寄地址*/
-    var sendAddressSms = UE.getEditor('sendAddressSms');
+    var sendAddressSms = UE.getEditor('sendAddressSms', {
+        toolbars: [tool],
+        autoHeightEnabled: true,
+        autoFloatEnabled: true
+    });
 
     sendAddressSms.ready(function() {
         sendAddressSms.setHeight(130);  //固定高度
@@ -622,6 +697,9 @@
     /*  寄回地址的id */
     var complaint_questionId = 5;
 
+    /* 用于判断是否第一次初始化省市区-- 只在选择类型为售后时使用 */
+    var isInitAddress = 0;
+
     /*初始化页面参数*/
     $(function () {
         /* 初始化单选框样式 */
@@ -737,6 +815,30 @@
         });
     }
 
+    /*初始化单选框样式*/
+    function initCheckByNode(node){
+        node.iCheck({
+            checkboxClass: 'icheckbox-blue',
+            radioClass: 'iradio-blue',
+            increaseArea: '20%'
+        });
+    }
+
+    /*
+    * type 1:不需要回访  2:需要回访
+    * */
+    function visitByType(type){
+        if(1 == type){  //不需要回访
+            $("#customer-visit-2").prop("checked",true); //不需要回访
+            initCheckByNode($("#customer-visit-2"));
+            $("#needToVisit").css("display","none");
+        }else{
+            $("#customer-visit-1").prop("checked",true); //需要回访
+            initCheckByNode($("#customer-visit-1"));
+            $("#needToVisit").css("display","block");
+        }
+    }
+
     function keyFun(node){
         var c=$(node);
         if(/[^\d]/.test(c.val())){//替换非数字字符
@@ -747,13 +849,14 @@
 
 
     /*初始化客服*/
+    var sysAminList;
     function initSysAdmin() {
-        var sysAminList = getSysAdmin();
+        sysAminList = getSysAdmin();
         var html = "";
         for(var i=0;i<sysAminList.length;i++){
             var adminList = sysAminList[i];
             if(adminId != null && adminId != "" && adminId != 0 && adminId == adminList.adminId ){
-                html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'</option>';
+                html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'(我)</option>';
             }else{
                 html += '<option value="'+ adminList.adminId +'">'+ adminList.adminName +'</option>';
             }
@@ -763,13 +866,12 @@
 
     /*初始化回访客服的选择*/
     function initVisitSysAdmin(){
-        var sysAminList = getSysAdmin();
         var html = "";
         var flag = false;
         for(var i=0;i<sysAminList.length;i++){
             var adminList = sysAminList[i];
             if(adminId != null && adminId != "" && adminId != 0 && adminId == adminList.adminId ){
-                html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'</option>';
+                html += '<option value="'+ adminList.adminId +'" selected>'+ adminList.adminName +'(我)</option>';
                 flag = true;
             }else{
                 html += '<option value="'+ adminList.adminId +'">'+ adminList.adminName +'</option>';
@@ -870,13 +972,16 @@
             $("#reissue").hide();
             $("#backGoods").hide();
             $("#noReasonBack").hide();
+
             switch(type)
             {
                 case 1:
                     otherHied();
+                    visitByType(1);
                     break;
                 case 2:
                     otherHied();
+                    visitByType(2);
                     break;
                 default:
                     break;
@@ -887,6 +992,15 @@
             if(msg == null || msg == ""){
                 initComplaintQuestionInfo("m");
             }
+
+            /* 在选择售后类型是,直接初始化省市区,使用isInitAddress 变量来判断 */
+            if(isInitAddress == 0){
+                var proId = setPro(null,2);
+                var cityId = setCity(null,proId,2);
+                setDistrict(null,cityId,2);
+                isInitAddress = 1;
+            }
+
             $("#renewed").show();
             $("#maintain").show();
             $("#reissue").show();
@@ -896,9 +1010,11 @@
             {
                 case 1:
                     otherHied();
+                    visitByType(1);
                     break;
                 case 2:
                     otherHied();
+                    visitByType(2); //需要回访
                     break;
                 case 3: //换新
                     result = isSolve.renewed;
@@ -916,6 +1032,7 @@
                     $("#sendAddressByPhone").show();
                     $("#updateProduct").show();
                     $("#postageAccount").show();    //邮费转账账户
+                    visitByType(2); //需要回访
                     break;
                 case 4: //维修
                     result = isSolve.maintain;
@@ -933,6 +1050,7 @@
                     $("#sendAddressByPhone").show();
                     $("#updateProduct").show();
                     $("#postageAccount").show();    //邮费转账账户
+                    visitByType(2); //需要回访
                     break;
                 case 5://补发
                     result = isSolve.reissue;
@@ -950,6 +1068,7 @@
                     $("#sendAddressByPhone").hide();
                     $("#updateProduct").hide();
                     $("#postageAccount").hide();    //邮费转账账户 -- 隐藏
+                    visitByType(2); //需要回访
                     break;
                 case 6: //退货
                     result = isSolve.backGoods;
@@ -967,6 +1086,7 @@
                     $("#sendAddressByPhone").show();
                     $("#updateProduct").hide();
                     $("#postageAccount").show();    //邮费转账账户
+                    visitByType(2); //需要回访
                     break;
                 case 7://无理由退货
                     result = isSolve.noReasonBack;
@@ -984,6 +1104,7 @@
                     $("#sendAddressByPhone").show();
                     $("#updateProduct").hide();
                     $("#postageAccount").show();    //邮费转账账户
+                    visitByType(2); //需要回访
                     break;
                 default:
                     break;
@@ -1159,10 +1280,16 @@
             return false;
         }
 
+        if(desc == null || desc == "" || questionId==null || questionId == ""){
+            layer.close(index);
+            layer.msg("信息不全,无法发送短信", {icon: 5, time: 3000});
+            return false;
+        }
+
         var reg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
         if(!reg.test(phone)){
-            layer.msg("手机号码格式不正确", {icon: 5, time: 3000});
             layer.close(index);
+            layer.msg("手机号码格式不正确", {icon: 5, time: 3000});
             return false;
         }
 
@@ -1255,8 +1382,11 @@
                        //address = '<td colspan="1">收货地址</td><td colspan="6" class="td-manage text-c" >'+ salesOrder.salesAddressInfo +'&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #0a6999;text-decoration: underline;" href="javascript:void(0);" title="编辑" onclick="updateAdress()">修改地址</a></td>' ;
                         address = salesOrder.salesAddressInfo;
 
-                        $("#sendName").val(salesOrder.salesAddressName); //订单名称
-                        $("#sendTel").val(salesOrder.salesAddressTel);  //订单电话号码
+                        $("#sendName").val(salesOrder.salesAddressName); //收件人名称
+                        $("#sendTel").val(salesOrder.salesAddressTel);  //收件人电话号码
+
+                        $("#customerName").val(salesOrder.salesAddressName); //收件人名称
+                        $("#customerTel").val(salesOrder.salesAddressTel);  //收件人电话号码
                     }
                    // $("#showOrderAddress").html(address);
                 }else{
@@ -1339,23 +1469,24 @@
     function setPro(provinceName,type) {
         var proId = '';
         var province = listProvince();
-        var selectPro = {};
+        var selectPro = new Array();
         if(type == 1){
             selectPro = listProvince("",provinceName);
-        }else if(type == 2){
-            selectPro = null;
         }
         if(province!=null){
             var provinceHtml = ''
             for(var i=0;i<province.length;i++){
-                if(selectPro!= null && province[i].provinceId == selectPro[0].provinceId){
-                    proId = selectPro[0].provinceId;
-                    provinceHtml += '<option value="'+ province[i].provinceId +'" selected>'+ province[i].province +'</option>';
-                }else{
-                    provinceHtml += '<option value="'+ province[i].provinceId +'">'+ province[i].province +'</option>';
-                }
+                provinceHtml += '<option value="'+ province[i].provinceId +'">'+ province[i].province +'</option>';
             }
+
             $("#province").html(provinceHtml);
+
+            if(selectPro != null && selectPro.length > 0 ){
+                proId = selectPro[0].provinceId;
+            }else{
+                proId = province[0].provinceId;
+            }
+            $("#province option[value='" + proId + "']").attr("selected","true");
         }
         return proId;
     }
@@ -1367,25 +1498,23 @@
     function setCity(cityName,proId,type) {
         var cityId = '';
         var city = listCity(proId,"");
-        var selectCity = {};
+        var selectCity = new Array();
         if(type == 1){
             selectCity = listCity(proId,cityName);
-        }else if(type == 2){
-            selectCity = null;
-            cityId = city[0].cityId;
         }
 
         if(city!=null){
             var cityHtml = ''
             for(var i=0;i<city.length;i++){
-                if(selectCity != null && city[i].cityId == selectCity[0].cityId){
-                    cityId = city[i].cityId;
-                    cityHtml += '<option value="'+ city[i].cityId +'" selected>'+ city[i].city +'</option>';
-                }else{
-                    cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
-                }
+                cityHtml += '<option value="'+ city[i].cityId +'">'+ city[i].city +'</option>';
             }
             $("#city").html(cityHtml);
+            if(selectCity != null && selectCity.length > 0 ){
+                cityId = selectCity[0].cityId;
+            }else{
+                cityId = city[0].cityId;
+            }
+            $("#city option[value='" + cityId + "']").attr("selected","true");
         }
         return cityId;
     }
@@ -1396,22 +1525,23 @@
      */
     function setDistrict(districtName,cityId,type) {
         var district = listDistrict(cityId,"");
-        var selectDistrict = {};
+        var selectDistrict = new Array();
         if(type == 1){
             selectDistrict = listDistrict(cityId,districtName);
-        }else if(type == 2){
-            selectDistrict = null;
         }
         if(district!=null){
             var districtHtml = ''
             for(var i=0;i<district.length;i++){
-                if(selectDistrict != null && district[i].districtId == selectDistrict[0].districtId){
-                    districtHtml += '<option value="'+ district[i].districtId +'" selected>'+ district[i].district +'</option>';
-                }else{
-                    districtHtml += '<option value="'+ district[i].districtId +'">'+ district[i].district +'</option>';
-                }
+                districtHtml += '<option value="'+ district[i].districtId +'">'+ district[i].district +'</option>';
             }
+            var disId = "";
             $("#district").html(districtHtml);
+            if(selectDistrict != null && selectDistrict.length > 0 ){
+                disId = selectDistrict[0].cityId;
+            }else{
+                disId = district[0].cityId;
+            }
+            $("#city option[value='" + disId + "']").attr("selected","true");
         }
     }
 
@@ -1437,6 +1567,7 @@
         }
         $("#TDSArea").html(html);
         $("#TDSArea").find("option").eq(0).prop("selected",true);
+        setTDSCollect();
     }
 
     /**
@@ -1471,10 +1602,10 @@
                     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 +'">' +
+                                '         <td width="15" style="'+ fristInputStyle +' padding: 0px;width: 25px;">' +
                                 '             <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))" >' +
+                                '             <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="产品数量"  id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
                                 '         </td>' +
                                 '     </tr>';
                         fristInputStyle = "";
@@ -1495,10 +1626,10 @@
                         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 +'">' +
+                                '         <td width="15" style="'+ fristInputStyle +'padding: 0px;width: 25px;">' +
                                 '             <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))" >' +
+                                '             <input type="text" class="input-text input-fittings-number" style="width: 100%;border: none;text-align: center;" value="'+ number +'" placeholder="配件数量" id="" name="" onkeyup="keyFun($(this))" onpaste="keyFun($(this))" >' +
                                 '         </td>' +
                                 '     </tr>';
                         fristInputStyle = "";
@@ -1598,11 +1729,16 @@
     function setTDSCollect(){
         var TDSArea = $("#TDSArea").find("option:selected").text();
         var TDSAddress = TDSCity + '-' + TDSArea;
-        $("#DTS-address").html(TDSAddress);
-
-        $("#DTS-in").html($("#customerInTDS").val());
 
-        $("#DTS-out").html($("#customerOutTDS").val());
+        if(TDSAddress != null && TDSAddress != ""){
+            $("#DTS-address").html("地址:" + TDSAddress);
+            var customerInTDS = $("#customerInTDS").val();
+            var customerOutTDS = $("#customerOutTDS").val()
+            if(customerInTDS != null && customerInTDS != "" && customerOutTDS != null && customerOutTDS != ""){
+                $("#DTS-in").html("进水:" + customerInTDS + " PPM");
+                $("#DTS-out").html("出水:" + customerOutTDS + " PPM");
+            }
+        }
     }
 </script>
 <script>
@@ -1695,10 +1831,6 @@
 
         /*----处理描述- start --*/
         var describeHandleDescText = UE.getEditor('describeHandleDescText').getContent();
-        if(describeContentText == null || describeContentText == ""){
-            layer.msg("未填写处理描述", {icon: 5, time: 3000});
-            return false;
-        }
         $("#describeHandleDesc").val(describeHandleDescText);
         /*----处理描述--end-----*/
 

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

@@ -60,12 +60,12 @@
     <div class="order-list">
         <div class="text-c">
             <form action="" method="post">
-                <div class="row cl">
+                <div class="row cl" style="margin-left: 0px;">
 
                  <#--   <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">
+                    <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;" > <span class="select-box">
                         <select name="" class="select" id="companyId">
                              <option value="">销售公司</option>
                             <#if companyInfoList?? &&  (companyInfoList?size > 0) >
@@ -76,15 +76,18 @@
                         </select>
                         </span>
                     </div>
-                    <div class="formControls col-2 col-sm-2" > <span class="select-box">
+                    <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;"> <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">
+                    <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;"> <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="0">取消订单</option>
                             <option value="1">待支付</option>
                             <option value="2">已支付</option>
                             <option value="3">退款申请中</option>
@@ -98,27 +101,26 @@
                             <option value="11">申请换货中</option>
                             <option value="12">已完成</option>
                             <option value="13">全额付款</option>
-                            <option value="14">定金付款</option>
+                            <option value="14">定金付款</option>-->
                         </select>
                         </span>
                     </div>
-                    <div class="formControls col-2 col-sm-2" >
+                    <div class="formControls col-2 col-sm-2"  style="padding: 0px 10px 0px 0px; width: 110px;">
                         <input type="text" class="input-text" value="" placeholder="订单编号" id="salesId" name="">
                     </div>
-                </div>
 
-                <div class="row cl" style="margin-top: 10px;">
+                     <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;" >
+                         <input type="text" class="input-text" value="" placeholder="收货人姓名" id="salesAddressName" name="">
+                     </div>
+                     <div class="formControls col-2 col-sm-2" style="padding: 0px 10px 0px 0px; width: 110px;">
+                         <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 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>
+
             </form>
         </div>
 
@@ -139,6 +141,11 @@
                 </thead>
                 <tbody id="orderAll">
 
+                     <tr class="text-c">
+                         <td colspan="9">没有搜索到订单~  <a src="javascript:void(0)" style="color: #00e;text-decoration: underline;" onclick="addOrder()">去添加</a>
+                         </td>
+                     </tr>
+
                 </tbody>
             </table>
         </div>
@@ -256,7 +263,7 @@
         });
 
         /*初始化  搜索订单  */
-        searchOrder();
+        //searchOrder();
 
 
     })
@@ -399,7 +406,7 @@
                 }
                 $("#salesAddressInfo").val(pro + "-" + city + "-" + dis + "-" + addres);
 
-                var itemList = new Array()
+                var itemList = new Array();
                 $("#addProduct").find(".input-color-number").each(function(){
                     var number = $(this).val();
                     if(number != null && number != ""){
@@ -410,6 +417,16 @@
                         itemList.push(salesOrderItem);
                     }
                 })
+//                $("#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) {//异步回调函数

+ 3 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/wap/cm/request_message.ftl

@@ -66,11 +66,11 @@
 <script type="text/javascript" src="${path}/common/lib/mui/js/city.data-3.js"></script>
 <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/jquery.min.js"></script>
 <script>
-	var questionId=getQueryString("questionId");
+	var questionId=${questionId ! '1'};
 	//自己写的js
 	mui.ready(function() {
 		if(questionId!=null){
-		$.ajax('${path}/QA/get_question?dates=' + new Date().getTime(), {
+		$.ajax('${path}/get_question?dates=' + new Date().getTime(), {
 						data: {
 							"questionId":questionId
 						},
@@ -112,7 +112,7 @@
 			parameter["questionNotSolvedNum"] = 1;
 		}
 		
-		$.ajax('${path}/QA/update_question_num?dates=' + new Date().getTime(), {
+		$.ajax('${path}/update_question_num?dates=' + new Date().getTime(), {
 						data:parameter,
 						dataType: 'json',
 						xhrFields: {

+ 2 - 2
watero-rst-web/src/main/webapp/WEB-INF/views/wap/cm/send_message.ftl

@@ -65,7 +65,7 @@
 <script>
 	//自己写的js
 	mui.ready(function() {
-		$.ajax('${path}/QA/get_back_out_question?dates=' + new Date().getTime(), {
+		$.ajax('${path}/get_back_out_question?dates=' + new Date().getTime(), {
 						data: {},
 						dataType: 'json',
 						xhrFields: {
@@ -103,7 +103,7 @@
 			parameter["questionNotSolvedNum"] = 1;
 		}
 		
-		$.ajax('${path}/QA/update_question_num?dates=' + new Date().getTime(), {
+		$.ajax('${path}/update_question_num?dates=' + new Date().getTime(), {
 						data:parameter,
 						dataType: 'json',
 						xhrFields: {

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

@@ -65,7 +65,7 @@ function Trim(str)
  * @returns {{}}
  */
 function listProvince(provinceId,provinceName){
-    var province = {};
+    var province = new Array();
     $.ajax({
         type: "get",
         data: {
@@ -93,7 +93,7 @@ function listProvince(provinceId,provinceName){
  * 获取市
  */
 function listCity(provinceId,cityName){
-    var city = {};
+    var city = new Array();
     $.ajax({
         type: "get",
         data: {
@@ -119,7 +119,7 @@ function listCity(provinceId,cityName){
  * 获取区
  */
 function listDistrict(cityId,districtName){
-    var district = {};
+    var district = new Array();
     $.ajax({
         type: "get",
         data: {