Browse Source

客诉修改

wangxiaoming 6 years ago
parent
commit
1c8fa3ae09

+ 56 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CmRelation.java

@@ -1,13 +1,20 @@
 package com.iamberry.rst.core.cm;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.ArrayList;
 import  java.util.Date;
 import  java.io.Serializable;
+import java.util.List;
+
 /**
  *  售后处理类
  * @author
  * @Date 2018-12-28
  */
 public class CmRelation implements  Serializable{
+    private static final long serialVersionUID = 8181376563638802640L;
     //处理主键
     private Integer relationId;
     //
@@ -63,16 +70,33 @@ public class CmRelation implements  Serializable{
     //转账账户姓名
     private String relationAlipayName;
     //签收日期
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
     private Date relationBackReceiptDate;
     //工厂维修报价
     private Integer relationFactoryCosts;
     //客户报价
     private Integer relationCustomerCosts;
     //创建时间
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     private Date relationCreateTime;
     //修改时间
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
     private Date relationUpdateTime;
 
+    //售后寄出产品表
+    private List<SendProdcue> sendProdcues = new ArrayList<SendProdcue>();
+    //售后寄回产品表
+    private List<ClosedProdcue> closedProdcues = new ArrayList<ClosedProdcue>();
+
+    /*订单关联集合*/
+    private List<RelationOrder> relationOrderList = new ArrayList<>();
+
+    /*订单集合*/
+    private List<SalesOrder> salesOrderList = new ArrayList<>();
+
     public Integer getRelationId(){
         return relationId;
     }
@@ -328,4 +352,36 @@ public class CmRelation implements  Serializable{
     public void setRelationUpdateTime(Date  relationUpdateTime){
         this.relationUpdateTime=relationUpdateTime;
     }
+
+    public List<SendProdcue> getSendProdcues() {
+        return sendProdcues;
+    }
+
+    public void setSendProdcues(List<SendProdcue> sendProdcues) {
+        this.sendProdcues = sendProdcues;
+    }
+
+    public List<ClosedProdcue> getClosedProdcues() {
+        return closedProdcues;
+    }
+
+    public void setClosedProdcues(List<ClosedProdcue> closedProdcues) {
+        this.closedProdcues = closedProdcues;
+    }
+
+    public List<RelationOrder> getRelationOrderList() {
+        return relationOrderList;
+    }
+
+    public void setRelationOrderList(List<RelationOrder> relationOrderList) {
+        this.relationOrderList = relationOrderList;
+    }
+
+    public List<SalesOrder> getSalesOrderList() {
+        return salesOrderList;
+    }
+
+    public void setSalesOrderList(List<SalesOrder> salesOrderList) {
+        this.salesOrderList = salesOrderList;
+    }
 }

+ 21 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerInfo.java

@@ -131,6 +131,8 @@ public class CustomerInfo  implements Serializable {
 
     private CustomerCommon customerCommon = new CustomerCommon(); //处理结果综合  公共类
 
+    private CmRelation cmRelation = new CmRelation();
+
     private String transactionNumber;     //外部交易号,订单id
     private Integer isAddOrder;      //1:原来就有订单  2:需要新添加订单
     //QC质检集合
@@ -498,10 +500,20 @@ public class CustomerInfo  implements Serializable {
         this.visit = visit;
     }
 
+    /**
+     * 请使用 getCmRelation
+     * @param customerCommon
+     */
+    @Deprecated
     public CustomerCommon getCustomerCommon() {
         return customerCommon;
     }
 
+    /**
+     * 请使用 setCmRelation
+     * @param customerCommon
+     */
+    @Deprecated
     public void setCustomerCommon(CustomerCommon customerCommon) {
         this.customerCommon = customerCommon;
     }
@@ -706,6 +718,15 @@ public class CustomerInfo  implements Serializable {
 //        this.isQuality = isQuality;
 //    }
 
+
+    public CmRelation getCmRelation() {
+        return cmRelation;
+    }
+
+    public void setCmRelation(CmRelation cmRelation) {
+        this.cmRelation = cmRelation;
+    }
+
     public Integer getFactoryId() {
         return factoryId;
     }

+ 1 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ProcMethod.java

@@ -8,6 +8,7 @@ import  java.io.Serializable;
  * @Date 2018-12-29
  */
 public class ProcMethod  implements  Serializable{
+    private static final long serialVersionUID = 5459213798616020261L;
     //处理方式id
     private Integer procMethodId;
     //处理方式类型id

+ 11 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/ProcType.java

@@ -8,10 +8,13 @@ import  java.io.Serializable;
  * @Date 2018-12-28
  */
 public class ProcType  implements  Serializable{
+    private static final long serialVersionUID = -3615790458273614264L;
     //处理方式类型主键
     private Integer procTypeId;
     //处理方式类型名称
     private String procTypeName;
+    //是否为售前  1:是  2:不是
+    private Integer procTypeSaleStatus;
     //处理方式状态 1:使用中 2:未使用
     private Integer procTypeStatus;
     //处理方式描述
@@ -68,4 +71,12 @@ public class ProcType  implements  Serializable{
     public void setProcTypeUpdateTime(Date  procTypeUpdateTime){
         this.procTypeUpdateTime=procTypeUpdateTime;
     }
+
+    public Integer getProcTypeSaleStatus() {
+        return procTypeSaleStatus;
+    }
+
+    public void setProcTypeSaleStatus(Integer procTypeSaleStatus) {
+        this.procTypeSaleStatus = procTypeSaleStatus;
+    }
 }

+ 7 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/procTypeMapper.xml

@@ -5,6 +5,7 @@
         <result    column="proc_type_id"    property="procTypeId" />
         <result    column="proc_type_name"    property="procTypeName" />
         <result    column="proc_type_status"    property="procTypeStatus" />
+        <result    column="proc_type_sale_status"    property="procTypeSaleStatus" />
         <result    column="proc_type_desc"    property="procTypeDesc" />
         <result    column="proc_type_create_time"    property="procTypeCreateTime" />
         <result    column="proc_type_update_time"    property="procTypeUpdateTime" />
@@ -12,6 +13,7 @@
     <sql    id="Base_List" >
         t.proc_type_id,
         t.proc_type_name,
+        t.proc_type_sale_status,
         t.proc_type_status,
         t.proc_type_desc,
         t.proc_type_create_time,
@@ -31,6 +33,9 @@
             <if test="procTypeStatus != null ">
                 AND t.proc_type_status = #{procTypeStatus}
             </if >
+            <if test="procTypeSaleStatus != null ">
+                AND t.proc_type_sale_status = #{procTypeSaleStatus}
+            </if >
         </where>
     </select>
     <select id="getProcTypeById" resultMap="BaseResultMap" parameterType="Integer" >
@@ -45,12 +50,14 @@
         (
         proc_type_name,
         proc_type_status,
+        proc_type_sale_status,
         proc_type_desc
         )
         values
         (
         #{procTypeName},
         #{procTypeStatus},
+        #{procTypeSaleStatus},
         #{procTypeDesc}
         )
     </insert>

+ 6 - 16
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminCustomerController.java

@@ -862,8 +862,8 @@ public class AdminCustomerController {
     @ResponseBody
     @RequiresPermissions("customer:add:customer")
     @RequestMapping("/save_customer")
-    public ResponseJson addCustomer(HttpServletRequest request, CustomerInfo customerInfo, SalesOrder salesOrder, CustomerCommon customerCommon,
-                                    String sendProdcuesJson, String sendFittingsJson, String closedProdcuesJson, String closedFittingsJson) throws Exception {
+    public ResponseJson addCustomer(HttpServletRequest request, CustomerInfo customerInfo, SalesOrder salesOrder, CmRelation cmRelation,
+                                    String sendProdcuesJson,  String closedProdcuesJson) throws Exception {
         ResponseJson rjx = this.isValiData(customerInfo);
         if (rjx.getResultCode() == 500) {
             return rjx;
@@ -877,29 +877,19 @@ public class AdminCustomerController {
         if (customerInfo.getIsNeedSelectOrder() == 1) { ////1:需要有订单    2:不需要有订单
             JSONArray jsonArray;
             List<SendProdcue> sendProdcueList;
-            List<SendFitting> sendFittingList;
             List<ClosedProdcue> closedProdcueList;
-            List<ClosedFitting> closedFittingList;
 
             jsonArray = JSONArray.fromObject(sendProdcuesJson);
             sendProdcueList = (List) JSONArray.toCollection(jsonArray, SendProdcue.class);
 
-            jsonArray = JSONArray.fromObject(sendFittingsJson);
-            sendFittingList = (List) JSONArray.toCollection(jsonArray, SendFitting.class);
-
             jsonArray = JSONArray.fromObject(closedProdcuesJson);
             closedProdcueList = (List) JSONArray.toCollection(jsonArray, ClosedProdcue.class);
 
-            jsonArray = JSONArray.fromObject(closedFittingsJson);
-            closedFittingList = (List) JSONArray.toCollection(jsonArray, ClosedFitting.class);
-
-            customerCommon.setSendProdcues(sendProdcueList);
-            customerCommon.setSendFittings(sendFittingList);
-            customerCommon.setClosedProdcues(closedProdcueList);
-            customerCommon.setClosedFittings(closedFittingList);
+            cmRelation.setSendProdcues(sendProdcueList);
+            cmRelation.setClosedProdcues(closedProdcueList);
         }
 
-        customerInfo.setCustomerCommon(customerCommon);
+        customerInfo.setCmRelation(cmRelation);
         String orderId = "";
         if (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5) {
             Integer adminId = AdminUtils.getLoginAdminId();
@@ -1023,7 +1013,7 @@ public class AdminCustomerController {
             customerCommon.setClosedProdcues(closedProdcueList);
             customerCommon.setClosedFittings(closedFittingList);
         }
-        customerInfo.setCustomerCommon(customerCommon);
+//        customerInfo.setCustomerCommon(customerCommon);
         String orderId = "";
         if (customerInfo.getCustomerIsSolve() == 3 || customerInfo.getCustomerIsSolve() == 4 || customerInfo.getCustomerIsSolve() == 5) {
             Integer adminId = AdminUtils.getLoginAdminId();

+ 48 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminProcMethodController.java

@@ -1,17 +1,64 @@
 package com.iamberry.rst.controllers.cm;
 
+import com.iamberry.rst.core.cm.ProcMethod;
+import com.iamberry.rst.core.cm.ProcType;
+import com.iamberry.rst.faces.cm.ProcMethodService;
+import com.iamberry.rst.faces.cm.ProcTypeService;
+import com.iamberry.wechat.tools.ResponseJson;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 查询处理方式
  * @author
  */
 @Controller
-@RequestMapping("/admin/customer")
+@RequestMapping("/admin/proc")
 public class AdminProcMethodController {
     private Logger logger = LoggerFactory.getLogger(AdminProcMethodController.class);
 
+    @Autowired
+    private ProcTypeService procTypeService;
+    @Autowired
+    private ProcMethodService procMethodService;
+
+    /**
+     * 获取处理分类
+     *
+     * @param request ProcType.procTypeSaleStatus
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/type")
+    public ResponseJson type(HttpServletRequest request,ProcType procType) {
+         List<ProcType> procTypeList = new ArrayList<>();    ////因为在前端不判断,所以需要直接初始化
+        procTypeList = procTypeService.getProcTypeList(procType);
+        ResponseJson rj = new ResponseJson(200, "查询成功", 200);
+        rj.addResponseKeyValue("list",procTypeList);
+        return rj;
+    }
+
+    /**
+     * 获取处理
+     * @param request ProcMethod.procTypeId
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping("/method")
+    public ResponseJson method(HttpServletRequest request,ProcMethod procMethod) {
+        List<ProcMethod> procMethodList = new ArrayList<>();    //因为在前端不判断,所以需要直接初始化
+        procMethodList = procMethodService.getProcMethodList(procMethod);
+        ResponseJson rj = new ResponseJson(200, "查询成功", 200);
+        rj.addResponseKeyValue("list",procMethodList);
+        return rj;
+    }
+
 }

+ 6 - 0
watero-rst-web/src/main/resources/watero-rst-orm.xml

@@ -93,6 +93,9 @@
 		<typeAlias type="com.iamberry.rst.core.cm.StoreShip" alias="StoreShip"/>
 		<typeAlias type="com.iamberry.rst.core.cm.CustomerStatisticalInfo" alias="CustomerStatisticalInfo"/>
 		<typeAlias type="com.iamberry.rst.core.cm.ReturnStatisticsInfo" alias="ReturnStatisticsInfo"/>
+		<typeAlias type="com.iamberry.rst.core.cm.ProcMethod" alias="ProcMethod"/>
+		<typeAlias type="com.iamberry.rst.core.cm.ProcType" alias="ProcType"/>
+		<typeAlias type="com.iamberry.rst.core.cm.CmRelation" alias="CmRelation"/>
 
 		<typeAlias type="com.iamberry.rst.core.fm.AwaitingSignclosedProductInfo" alias="AwaitingSignclosedProductInfo"/>
 		<typeAlias type="com.iamberry.rst.core.fm.ComplaintDetectInfo" alias="ComplaintDetectInfo"/>
@@ -239,6 +242,9 @@
 		<mapper resource="com/iamberry/rst/service/cm/mapper/relationOrderMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/cm/mapper/storeShipMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/cm/mapper/postOrderNumMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/cm/mapper/procTypeMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/cm/mapper/procMethodMapper.xml"/>
+		<mapper resource="com/iamberry/rst/service/cm/mapper/cmRelationMapper.xml"/>
 
 		<mapper resource="com/iamberry/rst/service/fm/mapper/awaitingSignclosedProductMapper.xml"/>
 		<mapper resource="com/iamberry/rst/service/fm/mapper/complaintDetectInfoMapper.xml"/>

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

@@ -297,7 +297,6 @@
                         <a href="javascript:void(0)" style="margin-left: 200px;" onclick="initComplaintQuestionInfo('ne')">下一页</a>
                     </div>
                 </div>
-
             </div>
 
             <div class="row cl">
@@ -311,7 +310,7 @@
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>问题回复:</label>
                 <div class="formControls col-9 col-sm-9">
                     <input type="hidden" name="questionId" id="questionId" value="">
-                    <script id="describeContentText" type="text/plain" style="width:100%;height:250px;"></script>
+                    <script id="describeContentText" type="text/plain" style="width:100%;height:150px;"></script>
                     <input type="hidden" name="describeContent" id="describeContent" value="">
                 </div>
             </div>
@@ -321,7 +320,7 @@
                 <label class="form-label col-1 col-sm-1">问题描述:</label>
                 <div class="formControls col-9 col-sm-9">
                     <span>问题描述详情,内部使用,不会对外公布。</span>
-                    <script id="describeHandleDescText" type="text/plain" style="width:100%;height:250px;"></script>
+                    <script id="describeHandleDescText" type="text/plain" style="width:100%;height:150px;"></script>
                     <input type="hidden" id="describeHandleDesc" name="describeHandleDesc">
                 </div>
             </div>
@@ -354,6 +353,22 @@
             <input type="hidden" id="closedProdcues" name="closedProdcuesJson" value="">
             <input type="hidden" id="closedFittings" name="closedFittingsJson" value="">
 
+            <div class="row cl init_proMethod" id="" code="returnCode" msg="resultMsg" data="returnMsg" >
+                <label class="form-label col-1 col-sm-1">处理结果:</label>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                         <select class="select" id="procTypeId" ulcId="2" ulcValName="procTypeName" ulcValId="procTypeId"  ulcURL="/admin/proc/type" msg="" ulcList="list">
+                         </select>
+                     </span>
+                </div>
+                <div class="formControls col-2 col-sm-2">
+                    <span class="select-box">
+                         <select class="select" id="procMethodId"  ulcId="3"  ulcValName="procMethodName" ulcValId="procMethodId"  ulcURL="/admin/proc/method?procTypeId=" msg="" ulcList="list" >
+                         </select>
+                     </span>
+                </div>
+            </div>
+            <#--
             <div class="row cl">
                 <label class="form-label col-1 col-sm-1">处理类型:</label>
                 <div class="formControls col-10 col-sm-10 skin-minimal">
@@ -386,7 +401,8 @@
                         <label for="customer-process-7">无理由退货</label>
                     </div>
                 </div>
-            </div>
+            </div>-->
+
             <div class="row cl" style="display: none;">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-10 col-sm-10">
@@ -401,6 +417,7 @@
                     </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">
@@ -435,12 +452,12 @@
                 </div>
             </div>
 
-            <div class="row cl" id="recipientInfoTitle" style="display: none;">
+            <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;">
+            <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="联系人格式不正确!" >
@@ -452,7 +469,8 @@
                     <input type="text" class="input-text" value="" placeholder="邮费转账 支付宝账户" id="relationAlipay" name="relationAlipay" errormsg="邮费转账账户!">
                 </div>
             </div>
-            <div class="row cl" id="recipientAddress" style="display: none;">
+
+            <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">
@@ -473,21 +491,20 @@
                         </select>
                     </span>
                 </div>
-
                 <input type="hidden" name="relationSendMergeAddress" id="relationSendMergeAddress">
-
             </div>
-            <div class="row cl" id="recipientAddressText" style="display: none;">
+
+            <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="renewedProduct" style="">
+
+            <div class="row cl" id="renewedProduct" style="display: none">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span><span id="relationProduct">寄回产品</span>:</label>
                 <div class="formControls col-9 col-sm-9 text-c" id="produceSelect">
-
                     <table class="table table-border table-bg table-bordered">
                         <thead>
                             <tr class="text-c" id="table1">
@@ -503,9 +520,30 @@
                             </tr>
                         </tbody>
                     </table>
+                </div>
+            </div>
 
+            <div class="row cl" id="updateProduct" style="display: none">
+                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>寄出产品:</label>
+                <div class="formControls col-9 col-sm-9" >
+                    <table class="table table-border table-bg table-bordered">
+                        <thead>
+                        <tr class="text-c" id="table2">
+                            <th style="text-align: center;" width="60">产品名称</th>
+                            <th style="text-align: center;" width="40">产品颜色</th>
+                            <th style="text-align: center;" width="30">数量</th>
+                            <th style="text-align: center;" width="100">机器编号</th>
+                        </tr>
+                        </thead>
+                        <tbody id="back-product">
+                            <tr id="">
+                                <td style="text-align: center;" colspan="4">选择订单后展示</td>
+                            </tr>
+                        </tbody>
+                    </table>
                 </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">
@@ -606,79 +644,7 @@
                      <textarea type="text" placeholder="" id="customerDesc" name="customerDesc" style="width: 100%;height: 80px;"></textarea>
                  </div>
               </div>
-            <div class="row cl" id="updateProduct" style="display: none;">
-                <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>更换产品:</label>
-                <div class="formControls col-9 col-sm-9" >
-
-                    <table class="table table-border table-bg table-bordered">
-                        <thead>
-                            <tr class="text-c" id="table2">
-                                <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="back-product">
-                        <#if productList??>
-                            <#list productList as product>
-                            <tr>
-                                <td width="80">
-                                    <input type="hidden" value="${product.productId}"><span>${product.productName}</span>
-                                </td>
-                                <td style="padding: 0px;text-align: center;">
-                                    <table style="height: 100%;">
-                                        <tbody>
-                                            <#list product.colorList as color>
-                                            <tr>
-                                                <td width="55" style="border-left: none;text-align: center;border-top: 1px solid #ddd;">
-                                                ${color.colorName}
-                                                </td>
-                                                <td width="45" style="border-top: 1px solid #ddd; padding: 0px;width: 25px;">
-                                                    <input type="hidden" class="input-produce-id" value="${product.productId}">
-                                                    <input type="hidden" class="input-color-id" value="${color.colorId}">
-                                                    <#assign number = ""/>
-                                                    <#list customerCommon.sendProdcues as sendProdcues>
-                                                        <#if sendProdcues.colorId == color.colorId >
-                                                            <#assign number = sendProdcues.sendProdcueNumber/>
-                                                        </#if>
-                                                    </#list>
-                                                    <input type="text" class="input-text input-color-number number-input" style="width: 100%;border: none;text-align: center;" value="${number}" placeholder="产品数量" id="color-1-1" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
-                                                </td>
-                                            </tr>
-                                            </#list>
-                                        </tbody>
-                                    </table>
-                                </td>
-                                <td style="padding: 0px;text-align: center;">
-                                    <table style="height: 100%;">
-                                        <tbody>
-                                            <#list product.fittingsList as fittingsInfo>
-                                            <tr>
-                                                <td width="55" style="border-left: none;text-align: center; border-top: 1px solid #ddd;">${fittingsInfo.fittingsName}</td>
-                                                <td width="45" style="border-top: 1px solid #ddd;padding: 0px;width: 25px;">
-                                                    <input type="hidden" class="input-produce-id" value="${fittingsInfo.productId}">
-                                                    <input type="hidden" class="input-fittings-id" value="${fittingsInfo.fittingsId}">
-                                                    <#assign number = ""/>
-                                                    <#list customerCommon.sendFittings as sendFittings>
-                                                        <#if sendFittings.fittingsId == fittingsInfo.fittingsId >
-                                                            <#assign number = sendFittings.sendFittingNumber/>
-                                                        </#if>
-                                                    </#list>
-                                                    <input type="text" class="input-text input-fittings-number" style="width: 100%;border: none;text-align: center;" value="${number}" placeholder="配件数量" id="fittings-1-1" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)">
-                                                </td>
-                                            </tr>
-                                            </#list>
-                                        </tbody>
-                                    </table>
-                                </td>
-                            </tr>
-                            </#list>
-                        </#if>
-                        </tbody>
-                    </table>
-                </div>
 
-            </div>
 
             <div class="row cl" style="display: none;">
                             <#-- <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>回访信息:</label>
@@ -774,8 +740,10 @@
 <script type="text/javascript" charset="utf-8" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
 
 <#-- 业务脚本JS -->
+<script type="text/javascript" charset="utf-8" src="${path}/common/js/common/UnlimitedLevelContact.js"></script>
 <script type="text/javascript" charset="utf-8" src="${path}/common/js/customer/customer.js"></script>
 
+
 <script>
 
     $(function(){
@@ -893,11 +861,10 @@
     var adminId = 0;
 
     /* 咨询类型  1:售前咨询  2:售后咨询  3:其他  */
-    var allCustomerInfoType;
+    var allCustomerInfoType=2;  //默认售后
 
-    /*全局标识当前状态  type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货*/
-    var allCustomerType = 1;
-    var allCustomerTypeName = ["已解决","未解决","换新","维修","补发","退货","无理由退货"];
+    var allProcMethodIsBack;    //是否需要寄回 1:需要寄回 2:不需要寄回
+    var allProcMethodIsSend;    //是否需要寄出 1:需要寄出 2:不需要寄出
 
     /*  寄回地址的id */
     var complaint_questionId = 5;
@@ -909,7 +876,7 @@
     var sysAminList;
 
     /*1:需要有订单    2:不需要有订单*/
-    var isNeedSelectOrder;
+    var isNeedSelectOrder = 2;
 
     /*初始化页面参数*/
     $(function () {
@@ -928,39 +895,27 @@
         /*初始化回访客服*/
         initVisitSysAdmin();
 
-        /*初始化选择处理结果 -- type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货 */
-        initProcessResult(3);
+        /**/
+        var promethodUlc = init_ulc($(".init_proMethod"));
+        promethodUlc.setUlcAllCallback(ulcProcessResult);
 
-        /*监听来源入口选择事件*/
-//        $("input[name='customerSourceType']").change(function (){
-//            var type = parseInt($(this).val());
-//            if(type == 3){
-//                $("#customerSourceOld").show();
-//            }else{
-//                $("#customerSourceOld").hide();
-//            }
-//        })
+        /*初始化选择处理结果 -- */
+        // initProcessResult(1,1); //
 
         /*监听客诉类型选择事件*/
         $("input[name='customerCounselType']").change(function (){
             allCustomerInfoType = parseInt($(this).val());
             if(allCustomerInfoType == 1){
-                $("#customer-process-1").iCheck('check');  //设置已解决
+//                $("#customer-process-1").iCheck('check');  //设置已解决
                 $("#twiceSellEnd").hide();
                 $("#openTheLock").hide();
-                allCustomerType = 1;
+                promethodUlc.setUlcById(0,1);
             }else{
-                $("#customer-process-3").iCheck('check');  //设置换新
+//                $("#customer-process-3").iCheck('check');  //设置换新
                 $("#twiceSellEnd").show();
                 $("#openTheLock").show();
-                allCustomerType =3;
+                promethodUlc.setUlcById(0,2);
             }
-            initProcessResult(allCustomerType,allCustomerInfoType);
-        })
-
-        /*监听处理结果选择事件*/
-        $("[name='customerIsSolve']").change(function(){
-            initProcessResult(parseInt($(this).val()));
         })
 
         /*监听问题类型 选择事件*/
@@ -994,7 +949,6 @@
         /*监听回访类型选择事件  是否需要回访  1:不需要回访  2:需要回复  */
 //        initVisitEvent();
 
-
         /*监听回访选择客服的选择事件*/
         $(document).on('change', '#visitAdminId', function() {
             var visitAdminName = $("#visitAdminId").find("option:selected").text();

File diff suppressed because it is too large
+ 421 - 1
watero-rst-web/src/main/webapp/common/js/common/UnlimitedLevelContact.js


+ 123 - 562
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -181,26 +181,26 @@ var isInitSendAddressSms = false;
 
 /*===============================定义全局变量以及监听事件和初始化  -- start -- =============================== */
 /*处理结果的执行状态*/
-var isSolve = {
-    solved : [],
-    noSolved : [],
-    renewed : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","换新发货","发货通知用户","收货后回访"],
-    maintain : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","产线维修","换新发货","发货通知用户","收货后回访"],
-    reissue : ["录入客诉","生成E订单","督促仓库发货","仓库发货","发货通知用户","收货后回访"],
-    backGoods : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"],
-    noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
-}
+// var isSolve = {
+//     solved : [],
+//     noSolved : [],
+//     renewed : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","换新发货","发货通知用户","收货后回访"],
+//     maintain : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","产线维修","换新发货","发货通知用户","收货后回访"],
+//     reissue : ["录入客诉","生成E订单","督促仓库发货","仓库发货","发货通知用户","收货后回访"],
+//     backGoods : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"],
+//     noReasonBack : ["录入客诉","督促用户寄回","录入快递单号","仓库收货","品质检测","退款","退货完成"]
+// }
 
 /*处理结果的变更状态  产品列表表头信息*/
-var isSolveTitleMsg = {
-    solved : [[],[]],
-    noSolved : [[],[]],
-    renewed : [["寄回产品","寄回产品颜色","退回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
-    maintain : [["寄回产品","寄回产品颜色","寄回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
-    reissue : [[],["补发产品","补发产品颜色","补发产品配件"]],
-    backGoods : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]],
-    noReasonBack : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]]
-}
+// var isSolveTitleMsg = {
+//     solved : [[],[]],
+//     noSolved : [[],[]],
+//     renewed : [["寄回产品","寄回产品颜色","退回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
+//     maintain : [["寄回产品","寄回产品颜色","寄回产品配件","机器编码"],["寄出产品","寄出产品颜色","寄出产品配件"]],
+//     reissue : [[],["补发产品","补发产品颜色","补发产品配件"]],
+//     backGoods : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]],
+//     noReasonBack : [["退回产品","退回产品颜色","退回产品配件","机器编码"],[]]
+// }
 /*===============================定义全局变量以及监听事件和初始化  -- end -- =============================== */
 
 /*===============================正则表达式  -- start -- =============================== */
@@ -403,28 +403,35 @@ function initProduceType(){
 }
 
 /**
- * 选择处理结果-- 默认选择已解决
- * type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货
+ *
  */
-function initProcessResult(type,allCustomerInfoType){
+function ulcProcessResult(data){
+    initProcessResult(data[1].procMethodIsBack,data[1].procMethodIsSend);
+}
 
-    if(type == null || type == ""){
-        type = 1;
+/**
+ * 选择处理结果-- 默认选择已解决
+ * type : 1 :已解决  2:未解决  3:换新  4:维修  5:补发   6:退货  7:无理由退货  -- 删除
+ * procMethodIsBack : 是否需要寄回 1:需要寄回 2:不需要寄回
+ * procMethodIsSend : 是否需要寄出 1:需要寄出 2:不需要寄出
+ */
+function initProcessResult(procMethodIsBack,procMethodIsSend){
+    if(procMethodIsBack == null || procMethodIsBack == ""){
+        procMethodIsBack = 1;
+    }
+    if(procMethodIsSend == null || procMethodIsSend == ""){
+        procMethodIsSend = 1;
     }
-    var customerInfoType = allCustomerInfoType;
-    allCustomerType = type;
+
+    allProcMethodIsBack=procMethodIsBack;
+    allProcMethodIsSend=procMethodIsSend;
+
+    var customerInfoType = allCustomerInfoType; //售前售后
 
     if(allCustomerInfoType == null || allCustomerInfoType == ""){
         allCustomerInfoType = $("input[name='customerCounselType']:checked").val();
     }
 
-    var statusHtml = '<li><span class="arrow"></span><div class="number">status_index</div><div>status_html</div></li>';
-    var resultHtml = '';
-    var result = {};
-    var resultProductTableTitle = {};
-
-    $("#solved").show(); //已解决
-    $("#noSolved").show();//未解决
     if(allCustomerInfoType == 1){  //售前
         $("#renewed").hide();
         $("#maintain").hide();
@@ -432,21 +439,8 @@ function initProcessResult(type,allCustomerInfoType){
         $("#backGoods").hide();
         $("#noReasonBack").hide();
         $("#customerCostsDiv").hide();
-        switch(type)
-        {
-            case 1:
-                otherHied(customerInfoType);
-                visitByType(1);
-                //getCompany();
-                break;
-            case 2:
-                otherHied(customerInfoType);
-                visitByType(2);
-                //getCompany();
-                break;
-            default:
-                break;
-        }
+        $("#sendInformationTitle").hide();
+        otherHied();
     }else if(allCustomerInfoType == 2){ //售后
         $("#customerCostsDiv").hide();
         if(!isInitSendAddressSms){
@@ -464,206 +458,84 @@ function initProcessResult(type,allCustomerInfoType){
                 isInitAddress = 1;
             }
         }
-
         $("#renewed").show();
         $("#maintain").show();
         $("#reissue").show();
         $("#backGoods").show();
         $("#noReasonBack").show();
-        switch(type)
-        {
-            case 1:
-                otherHied();
-                visitByType(1);
-                //getCompany();
-                break;
-            case 2:
-                otherHied();
-                visitByType(2); //需要回访
-                //getCompany();
-                break;
-            case 3: //换新
-                result = isSolve.renewed;
-                resultProductTableTitle = isSolveTitleMsg.renewed;
-                $("#relationProduct").html("换新产品");
-                $("#processResultStatus").show();
-                $("#orderHead").show();
-                $("#order").show();
-                //$("#recipientInfo").show();
-                //$("#recipientInfoTitle").show();
-                //$("#recipientAddress").show();
-                //$("#recipientAddressText").show();
-                $("#renewedProduct").show();
-                //$("#TDScollect").show();
-                //$("#TDScollectShow").show();
-                $("#sendAddressInfo").show();
-                $("#sendAddressByPhone").show();
-                $("#updateProduct").hide(); //换新产品
-                $("#postageAccount").show();    //邮费转账账户
-                $("#sendInformationTitle").show();
-                $("#sendAddressSmsHtml").show();
-                visitByType(2); //需要回访
-                //$("#salesChannelsSelect").show();  //展示销售公司
-                if(customerInfoType == 1){
-                    $("#salesChannelsSelect").hide();  //展示销售公司
-                    $("#TDScollect").hide();
-                }else{
-                    $("#salesChannelsSelect").show();  //展示销售公司
-                    $("#TDScollect").show();
-                }
-                break;
-            case 4: //维修
-                result = isSolve.maintain;
-                resultProductTableTitle = isSolveTitleMsg.maintain;
-                $("#relationProduct").html("维修产品");
-                $("#processResultStatus").show();
-                $("#orderHead").show();
-                $("#order").show();
-                //$("#recipientInfo").show();
-                //$("#recipientInfoTitle").show();
-                //$("#recipientAddress").show();
-                //$("#recipientAddressText").show();
-                $("#renewedProduct").show();
-                //$("#TDScollect").show();
-                //$("#TDScollectShow").show();
-                $("#sendAddressInfo").show();
-                $("#sendAddressByPhone").show();
-                $("#updateProduct").hide();//维修产品
-                $("#postageAccount").show();    //邮费转账账户
-                $("#sendInformationTitle").show();
-                $("#sendAddressSmsHtml").show();
-                visitByType(2); //需要回访
-                //$("#salesChannelsSelect").show();  //展示销售公司
-                if(customerInfoType == 1){
-                    $("#salesChannelsSelect").hide();  //展示销售公司
-                    $("#TDScollect").hide();
-                }else{
-                    $("#salesChannelsSelect").show();  //展示销售公司
-                    $("#TDScollect").show();
-                }
-                $("#customerCostsDiv").show();
-                break;
-            case 5://补发
-                result = isSolve.reissue;
-                resultProductTableTitle = isSolveTitleMsg.reissue;
-                $("#relationProduct").html("补发产品");
-                $("#processResultStatus").show();
-                $("#orderHead").show();
-                $("#order").show();
-                //$("#recipientInfo").show();
-                //$("#recipientInfoTitle").show();
-                // $("#recipientAddress").show();
-                // $("#recipientAddressText").show();
-                $("#renewedProduct").hide();
-                //$("#TDScollect").show();
-                //$("#TDScollectShow").show();
-                $("#sendAddressInfo").hide();
-                $("#sendAddressByPhone").hide();
-                $("#updateProduct").hide();
-                $("#postageAccount").hide();    //邮费转账账户 -- 隐藏
-                $("#sendInformationTitle").hide();    //寄回信息标题隐藏
-                $("#sendAddressSmsHtml").hide();    //寄回信息标题隐藏
-                visitByType(2); //需要回访
-                //$("#salesChannelsSelect").show();  //展示销售公司
-                if(customerInfoType == 1){
-                    $("#salesChannelsSelect").hide();  //展示销售公司
-                    $("#TDScollect").hide();
-                }else{
-                    $("#salesChannelsSelect").show();  //展示销售公司
-                    $("#TDScollect").show();
-                }
-                $("#customerCostsDiv").hide();
-                break;
-            case 6: //退货
-                result = isSolve.backGoods;
-                resultProductTableTitle = isSolveTitleMsg.backGoods;
-                $("#relationProduct").html("退货产品");
-                $("#processResultStatus").show();
-                $("#orderHead").show();
-                $("#order").show();
-                // $("#recipientInfo").show();
-                //$("#recipientInfoTitle").show();
-                //$("#recipientAddress").show();
-                //$("#recipientAddressText").show();
-                $("#renewedProduct").show();
-                //$("#TDScollect").show();
-                //$("#TDScollectShow").show();
-                $("#sendAddressInfo").show();
-                $("#sendAddressByPhone").show();
-                $("#updateProduct").hide();
-                $("#postageAccount").show();    //邮费转账账户
-                $("#sendInformationTitle").show();
-                $("#sendAddressSmsHtml").show();
-                visitByType(2); //需要回访
-                //$("#salesChannelsSelect").show();  //展示销售公司
-                if(customerInfoType == 1){
-                    $("#salesChannelsSelect").hide();  //展示销售公司
-                    $("#TDScollect").hide();
-                }else{
-                    $("#salesChannelsSelect").show();  //展示销售公司
-                    $("#TDScollect").show();
-                }
-                $("#customerCostsDiv").hide();
-                break;
-            case 7://无理由退货
-                result = isSolve.noReasonBack;
-                resultProductTableTitle = isSolveTitleMsg.noReasonBack;
-                $("#relationProduct").html("退货产品");
-                $("#processResultStatus").show();
-                $("#orderHead").show();
-                $("#order").show();
-                //$("#recipientInfo").show();
-                //$("#recipientInfoTitle").show();
-                //$("#recipientAddress").show();
-                //$("#recipientAddressText").show();
-                $("#renewedProduct").show();
-                //$("#TDScollect").show();
-                //$("#TDScollectShow").show();
-                $("#sendAddressInfo").show();
-                $("#sendAddressByPhone").show();
-                $("#updateProduct").hide();
-                $("#postageAccount").show();    //邮费转账账户
-                $("#sendInformationTitle").show();
-                $("#sendAddressSmsHtml").show();
-                visitByType(2); //需要回访
-                //$("#salesChannelsSelect").show();  //展示销售公司
-                if(customerInfoType == 1){
-                    $("#salesChannelsSelect").hide();  //展示销售公司
-                    $("#TDScollect").hide();
-                }else{
-                    $("#salesChannelsSelect").show();  //展示销售公司
-                    $("#TDScollect").show();
-                }
-                $("#customerCostsDiv").hide();
-                break;
-            default:
-                break;
+        $("#salesChannelsSelect").show();  //展示销售公司
+        $("#TDScollect").show();
+
+        if(procMethodIsBack == 2 && procMethodIsSend == 2){ //不需要寄回,不需要寄出就是 已解决,未解决
+            otherHied();
+            visitByType(1);
         }
-    }
-    for(var i=0;i< result.length;i++){
-        var html = statusHtml.replace("status_index",i+1);
-        html = html.replace("status_html",result[i]);
-        resultHtml += html;
-    }
 
-    if(resultProductTableTitle != null && resultProductTableTitle.length > 0){
-        /* 根据处理类型来切换 产品列表的列名称 */
-        for(var i=0;i<resultProductTableTitle[0].length;i++){
-            $("#table1").find("th").eq(i).html(resultProductTableTitle[0][i]);
+        var promType = $("#procTypeId").val() //查看是否为维修
+        if(promType == 3){
+            $("#customerCostsDiv").hide();  //工厂报价
         }
-        for(var i=0;i<resultProductTableTitle[1].length;i++){
-            $("#table2").find("th").eq(i).html(resultProductTableTitle[1][i]);
+
+        if((procMethodIsBack == 1 || procMethodIsSend == 1) && isNeedSelectOrder == 1){  //是否需要寄回 1:需要寄回 2:不需要寄回
+            // result = isSolve.renewed;
+            // resultProductTableTitle = isSolveTitleMsg.renewed;
+            $("#relationProduct").html("产品操作");     //寄回产品
+            $("#processResultStatus").show();
+            $("#orderHead").show();
+            $("#order").show();
+            $("#renewedProduct").show();
+            $("#sendAddressInfo").show();
+            $("#sendAddressByPhone").show();
+            $("#updateProduct").show(); //换新产品
+            $("#postageAccount").show();    //邮费转账账户
+            $("#sendInformationTitle").show();
+            $("#sendAddressSmsHtml").show();
+
+            //地址信息
+            $("#recipientInfoTitle").show();
+            $("#recipientInfo").show();
+            $("#recipientAddress").show();
+            $("#recipientAddressText").show();
+            $("#renewedProduct").show();
+            $("#updateProduct").show();
+            //地址信息
+
+            visitByType(2); //需要回访
+            if(customerInfoType == 1){
+                $("#salesChannelsSelect").hide();  //展示销售公司
+                $("#TDScollect").hide();
+            }else{
+                $("#salesChannelsSelect").show();  //展示销售公司
+                $("#TDScollect").show();
+            }
         }
     }
+    // for(var i=0;i< result.length;i++){
+    //     var html = statusHtml.replace("status_index",i+1);
+    //     html = html.replace("status_html",result[i]);
+    //     resultHtml += html;
+    // }
 
-    $("#processResultStatus").html(resultHtml);
+    // if(resultProductTableTitle != null && resultProductTableTitle.length > 0){
+    //     /* 根据处理类型来切换 产品列表的列名称 */
+    //     for(var i=0;i<resultProductTableTitle[0].length;i++){
+    //         $("#table1").find("th").eq(i).html(resultProductTableTitle[0][i]);
+    //     }
+    //     for(var i=0;i<resultProductTableTitle[1].length;i++){
+    //         $("#table2").find("th").eq(i).html(resultProductTableTitle[1][i]);
+    //     }
+    // }
+    // $("#processResultStatus").html(resultHtml);
 
-    opentionSelectOrderDiv();
+    // opentionSelectOrderDiv();
 }
 
 /*已解决|未解决 */
 function otherHied(customerInfoType){
-    //$("#salesChannelsSelect").show();  //展示销售公司
+    // $("#salesChannelsSelect").show();  //展示销售公司
+    // $("#TDScollect").show();
+    // $("#TDScollectShow").show();
+
     $("#processResultStatus").hide();   //处理结果的执行状态  已解决未解决没有该信息
     $("#orderHead").hide();
     $("#order").hide();
@@ -672,18 +544,9 @@ function otherHied(customerInfoType){
     $("#recipientAddress").hide();
     $("#recipientAddressText").hide();
     $("#renewedProduct").hide();
-    //$("#TDScollect").show();
-    //$("#TDScollectShow").show();
     $("#sendAddressInfo").hide();
     $("#sendAddressByPhone").hide();
     $("#updateProduct").hide();
-    if(customerInfoType == 1){
-        $("#salesChannelsSelect").hide();  //展示销售公司
-        $("#TDScollect").hide();
-    }else{
-        $("#salesChannelsSelect").show();  //展示销售公司
-        $("#TDScollect").show();
-    }
 }
 
 /*初始化问题大类*/
@@ -1314,106 +1177,6 @@ function linkageSetDistrict(){
 }
 
 /**
- * 展示产品 -- 20180417以前
- * @param orderItemList
- */
-/*function setProduce(orderItemList) {
-    var productList = getProduct() ; //所有产品
-    var html = "";
-    var productTypeNo = 0;
-
-    for(var i=0;i<productList.length;i++) {
-        var product = productList[i];
-        var produceFittings = getProduceFittings(product.productId);  //获取该产品的所有配件
-        var colorList = product.colorList;  //该产品的所有颜色
-
-        var productType = product.productType;
-
-        var colorHtml = '';
-        if(colorList != null && colorList.length >0 ){
-            colorHtml += '<table style="height: 100%;">';
-            for(var j=0;j<colorList.length;j++){
-                var number = "";
-                var color = colorList[j];
-                for(var k=0;k<orderItemList.length;k++){
-                    var item = orderItemList[k];
-                    if(item.itemColorId == color.colorId && item.itemIsSource == 1){
-                        number = item.itemNum;
-                    }
-                }
-                var fristInputStyle = "border-top: 1px solid #ddd;";
-                if(color.colorProductId == product.productId) {
-                    colorHtml += '<tr >' +
-                        '         <td width="55" style="border-left: none;text-align: center;'+ fristInputStyle +'">' + color.colorName + '</td>' +
-                        '         <td width="45" 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%;border: none;text-align: center;" value="'+ number +'" placeholder="产品数量"  id="color-' + color.colorProductId + '-' + color.colorId + '" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)" >' +
-                        '         </td>' +
-                        '     </tr>';
-                    fristInputStyle = "";
-                }
-
-            }
-            colorHtml += '</table>';
-        }else{
-            colorHtml += '<span>暂无该产品的颜色!<span>';
-        }
-
-        var produceFittingsHtml = '';
-        if(produceFittings != null && produceFittings.length > 0){
-            produceFittingsHtml += '<table style="height: 100%;">';
-            for(var m=0;m<produceFittings.length;m++){
-
-                var number = "";
-                var fitt = produceFittings[m];
-                for(var k=0;k<orderItemList.length;k++){
-                    var item = orderItemList[k];
-                    if(item.itemColorId == fitt.fittingsId && item.itemIsSource == 2){
-                        number = item.itemNum;
-                    }
-                }
-
-                var produceFit = produceFittings[m];
-                if(produceFit.productId == product.productId) {
-                    var fristInputStyle = "border-top: 1px solid #ddd;";
-                    produceFittingsHtml += '<tr >' +
-                        '         <td width="55" style="border-left: none;text-align: center; '+ fristInputStyle +'">' + produceFit.fittingsName +'</td>' +
-                        '         <td width="45" 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%;border: none;text-align: center;" value="'+ number +'" placeholder="配件数量" id="fittings-' + produceFit.productId + '-' + produceFit.fittingsId +'" name="" onkeyup="keyFun($(this),999)" onpaste="keyFun($(this),999)" >' +
-                        '         </td>' +
-                        '     </tr>';
-                    fristInputStyle = "";
-                }
-            }
-            produceFittingsHtml += '</table>';
-        }else{
-            produceFittingsHtml += '<span>暂无产品配件!<span>';
-        }
-
-        var produceHtml = '<input type="hidden" value="'+ product.productId +'">' +
-            '<span>'+  product.productName +'</span>';
-
-        html += ' <tr >' +
-            '    <td width="80">'+ produceHtml +'</td>' +
-            '    <td style="padding: 0px;text-align: center;">' +
-            colorHtml +
-            '   </td>' +
-            '    <td style="padding: 0px;text-align: center;">' +
-            produceFittingsHtml +
-            '    </td>' +
-            '</tr>';
-    }
-
-    $("#addProduct").html(html);
-
-    setBackProduct(html);  //设置寄回产品
-    //monitorProduct();   //监听产品变化
-}*/
-
-/**
  * 展示产品 -
  * todo 20180417
  * @param orderItemList
@@ -1443,7 +1206,7 @@ function setProduce(orderItemList) {
             + '<input type="hidden" class="input-fc-id" value="' + item.itemColorId +'">'
             + '<input type="hidden" class="input-69code" value="' + item.itemColorBar +'">'
             +  fiHtml
-            + '<input type="'+ fiHidden +'" class="input-text input-number input-code" style="width: 100%;border: none;text-align: center;" value="" placeholder="机器编号" name="" id="item-' + item.itemProductId + '-' + item.itemColorId +'" number="'+ item.itemNum +'"  itemIsSource="'+ item.itemIsSource +'"  onkeyup="keyFunString($(this),30)" onpaste="keyFunString($(this),30)" >'
+            + '<input type="'+ fiHidden +'" class="input-text input-number input-code" style="width: 100%;border: none;text-align: center;" value="" placeholder="机器编号" name="" id="item-' + item.itemProductId + '-' + item.itemColorId +'" number="'+ item.itemNum +'" "  onkeyup="keyFunString($(this),30)" onpaste="keyFunString($(this),30)" >'
             + '</td>'
             + '</tr>';
     }
@@ -1642,17 +1405,20 @@ function  opentionSelectOrder(type){
  * 展示订单
  */
 function opentionSelectOrderDiv(){
-    if(isNeedSelectOrder == 2 || allCustomerType == 1 || allCustomerType == 2 ){        //不展示
+    if(isNeedSelectOrder == 2 || (allProcMethodIsBack == 2 && allProcMethodIsSend == 2) ){        //不展示
         $("#orderHead").hide();
         $("#order").hide();
         $("#renewedProduct").hide();
+        $("#updateProduct").hide();
     }else{      //展示
         $("#orderHead").show();
         $("#order").show();
-        if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7 ){
+        if(allProcMethodIsBack == 1){
             $("#renewedProduct").show();
+            $("#updateProduct").show();
         }else{
             $("#renewedProduct").hide();
+            $("#updateProduct").hide();
         }
     }
 };
@@ -1698,30 +1464,17 @@ $(function(){
 
 /* 添加客诉的准备 */
 function addCustomerReady(){
-    //保存QA
-    //saveQuestion(2);
-
-    var QAId = $("#questionId").val();
-    if(QAId == null || QAId == "" || typeof (QAId) == "undefined"){
-        return false;
-    }
-
     /* 是否需要添加订单,赋值 */
     $("#isNeedSelectOrder").val(isNeedSelectOrder);
     if(isNeedSelectOrder == 1){
         var post_ids = $("#ids").val();
         if(post_ids == null || post_ids == ""){
             layer.msg("请重新选择订单", {icon: 5, time: 3000});
-            phoneFlag = false;
+            return false;
         }
     }
 
-    /* 录入电话号码和姓名到客诉基本信息里面  */
-    /*if(allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 5 || allCustomerType == 6 || allCustomerType == 7){
-        $("#customerName").val($("#sendName").val());
-        $("#customerTel").val($("#sendTel").val());
-    }*/
-
+    /*验证手机号码*/
     var phoneFlag = true;
     $(".associated-phone").each(function () {
         var phone = $(this).val();
@@ -1730,33 +1483,13 @@ function addCustomerReady(){
                 vailErrorMsg($(this),"手机号码格式不正确");
                 phoneFlag = false;
             }
-            /*if (!phoneReg.test(phone)) {
-                vailErrorMsg($(this),"手机号码格式不正确");
-                phoneFlag = false;
-            }*/
         }
     })
-
     if(!phoneFlag){
         return false;
     }
+    /*验证手机号码*/
 
-    /*验证来源入口*/
-    // var customerSourceType = $("input:radio[name='customerSourceType']:checked").val();
-    // var ty_text = $(".customerSourceType_text_"+customerSourceType).val();
-    // if(ty_text != null && ty_text != "" && typeof(ty_text) != "undefined" ){
-    //     $("#customerSource").val(ty_text);
-    // }
-
-    // if(customerSourceType == 3){
-    //     var customerSourceOld = $("#customerSourceOld").val();
-    //     if(customerSourceOld == null || customerSourceOld == "" || typeof(customerSourceOld)=="undefined"){
-    //         vailErrorMsg($("#customerSourceOld"),"未填写来源入口");
-    //         return false;
-    //     }else{
-    //         $("#customerSource").val(customerSourceOld);
-    //     }
-    // }
 
     /*根据产品类型,获取来源商城*/
     var typeCompany = parseInt($("input:radio[name='typeId']:checked").attr("typeCompany"));
@@ -1817,165 +1550,31 @@ function addCustomerReady(){
     $("#describeHandleDesc").val(describeHandleDescText);
     /*----处理描述--end-----*/
 
-    /* --- 类型:售后   处理结果:维修/换新/补发/退货/无理由退货 -- 处理产品 start---- */
-
-    if(isNeedSelectOrder == 1) {     //需要订单
 
+    /* --- 类型:售后   处理结果:维修/换新/补发/退货/无理由退货 -- 处理产品 start---- */
+    if(isNeedSelectOrder == 1 &&  (allProcMethodIsBack == 1 || allProcMethodIsSend == 1 ) ) {     //需要订单
         var sendProdcues = new Array();  //寄出产品表
-        var sendFittings = new Array();
-        var closedProdcues = new Array();         //获取寄回,寄出直接复制寄回
-        var closedFittings = new Array();         //获取寄回,寄出直接复制寄回
+        var closedProdcues = new Array(); //获取寄回,寄出直接复制寄回
 
         $("#addProduct").find(".input-code").each(function () {
             var machineNo = $(this).val();    //机器编号
             var number = $(this).parents("tr").find(".input-itemNum").eq(0).val();    //数量
-            var itemIsSource = $(this).attr("itemissource");    //是否为配件  1:产品颜色表,2:配件表
             if (number != null && number != "" && number != 0) {
                 var product = new Object();
-                var fittings = new Object();
-                // product.productId = $(this).parent().find(".input-produce-id").val();
-                // product.colorId = $(this).parent().find(".input-fc-id").val();
                 product.colorBar = $(this).parent().find(".input-69code").val();
-                // fittings.productId = $(this).parent().find(".input-produce-id").val();
-                // fittings.fittingsId = $(this).parent().find(".input-fc-id").val();
-                fittings.colorBar = $(this).parent().find(".input-69code").val();
-                if(itemIsSource == 1){ //产品颜色
-                    product.sendProdcueNumber = number;
-                    product.closedProdcueNumber = number;
-                    product.closedProdcueMachineNo = machineNo;
-                    //换新、维修,退货,无理由退货,
-                    if (allCustomerType == 3 || allCustomerType == 4 ){        //换新/维修
-                        sendProdcues.push(product);
-                        closedProdcues.push(product);
-                    }else if(allCustomerType == 6 || allCustomerType == 7){
-                        closedProdcues.push(product);
-                    }else if(allCustomerType == 5){             //补发
-                        sendProdcues.push(product);
-                    }
-                }else{
-                    fittings.sendFittingNumber = number;
-                    fittings.closedFittingNumber = number;
-                    //换新、维修,退货,无理由退货,
-                    if (allCustomerType == 3 || allCustomerType == 4 ) {        //换新/维修
-                        sendFittings.push(fittings);
-                        closedFittings.push(fittings);
-                    }else if(allCustomerType == 6 || allCustomerType == 7){
-                        closedFittings.push(fittings);
-                    }else if(allCustomerType == 5){             //补发
-                        sendFittings.push(fittings);
-                    }
+                product.sendProdcueNumber = number;
+                product.closedProdcueNumber = number;
+                product.closedProdcueMachineNo = machineNo;
+                if (allProcMethodIsBack == 1 ){
+                    closedProdcues.push(product);
+                }
+                if (allProcMethodIsSend == 1 ){
+                    sendProdcues.push(product);
                 }
             }
         })
-
-        // $("#addProduct").find(".input-fittings-number").each(function () {
-        //     var number = $(this).val();
-        //     if (number != null && number != "" && number != 0) {
-        //         var fittings = new Object();
-        //         fittings.productId = $(this).parent().find(".input-produce-id").val();
-        //         fittings.fittingsId = $(this).parent().find(".input-fittings-id").val();
-        //         //换新、维修,退货,无理由退货,
-        //         if (allCustomerType == 3 || allCustomerType == 4 || allCustomerType == 6 || allCustomerType == 7) {
-        //             fittings.closedFittingNumber = number;
-        //             closedFittings.push(fittings);
-        //         } else if (allCustomerType == 5) {
-        //             fittings.sendFittingNumber = number;
-        //             sendFittings.push(fittings);
-        //         }
-        //     }
-        // })
-
-        // $("#back-product").find(".input-color-number").each(function () {
-        //     var number = $(this).val();
-        //     if (number != null && number != "" && number != 0) {
-        //         //换新、维修,
-        //         if (allCustomerType == 3 || allCustomerType == 4) {
-        //             var fittings = new Object();
-        //             fittings.productId = $(this).parent().find(".input-produce-id").val();
-        //             fittings.colorId = $(this).parent().find(".input-color-id").val();
-        //             fittings.sendProdcueNumber = number;
-        //             sendProdcues.push(fittings);
-        //         }
-        //     }
-        // })
-
-        // $("#back-product").find(".input-fittings-number").each(function () {
-        //     var number = $(this).val();
-        //     if (number != null && number != "" && number != 0) {
-        //         //换新、维修
-        //         if (allCustomerType == 3 || allCustomerType == 4) {
-        //             var fittings = new Object();
-        //             fittings.productId = $(this).parent().find(".input-produce-id").val();
-        //             fittings.fittingsId = $(this).parent().find(".input-fittings-id").val();
-        //             fittings.sendFittingNumber = number;
-        //             sendFittings.push(fittings);
-        //         }
-        //     }
-        // })
-
-        var backErrorMsg = "请选择一个replace_error_msg寄回的产品或配件并填写一个以上的数量!"
-        var sendErrorMsg = "请选择一个replace_error_msg寄送的产品或配件并填写一个以上的数量!"
-        var process = true;
-        switch (allCustomerType) {
-            case 3:
-                process = processIsEmpty([closedProdcues, closedFittings]);
-                if (!process) {
-                    var msg = backErrorMsg.replace("replace_error_msg", "换新");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                process = processIsEmpty([sendProdcues, sendFittings]);
-                if (!process) {
-                    var msg = sendErrorMsg.replace("replace_error_msg", "换新");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            case 4:
-                process = processIsEmpty([closedProdcues, closedFittings]);
-                if (!process) {
-                    var msg = backErrorMsg.replace("replace_error_msg", "维修");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                process = processIsEmpty([sendProdcues, sendFittings]);
-                if (!process) {
-                    var msg = sendErrorMsg.replace("replace_error_msg", "维修");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            case 5:
-                process = processIsEmpty([sendProdcues, sendFittings]);
-                if (!process) {
-                    var msg = sendErrorMsg.replace("replace_error_msg", "补发");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            case 6:
-                process = processIsEmpty([closedProdcues, closedFittings]);
-                if (!process) {
-                    var msg = backErrorMsg.replace("replace_error_msg", "退货");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            case 7:
-                process = processIsEmpty([closedProdcues, closedFittings]);
-                if (!process) {
-                    var msg = backErrorMsg.replace("replace_error_msg", "退货");
-                    layer.msg(msg, {icon: 5, time: 3000});
-                    return false;
-                }
-                break;
-            default:
-                break;
-        }
         $("#sendProdcues").val(JSON.stringify(sendProdcues));
-        $("#sendFittings").val(JSON.stringify(sendFittings));
         $("#closedProdcues").val(JSON.stringify(closedProdcues));
-        $("#closedFittings").val(JSON.stringify(closedFittings));
     }
 
     var visitTimeSelect = $("input[name='visitTimeSelect']:checked").val();
@@ -1999,44 +1598,6 @@ function addCustomerReady(){
     }
     return true;
 }
-
-/* 判断产品与配件是否填入值 */
-function processIsEmpty(process){
-    if(process != null && process != "" && process.length > 0){
-        var flag = 2;
-        var num = 0;
-        if(process[0] == null ||  process[0].length < 1 ){
-            flag -- ;
-        }
-        if(process[1] == null ||  process[1].length < 1 ){
-            flag -- ;
-        }
-
-        for(var j=0; j<process.length;j++){
-            for(var i=0;i<process[j].length;i++){
-                if(process[j][i].sendProdcueNumber !== undefined){
-                    num +=  process[j][i].sendProdcueNumber;
-                }
-                if(process[j][i].sendFittingNumber !== undefined){
-                    num += process[j][i].sendFittingNumber;
-                }
-                if(process[j][i].closedProdcueNumber !== undefined){
-                    num += process[j][i].closedProdcueNumber ;
-                }
-                if(process[j][i].closedFittingNumber !== undefined){
-                    num += process[j][i].closedFittingNumber;
-                }
-            }
-        }
-        if(flag == 0){
-            return false;
-        }
-        if(num == 0){
-            return false;
-        }
-    }
-    return true;
-}
 /*===============================客诉提交  -- end -- =============================== */