浏览代码

客诉修改

wangxiaoming 6 年之前
父节点
当前提交
7c2d752d57

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

@@ -159,6 +159,11 @@ public class CustomerInfo  implements Serializable {
     private Integer procMethodIsBack; //处理方式名称1:需要寄回 2:不需要寄回
     private Integer procMethodIsSend; //处理方式名称1:需要寄出 2:不需要寄出
 
+
+    private String customerProvinceId;    //省
+    private String customerCityId;    //市
+    private String customerDistrictId;    //区
+
     public void setComplaintDetectList(List<ComplaintDetectInfo> complaintDetectList) {
         this.complaintDetectList = complaintDetectList;
     }
@@ -788,4 +793,28 @@ public class CustomerInfo  implements Serializable {
     public void setProcMethodIsSend(Integer procMethodIsSend) {
         this.procMethodIsSend = procMethodIsSend;
     }
+
+    public String getCustomerProvinceId() {
+        return customerProvinceId;
+    }
+
+    public void setCustomerProvinceId(String customerProvinceId) {
+        this.customerProvinceId = customerProvinceId;
+    }
+
+    public String getCustomerCityId() {
+        return customerCityId;
+    }
+
+    public void setCustomerCityId(String customerCityId) {
+        this.customerCityId = customerCityId;
+    }
+
+    public String getCustomerDistrictId() {
+        return customerDistrictId;
+    }
+
+    public void setCustomerDistrictId(String customerDistrictId) {
+        this.customerDistrictId = customerDistrictId;
+    }
 }

+ 21 - 30
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/CustomerServiceImpl.java

@@ -218,7 +218,7 @@ public class CustomerServiceImpl implements CustomerService {
     public Integer updateCustomerInfo(CustomerInfo customerInfo,SalesOrder salesOrder){
         Integer isNeedSelectOrder = customerInfo.getIsNeedSelectOrder();
         //当前处理信息
-        CmRelation cr =  cmRelationMapper.getCmRelationByCustomerId(customerInfo.getCustomerId());
+        CmRelation cr =  customerInfo.getCmRelation();
 
         //删除旧的售后数据
         customerService.deleteCustomerAfterSales(customerInfo,cr);
@@ -263,7 +263,6 @@ public class CustomerServiceImpl implements CustomerService {
         }
 
         ProcMethod procMethod = procMethodService.getProcMethodById(customerInfo.getProcMethodId());
-        CmRelation cmRelation = customerInfo.getCmRelation();
         if (2 == customerInfo.getCustomerCounselType() && (procMethod.getProcMethodIsBack()==1||procMethod.getProcMethodIsSend()==1)){
             if(isNeedSelectOrder == 1){
                 SalesOrder so = new SalesOrder();
@@ -280,24 +279,22 @@ public class CustomerServiceImpl implements CustomerService {
             }
             logger.info("-----------添加客诉-添加订单 --------------");
         }
-        cmRelation.setRelationId(cr.getRelationId());
-        cmRelation.setRelationDesc(cr.getRelationDesc());//备注
         if (procMethod.getProcMethodIsBack()==2) {
-            cmRelation.setRelationBackStatus(1); //寄回状态 1:未寄回
-            cmRelation.setRelationIsTransfer(0);    //是否已转账邮费
-            cmRelation.setRelationBackPostage(0);   //邮费
-            cmRelation.setRelationBackLogisticsCompany("");//寄回物流公司
-            cmRelation.setRelationBackLogisticsNo("");//寄回物流单号
-            cmRelation.setRelationAlipay("");//转账账户
-            cmRelation.setRelationAlipayName("");//转账账户 (账户姓名)
+            cr.setRelationBackStatus(1); //寄回状态 1:未寄回
+            cr.setRelationIsTransfer(0);    //是否已转账邮费
+            cr.setRelationBackPostage(0);   //邮费
+            cr.setRelationBackLogisticsCompany("");//寄回物流公司
+            cr.setRelationBackLogisticsNo("");//寄回物流单号
+            cr.setRelationAlipay("");//转账账户
+            cr.setRelationAlipayName("");//转账账户 (账户姓名)
         }
         if (procMethod.getProcMethodIsSend()==2) {
-            cmRelation.setRelationSendStatus(1); //寄送状态 1:未寄送
-            cmRelation.setRelationSendLogisticsCompany("");//寄送物流公司
-            cmRelation.setRelationSendLogisticsNo("");//寄送物流单号
+            cr.setRelationSendStatus(1); //寄送状态 1:未寄送
+            cr.setRelationSendLogisticsCompany("");//寄送物流公司
+            cr.setRelationSendLogisticsNo("");//寄送物流单号
         }
         /* 初始化产品类型,名称,配件名称 */
-        customerService.setName(cmRelation);
+        customerService.setName(cr);
         logger.info("-----------修改客诉-初始化产品,配件信息--------------");
 
         ComplaintDetectInfo complaintDetectInfo = new ComplaintDetectInfo();  //品质检测
@@ -306,7 +303,7 @@ public class CustomerServiceImpl implements CustomerService {
         boolean isReturn = false;
         logger.info("-----------修改客诉-创建仓储/品检成功--------------");
 
-        flag = cmRelationMapper.update(cmRelation);
+        flag = cmRelationMapper.update(cr);
         if(flag < 1){
             throw new RuntimeException("修改客诉-修改处理信息失败");
         }
@@ -316,7 +313,7 @@ public class CustomerServiceImpl implements CustomerService {
         List<RelationOrder> relationOrderList = new ArrayList<>();
         for (SalesOrder sor : orderList) {
             RelationOrder ro = new RelationOrder();
-            ro.setRelationId(cmRelation.getRelationId());
+            ro.setRelationId(cr.getRelationId());
             ro.setSalesId(sor.getSalesId());
             ro.setRelationCustomerId(customerInfo.getCustomerId());
             relationOrderList.add(ro);
@@ -340,12 +337,12 @@ public class CustomerServiceImpl implements CustomerService {
         logger.info("-----------添加客诉-添加处理与订单关联表--------------");
 
         logger.info("-----------添加客诉-修改订单--------------");
-        CustomerCommonUtil.setProduce(cmRelation);
-        if(cmRelation.getClosedProdcues() != null && cmRelation.getClosedProdcues().size()>0){
-            closedProdcueMapper.insert(cmRelation.getClosedProdcues());
+        CustomerCommonUtil.setProduce(cr);
+        if(cr.getClosedProdcues() != null && cr.getClosedProdcues().size()>0){
+            closedProdcueMapper.insert(cr.getClosedProdcues());
         }
-        if(cmRelation.getSendProdcues() != null && cmRelation.getSendProdcues().size() > 0){
-            sendProdcueMapper.insert(cmRelation.getSendProdcues());
+        if(cr.getSendProdcues() != null && cr.getSendProdcues().size() > 0){
+            sendProdcueMapper.insert(cr.getSendProdcues());
         }
         logger.info("-----------添加客诉-寄回寄出产品配件成功--------------");
 
@@ -386,17 +383,11 @@ public class CustomerServiceImpl implements CustomerService {
             SalesOrder newOrder = new SalesOrder(); //salesOrderStatus
             newOrder.setSalesId(relationOrderList.get(k).getSalesId());
             newOrder.setSalesOrderStatus(1);    //恢复订单到之前的状态
-            flag = salesOrderMapper.updateSalesOrder(newOrder);
-            if(flag < 1){
-                throw new RuntimeException("修改客诉-恢复订单状态,恢复订单状态失败");
-            }
+            salesOrderMapper.updateSalesOrder(newOrder);
         }
 
         /* 删除掉订单与处理的关联表 */
-        flag =  relationOrderService.deleteByRelationId(cmRelation.getRelationId());
-        if(flag < 1){
-            throw new RuntimeException("修改客诉-恢复订单状态,恢复订单状态失败");
-        }
+        relationOrderService.deleteByRelationId(cmRelation.getRelationId());
     }
 
     @Override

+ 20 - 5
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/customerInfoMapper.xml

@@ -58,7 +58,10 @@
       t.customer_out_damaged,
       t.customer_secondary_customer,
       t.customer_last_id,
-      t.customer_initial_id
+      t.customer_initial_id,
+      t.customer_province_id,
+      t.customer_city_id,
+      t.customer_district_id
     from tb_rst_cm_customer_info t
     where t.customer_id = #{customerId,jdbcType=INTEGER}
   </select>
@@ -453,14 +456,17 @@
       company_id, store_id, customer_source_type, 
       customer_source, customer_counsel_type, customer_name, 
       customer_tel,customer_wechat_name, customer_is_solve, customer_is_visit,
-      customer_in_TDS, customer_out_TDS, customer_area, type_id, customer_desc, customer_out_damaged, customer_secondary_customer, customer_last_id, customer_initial_id
+      customer_in_TDS, customer_out_TDS, customer_area, type_id, customer_desc, customer_out_damaged, customer_secondary_customer, customer_last_id,
+       customer_province_id,customer_city_id,customer_district_id,
+       customer_initial_id
       )
     values (#{customerId,jdbcType=INTEGER}, #{adminId,jdbcType=INTEGER}, #{questionId,jdbcType=INTEGER}, 
       #{companyId,jdbcType=INTEGER}, #{storeId,jdbcType=INTEGER}, #{customerSourceType,jdbcType=TINYINT}, 
       #{customerSource,jdbcType=VARCHAR}, #{customerCounselType,jdbcType=BIT}, #{customerName,jdbcType=VARCHAR}, 
       #{customerTel,jdbcType=VARCHAR},#{customerWechatName,jdbcType=VARCHAR}, #{customerIsSolve,jdbcType=TINYINT}, #{customerIsVisit,jdbcType=VARCHAR},
-      #{customerInTDS,jdbcType=INTEGER}, #{customerOutTDS,jdbcType=INTEGER}, #{customerArea,jdbcType=VARCHAR},#{typeId},#{customerDesc},#{customerOutDamaged},#{customerSecondaryCustomer}
-      ,#{customerLastId},#{customerInitialId}
+      #{customerInTDS,jdbcType=INTEGER}, #{customerOutTDS,jdbcType=INTEGER}, #{customerArea,jdbcType=VARCHAR},#{typeId},#{customerDesc},#{customerOutDamaged},#{customerSecondaryCustomer},#{customerLastId},
+      #{customerProvinceId},#{customerCityId},#{customerDistrictId},
+      #{customerInitialId}
       )
   </insert>
 
@@ -535,7 +541,16 @@
         customer_last_id = #{customerLastId},
       </if>
       <if test="customerInitialId != null" >
-        customer_initial_id = #{customerInitialId}
+        customer_initial_id = #{customerInitialId},
+      </if>
+      <if test="customerProvinceId != null" >
+        customer_province_id = #{customerProvinceId},
+      </if>
+      <if test="customerCityId != null" >
+        customer_city_id = #{customerCityId},
+      </if>
+      <if test="customerDistrictId != null" >
+        customer_district_id = #{customerDistrictId},
       </if>
       <if test="factoryId != null" >
         factory_id = #{factoryId}

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

@@ -925,6 +925,8 @@ public class AdminCustomerController {
         }
         customerInfo.setTransactionNumber(orderId);
 
+        customerInfo.setCmRelation(cmRelation);
+
         Integer customerId = customerInfo.getCustomerId();
         logger.info("-----------------修改客诉开始----------------------");
         try {

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

@@ -385,13 +385,13 @@
                 </div>
             </div>
 
-            <div class="row cl" id="orderHead" style="display: none;">
+            <div class="row cl orderHead" id="" style="display: none;">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>订单信息:</label>
                 <div class="formControls col-1 col-sm-1">
                     <button type="button" class="btn btn-primary" id="selectOrder">搜索订单</button>
                 </div>
             </div>
-            <div class="row cl" id="order" style="display: none;">
+            <div class="row cl orderHead" id="" style="display: none;">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-9 col-sm-9 text-c">
                     <table class="table table-border table-bg table-bordered" >
@@ -419,12 +419,12 @@
                 </div>
             </div>
 
-            <div class="row cl" id="recipientInfoTitle" style="display: none">
+            <div class="row cl recipientInfo" id="" 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 recipientInfo" id="" 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="联系人格式不正确!" >
@@ -437,7 +437,7 @@
                 </div>
             </div>
 
-            <div class="row cl" id="recipientAddress" style="display: none">
+            <div class="row cl recipientAddress" id="" 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">
@@ -461,7 +461,7 @@
                 <input type="hidden" name="relationSendMergeAddress" id="relationSendMergeAddress">
             </div>
 
-            <div class="row cl" id="recipientAddressText" style="display: none">
+            <div class="row cl recipientAddress" id="" 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>
@@ -469,29 +469,42 @@
                 </div>
             </div>
 
-            <div class="row cl" id="renewedProduct" style="display: none">
+            <div class="row cl renewedProduct" id="" 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">
+                <div class="formControls col-1 col-sm-1">
+                    <button type="button" class="btn btn-primary" id="" onclick="addProduct(1)">添加产品</button>
+                </div>
+            </div>
+            <div class="row cl renewedProduct" id="" style="display: none">
+                <label class="form-label col-1 col-sm-1"></label>
+                <div class="formControls col-9 col-sm-9" >
                     <table class="table table-border table-bg table-bordered">
                         <thead>
-                            <tr class="text-c" id="table1">
-                                <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>
+                        <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>
+                            <th style="text-align: center;" width="30">操作</th>
+                        </tr>
                         </thead>
-                        <tbody id="addProduct">
-                            <tr id="">
-                                <td style="text-align: center;" colspan="4">选择订单后展示</td>
-                            </tr>
+                        <tbody id="addBackProduct">
+                        <tr id="">
+                            <td style="text-align: center;" colspan="5">选择订单后展示</td>
+                        </tr>
                         </tbody>
                     </table>
                 </div>
             </div>
 
-            <div class="row cl" id="updateProduct" style="display: none">
+            <div class="row cl updateProduct" id="" style="display: none">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>寄出产品:</label>
+                <div class="formControls col-1 col-sm-1">
+                    <button type="button" class="btn btn-primary" id="" onclick="addProduct(2)">添加产品</button>
+                </div>
+            </div>
+            <div class="row cl updateProduct" id="" style="display: none">
+                <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-9 col-sm-9" >
                     <table class="table table-border table-bg table-bordered">
                         <thead>
@@ -500,12 +513,13 @@
                             <th style="text-align: center;" width="40">产品颜色</th>
                             <th style="text-align: center;" width="30">数量</th>
                             <th style="text-align: center;" width="100">机器编号</th>
+                            <th style="text-align: center;" width="30">操作</th>
                         </tr>
                         </thead>
-                        <tbody id="back-product">
-                            <tr id="">
-                                <td style="text-align: center;" colspan="4">选择订单后展示</td>
-                            </tr>
+                        <tbody id="addSendProduct">
+                        <tr id="">
+                            <td style="text-align: center;" colspan="5">选择订单后展示</td>
+                        </tr>
                         </tbody>
                     </table>
                 </div>
@@ -521,14 +535,15 @@
                     <input type="text" class="input-text trim_input" placeholder="客户报价" id="relationCustomerCosts" name="relationCustomerCosts" value="">
                   </div>
             </div>
-            <div class="row cl"  id="sendInformationTitle">
+
+            <div class="row cl sendAddressInfo"  id="">
                  <label class="form-label col-1 col-sm-1">
                      <div class="tit-2">寄回信息</div>
                  </label>
                      <div class="formControls col-10 col-sm-10">
                       </div>
             </div>
-            <div class="row cl" id="sendAddressInfo">
+            <div class="row cl sendAddressInfo" id="">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-9 col-sm-9" style="height: 240px" id="sendAddressSmsHtml">
                    <#-- <script id="sendAddressSms" type="text/plain" style="width:983px;height:200px;"></script>
@@ -536,7 +551,7 @@
                 </div>
             </div>
 
-            <div class="row cl" id="sendAddressByPhone" style="display: none;">
+            <div class="row cl sendAddressInfo" id="" style="display: none;">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-2 col-sm-2">
                     <input type="text" class="input-text associated-phone" value="" placeholder="请输入手机号" id="m-phone" name="">
@@ -560,7 +575,7 @@
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-2 col-sm-2" style="position: relative;">
                     <span class="select-box">
-                        <select name="initProvinceCode" class="select" id="initProvince"
+                        <select name="customerProvinceId" class="select" id="initProvince"
                                 ulcValName="province" ulcValId="provinceId"  ulcURL="/address/list_province" ulcMsg="" ulcList="provinceList"
                                 ulcIsFristSelect="true" ulcFristSelectMsg="请选择省份">
                         </select>
@@ -568,7 +583,7 @@
                 </div>
                 <div class="formControls col-2 col-sm-2">
                     <span class="select-box">
-                        <select name="initCityCode" class="select" id="initCity"
+                        <select name="customerCityId" class="select" id="initCity"
                                 ulcValName="city" ulcValId="cityId"  ulcURL="/address/list_city?provinceId=" ulcMsg="" ulcList="cityList"
                                 ulcIsFristSelect="true" ulcFristSelectMsg="请选择市">
                         </select>
@@ -576,7 +591,7 @@
                 </div>
                 <div class="formControls col-2 col-sm-2" style="position: relative;">
                     <span class="select-box">
-                        <select name="initDistrictCode" class="select" id="initCountry"
+                        <select name="customerDistrictId" class="select" id="initCountry"
                                 ulcValName="district" ulcValId="districtId"  ulcURL="/address/list_district?cityId=" ulcMsg="" ulcList="districtList"
                                 ulcIsFristSelect="true" ulcFristSelectMsg="请选择区/县">
                         </select>
@@ -744,6 +759,9 @@
     /*1:需要有订单    2:不需要有订单*/
     var isNeedSelectOrder = 2;
 
+    /*添加产品的类型 0:全部添加  1:寄回产品添加   2:寄出产品添加 */
+    var productAddType = 0;
+
     /*初始化页面参数*/
     $(function () {
         /* 初始化单选框样式 */
@@ -772,10 +790,12 @@
         $("input[name='customerCounselType']").change(function (){
             allCustomerInfoType = parseInt($(this).val());
             if(allCustomerInfoType == 1){
+                isNeedSelectOrder = 2;
                 $("#twiceSellEnd").hide();
                 $("#openTheLock").hide();
                 promethodUlc.setUlcById(0,1);
             }else{
+                isNeedSelectOrder = 1;
                 $("#twiceSellEnd").show();
                 $("#openTheLock").show();
                 promethodUlc.setUlcById(0,2);

+ 69 - 50
watero-rst-web/src/main/webapp/WEB-INF/views/cm/customer/update_customer.ftl

@@ -370,14 +370,14 @@
                     </ul>
                 </div>
             </div>
-            <div class="row cl" id="orderHead" style="display: none;">
+            <div class="row cl orderHead" id="" style="display: none;">
                 <label class="form-label col-1 col-sm-1"><span class="c-red">*</span>订单信息:</label>
                 <div class="formControls col-1 col-sm-1">
                     <button type="button" class="btn btn-primary" id="selectOrder">搜索订单</button>
                 </div>
             </div>
 
-            <div class="row cl" id="order" style="display: none;">
+            <div class="row cl orderHead" id="" style="display: none;">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-9 col-sm-9 text-c">
                     <table class="table table-border table-bg table-bordered">
@@ -430,12 +430,12 @@
             <input type="hidden" id="orderId" name="salesId" value="">
             <input type="hidden" id="ids" name="ids" value="${ids!''}" >
 
-            <div class="row cl" id="recipientInfoTitle" style="display: none;">
+            <div class="row cl recipientInfo" id="" 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 recipientInfo" id="" 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="${cmRelation.relationSendName!''}" placeholder="填写收件人姓名" id="sendName" name="relationSendName" datatype="/^[\u4e00-\u9fa5]{1,20}$/" errormsg="联系人格式不正确!" >
@@ -447,7 +447,7 @@
                     <input type="text" class="input-text" value="${cmRelation.relationAlipay!''}" placeholder="邮费转账 支付宝账户" id="relationAlipay" name="relationAlipay" errormsg="邮费转账账户!">
                 </div>
             </div>
-            <div class="row cl" id="recipientAddress" style="display: none;">
+            <div class="row cl recipientAddress" id="" 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,58 +473,73 @@
                 <input type="hidden" name="relationSendMergeAddress" id="relationSendMergeAddress">
 
             </div>
-            <div class="row cl" id="recipientAddressText" style="display: none;">
+            <div class="row cl recipientAddress" id="" 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)">${cmRelation.relationSendAddress!''}</textarea>
                     <span id="addrssMsg"></span>
                 </div>
             </div>
-            <div class="row cl" id="renewedProduct" style="display: none;">
+
+            <div class="row cl renewedProduct" id="" 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">
+                </div>
+            </div>
+
+            <div class="row cl renewedProduct" id="" style="display: none;">
+                <label class="form-label col-1 col-sm-1"></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">
-                                <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>
+                        <tr class="text-c" id="table1">
+                            <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>
+                            <th style="text-align: center;" width="30">操作</th>
+                        </tr>
                         </thead>
-                        <tbody id="addProduct">
-                            <#if (cmRelation.closedProdcues?size>0)>
-                                <#list cmRelation.closedProdcues as closedProdcues>
-                                <tr>
-                                        <td style="text-align: center;">
-                                            ${closedProdcues.closedProductName!""}
-                                        </td>
-                                        <td style="text-align: center;">
-                                            ${closedProdcues.closedColorName!""}
-                                        </td>
-                                        <td style="text-align: center;">
-                                            <input type="text" style="width: 100%;border: none;text-align: center;" class="input-text input-number input-itemNum" value="${closedProdcues.closedProdcueNumber!"0"}"  placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)">
-                                        </td>
-                                        <td style="text-align: center;">
-                                            <input type="hidden" class="input-produce-id" value="${closedProdcues.productId}">
-                                            <input type="hidden" class="input-fc-id" value="${closedProdcues.colorId}">
-                                            <input type="hidden" class="input-69code" value="${closedProdcues.colorBar}">
-                                            <input type="text" class="input-text input-number input-code" style="width: 100%;border: none;text-align: center;" value="${closedProdcues.closedProdcueMachineNo!""}" placeholder="机器编号" name="" id="item-${closedProdcues.productId}-${closedProdcues.colorId}" number="${closedProdcues.closedProdcueNumber}"  itemIsSource="1"  onkeyup="keyFunString($(this),30)" onpaste="keyFunString($(this),30)" >
-                                        </td>
-                                </tr>
-                                </#list>
-                            <#else >
-                                <tr>
-                                    <td style="text-align: center;" colspan="4">选择订单后展示</td>
-                                </tr>
-                            </#if>
+                        <tbody id="addBackProduct">
+                        <#if (cmRelation.closedProdcues?size>0)>
+                            <#list cmRelation.closedProdcues as closedProdcues>
+                            <tr>
+                                <td style="text-align: center;">
+                                ${closedProdcues.closedProductName!""}
+                                </td>
+                                <td style="text-align: center;">
+                                ${closedProdcues.closedColorName!""}
+                                </td>
+                                <td style="text-align: center;">
+                                    <input type="text" style="width: 100%;border: none;text-align: center;" class="input-text input-number input-itemNum" value="${closedProdcues.closedProdcueNumber!"0"}"  placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)">
+                                </td>
+                                <td style="text-align: center;">
+                                    <input type="hidden" class="input-produce-id" value="${closedProdcues.productId}">
+                                    <input type="hidden" class="input-fc-id" value="${closedProdcues.colorId}">
+                                    <input type="hidden" class="input-69code" value="${closedProdcues.colorBar}">
+                                    <input type="text" class="input-text input-number input-code" style="width: 100%;border: none;text-align: center;" value="${closedProdcues.closedProdcueMachineNo!""}" placeholder="机器编号" name="" id="item-${closedProdcues.productId}-${closedProdcues.colorId}" number="${closedProdcues.closedProdcueNumber}"  itemIsSource="1"  onkeyup="keyFunString($(this),30)" onpaste="keyFunString($(this),30)" >
+                                </td>
+                                <td style="text-align: center;" ><a href="javascript:void(0)" onclick="delColor(this)" >删除</a></td>
+                            </tr>
+                            </#list>
+                        <#else >
+                        <tr>
+                            <td style="text-align: center;" colspan="5">选择订单后展示</td>
+                        </tr>
+                        </#if>
                         </tbody>
                     </table>
                 </div>
             </div>
-            <div class="row cl" id="updateProduct" style="display: none;">
+
+            <div class="row cl updateProduct" id="" 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" ></div>
+            </div>
+
+            <div class="row cl updateProduct" id="" style="display: none;">
+                <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-9 col-sm-9" >
 
                     <table class="table table-border table-bg table-bordered">
@@ -534,9 +549,10 @@
                             <th style="text-align: center;" width="40">产品颜色</th>
                             <th style="text-align: center;" width="30">产品配件</th>
                             <th style="text-align: center;" width="100">机器编码</th>
+                            <th style="text-align: center;" width="30">操作</th>
                         </tr>
                         </thead>
-                        <tbody id="back-product">
+                        <tbody id="addSendProduct">
                             <#if (cmRelation.sendProdcues?size>0)>
                                 <#list cmRelation.sendProdcues as sendProdcues>
                                 <tr>
@@ -555,6 +571,7 @@
                                         <input type="hidden" class="input-69code" value="${sendProdcues.colorBar}">
                                         <input type="text" class="input-text input-number input-code" style="width: 100%;border: none;text-align: center;" value="${sendProdcues.sendProdcueMachineNo!""}" placeholder="机器编号" name="" id="item-${sendProdcues.productId}-${sendProdcues.colorId}" number="${sendProdcues.sendProdcueNumber}"  itemIsSource="1"  onkeyup="keyFunString($(this),30)" onpaste="keyFunString($(this),30)" >
                                     </td>
+                                    <td style="text-align: center;" ><a href="javascript:void(0)" onclick="delColor(this)" >删除</a></td>
                                 </tr>
                                 </#list>
                             <#else >
@@ -578,14 +595,14 @@
                 </div>
             </div>
 
-            <div class="row cl" id="sendInformationTitle">
+            <div class="row cl sendAddressInfo" id="">
                   <label class="form-label col-1 col-sm-1">
                   <div class="tit-2">寄回信息</div>
                 </label>
                 <div class="formControls col-10 col-sm-10"></div>
             </div>
 
-            <div class="row cl" id="sendAddressInfo">
+            <div class="row cl sendAddressInfo" id="">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-9 col-sm-9" style="height: 250px" id="sendAddressSmsHtml">
                     <#-- <script id="sendAddressSms" type="text/plain" style="width:983px;height:200px;"></script>
@@ -613,28 +630,28 @@
                  </div>
             </div>
 
-            <div class="row cl init_address" id="TDScollect" style="display: none;" code="returnCode" msg="resultMsg" data="returnMsg">
+            <div class="row cl init_address" id="TDScollect" style="" code="returnCode" msg="resultMsg" data="returnMsg">
                 <label class="form-label col-1 col-sm-1"></label>
                 <div class="formControls col-2 col-sm-2" style="position: relative;">
                     <span class="select-box">
-                        <select name="initProvinceCode" class="select" id="initProvince"
-                                ulcValName="province" ulcValId="provinceId"  ulcURL="/address/list_province" ulcMsg="" ulcList="provinceList"
+                        <select name="customerProvinceId" class="select" id="initProvince"
+                                ulcValName="province" ulcValId="provinceId" ulcId="${customerInfo.customerProvinceId!''}"  ulcURL="/address/list_province" ulcMsg="" ulcList="provinceList"
                                 ulcIsFristSelect="true" ulcFristSelectMsg="请选择省份">
                         </select>
                     </span>
                 </div>
                 <div class="formControls col-2 col-sm-2">
                     <span class="select-box">
-                        <select name="initCityCode" class="select" id="initCity"
-                                ulcValName="city" ulcValId="cityId"  ulcURL="/address/list_city?provinceId=" ulcMsg="" ulcList="cityList"
+                        <select name="customerCityId" class="select" id="initCity"
+                                ulcValName="city" ulcValId="cityId" ulcId="${customerInfo.customerCityId!''}"  ulcURL="/address/list_city?provinceId=" ulcMsg="" ulcList="cityList"
                                 ulcIsFristSelect="true" ulcFristSelectMsg="请选择市">
                         </select>
                     </span>
                 </div>
                 <div class="formControls col-2 col-sm-2" style="position: relative;">
                     <span class="select-box">
-                        <select name="initDistrictCode" class="select" id="initCountry"
-                                ulcValName="district" ulcValId="districtId"  ulcURL="/address/list_district?cityId=" ulcMsg="" ulcList="districtList"
+                        <select name="customerDistrictId" class="select" id="initCountry"
+                                ulcValName="district" ulcValId="districtId" ulcId="${customerInfo.customerDistrictId!''}" ulcURL="/address/list_district?cityId=" ulcMsg="" ulcList="districtList"
                                 ulcIsFristSelect="true" ulcFristSelectMsg="请选择区/县">
                         </select>
                     </span>
@@ -782,10 +799,12 @@
         $("input[name='customerCounselType']").change(function (){
             allCustomerInfoType = parseInt($(this).val());
             if(allCustomerInfoType == 1){
+                isNeedSelectOrder = 2;
                 $("#twiceSellEnd").hide();
                 $("#openTheLock").hide();
                 promethodUlc.setUlcById(0,1);
             }else{
+                isNeedSelectOrder = 1;
                 $("#twiceSellEnd").show();
                 $("#openTheLock").show();
                 promethodUlc.setUlcById(0,2);

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

@@ -39,9 +39,9 @@
                 //是否已加载出来值 //默认为否,因为异步初始是没有值的
                 this.isLoad = false;
                 //因为change事件能够重复添加,所以,在这里控制change事件重复问题,导致页面点击一次,调用多次联动
-                this.isLoadChangeEvent = false; //直接删除change,所以弃用
+                this.isLoadChangeEvent = false; //
                 //用于绑定回调函数的调用
-                //this.isBackChangeEvent = false; //直接删除change,所以弃用
+                //this.isBackChangeEvent = false; //弃用
                 //标记为以哪个数据为主  1:id   2:name   默认为1
                 this.dataType = 1;
 
@@ -147,7 +147,7 @@
                                 ulc.allBackData();
                             }
                         }
-                        /* 递归查询下一级 */
+                        // 递归查询下一级
                         if(ulc.options.ulcLevel.length-1 > level ){
                             var ulcId = ulc.options.ulcLevel[level+1].ulcId,ulcName=ulc.options.ulcLevel[level+1].ulcName;
                             if(ulc.ulcIsEmpty(ulcName)){
@@ -311,7 +311,7 @@
             this.options.allCallback(ulc.options.data);
         },
         setUlcCallback:function (fun,level) {
-            /*回调函数设置*/
+            //回调函数设置
             this.options.ulcLevel[level].callback = fun;
         },
         setUlcAllCallback:function (fun) {

+ 142 - 135
watero-rst-web/src/main/webapp/common/js/customer/customer.js

@@ -434,15 +434,10 @@ function initProcessResult(procMethodIsBack,procMethodIsSend){
         allCustomerInfoType = $("input[name='customerCounselType']:checked").val();
     }
 
+    otherHied();    //全部隐藏
+
     if(allCustomerInfoType == 1){  //售前
-        $("#renewed").hide();
-        $("#maintain").hide();
-        $("#reissue").hide();
-        $("#backGoods").hide();
-        $("#noReasonBack").hide();
         $("#customerCostsDiv").hide();
-        $("#sendInformationTitle").hide();
-        otherHied();
     }else if(allCustomerInfoType == 2){ //售后
         $("#customerCostsDiv").hide();
         if(!isInitSendAddressSms){
@@ -465,7 +460,6 @@ function initProcessResult(procMethodIsBack,procMethodIsSend){
         $("#TDScollect").show();
 
         if((procMethodIsBack == 2 && procMethodIsSend == 2) || isNeedSelectOrder == 2){ //不需要寄回,不需要寄出就是 已解决,未解决
-            otherHied();
             visitByType(1);
         }
 
@@ -474,29 +468,21 @@ function initProcessResult(procMethodIsBack,procMethodIsSend){
             $("#customerCostsDiv").hide();  //工厂报价
         }
 
-        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(); //换新产品
+        if((procMethodIsBack == 1 || procMethodIsSend == 1) && isNeedSelectOrder == 1){  //是否有订单
+            if(procMethodIsBack == 1 ){ //需要寄回
+                $(".renewedProduct").show();
+            }
+            if(procMethodIsSend == 1){  //需要寄出
+                $(".updateProduct").show();
+            }
+            //订单信息
+            $(".orderHead").show();
+            $(".sendAddressInfo").show();
             $("#postageAccount").show();    //邮费转账账户
-            $("#sendInformationTitle").show();
-            $("#sendAddressSmsHtml").show();
 
             //地址信息
-            $("#recipientInfoTitle").show();
-            $("#recipientInfo").show();
-            $("#recipientAddress").show();
-            $("#recipientAddressText").show();
-            $("#renewedProduct").show();
-            $("#updateProduct").show();
-            //地址信息
+            $(".recipientInfo").show();
+            $(".recipientAddress").show();
 
             visitByType(2); //需要回访
             if(customerInfoType == 1){
@@ -508,44 +494,16 @@ function initProcessResult(procMethodIsBack,procMethodIsSend){
             }
         }
     }
-    // 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]);
-    //     }
-    //     for(var i=0;i<resultProductTableTitle[1].length;i++){
-    //         $("#table2").find("th").eq(i).html(resultProductTableTitle[1][i]);
-    //     }
-    // }
-    // $("#processResultStatus").html(resultHtml);
-
-    // opentionSelectOrderDiv();
 }
 
 /*已解决|未解决 */
 function otherHied(customerInfoType){
-    // $("#salesChannelsSelect").show();  //展示销售公司
-    // $("#TDScollect").show();
-    // $("#TDScollectShow").show();
-
-    $("#processResultStatus").hide();   //处理结果的执行状态  已解决未解决没有该信息
-    $("#orderHead").hide();
-    $("#order").hide();
-    $("#recipientInfo").hide();
-    $("#recipientInfoTitle").hide();
-    $("#recipientAddress").hide();
-    $("#recipientAddressText").hide();
-    $("#renewedProduct").hide();
-    $("#sendAddressInfo").hide();
-    $("#sendAddressByPhone").hide();
-    $("#updateProduct").hide();
-    $("#sendInformationTitle").hide();
+    $(".orderHead").hide();
+    $(".recipientInfo").hide();
+    $(".recipientAddress").hide();
+    $(".sendAddressInfo").hide();
+    $(".renewedProduct").hide();
+    $(".updateProduct").hide();
 }
 
 /*初始化问题大类*/
@@ -993,7 +951,6 @@ function setSelectOrder(orderId){
             $("#storeId").val(storeId);
             $("#ids").val(orderId);
             getCompany();
-
             layer.close(index);
         },
         error: function(XmlHttpRequest, textStatus, errorThrown){
@@ -1188,14 +1145,7 @@ function setProduce(orderItemList) {
     var colorHtml = '';
     for(var k=0;k<orderItemList.length;k++){
         var item = orderItemList[k];
-        var fiHidden = "";
-        var fiHtml = "";
-        if(item.itemIsSource == 1){
-            fiHidden = "text"
-        }else{
-            fiHidden = "hidden"
-            fiHtml = "-"
-        }
+        var fiHtml = "-";
         colorHtml += '<tr >'
             + '<td style="text-align: center;" >' + item.itemProductName + '</td>'
             + '<td style="text-align: center;" >' + item.itemProductColor + '</td>'
@@ -1204,14 +1154,24 @@ function setProduce(orderItemList) {
             + '<input type="hidden" class="input-produce-id" value="' + item.itemProductId + '">'
             + '<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 +'" "  onkeyup="keyFunString($(this),30)" onpaste="keyFunString($(this),30)" >'
+            + '<input type="" 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>'
+            + '<td style="text-align: center;" ><a href="javascript:void(0)" onclick="delColor(this)" >删除</a></td>'
             + '</tr>';
     }
-    $("#addProduct").html(colorHtml);
-   // setBackProduct(html);  //设置寄回产品
-    //monitorProduct();   //监听产品变化
+    if(allProcMethodIsBack == 1 ){ //需要寄回
+        $("#addBackProduct").html(colorHtml);
+    }
+    if(allProcMethodIsSend == 1){  //需要寄出
+        $("#addSendProduct").html(colorHtml);
+    }
+}
+
+/**
+ * 删除颜色
+ */
+function delColor(node) {
+    $(node).parent().parent().remove();
 }
 
 /*获取产品*/
@@ -1255,37 +1215,6 @@ function getProduceFittings(productId){
     return produceFittings;
 }
 
-// /*监听产品变化 -- 暂时不用
-// */
-// function monitorProduct(){
-//     /*产品数量*/
-//     $("#addProduct").find(".input-color-number").blur(function (){
-//         setBackProduct();
-//     })
-//     /*产品配件*/
-//     $("#addProduct").find(".input-fittings-number").blur(function (){
-//         setBackProduct();
-//     })
-// }
-
-/*设置寄回产品  -- 暂时不用 */
-// function setBackProduct(html) {
-//     if(html != null && html != "" && typeof(html) != "undefined"){
-//         $("#back-product").html(html);
-//     }else{
-//         $("#addProduct").find(".input-color-number").each(function(){
-//             var number = $(this).val();
-//             var colorNodeId = $(this).attr("id");
-//             $("#back-product").find("#"+colorNodeId).val(number);
-//         })
-//         $("#addProduct").find(".input-fittings-number").each(function(){
-//             var number = $(this).val();
-//             var fittingsNodeId = $(this).attr("id");
-//             $("#back-product").find("#"+fittingsNodeId).val(number);
-//         })
-//     }
-// }
-
 /*设置TDS收集信息*/
 function setTDSCollect(){
     var TDSArea = $("#TDSArea").find("option:selected").text();
@@ -1402,24 +1331,22 @@ function  opentionSelectOrder(){
 /**
  * 展示订单
  */
-function opentionSelectOrderDiv(){
-    if(isNeedSelectOrder == 2 || (allProcMethodIsBack == 2 && allProcMethodIsSend == 2) ){        //不展示
-        $("#orderHead").hide();
-        $("#order").hide();
-        $("#renewedProduct").hide();
-        $("#updateProduct").hide();
-    }else{      //展示
-        $("#orderHead").show();
-        $("#order").show();
-        if(allProcMethodIsBack == 1){
-            $("#renewedProduct").show();
-            $("#updateProduct").show();
-        }else{
-            $("#renewedProduct").hide();
-            $("#updateProduct").hide();
-        }
-    }
-};
+// function opentionSelectOrderDiv(){
+//     if(isNeedSelectOrder == 2 || (allProcMethodIsBack == 2 && allProcMethodIsSend == 2) ){        //不展示
+//         $(".orderHead").hide();
+//         $(".renewedProduct").hide();
+//         $(".updateProduct").hide();
+//     }else{      //展示
+//         $(".orderHead").show();
+//         if(allProcMethodIsBack == 1){
+//             $(".renewedProduct").show();
+//             $(".updateProduct").show();
+//         }else{
+//             $(".renewedProduct").hide();
+//             $(".updateProduct").hide();
+//         }
+//     }
+// };
 
 /*===============================客诉提交  -- start -- =============================== */
 $(function(){
@@ -1554,10 +1481,24 @@ function addCustomerReady(){
 
     /* --- 类型:售后   处理结果:维修/换新/补发/退货/无理由退货 -- 处理产品 start---- */
     if(isNeedSelectOrder == 1 &&  (allProcMethodIsBack == 1 || allProcMethodIsSend == 1 ) ) {     //需要订单
-        var sendProdcues = new Array();  //寄出产品表
+        // 寄回
         var closedProdcues = new Array(); //获取寄回,寄出直接复制寄回
+        $("#addBackProduct").find(".input-code").each(function () {
+            var machineNo = $(this).val();    //机器编号
+            var number = $(this).parents("tr").find(".input-itemNum").eq(0).val();    //数量
+            if (number != null && number != "" && number != 0) {
+                var product = new Object();
+                product.colorBar = $(this).parent().find(".input-69code").val();
+                product.sendProdcueNumber = number;
+                product.closedProdcueNumber = number;
+                product.closedProdcueMachineNo = machineNo;
+                closedProdcues.push(product);
+            }
+        });
 
-        $("#addProduct").find(".input-code").each(function () {
+        //寄出
+        var sendProdcues = new Array();  //寄出产品表
+        $("#addSendProduct").find(".input-code").each(function () {
             var machineNo = $(this).val();    //机器编号
             var number = $(this).parents("tr").find(".input-itemNum").eq(0).val();    //数量
             if (number != null && number != "" && number != 0) {
@@ -1566,14 +1507,9 @@ function addCustomerReady(){
                 product.sendProdcueNumber = number;
                 product.closedProdcueNumber = number;
                 product.closedProdcueMachineNo = machineNo;
-                if (allProcMethodIsBack == 1 ){
-                    closedProdcues.push(product);
-                }
-                if (allProcMethodIsSend == 1 ){
-                    sendProdcues.push(product);
-                }
+                sendProdcues.push(product);
             }
-        })
+        });
         $("#sendProdcues").val(JSON.stringify(sendProdcues));
         $("#closedProdcues").val(JSON.stringify(closedProdcues));
     }
@@ -1722,4 +1658,75 @@ function selectOnCustomer() {
         }
     }
 }
-/*根据客户信息查询老的客诉---end--*/
+/*根据客户信息查询老的客诉---end--*/
+
+/**
+ * 添加产品
+ */
+function addProduct(type) {
+    productAddType = type;
+    layer_show("商品列表",url_path + "/admin/salesOrder/to_add_product","1000","500");
+}
+
+
+/**
+ * 选择商品回调
+ * @param colorIds
+ */
+function setSelectProduct(colorIds){
+    var index = layer.load(1, {
+        shade: [0.5,'#fff'] //0.1透明度的白色背景
+    });
+
+    var colorIdArray = colorIds.split("_");
+    for(var i=0;i<colorIdArray.length;i++){
+        var colorId = colorIdArray[i];
+        if(colorId == ""){
+            break;
+        }
+
+        var flag = true;
+        $("#add_product").find("tr").each(function (){
+            var colId = $(this).find(".color_id").eq(0).val();
+            if(colId == colorId){
+                flag  = false;
+            }
+        });
+        if(!flag){
+            continue;
+        }
+        $.ajax({
+            type: "POST",
+            data: { colorId : colorId},
+            url: url_path +"/admin/product/get_product",
+            success: function(data){
+                var html = "";
+                if (data.returnCode == 200 && data.returnMsg.productColorList.length > 0 ) {
+                    for(var i=0;i<data.returnMsg.productColorList.length;i++){
+                        var productColor = data.returnMsg.productColorList[i];
+                        html += '<tr >'
+                            + '<td style="text-align: center;" >' + cufte(productColor.productName) + '</td>'
+                            + '<td style="text-align: center;" >' + cufte(productColor.colorName) + '</td>'
+                            + '<td style="text-align: center;"><input type="text" style="width: 100%;border: none;text-align: center;" class="input-text input-number input-itemNum" value="1"  placeholder="产品数量" onkeyup="keyFun($(this),999,1)" onpaste="keyFun($(this),999,1)"></td>'
+                            + '<td style="text-align: center;" >'
+                            + '<input type="hidden" class="input-produce-id" value="' + productColor.colorProductId + '">'
+                            + '<input type="hidden" class="input-fc-id" value="' + productColor.colorId +'">'
+                            + '<input type="hidden" class="input-69code" value="' + productColor.colorBar +'">'
+                            + '<input type="" class="input-text input-number input-code" style="width: 100%;border: none;text-align: center;" value="" placeholder="机器编号" name="" id="item-' + productColor.colorProductId + '-' + productColor.colorId +'" number="1" "  onkeyup="keyFunString($(this),30)" onpaste="keyFunString($(this),30)" >'
+                            + '</td>'
+                            + '<td style="text-align: center;" ><a href="javascript:void(0)" onclick="delColor(this)" >删除</a></td>'
+                            + '</tr>';
+                    }
+                }else{
+                    layer.msg("添加产品失败!", {icon: 5, time: 3000});
+                }
+                if(productAddType == 2){
+                    $("#addSendProduct").append(html);
+                }else if(productAddType == 1){
+                    $("#addBackProduct").append(html);
+                }
+            }
+        });
+    }
+    layer.close(index);
+}